X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatline.h;h=3649c549aff681d3cff138903db98aaa59cd9a9c;hp=c7ac49b7c6d69acfe3e4b12c3e968b3c491845e2;hb=65c657b9339661b5ba31f132c914873f4a9093ae;hpb=65118437813c853cbcc52f0c1a061457e264ed1a diff --git a/src/qtui/chatline.h b/src/qtui/chatline.h index c7ac49b7..3649c549 100644 --- a/src/qtui/chatline.h +++ b/src/qtui/chatline.h @@ -23,7 +23,7 @@ #include -#include "messagemodel.h" +#include "chatlinemodel.h" class ChatItem; @@ -34,23 +34,25 @@ class ChatLine : public QGraphicsItem { virtual ~ChatLine(); virtual QRectF boundingRect () const; - inline int width() const { return _width; } - inline int height() const { return _height; } + inline qreal width() const { return _width; } + inline qreal height() const { return _height; } + ChatItem *item(ChatLineModel::ColumnType) const; 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); } + void setSelected(bool selected, ChatLineModel::ColumnType minColumn = ChatLineModel::ContentsColumn); + void setHighlighted(bool highlighted); protected: - //bool sceneEvent ( QEvent * event ); private: ChatItem *_timestampItem, *_senderItem, *_contentsItem; - int _width, _height; + qreal _width, _height; + + enum { Selected = 0x40, Highlighted = 0x80 }; + quint8 _selection; // save space, so we put both the col and the flags into one byte }; #endif