Provide a contextmenu for the ignore list
[quassel.git] / src / qtui / mainwin.h
index 76bf35e..c22d32d 100644 (file)
 #  include <QMainWindow>
 #endif
 
+#ifdef Q_WS_WIN
+#  include <windows.h>
+#endif
+
 #include <QSystemTrayIcon>
 
 #include "qtui.h"
-#include "sessionsettings.h"
 #include "titlesetter.h"
+#include "uisettings.h"
 
 class ActionCollection;
+class BufferHotListFilter;
 class BufferView;
 class BufferViewConfig;
 class ClientBufferViewConfig;
@@ -68,21 +73,34 @@ class MainWin
     void addBufferView(ClientBufferViewConfig *config);
     BufferView *allBuffersView() const;
 
+    BufferWidget *bufferWidget() const { return _bufferWidget; }
+
     inline SystemTray *systemTray() const;
 
-    virtual bool event(QEvent *event);
+    bool event(QEvent *event);
 
     static void flagRemoteCoreOnly(QObject *object) { object->setProperty("REMOTE_CORE_ONLY", true); }
     static bool isRemoteCoreOnly(QObject *object) { return object->property("REMOTE_CORE_ONLY").toBool(); }
 
+    void saveStateToSettings(UiSettings &);
+    void restoreStateFromSettings(UiSettings &);
+
   public slots:
-    void saveStateToSession(const QString &sessionId);
-    void saveStateToSessionSettings(SessionSettings &s);
     void showStatusBarMessage(const QString &message);
 
+    void toggleMinimizedToTray();
+
+    //! Bring window to front and focus it
+    void forceActivated();
+
+    //! Quit application
+    void quit();
+
   protected:
     void closeEvent(QCloseEvent *event);
-    virtual void changeEvent(QEvent *event);
+    void changeEvent(QEvent *event);
+    void moveEvent(QMoveEvent *event);
+    void resizeEvent(QResizeEvent *event);
 
   protected slots:
     void connectedToCore();
@@ -90,12 +108,12 @@ class MainWin
     void updateLagIndicator(int lag = -1);
     void disconnectedFromCore();
     void setDisconnectedState();
-    void systrayActivated(QSystemTrayIcon::ActivationReason);
 
   private slots:
     void addBufferView(int bufferViewConfigId);
     void awayLogDestroyed();
     void removeBufferView(int bufferViewConfigId);
+    void currentBufferChanged(BufferId);
     void messagesInserted(const QModelIndex &parent, int start, int end);
     void showAboutDlg();
     void showChannelList(NetworkId netId = NetworkId());
@@ -105,15 +123,18 @@ class MainWin
     void showAwayLog();
     void showSettingsDlg();
     void showNotificationsDlg();
+    void showIgnoreList(QString newRule = QString());
 #ifdef HAVE_KDE
     void showShortcutsDlg();
 #endif
     void on_actionConfigureNetworks_triggered();
     void on_actionConfigureViews_triggered();
     void on_actionLockLayout_toggled(bool lock);
+    void on_jumpHotBuffer_triggered();
     void on_actionDebugNetworkModel_triggered();
     void on_actionDebugBufferViewOverlay_triggered();
     void on_actionDebugMessageModel_triggered();
+    void on_actionDebugHotList_triggered();
     void on_actionDebugLog_triggered();
 
     void clientNetworkCreated(NetworkId);
@@ -121,6 +142,7 @@ class MainWin
     void clientNetworkUpdated();
     void connectOrDisconnectFromNet();
 
+    void saveMenuBarStatus(bool enabled);
     void saveStatusBarStatus(bool enabled);
 
     void loadLayout();
@@ -154,12 +176,13 @@ class MainWin
     void setupSystray();
     void setupTitleSetter();
     void setupToolBars();
+    void setupHotList();
 
     void updateIcon();
-    void hideToTray();
-    void toggleMinimizedToTray();
     void enableMenus();
 
+    void hideToTray();
+
     SystemTray *_systemTray;
 
     QList<BufferViewDock *> _bufferViews;
@@ -172,6 +195,16 @@ class MainWin
     QToolBar *_mainToolBar, *_chatViewToolBar, *_nickToolBar;
 
     QWidget *_awayLog;
+
+    QSize _normalSize; //!< Size of the non-maximized window
+    QPoint _normalPos; //!< Position of the non-maximized window
+
+#ifdef Q_WS_WIN
+    DWORD dwTickCount;
+#endif
+
+    BufferHotListFilter *_bufferHotList;
+
     friend class QtUi;
 };