1 /***************************************************************************
2 * Copyright (C) 2005-07 by The Quassel Team *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
29 #include "bufferinfo.h"
31 #include <QVariantMap>
33 //!\brief Encapsulates the contents of a single channel, query or server status context.
34 /** A Buffer maintains a list of existing nicks and their status.
36 class Buffer : public QObject {
40 Buffer(BufferInfo, QObject *parent = 0);
55 Q_DECLARE_FLAGS(ActivityLevel, Activity)
57 bool isStatusBuffer() const;
58 Type bufferType() const;
59 bool isActive() const;
61 BufferInfo bufferInfo() const;
62 void updateBufferInfo(BufferInfo bufferid);
65 NetworkId networkId() const;
67 QString networkName() const;
70 QList<AbstractUiMsg *> contents() const;
72 QVariantMap nickList() const;
73 QString topic() const;
74 QString ownNick() const;
77 void userInput(const BufferInfo &, QString);
78 void nickListChanged(QVariantMap nicks);
79 void topicSet(QString topic);
80 void ownNickSet(QString ownNick);
81 void bufferUpdated(Buffer *);
83 void msgAppended(AbstractUiMsg *);
84 void msgPrepended(AbstractUiMsg *);
85 void layoutQueueEmpty();
88 void setActive(bool active = true);
89 void appendMsg(const Message &);
90 void prependMsg(const Message &);
94 // void setTopic(QString);
95 // //void setNicks(QStringList);
96 // void addNick(QString nick, QVariantMap props);
97 // void renameNick(QString oldnick, QString newnick);
98 // void removeNick(QString nick);
99 // void updateNick(QString nick, QVariantMap props);
100 // void setOwnNick(QString nick);
102 void processUserInput(QString);
105 BufferInfo _bufferInfo;
110 QList<Message> layoutQueue;
111 QList<AbstractUiMsg *> layoutedMsgs;
114 Q_DECLARE_OPERATORS_FOR_FLAGS(Buffer::ActivityLevel)