X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatscene.h;h=6595ea4ff6772899766a22f62e04871284542777;hp=4d66f648411d42290b84d914f5c475d3d4c27577;hb=cf0e5a5e8d6b27cd377b594a4342a7b493f815b0;hpb=f824db0e31b54969e0b7fa0b5405b1e9173d482c diff --git a/src/qtui/chatscene.h b/src/qtui/chatscene.h index 4d66f648..6595ea4f 100644 --- a/src/qtui/chatscene.h +++ b/src/qtui/chatscene.h @@ -108,6 +108,7 @@ public: public slots: void updateForViewport(qreal width, qreal height); void setWidth(qreal width); + void layout(int start, int end, qreal width); // these are used by the chatitems to notify the scene and manage selections void setSelectingItem(ChatItem *item); @@ -120,8 +121,10 @@ public: void requestBacklog(); +#ifdef HAVE_WEBKIT void loadWebPreview(ChatItem *parentItem, const QString &url, const QRectF &urlRect); void clearWebPreview(ChatItem *parentItem = 0); +#endif signals: void lastLineChanged(QGraphicsItem *item, qreal offset); @@ -139,12 +142,14 @@ protected: protected slots: void rowsInserted(const QModelIndex &, int, int); void rowsAboutToBeRemoved(const QModelIndex &, int, int); + void dataChanged(const QModelIndex &, const QModelIndex &); private slots: void firstHandlePositionChanged(qreal xpos); void secondHandlePositionChanged(qreal xpos); - void showWebPreviewEvent(); - void deleteWebPreviewEvent(); +#ifdef HAVE_WEBKIT + void webPreviewNextStep(); +#endif void showWebPreviewChanged(); void clickTimeout(); @@ -187,16 +192,25 @@ private: bool _showWebPreview; +#ifdef HAVE_WEBKIT struct WebPreview { + enum PreviewState { + NoPreview, + NewPreview, + DelayPreview, + ShowPreview, + HidePreview + }; ChatItem *parentItem; QGraphicsItem *previewItem; QString url; QRectF urlRect; - QTimer delayTimer; - QTimer deleteTimer; - WebPreview() : parentItem(0), previewItem(0) {} + PreviewState previewState; + QTimer timer; + WebPreview() : parentItem(0), previewItem(0), previewState(NoPreview) {} }; WebPreview webPreview; +#endif // HAVE_WEBKIT }; #endif