X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatlinemodel.h;h=92aadc552127b21c26500e5d391b055f681808ff;hp=c089cb408872f7129874fdf20e569c6e4d48ebcf;hb=f04db2cb802b1296ca739c823495930c71d3b4ab;hpb=d7a7c6e5242fd0f500b2c1c75579c9db81a91d0c diff --git a/src/qtui/chatlinemodel.h b/src/qtui/chatlinemodel.h index c089cb40..92aadc55 100644 --- a/src/qtui/chatlinemodel.h +++ b/src/qtui/chatlinemodel.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-09 by the Quassel Project * + * Copyright (C) 2005-2013 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #ifndef CHATLINEMODEL_H_ @@ -26,49 +26,49 @@ #include #include "chatlinemodelitem.h" -class ChatLineModel : public MessageModel { - Q_OBJECT +class ChatLineModel : public MessageModel +{ + Q_OBJECT public: - enum ChatLineRole { - WrapListRole = MessageModel::UserRole, - MsgLabelRole, - SelectedBackgroundRole - }; + enum ChatLineRole { + WrapListRole = MessageModel::UserRole, + MsgLabelRole, + SelectedBackgroundRole + }; - ChatLineModel(QObject *parent = 0); - - typedef ChatLineModelItem::Word Word; - typedef ChatLineModelItem::WrapList WrapList; + ChatLineModel(QObject *parent = 0); + typedef ChatLineModelItem::Word Word; + typedef ChatLineModelItem::WrapList WrapList; + virtual inline const MessageModelItem *messageItemAt(int i) const { return &_messageList[i]; } protected: // virtual MessageModelItem *createMessageModelItem(const Message &); - virtual inline int messageCount() const { return _messageList.count(); } - virtual inline bool messagesIsEmpty() const { return _messageList.isEmpty(); } - virtual inline const MessageModelItem *messageItemAt(int i) const { return &_messageList[i]; } - virtual inline MessageModelItem *messageItemAt(int i) { return &_messageList[i]; } - virtual inline const MessageModelItem *firstMessageItem() const { return &_messageList.first(); } - virtual inline MessageModelItem *firstMessageItem() { return &_messageList.first(); } - virtual inline const MessageModelItem *lastMessageItem() const { return &_messageList.last(); } - virtual inline MessageModelItem *lastMessageItem() { return &_messageList.last(); } - virtual inline void insertMessage__(int pos, const Message &msg) { _messageList.insert(pos, ChatLineModelItem(msg)); } - virtual void insertMessages__(int pos, const QList &); - virtual inline void removeMessageAt(int i) { _messageList.removeAt(i); } - virtual inline void removeAllMessages() { _messageList.clear(); } - virtual Message takeMessageAt(int i); + virtual inline int messageCount() const { return _messageList.count(); } + virtual inline bool messagesIsEmpty() const { return _messageList.isEmpty(); } + virtual inline MessageModelItem *messageItemAt(int i) { return &_messageList[i]; } + virtual inline const MessageModelItem *firstMessageItem() const { return &_messageList.first(); } + virtual inline MessageModelItem *firstMessageItem() { return &_messageList.first(); } + virtual inline const MessageModelItem *lastMessageItem() const { return &_messageList.last(); } + virtual inline MessageModelItem *lastMessageItem() { return &_messageList.last(); } + virtual inline void insertMessage__(int pos, const Message &msg) { _messageList.insert(pos, ChatLineModelItem(msg)); } + virtual void insertMessages__(int pos, const QList &); + virtual inline void removeMessageAt(int i) { _messageList.removeAt(i); } + virtual inline void removeAllMessages() { _messageList.clear(); } + virtual Message takeMessageAt(int i); protected slots: - virtual void styleChanged(); + virtual void styleChanged(); private: - QList _messageList; + QList _messageList; }; + QDataStream &operator<<(QDataStream &out, const ChatLineModel::WrapList); QDataStream &operator>>(QDataStream &in, ChatLineModel::WrapList &); Q_DECLARE_METATYPE(ChatLineModel::WrapList) #endif -