Introduce column separator items; change most of ChatView to use qreal
[quassel.git] / src / qtui / chatline.h
index c16de80..c7ac49b 100644 (file)
 #ifndef CHATLINE_H_
 #define CHATLINE_H_
 
-class Chatline : public MessageItem {
+#include <QGraphicsItem>
+
+#include "messagemodel.h"
+
+class ChatItem;
+
+class ChatLine : public QGraphicsItem {
 
   public:
-    Chatline(const Message &);
+    ChatLine(const QModelIndex &tempIndex, QGraphicsItem *parent = 0);
+    virtual ~ChatLine();
+
+    virtual QRectF boundingRect () const;
+    inline int width() const { return _width; }
+    inline int height() const { return _height; }
+
+    virtual void paint (QPainter * painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+    //void layout();
+
+    // returns height
+    qreal setGeometry(qreal width, qreal firstColPos, qreal secondColPos);
+
+    //void myMousePressEvent ( QGraphicsSceneMouseEvent * event ) { qDebug() << "press"; mousePressEvent(event); }
 
-    virtual QVariant data(int column, int role) const;
-    virtual bool setData(int column, const QVariant &value, int role);
+  protected:
+    //bool sceneEvent ( QEvent * event );
 
+  private:
+    ChatItem *_timestampItem, *_senderItem, *_contentsItem;
+    int _width, _height;
 };
 
 #endif