virtual inline QVector<QTextLayout::FormatRange> additionalFormats() const { return QVector<QTextLayout::FormatRange>(); }
qint16 posToCursor(const QPointF &pos);
- inline void ChatItem::setPrivateData(ChatItemPrivate *data) { Q_ASSERT(!_data); _data = data; }
- inline ChatItemPrivate *ChatItem::privateData() const;
+ inline void setPrivateData(ChatItemPrivate *data) { Q_ASSERT(!_data); _data = data; }
+ inline ChatItemPrivate *privateData() const;
// WARNING: setGeometry and setHeight should not be used without either:
// a) calling prepareGeometryChange() immediately before setColumns()
ContentsChatItem(const qreal &width, const QPointF &pos, QGraphicsItem *parent);
inline ChatLineModel::ColumnType column() const { return ChatLineModel::ContentsColumn; }
+ inline QFontMetricsF *fontMetrics() const { return _fontMetrics; }
protected:
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
QList<Clickable> findClickables();
void endHoverMode();
+ void showWebPreview(const Clickable &click);
+ void clearWebPreview();
+
// WARNING: setGeometry and setHeight should not be used without either:
// a) calling prepareGeometryChange() immediately before setColumns()
friend class ChatLine;
friend struct ContentsChatItemPrivate;
- inline QFontMetricsF *fontMetrics() const { return _fontMetrics; }
QFontMetricsF *_fontMetrics;
};
};
struct ContentsChatItemPrivate : ChatItemPrivate {
+ ContentsChatItem *contentsItem;
QList<ContentsChatItem::Clickable> clickables;
ContentsChatItem::Clickable currentClickable;
bool hasDragged;
- ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c) : ChatItemPrivate(l), clickables(c), hasDragged(false) {}
+ ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false) {}
};
+
//inlines regarding ContentsChatItemPrivate
ContentsChatItemPrivate *ContentsChatItem::privateData() const { return (ContentsChatItemPrivate *)ChatItem::privateData(); }
qint16 wordidx;
qint16 lineCount;
qreal choppedTrailing;
- qint16 lastwrapcol;
- qreal lastwrappos;
- qreal width;
};
/*************************************************************************************************/