~ubuntu-branches/ubuntu/raring/quassel/raring-proposed

« back to all changes in this revision

Viewing changes to src/qtui/chatscene.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-08-11 12:48:08 UTC
  • mfrom: (1.1.40 upstream)
  • Revision ID: james.westby@ubuntu.com-20100811124808-wl3zpp4gpbzmvn4t
Tags: 0.7~beta1-0ubuntu1
* New upstream beta release
  - Add libqca2-dev to build-depends for blowfish support
* Switch to source format v3 (Quilt) to use .bz2 tarball
  - Drop build-depends on quilt and update debian/rules
  - Add debian/source/format

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
class ChatLine;
37
37
class ChatView;
38
38
class ColumnHandleItem;
 
39
class MarkerLineItem;
39
40
class WebPreviewItem;
40
41
 
41
42
class QGraphicsSceneMouseEvent;
57
58
    ContentsChatItemType,
58
59
    SearchHighlightType,
59
60
    WebPreviewType,
60
 
    ColumnHandleType
 
61
    ColumnHandleType,
 
62
    MarkerLineType
61
63
  };
62
64
 
63
65
  enum ClickMode {
82
84
 
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()); }
 
89
 
 
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
 
100
   */
 
101
  ChatLine *chatLine(MsgId msgId, bool matchExact = true, bool ignoreDayChange = true) const;
 
102
 
 
103
  inline ChatLine *lastLine() const { return _lines.count() ? _lines.last() : 0; }
 
104
 
 
105
  inline MarkerLineItem *markerLine() const { return _markerLine; }
86
106
 
87
107
  inline bool isSingleBufferScene() const { return _singleBufferId.isValid(); }
88
108
  inline BufferId singleBufferId() const { return _singleBufferId; }
103
123
 
104
124
  bool isScrollingAllowed() const;
105
125
 
106
 
  virtual bool event(QEvent *e);
107
 
 
108
126
 public slots:
109
127
  void updateForViewport(qreal width, qreal height);
110
128
  void setWidth(qreal width);
111
129
  void layout(int start, int end, qreal width);
112
130
 
 
131
  void setMarkerLineVisible(bool visible = true);
 
132
  void setMarkerLine(MsgId msgId = MsgId());
 
133
  void jumpToMarkerLine(bool requestBacklog);
 
134
 
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; }
152
174
#endif
153
175
  void showWebPreviewChanged();
154
176
 
 
177
  void rowsRemoved();
 
178
 
155
179
  void clickTimeout();
156
180
 
157
181
private:
173
197
  void updateSceneRect(const QRectF &rect);
174
198
  qreal _viewportHeight;
175
199
 
 
200
  MarkerLineItem *_markerLine;
 
201
  bool _markerLineVisible, _markerLineValid, _markerLineJumpPending;
 
202
 
176
203
  ColumnHandleItem *_firstColHandle, *_secondColHandle;
177
204
  qreal _firstColHandlePos, _secondColHandlePos;
178
205
  CutoffMode _cutoffMode;