X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.h;h=dd926bb4c7ea226e5f6685da4f1b9cd89deb785a;hp=f572bb441f6de9ac46e3e24a3db8213d69948ec6;hb=339ed024e6cf074108e39360e7db58ea0961761b;hpb=ddc6e09ffaa24fdb2f7440ddc79b3c621df41cba diff --git a/src/qtui/chatitem.h b/src/qtui/chatitem.h index f572bb44..dd926bb4 100644 --- a/src/qtui/chatitem.h +++ b/src/qtui/chatitem.h @@ -166,7 +166,10 @@ 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() // b) calling Chatline::setPos() immediately afterwards @@ -202,43 +205,24 @@ struct ContentsChatItemPrivate : ChatItemPrivate { ContentsChatItem::Clickable currentClickable; bool hasDragged; -#ifdef HAVE_WEBKIT - ContentsChatItemPrivate(QTextLayout *l, const QList &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false), controller(0) {} -#else +#ifndef HAVE_WEBKIT ContentsChatItemPrivate(QTextLayout *l, const QList &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false) {} -#endif +#else + ContentsChatItemPrivate(QTextLayout *l, const QList &c, ContentsChatItem *parent) : ChatItemPrivate(l), contentsItem(parent), clickables(c), hasDragged(false), previewItem(0) {} ~ContentsChatItemPrivate(); -#ifdef HAVE_WEBKIT void loadWebPreview(const QString &url, const QRectF &urlRect); - void clearPreview(); + void clearWebPreview(); private: - class PreviewController; class PreviewItem; - PreviewController *controller; -#endif //#ifdef HAVE_WEBKIT + PreviewItem *previewItem; + QString previewUrl; + QRectF previewUrlRect; +#endif //#ifndef HAVE_WEBKIT }; #ifdef HAVE_WEBKIT -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: