Add a shortcut for hiding current buffer.
[quassel.git] / src / qtui / mainwin.h
index 9807550..49b49d7 100644 (file)
 #  include <QMainWindow>
 #endif
 
-#ifdef Q_WS_WIN
-#  include <windows.h>
-#endif
-
 #include "qtui.h"
 #include "titlesetter.h"
 #include "uisettings.h"
@@ -49,6 +45,7 @@ class MsgProcessorStatusWidget;
 class NickListWidget;
 class SystemTray;
 class ChatMonitorView;
+class TopicWidget;
 
 class QMenu;
 class QLabel;
@@ -73,12 +70,10 @@ class MainWin
 
     void addBufferView(ClientBufferViewConfig *config);
     BufferView *allBuffersView() const;
+    BufferView *activeBufferView() const;
 
     inline BufferWidget *bufferWidget() const { return _bufferWidget; }
-
-#ifndef QT_NO_SYSTEMTRAYICON
     inline SystemTray *systemTray() const { return _systemTray; }
-#endif
 
     bool event(QEvent *event);
 
@@ -90,20 +85,17 @@ class MainWin
 
   public slots:
     void showStatusBarMessage(const QString &message);
-
-#ifndef QT_NO_SYSTEMTRAYICON
-    void toggleMinimizedToTray();
-#endif
-
-    //! Bring window to front and focus it
-    void forceActivated();
+    void hideCurrentBuffer();
+    void nextBufferView();     //!< Activate the next bufferview
+    void previousBufferView(); //!< Activate the previous bufferview
+    void nextBuffer();
+    void previousBuffer();
 
     //! Quit application
     void quit();
 
   protected:
     void closeEvent(QCloseEvent *event);
-    void changeEvent(QEvent *event);
     void moveEvent(QMoveEvent *event);
     void resizeEvent(QResizeEvent *event);
 
@@ -128,9 +120,9 @@ class MainWin
     void showSettingsDlg();
     void showNotificationsDlg();
     void showIgnoreList(QString newRule = QString());
-#ifdef HAVE_KDE
     void showShortcutsDlg();
-#endif
+    void toggleFullscreen();
+
     void handleCoreConnectionError(const QString &errorMsg);
     void userAuthenticationRequired(CoreAccount *, bool *valid, const QString &errorMessage);
     void handleNoSslInClient(bool *accepted);
@@ -149,6 +141,9 @@ class MainWin
     void on_actionDebugHotList_triggered();
     void on_actionDebugLog_triggered();
 
+    void bindJumpKey();
+    void onJumpKey();
+
     void clientNetworkCreated(NetworkId);
     void clientNetworkRemoved(NetworkId);
     void clientNetworkUpdated();
@@ -161,6 +156,9 @@ class MainWin
     void saveLayout();
 
     void bufferViewToggled(bool enabled);
+    void bufferViewVisibilityChanged(bool visible);
+    void changeActiveBufferView(bool backwards);
+    void changeActiveBufferView(int bufferViewId);
 
   signals:
     void connectToCore(const QVariantMap &connInfo);
@@ -173,6 +171,7 @@ class MainWin
 
     MsgProcessorStatusWidget *_msgProcessorStatusWidget;
     CoreConnectionStatusWidget *_coreConnectionStatusWidget;
+    SystemTray *_systemTray;
 
     TitleSetter _titleSetter;
 
@@ -183,6 +182,7 @@ class MainWin
     void setupChatMonitor();
     void setupInputWidget();
     void setupTopicWidget();
+    void setupViewMenuTail();
     void setupStatusBar();
     void setupSystray();
     void setupTitleSetter();
@@ -192,16 +192,12 @@ class MainWin
     void updateIcon();
     void enableMenus();
 
-#ifndef QT_NO_SYSTEMTRAYICON
-    void hideToTray();
-    SystemTray *_systemTray;
-#endif
-
     QList<BufferViewDock *> _bufferViews;
     BufferWidget *_bufferWidget;
     NickListWidget *_nickListWidget;
     InputWidget *_inputWidget;
     ChatMonitorView *_chatMonitorView;
+    TopicWidget *_topicWidget;
 
     QMenu *_fileMenu, *_networksMenu, *_viewMenu, *_bufferViewsMenu, *_settingsMenu, *_helpMenu, *_helpDebugMenu;
     QMenu *_toolbarMenu;
@@ -214,11 +210,9 @@ class MainWin
     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;
+    QHash<int, BufferId> _jumpKeyMap;
+    int _activeBufferViewIndex;
 
     friend class QtUi;
 };