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 ***************************************************************************/
25 #include "gui/ui_mainwin.h"
29 #include "chatwidget.h"
38 extern LayoutThread *layoutThread;
40 //!\brief The main window and central object of Quassel GUI.
41 /** In addition to displaying the main window including standard stuff like a menubar,
42 * dockwidgets and of course the chat window, this class also stores all data it
43 * receives from the core, and it maintains a list of all known nicks.
45 class MainWin : public QMainWindow {
53 void registerBufferViewDock(BufferViewDock *);
56 void closeEvent(QCloseEvent *event);
59 void sendInput(BufferId, QString message);
60 void bufferSelected(Buffer *);
61 void bufferUpdated(Buffer *);
62 void bufferActivity(Buffer::ActivityLevel, Buffer *);
63 void bufferDestroyed(Buffer *);
64 void backlogReceived(Buffer *, QList<Message>);
65 void requestBacklog(BufferId, QVariant, QVariant);
67 void importOldBacklog();
70 void userInput(BufferId, QString);
71 void networkConnected(QString);
72 void networkDisconnected(QString);
73 void recvNetworkState(QString, QVariant);
74 void recvMessage(Message message);
75 void recvStatusMsg(QString network, QString message);
76 void setTopic(QString net, QString buf, QString);
77 void addNick(QString net, QString nick, VarMap props);
78 void removeNick(QString net, QString nick);
79 void renameNick(QString net, QString oldnick, QString newnick);
80 void updateNick(QString net, QString nick, VarMap props);
81 void setOwnNick(QString net, QString nick);
82 void recvBacklogData(BufferId, QList<QVariant>, bool);
83 void updateBufferId(BufferId);
85 void showServerList();
86 void showSettingsDlg();
88 void showBuffer(BufferId);
89 void showBuffer(Buffer *);
99 void setupSettingsDlg();
100 void syncToCore(); // implemented in main_mono.cpp or main_gui.cpp
101 //Buffer * getBuffer(QString net, QString buf);
102 Buffer *getBuffer(BufferId);
103 BufferId getStatusBufferId(QString net);
104 BufferId getBufferId(QString net, QString buf);
105 //void buffersUpdated();
107 QSystemTrayIcon *systray;
108 //QWorkspace *workspace;
110 //BufferWidget *bufferWidget;
112 ServerListDlg *serverListDlg;
113 CoreConnectDlg *coreConnectDlg;
114 SettingsDlg *settingsDlg;
116 //QString currentNetwork, currentBuffer;
117 //QHash<QString, QHash<QString, Buffer*> > buffers;
119 QHash<BufferId, Buffer *> buffers;
120 QHash<uint, BufferId> bufferIds;
121 QHash<QString, QHash<QString, VarMap> > nicks;
122 QHash<QString, bool> connected;
123 QHash<QString, QString> ownNick;
124 //QHash<QString, QList<Message> > coreBackLog;
125 QList<BufferId> coreBuffers;
127 QList<BufferViewDock *> netViews;
130 QList<Message> layoutQueue;