giving the chatscene more control over the webpreview thus making it less crashy
[quassel.git] / src / qtui / chatitem.h
index 31fdd5e..c2cb4ee 100644 (file)
@@ -74,8 +74,8 @@ protected:
   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()
@@ -166,6 +166,9 @@ private:
 
   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()
@@ -197,13 +200,15 @@ struct ContentsChatItem::Clickable {
 };
 
 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(); }
 
@@ -222,9 +227,6 @@ private:
   qint16 wordidx;
   qint16 lineCount;
   qreal choppedTrailing;
-  qint16 lastwrapcol;
-  qreal lastwrappos;
-  qreal width;
 };
 
 /*************************************************************************************************/