+protected slots:
+ void rowsInserted(const QModelIndex &, int, int);
+ void rowsAboutToBeRemoved(const QModelIndex &, int, int);
+
+private slots:
+ void firstHandlePositionChanged(qreal xpos);
+ void secondHandlePositionChanged(qreal xpos);
+ void showWebPreviewEvent();
+ void deleteWebPreviewEvent();
+
+private:
+ void setHandleXLimits();
+ void updateSelection(const QPointF &pos);
+ QString selectionToString() const;
+
+ QString _idString;
+ QAbstractItemModel *_model;
+ QList<ChatLine *> _lines;
+ bool _singleBufferScene;
+
+ // calls to QChatScene::sceneRect() are very expensive. As we manage the scenerect ourselves
+ // we store the size in a member variable.
+ QRectF _sceneRect;
+ int _firstLineRow; // the first row to display (aka: not a daychange msg)
+ void updateSceneRect(qreal width);
+ inline void updateSceneRect() { updateSceneRect(_sceneRect.width()); }
+ void updateSceneRect(const QRectF &rect);
+ qreal _viewportHeight;
+
+ ColumnHandleItem *_firstColHandle, *_secondColHandle;
+ qreal _firstColHandlePos, _secondColHandlePos;
+ CutoffMode _cutoffMode;
+
+ ChatItem *_selectingItem;
+ int _selectionStartCol, _selectionMinCol;
+ int _selectionStart;
+ int _selectionEnd;
+ int _firstSelectionRow;
+ bool _isSelecting;
+
+ struct WebPreview {
+ ChatItem *parentItem;
+ QGraphicsItem *previewItem;
+ QString url;
+ QRectF urlRect;
+ QTimer delayTimer;
+ QTimer deleteTimer;
+ WebPreview() : parentItem(0), previewItem(0) {}
+ };
+ WebPreview webPreview;