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);
59 void setBuffer(Buffer *);
61 void prependMessages(Buffer *, QList<Message>); // for backlog processing
64 void resizeEvent ( QResizeEvent * event );
68 void itemExpansionChanged(QTreeWidgetItem *);
71 //void displayMsg(Message);
72 void updateNickList(BufferState *state, VarMap nicks);
73 void updateNickList(VarMap nicks);
74 void setOwnNick(QString ownNick);
75 void setTopic(QString topic);
76 void setActive(bool act = true);
78 void messagesLayouted(LayoutTask);
84 QHash<Buffer *, BufferState *> states;
87 ChatWidget *chatWidget;
89 QTreeWidget *nickTree;
94 LayoutThread *layoutThread;
95 QHash<Buffer *, QList<ChatLine*> > chatLineCache;
96 QHash<Buffer *, QList<Message> > msgCache;
100 ChatWidget *chatWidget;
101 QTreeWidget *nickTree;
105 QByteArray splitterState;
106 QString topic, ownNick;
110 bool opsExpanded, voicedExpanded, usersExpanded;