1 /***************************************************************************
2 * Copyright (C) 2005/06 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 "ui_bufferwidget.h"
33 class ChatWidgetContents;
36 //!\brief Encapsulates the contents of a single channel, query or server status context.
37 /** A Buffer maintains a list of existing nicks and their status. New messages can be appended using
38 * displayMsg(). A buffer displays its contents by way of a BufferWidget, which can be shown
39 * (and created on demand) by calling showWidget().
41 class Buffer : public QObject {
45 Buffer(QString network, QString buffer);
48 bool isActive() { return active; }
53 void userInput(QString, QString, QString);
54 void nickListChanged(QStringList);
57 void setActive(bool active = true);
58 void displayMsg(Message);
59 //void recvStatusMsg(QString msg);
60 void setTopic(QString);
61 //void setNicks(QStringList);
62 void addNick(QString nick, VarMap props);
63 void renameNick(QString oldnick, QString newnick);
64 void removeNick(QString nick);
65 void updateNick(QString nick, VarMap props);
66 void setOwnNick(QString nick);
68 QWidget * showWidget(QWidget *parent = 0);
75 void userInput(QString);
80 ChatWidget *chatWidget;
81 ChatWidgetContents *contentsWidget;
85 QString networkName, bufferName;
87 QList<Message> contents;
90 //!\brief Displays the contents of a Buffer.
91 /** A BufferWidget usually includes a topic line, a nicklist, the chat itself, and an input line.
92 * For server buffers or queries, there is of course no nicklist.
93 * The contents of the chat is rendered by a ChatWidget.
95 class BufferWidget : public QWidget {
99 BufferWidget(QString netname, QString bufname, bool active, QString ownNick, ChatWidgetContents *contents, Buffer *parentBuffer, QWidget *parent = 0);
102 void setActive(bool act = true);
105 void userInput(QString);
110 void displayMsg(Message);
111 void updateNickList(VarMap nicks);
112 void setOwnNick(QString ownNick);
113 void setTopic(QString topic);
117 void itemExpansionChanged(QTreeWidgetItem *);
122 Buffer *parentBuffer;
128 bool opsExpanded, voicedExpanded, usersExpanded;