X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.h;h=b8b6e14583118d50dd7b9d14c06cc688c98ebd1c;hp=31fdd5eec7d8ec59bc1389cb268ecdbecf95ec85;hb=e178f81f44f5e305315f7755ca404c2a5f992711;hpb=429f2aad1e22ba8410f4ea63471fcfc9887c55aa diff --git a/src/qtui/chatitem.h b/src/qtui/chatitem.h index 31fdd5ee..b8b6e145 100644 --- a/src/qtui/chatitem.h +++ b/src/qtui/chatitem.h @@ -74,8 +74,8 @@ protected: virtual inline QVector additionalFormats() const { return QVector(); } 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() @@ -146,6 +146,7 @@ public: 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); @@ -166,6 +167,9 @@ private: QList 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() @@ -174,7 +178,6 @@ private: friend class ChatLine; friend struct ContentsChatItemPrivate; - inline QFontMetricsF *fontMetrics() const { return _fontMetrics; } QFontMetricsF *_fontMetrics; }; @@ -197,13 +200,15 @@ struct ContentsChatItem::Clickable { }; struct ContentsChatItemPrivate : ChatItemPrivate { + ContentsChatItem *contentsItem; QList clickables; ContentsChatItem::Clickable currentClickable; bool hasDragged; - ContentsChatItemPrivate(QTextLayout *l, const QList &c) : ChatItemPrivate(l), clickables(c), hasDragged(false) {} + ContentsChatItemPrivate(QTextLayout *l, const QList &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false) {} }; + //inlines regarding ContentsChatItemPrivate ContentsChatItemPrivate *ContentsChatItem::privateData() const { return (ContentsChatItemPrivate *)ChatItem::privateData(); } @@ -222,9 +227,6 @@ private: qint16 wordidx; qint16 lineCount; qreal choppedTrailing; - qint16 lastwrapcol; - qreal lastwrappos; - qreal width; }; /*************************************************************************************************/