X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatlinemodel.h;h=4604a9b7559677c4f162614d2076f3263926249b;hb=c9fb1fc22df2429e145d8f21e6ba0b0a92660efd;hp=da4a5419bd71090beca5cb645b17e9da21237a78;hpb=ef12cc4010e853348474b4ea15c383dd596d4858;p=quassel.git diff --git a/src/qtui/chatlinemodel.h b/src/qtui/chatlinemodel.h index da4a5419..4604a9b7 100644 --- a/src/qtui/chatlinemodel.h +++ b/src/qtui/chatlinemodel.h @@ -23,17 +23,33 @@ #include "messagemodel.h" -class ChatlineModel : public MessageModel { +class ChatLineModel : public MessageModel { Q_OBJECT - public: - ChatlineModel(QObject *parent = 0); - virtual ~ChatlineModel(); +public: + enum ChatLineRole { + WrapListRole = MessageModel::UserRole + }; - protected: - virtual MessageItem *createMessageItem(const Message &); + ChatLineModel(QObject *parent = 0); + + /// Used to store information about words to be used for wrapping + struct Word { + quint16 start; + qreal width; + qreal trailing; + }; + typedef QVector WrapList; + +protected: + virtual MessageModelItem *createMessageModelItem(const Message &); }; +QDataStream &operator<<(QDataStream &out, const ChatLineModel::WrapList); +QDataStream &operator>>(QDataStream &in, ChatLineModel::WrapList &); + +Q_DECLARE_METATYPE(ChatLineModel::WrapList) + #endif