#include "messagemodel.h"
-class ChatLineModelItemPrivate;
+#include "uistyle.h"
class ChatLineModelItem : public MessageModelItem {
public:
ChatLineModelItem(const Message &);
- ChatLineModelItem(const ChatLineModelItem &other);
- ~ChatLineModelItem();
virtual QVariant data(int column, int role) const;
- /// Used to store information about words to be used for wrapping
- struct Word {
- quint16 start;
- qreal endX;
- qreal width;
- qreal trailing;
- };
- typedef QVector<Word> WrapList;
+ virtual inline const Message &message() const { return _styledMsg; }
+ virtual inline const QDateTime ×tamp() const { return _styledMsg.timestamp(); }
+ virtual inline const MsgId &msgId() const { return _styledMsg.msgId(); }
+ virtual inline const BufferId &bufferId() const { return _styledMsg.bufferId(); }
+ virtual inline void setBufferId(BufferId bufferId) { _styledMsg.setBufferId(bufferId); }
+ virtual inline Message::Type msgType() const { return _styledMsg.type(); }
+ virtual inline Message::Flags msgFlags() const { return _styledMsg.flags(); }
private:
- ChatLineModelItemPrivate *_data;
+ QVariant timestampData(int role) const;
+ QVariant senderData(int role) const;
+ QVariant contentsData(int role) const;
+
+ QVariant backgroundBrush(UiStyle::FormatType subelement, bool selected = false) const;
+ quint32 messageLabel() const;
+
+ UiStyle::StyledMessage _styledMsg;
};
#endif