giving the chatscene more control over the webpreview thus making it less crashy
[quassel.git] / src / qtui / chatitem.h
index b6e8a9c..c2cb4ee 100644 (file)
@@ -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()
@@ -202,46 +205,9 @@ struct ContentsChatItemPrivate : ChatItemPrivate {
   ContentsChatItem::Clickable currentClickable;
   bool hasDragged;
 
-  ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false), controller(0) {}
-  ~ContentsChatItemPrivate();
-
-  void loadWebPreview(const QString &url, const QRectF &urlRect);
-  void clearPreview();
-
-private:
-  class PreviewController;
-  class PreviewItem;
-  PreviewController *controller;
+  ContentsChatItemPrivate(QTextLayout *l, const QList<ContentsChatItem::Clickable> &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false) {}
 };
 
-class ContentsChatItemPrivate::PreviewController : public QObject {
-  Q_OBJECT
-public:
-  PreviewController(ContentsChatItem *contentsItem) : contentsItem(contentsItem), previewItem(0) {}
-  ~PreviewController();
-
-  void loadPage(const QString &url, const QRectF &urlRect);
-
-private slots:
-  void pageLoaded(bool success);
-
-private:
-  ContentsChatItem *contentsItem;
-  ContentsChatItemPrivate::PreviewItem *previewItem;
-
-  QString url;
-};
-
-class QWebView;
-class ContentsChatItemPrivate::PreviewItem : public QGraphicsItem {
-public:
-  PreviewItem(QWebView *webView);
-  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
-  virtual inline QRectF boundingRect() const { return _boundingRect; }
-
-private:
-  QRectF _boundingRect;
-};
 
 //inlines regarding ContentsChatItemPrivate
 ContentsChatItemPrivate *ContentsChatItem::privateData() const { return (ContentsChatItemPrivate *)ChatItem::privateData(); }