X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fchatlinemodelitem.h;h=9fe4b8bc1c88af5a1fc31e91cbe47cdd7c07cc6e;hb=ced47a86a4e196498d1f57f581a6cc7976cb3558;hp=a2ef9b9aec879f13d096c15f40b747f4696636e7;hpb=547fa73991ebf14d6a33bae3d955ebce6b8d74f2;p=quassel.git diff --git a/src/qtui/chatlinemodelitem.h b/src/qtui/chatlinemodelitem.h index a2ef9b9a..9fe4b8bc 100644 --- a/src/qtui/chatlinemodelitem.h +++ b/src/qtui/chatlinemodelitem.h @@ -1,5 +1,5 @@ /*************************************************************************** - * 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 * @@ -21,9 +21,8 @@ #ifndef CHATLINEMODELITEM_H_ #define CHATLINEMODELITEM_H_ -#include +#include "messagemodel.h" -#include "chatlinemodel.h" #include "uistyle.h" class ChatLineModelItem : public MessageModelItem { @@ -31,21 +30,24 @@ public: ChatLineModelItem(const Message &); virtual QVariant data(int column, int role) const; - virtual inline bool setData(int column, const QVariant &value, int role) { return false; } -private: - void computeWrapList(); + 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(); } - struct ChatLinePart { - QString plainText; - UiStyle::FormatList formatList; - }; - ChatLinePart _timestamp, _sender, _contents; +private: + QVariant timestampData(int role) const; + QVariant senderData(int role) const; + QVariant contentsData(int role) const; - ChatLineModel::WrapList _wrapList; + QVariant backgroundBrush(UiStyle::FormatType subelement, bool selected = false) const; + quint32 messageLabel() const; - static unsigned char *TextBoundaryFinderBuffer; - static int TextBoundaryFinderBufferSize; + UiStyle::StyledMessage _styledMsg; }; #endif