1 /***************************************************************************
2 * Copyright (C) 2005-08 by the Quassel Project *
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) version 3. *
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 ***************************************************************************/
24 #include "ui_mainwin.h"
28 #include <QSystemTrayIcon>
34 class BufferViewConfig;
42 //!\brief The main window of Quassel's QtUi.
43 class MainWin : public QMainWindow {
47 MainWin(QtUi *gui, QWidget *parent = 0);
51 void addBufferView(BufferViewConfig *config = 0);
53 AbstractUiMsg *layoutMsg(const Message &);
54 void displayTrayIconMessage(const QString &title, const QString &message);
56 virtual bool event(QEvent *event);
59 void setTrayIconActivity(bool active = false);
62 void closeEvent(QCloseEvent *event);
63 virtual void changeEvent(QEvent *event);
66 void connectedToCore();
67 void setConnectedState();
68 void securedConnection();
69 void disconnectedFromCore();
70 void setDisconnectedState();
71 void systrayActivated( QSystemTrayIcon::ActivationReason );
74 void addBufferView(int bufferViewConfigId);
75 void removeBufferView(int bufferViewConfigId);
76 void receiveMessage(const Message &msg);
77 void showSettingsDlg();
78 void showNetworkDlg();
79 void showManageViewsDlg();
81 void showDebugConsole();
83 void showCoreConnectionDlg(bool autoConnect = false);
84 void coreConnectionDlgFinished(int result);
86 void clientNetworkCreated(NetworkId);
87 void clientNetworkRemoved(NetworkId);
88 void clientNetworkUpdated();
89 void connectOrDisconnectFromNet();
91 void changeTopic(const QString &topic);
92 void makeTrayIconBlink();
93 void saveStatusBarStatus(bool enabled);
98 void connectToCore(const QVariantMap &connInfo);
99 void disconnectFromCore();
100 void requestBacklog(BufferInfo, QVariant, QVariant);
111 void setupNickWidget();
112 void setupChatMonitor();
113 void setupInputWidget();
114 void setupTopicWidget();
115 void setupStatusBar();
118 void setupSettingsDlg();
120 void toggleVisibility();
124 QSystemTrayIcon *systray;
125 QIcon activeTrayIcon;
126 QIcon onlineTrayIcon;
127 QIcon offlineTrayIcon;
131 CoreConnectDlg *coreConnectDlg;
132 SettingsDlg *settingsDlg;
133 DebugConsole *debugConsole;
135 BufferId currentBuffer;
136 QString currentProfile;
138 QList<QDockWidget *> _netViews;
139 NickListWidget *nickListWidget;
141 QAction *actionEditNetworks;
142 QList<QAction *> networkActions;