#ifndef _CHATSCENE_H_
#define _CHATSCENE_H_
+#include <QAbstractItemModel>
#include <QGraphicsScene>
class AbstractUiMsg;
class Buffer;
+class ChatItem;
class ChatLine;
class QGraphicsSceneMouseEvent;
Q_OBJECT
public:
- ChatScene(Buffer *buffer, QObject *parent);
+ ChatScene(QAbstractItemModel *model, QObject *parent);
virtual ~ChatScene();
Buffer *buffer() const;
+ inline QAbstractItemModel *model() const { return _model; }
public slots:
+ void setWidth(int);
- protected slots:
- void appendMsg(AbstractUiMsg *msg);
- void prependMsg(AbstractUiMsg *msg);
+ signals:
+ void heightChanged(int height);
+ protected slots:
+ void rowsInserted(const QModelIndex &, int, int);
void mousePressEvent ( QGraphicsSceneMouseEvent * mouseEvent );
private:
- Buffer *_buffer;
- QList<ChatLine*> _lines;
+ int _width, _height;
+ int _timestampWidth, _senderWidth;
+ QAbstractItemModel *_model;
+ QList<ChatLine *> _lines;
};