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 ***************************************************************************/
27 #include "chatwidget.h"
33 class ChatWidgetContents;
37 //!\brief Encapsulates the contents of a single channel, query or server status context.
38 /** A Buffer maintains a list of existing nicks and their status. New messages can be appended using
39 * displayMsg(). A buffer displays its contents by way of a BufferWidget, which can be shown
40 * (and created on demand) by calling showWidget().
42 class Buffer : public QObject {
46 //Buffer(QString network, QString buffer);
51 enum Type { ServerBuffer, ChannelBuffer, QueryBuffer };
52 Type bufferType() { return type; }
53 bool isActive() { return active; }
55 QString networkName() { return _networkName; }
56 QString bufferName() { return _bufferName; }
57 BufferId bufferId() { return id; }
58 QList<ChatLine *> contents() { return lines; }
59 VarMap nickList() { return nicks; }
60 QString topic() { return _topic; }
61 QString ownNick() { return _ownNick; }
64 void userInput(BufferId, QString);
65 //void msgDisplayed(Message);
66 void chatLineAppended(ChatLine *);
67 void chatLinePrepended(ChatLine *);
68 void nickListChanged(VarMap nicks);
69 void topicSet(QString topic);
70 void ownNickSet(QString ownNick);
71 void bufferUpdated(Buffer *);
72 void bufferDestroyed(Buffer *);
75 void setActive(bool active = true);
76 //void displayMsg(Message);
77 //void prependMessages(QList<Message>); // for backlog
78 void appendChatLine(ChatLine *);
79 void prependChatLine(ChatLine *);
80 //void prependChatLines(QList<ChatLine *>);
81 //void recvStatusMsg(QString msg);
82 void setTopic(QString);
83 //void setNicks(QStringList);
84 void addNick(QString nick, VarMap props);
85 void renameNick(QString oldnick, QString newnick);
86 void removeNick(QString nick);
87 void updateNick(QString nick, VarMap props);
88 void setOwnNick(QString nick);
90 void processUserInput(QString);
100 QString _networkName, _bufferName;
103 //QList<Message> _contents;
104 QList<ChatLine *> lines;