Implemented Custom Views (configurable via drag and drop)
[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 "ui_mainwin.h"
26
27 #include "quasselui.h"
28 //#include "global.h"
29 #include "message.h"
30 #include "chatwidget.h"
31 #include "bufferviewfilter.h"
32 #include "bufferviewwidget.h"
33
34 class ServerListDlg;
35 class CoreConnectDlg;
36 //class BufferViewDock;
37 class Buffer;
38 class BufferWidget;
39 class SettingsDlg;
40
41 //!\brief The main window and central object of Quassel GUI.
42 /** In addition to displaying the main window including standard stuff like a menubar,
43  * dockwidgets and of course the chat window, this class also stores all data it
44  * receives from the core, and it maintains a list of all known nicks.
45  */
46 class MainWin : public QMainWindow, public AbstractUi {
47   Q_OBJECT
48
49   public:
50     MainWin();
51     ~MainWin();
52
53     void init();
54     void registerBufferViewDock(BufferViewDock *);
55
56     AbstractUiMsg *layoutMsg(const Message &);
57
58   protected:
59     void closeEvent(QCloseEvent *event);
60
61     //void importOldBacklog();
62
63   private slots:
64
65     void showServerList();
66     void showSettingsDlg();
67
68     void showBuffer(BufferId);
69     void showBuffer(Buffer *);
70
71     void importBacklog();
72
73   signals:
74     void importOldBacklog();
75
76   private:
77     Ui::MainWin ui;
78
79     void setupMenus();
80     void setupViews();
81     void setupSettingsDlg();
82
83     QSystemTrayIcon *systray;
84
85     ServerListDlg *serverListDlg;
86     CoreConnectDlg *coreConnectDlg;
87     SettingsDlg *settingsDlg;
88
89     uint currentBuffer;
90
91     QList<BufferViewDock *> netViews;
92
93 };
94
95 #endif