#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 endX;
+ qreal width;
+ qreal trailing;
+ };
+ typedef QVector<Word> 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