/***************************************************************************
- * Copyright (C) 2005-08 by the Quassel Project *
+ * Copyright (C) 2005-09 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#ifndef CHATLINEMODELITEM_H_
#define CHATLINEMODELITEM_H_
-#include <QVector>
-
-#include "chatlinemodel.h"
-#include "uistyle.h"
+#include "messagemodel.h"
class ChatLineModelItemPrivate;
class ChatLineModelItem : public MessageModelItem {
public:
ChatLineModelItem(const Message &);
+ ChatLineModelItem(const ChatLineModelItem &other);
~ChatLineModelItem();
- virtual QVariant data(int column, int role) const;
- virtual inline bool setData(int column, const QVariant &value, int role) { Q_UNUSED(column); Q_UNUSED(value); Q_UNUSED(role); return false; }
-private:
- void computeWrapList() const;
+ virtual QVariant data(int column, int role) const;
- struct ChatLinePart {
- QString plainText;
- UiStyle::FormatList formatList;
+ /// Used to store information about words to be used for wrapping
+ struct Word {
+ quint16 start;
+ qreal endX;
+ qreal width;
+ qreal trailing;
};
- ChatLinePart _timestamp, _sender, _contents;
+ typedef QVector<Word> WrapList;
+private:
ChatLineModelItemPrivate *_data;
-
- static unsigned char *TextBoundaryFinderBuffer;
- static int TextBoundaryFinderBufferSize;
};
#endif