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 ***************************************************************************/
30 //!\brief Encapsulates the contents of a single channel, query or server status context.
31 /** A Buffer maintains a list of existing nicks and their status.
33 class Buffer : public QObject {
40 enum Type { ServerBuffer, ChannelBuffer, QueryBuffer };
48 Q_DECLARE_FLAGS(ActivityLevel, Activity)
50 Type bufferType() const;
51 bool isActive() const;
53 QString networkName() const;
54 QString bufferName() const;
55 QString displayName() const;
56 BufferId bufferId() const;
57 QList<AbstractUiMsg *> contents() const;
58 VarMap nickList() const;
59 QString topic() const;
60 QString ownNick() const;
61 bool isStatusBuffer() const;
64 void userInput(const BufferId &, QString);
65 void nickListChanged(VarMap nicks);
66 void topicSet(QString topic);
67 void ownNickSet(QString ownNick);
68 void bufferUpdated(Buffer *);
69 void bufferDestroyed(Buffer *);
71 void msgAppended(AbstractUiMsg *);
72 void msgPrepended(AbstractUiMsg *);
73 void layoutQueueEmpty();
76 void setActive(bool active = true);
77 void appendMsg(const Message &);
78 void prependMsg(const Message &);
80 void setTopic(QString);
81 //void setNicks(QStringList);
82 void addNick(QString nick, VarMap props);
83 void renameNick(QString oldnick, QString newnick);
84 void removeNick(QString nick);
85 void updateNick(QString nick, VarMap props);
86 void setOwnNick(QString nick);
88 void processUserInput(QString);
98 QString _networkName, _bufferName;
101 QList<Message> layoutQueue;
102 QList<AbstractUiMsg *> layoutedMsgs;
105 Q_DECLARE_OPERATORS_FOR_FLAGS(Buffer::ActivityLevel)