83
85
ChatView *chatView() const;
84
86
ChatItem *chatItemAt(const QPointF &pos) const;
85
inline ChatLine *chatLine(int row) { return (row < _lines.count()) ? _lines[row] : 0; }
87
inline ChatLine *chatLine(int row) const { return (row < _lines.count()) ? _lines.value(row) : 0; }
88
inline ChatLine *chatLine(const QModelIndex &index) const { return _lines.value(index.row()); }
90
//! Find the ChatLine belonging to a MsgId
91
/** Searches for the ChatLine belonging to a MsgId. If there are more than one ChatLine with the same msgId,
92
* the first one is returned.
93
* Note that this method performs a binary search, hence it has as complexity of O(log n).
94
* If matchExact is false, and we don't have an exact match for the given msgId, we return the visible line right
95
* above the requested one.
96
* \param msgId The message ID to look for
97
* \param matchExact Whether we find only exact matches
98
* \param ignoreDayChange Whether we ignore day change messages
99
* \return The ChatLine corresponding to the given MsgId
101
ChatLine *chatLine(MsgId msgId, bool matchExact = true, bool ignoreDayChange = true) const;
103
inline ChatLine *lastLine() const { return _lines.count() ? _lines.last() : 0; }
105
inline MarkerLineItem *markerLine() const { return _markerLine; }
87
107
inline bool isSingleBufferScene() const { return _singleBufferId.isValid(); }
88
108
inline BufferId singleBufferId() const { return _singleBufferId; }
104
124
bool isScrollingAllowed() const;
106
virtual bool event(QEvent *e);
109
127
void updateForViewport(qreal width, qreal height);
110
128
void setWidth(qreal width);
111
129
void layout(int start, int end, qreal width);
131
void setMarkerLineVisible(bool visible = true);
132
void setMarkerLine(MsgId msgId = MsgId());
133
void jumpToMarkerLine(bool requestBacklog);
113
135
// these are used by the chatitems to notify the scene and manage selections
114
136
void setSelectingItem(ChatItem *item);
115
137
ChatItem *selectingItem() const { return _selectingItem; }
173
197
void updateSceneRect(const QRectF &rect);
174
198
qreal _viewportHeight;
200
MarkerLineItem *_markerLine;
201
bool _markerLineVisible, _markerLineValid, _markerLineJumpPending;
176
203
ColumnHandleItem *_firstColHandle, *_secondColHandle;
177
204
qreal _firstColHandlePos, _secondColHandlePos;
178
205
CutoffMode _cutoffMode;