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 ***************************************************************************/
31 class ChatWidgetContents;
35 //!\brief Encapsulates the contents of a single channel, query or server status context.
36 /** A Buffer maintains a list of existing nicks and their status. New messages can be appended using
37 * displayMsg(). A buffer displays its contents by way of a BufferWidget, which can be shown
38 * (and created on demand) by calling showWidget().
40 class Buffer : public QObject {
44 Buffer(QString network, QString buffer);
48 enum Type { ServerBuffer, ChannelBuffer, QueryBuffer };
49 Type bufferType() { return type; }
50 bool isActive() { return active; }
52 QString networkName() { return _networkName; }
53 QString bufferName() { return _bufferName; }
54 QList<Message> *contents() { return &_contents; }
55 VarMap nickList() { return nicks; }
56 QString topic() { return _topic; }
57 QString ownNick() { return _ownNick; }
60 void userInput(QString, QString, QString);
61 void msgDisplayed(Message);
62 void nickListChanged(VarMap nicks);
63 void topicSet(QString topic);
64 void ownNickSet(QString ownNick);
65 void bufferUpdated(Buffer *);
66 void bufferDestroyed(Buffer *);
69 void setActive(bool active = true);
70 void displayMsg(Message);
71 void prependMessages(QList<Message>); // for backlog
72 //void recvStatusMsg(QString msg);
73 void setTopic(QString);
74 //void setNicks(QStringList);
75 void addNick(QString nick, VarMap props);
76 void renameNick(QString oldnick, QString newnick);
77 void removeNick(QString nick);
78 void updateNick(QString nick, VarMap props);
79 void setOwnNick(QString nick);
81 void processUserInput(QString);
90 QString _networkName, _bufferName;
93 QList<Message> _contents;