X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fqtui.h;h=d170ae3dc97fa4d2073303ebcfd694bbe962eb8e;hb=5c78a50fa720e5f82fcaa03c0176feab71d74c8e;hp=2c1156f706c54d9914ef5c31643ba53be34ed27d;hpb=4df7862b00b2113dabdf52342b2c15560313f476;p=quassel.git diff --git a/src/qtui/qtui.h b/src/qtui/qtui.h index 2c1156f7..d170ae3d 100644 --- a/src/qtui/qtui.h +++ b/src/qtui/qtui.h @@ -21,12 +21,15 @@ #ifndef QTUI_H #define QTUI_H -#include "qtuistyle.h" #include "quasselui.h" +#include "abstractnotificationbackend.h" + +class ActionCollection; class MainWin; class MessageModel; class QtUiMessageProcessor; +class QtUiStyle; //! This class encapsulates Quassel's Qt-based GUI. /** This is basically a wrapper around MainWin, which is necessary because we cannot derive MainWin @@ -42,7 +45,26 @@ public: MessageModel *createMessageModel(QObject *parent); AbstractMessageProcessor *createMessageProcessor(QObject *parent); - inline static QtUiStyle *style() { return _style; } + inline static QtUiStyle *style(); + inline static MainWin *mainWindow(); + + //! Access the global ActionCollection. + /** This ActionCollection is associated with the main window, i.e. it contains global + * actions (and thus, shortcuts). Widgets providing application-wide shortcuts should + * create appropriate Action objects using QtUi::actionCollection()->add\(). + */ + inline static ActionCollection *actionCollection(); + + /* Notifications */ + + static void registerNotificationBackend(AbstractNotificationBackend *); + static void unregisterNotificationBackend(AbstractNotificationBackend *); + static void unregisterAllNotificationBackends(); + static const QSet ¬ificationBackends(); + static uint invokeNotification(BufferId bufId, const QString &sender, const QString &text); + static void closeNotification(uint notificationId); + static void closeNotifications(BufferId bufferId); + static const QList &activeNotifications(); public slots: void init(); @@ -52,8 +74,15 @@ protected slots: void disconnectedFromCore(); private: - MainWin *mainWin; + static MainWin *_mainWin; + static ActionCollection *_actionCollection; static QtUiStyle *_style; + static QSet _notificationBackends; + static QList _notifications; }; +ActionCollection *QtUi::actionCollection() { return _actionCollection; } +QtUiStyle *QtUi::style() { return _style; } +MainWin *QtUi::mainWindow() { return _mainWin; } + #endif