Improve scrolling and dynamic backlog fetching behavior
[quassel.git] / src / qtui / chatview.h
index 88a7e23..27713ea 100644 (file)
@@ -29,38 +29,34 @@ class AbstractUiMsg;
 class Buffer;
 class ChatLine;
 class ChatScene;
+class MessageFilter;
 
 class ChatView : public QGraphicsView, public AbstractChatView {
   Q_OBJECT
 
-  public:
-    ChatView(Buffer *, QWidget *parent = 0);
-    ~ChatView();
+public:
+  ChatView(MessageFilter *, QWidget *parent = 0);
+  ChatView(BufferId bufferId, QWidget *parent = 0);
 
-    ChatScene *scene() const;
+  virtual MsgId lastMsgId() const;
+  inline ChatScene *scene() const { return _scene; }
 
-  public slots:
+public slots:
+  inline virtual void clear() {}
 
-    void clear();
+protected:
+  virtual void resizeEvent(QResizeEvent *event);
 
-    void prependMsg(AbstractUiMsg *);
-    void appendMsg(AbstractUiMsg *);
+protected slots:
+  virtual void sceneHeightChangedAt(qreal ypos, qreal hdiff);
+  virtual void verticalScrollbarChanged(int);
 
-    void prependChatLine(ChatLine *);
-    void appendChatLine(ChatLine *);
-    void prependChatLines(QList<ChatLine *>);
-    void appendChatLines(QList<ChatLine *>);
+private:
+  void init(MessageFilter *filter);
 
-    void setContents(const QList<AbstractUiMsg *> &);
-
-  protected:
-    virtual void resizeEvent(QResizeEvent *event);
-
-  protected slots:
-    virtual void sceneHeightChanged(qreal height);
-
-  private:
-    ChatScene *_scene;
+  ChatScene *_scene;
+  int _lastScrollbarPos;
 };
 
+
 #endif