Handle rowsInserted() and add new messages to the scene.
[quassel.git] / src / qtui / chatscene.h
index beeb699..fd72010 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-07 by the Quassel IRC Team                         *
+ *   Copyright (C) 2005-08 by the Quassel Project                          *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
 
 #include <QGraphicsScene>
 
+#include "messagemodel.h"
+
 class AbstractUiMsg;
 class Buffer;
+class ChatItem;
 class ChatLine;
 class QGraphicsSceneMouseEvent;
 
@@ -32,22 +35,24 @@ class ChatScene : public QGraphicsScene {
   Q_OBJECT
 
   public:
-    ChatScene(Buffer *buffer, QObject *parent);
+    ChatScene(MessageModel *model, QObject *parent);
     virtual ~ChatScene();
 
     Buffer *buffer() const;
+    inline MessageModel *model() const { return _model; }
 
   public slots:
+    void setWidth(int);
 
   protected slots:
-    void appendMsg(AbstractUiMsg *msg);
-    void prependMsg(AbstractUiMsg *msg);
-
+    void rowsInserted(const QModelIndex &, int, int);
     void mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent );
 
   private:
-    Buffer *_buffer;
-    QList<ChatLine*> _lines;
+    int _width, _height;
+    int _timestampWidth, _senderWidth;
+    MessageModel *_model;
+    QList<ChatLine *> _lines;
 
 };