Starting reorganization of files in preparation of separation of client and GUI.
[quassel.git] / src / qtgui / mainwin.h
1 /***************************************************************************
2  *   Copyright (C) 2005-07 by The Quassel Team                             *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
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.                                   *
9  *                                                                         *
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.                          *
14  *                                                                         *
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  ***************************************************************************/
20
21 #ifndef _MAINWIN_H_
22 #define _MAINWIN_H_
23
24 #include <QtGui>
25 #include "gui/ui_mainwin.h"
26
27 #include "global.h"
28 #include "message.h"
29 #include "chatwidget.h"
30
31 class ServerListDlg;
32 class CoreConnectDlg;
33 class BufferViewDock;
34 class Buffer;
35 class BufferWidget;
36 class SettingsDlg;
37
38 //!\brief The main window and central object of Quassel GUI.
39 /** In addition to displaying the main window including standard stuff like a menubar,
40  * dockwidgets and of course the chat window, this class also stores all data it
41  * receives from the core, and it maintains a list of all known nicks.
42  */
43 class MainWin : public QMainWindow {
44   Q_OBJECT
45
46   public:
47     MainWin();
48     ~MainWin();
49
50     void init();
51     void registerBufferViewDock(BufferViewDock *);
52
53   protected:
54     void closeEvent(QCloseEvent *event);
55
56   signals:
57     //void sendInput(BufferId, QString message);
58     //void bufferSelected(Buffer *);
59     //void bufferUpdated(Buffer *);
60     //void bufferActivity(Buffer::ActivityLevel, Buffer *);
61     //void bufferDestroyed(Buffer *);
62     //void backlogReceived(Buffer *, QList<Message>);
63     //void requestBacklog(BufferId, QVariant, QVariant);
64
65     void importOldBacklog();
66
67   private slots:
68     
69     //void userInput(BufferId, QString);
70     //void networkConnected(QString);
71     //void networkDisconnected(QString);
72     //void recvNetworkState(QString, QVariant);
73     //void recvMessage(Message message);
74     //void recvStatusMsg(QString network, QString message);
75     //void setTopic(QString net, QString buf, QString);
76     //void addNick(QString net, QString nick, VarMap props);
77     //void removeNick(QString net, QString nick);
78     //void renameNick(QString net, QString oldnick, QString newnick);
79     //void updateNick(QString net, QString nick, VarMap props);
80     //void setOwnNick(QString net, QString nick);
81     //void recvBacklogData(BufferId, QList<QVariant>, bool);
82     //void updateBufferId(BufferId);
83
84     void showServerList();
85     void showSettingsDlg();
86
87     void showBuffer(BufferId);
88     void showBuffer(Buffer *);
89
90     void importBacklog();
91
92   private:
93     Ui::MainWin ui;
94
95     void setupMenus();
96     void setupViews();
97     void setupSettingsDlg();
98     //void syncToCore();  // implemented in main_mono.cpp or main_gui.cpp
99     //Buffer * getBuffer(QString net, QString buf);
100     //Buffer *getBuffer(BufferId);
101     //BufferId getStatusBufferId(QString net);
102     //BufferId getBufferId(QString net, QString buf);
103     //void buffersUpdated();
104
105     QSystemTrayIcon *systray;
106     //QWorkspace *workspace;
107     //QWidget *widget;
108     //BufferWidget *bufferWidget;
109
110     ServerListDlg *serverListDlg;
111     CoreConnectDlg *coreConnectDlg;
112     SettingsDlg *settingsDlg;
113
114     //QString currentNetwork, currentBuffer;
115     //QHash<QString, QHash<QString, Buffer*> > buffers;
116     uint currentBuffer;
117     //QHash<BufferId, Buffer *> buffers;
118     //QHash<uint, BufferId> bufferIds;
119     //QHash<QString, QHash<QString, VarMap> > nicks;
120     //QHash<QString, bool> connected;
121     //QHash<QString, QString> ownNick;
122     //QHash<QString, QList<Message> > coreBackLog;
123     //QList<BufferId> coreBuffers;
124
125     QList<BufferViewDock *> netViews;
126
127     //QTimer *layoutTimer;
128     //QList<Message> layoutQueue;
129 };
130
131 #endif