- void setHandleXLimits();
- void updateSelection(const QPointF &pos);
- QString selectionToString() const;
-
- QString _idString;
- QAbstractItemModel *_model;
- QList<ChatLine *> _lines;
- bool _singleBufferScene;
-
- ColumnHandleItem *firstColHandle, *secondColHandle;
- qreal firstColHandlePos, secondColHandlePos;
-
- ChatItem *_selectingItem;
- int _selectionStartCol, _selectionMinCol;
- int _selectionStart;
- int _selectionEnd;
- int _firstSelectionRow, _lastSelectionRow;
- bool _isSelecting;
-
- int _lastBacklogSize;
+ void setHandleXLimits();
+ void updateSelection(const QPointF &pos);
+
+ ChatView *_chatView;
+ QString _idString;
+ QAbstractItemModel *_model;
+ QList<ChatLine *> _lines;
+ BufferId _singleBufferId;
+
+ // 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;
+
+ MarkerLineItem *_markerLine;
+ bool _markerLineVisible, _markerLineValid, _markerLineJumpPending;
+
+ ColumnHandleItem *_firstColHandle, *_secondColHandle;
+ qreal _firstColHandlePos, _secondColHandlePos;
+ int _defaultFirstColHandlePos, _defaultSecondColHandlePos;
+ CutoffMode _cutoffMode;
+ /// Whether to re-add hidden brackets around sender for all message types
+ bool _alwaysBracketSender;
+
+ ChatItem *_selectingItem;
+ int _selectionStartCol, _selectionMinCol;
+ int _selectionStart;
+ int _selectionEnd;
+ int _firstSelectionRow;
+ bool _isSelecting;
+
+ QTimer _clickTimer;
+ ClickMode _clickMode;
+ QPointF _clickPos;
+ bool _clickHandled;
+ bool _leftButtonPressed;
+
+ bool _showWebPreview;
+
+ bool _showSenderBrackets; /// If true, show brackets around sender names
+
+ bool _useCustomTimestampFormat; /// If true, use the custom timestamp format
+ QString _timestampFormatString; /// Format of the timestamp string
+ bool _timestampHasBrackets; /// If true, timestamp format has [brackets] of some sort
+
+ static const int _webSearchSelectionTextMaxVisible = 24;
+
+#if defined HAVE_WEBKIT || defined HAVE_WEBENGINE
+ struct WebPreview {
+ enum PreviewState {
+ NoPreview,
+ NewPreview,
+ DelayPreview,
+ ShowPreview,
+ HidePreview
+ };
+ ChatItem *parentItem;
+ QGraphicsItem *previewItem;
+ QUrl url;
+ QRectF urlRect;
+ PreviewState previewState;
+ QTimer timer;
+ WebPreview() : parentItem(0), previewItem(0), previewState(NoPreview) {}
+ };
+ WebPreview webPreview;
+#endif // HAVE_WEBKIT || HAVE_WEBENGINE