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 ***************************************************************************/
21 #ifndef _BUFFERWIDGET_H_
22 #define _BUFFERWIDGET_H_
24 #include "gui/ui_bufferwidget.h"
28 #include "chatwidget.h"
35 //!\brief Displays the contents of a Buffer.
36 /** A BufferWidget usually includes a topic line, a nicklist, the chat itself, and an input line.
37 * For server buffers or queries, there is of course no nicklist.
38 * The contents of the chat is rendered by a ChatWidget.
40 class BufferWidget : public QWidget {
44 BufferWidget(QWidget *parent = 0);
48 QSize sizeHint() const;
51 void userInput(QString msg);
54 //void layoutMessages(LayoutTask);
55 void nickListUpdated(QStringList l);
60 void setBuffer(Buffer *);
62 //void prependMessages(Buffer *, QList<Message>); // for backlog processing
65 void resizeEvent ( QResizeEvent * event );
69 void itemExpansionChanged(QTreeWidgetItem *);
72 //void displayMsg(Message);
73 void updateNickList(BufferState *state, VarMap nicks);
74 void updateNickList(VarMap nicks);
75 void setOwnNick(QString ownNick);
76 void setTopic(QString topic);
77 void setActive(bool act = true);
79 //void messagesLayouted(LayoutTask);
85 QHash<Buffer *, BufferState *> states;
88 ChatWidget *chatWidget;
90 QTreeWidget *nickTree;
95 //LayoutThread *layoutThread;
96 //QHash<Buffer *, QList<ChatLine*> > chatLineCache;
97 //QHash<Buffer *, QList<Message> > msgCache;
101 ChatWidget *chatWidget;
102 QTreeWidget *nickTree;
106 QByteArray splitterState;
107 QString topic, ownNick;
111 bool opsExpanded, voicedExpanded, usersExpanded;