X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtui.h;h=9a00ef4e4e4684bb0e35743e05a01b8c480d63de;hp=33eb1b8766deb3df77e41e4caa769ef0d3648d2d;hb=d0e9b9ff20a9b8e41b7983c6601aa4e04a50062f;hpb=2ab3040da0e42f4afdd282e34f0d8b089020a73d diff --git a/src/qtui/qtui.h b/src/qtui/qtui.h index 33eb1b87..9a00ef4e 100644 --- a/src/qtui/qtui.h +++ b/src/qtui/qtui.h @@ -23,7 +23,9 @@ #include "quasselui.h" -class AbstractNotificationBackend; +#include "abstractnotificationbackend.h" +#include "mainwin.h" + class ActionCollection; class MainWin; class MessageModel; @@ -45,18 +47,27 @@ public: AbstractMessageProcessor *createMessageProcessor(QObject *parent); 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 + //! Access global ActionCollections. + /** These ActionCollections are associated with the main window, i.e. they contain global * actions (and thus, shortcuts). Widgets providing application-wide shortcuts should - * create appropriate Action objects using QtUi::actionCollection()->add\(). + * create appropriate Action objects using QtUi::actionCollection(cat)->add\(). + * @param category The category (default: "General") */ - inline static ActionCollection *actionCollection(); + static ActionCollection *actionCollection(const QString &category = "General"); + inline AbstractActionProvider *actionProvider() const; + + /* Notifications */ static void registerNotificationBackend(AbstractNotificationBackend *); static void unregisterNotificationBackend(AbstractNotificationBackend *); static void unregisterAllNotificationBackends(); - static void notify(BufferId bufId, const QString &sender, const QString &text); + static const QList ¬ificationBackends(); + static uint invokeNotification(BufferId bufId, const QString &sender, const QString &text); + static void closeNotification(uint notificationId); + static void closeNotifications(BufferId bufferId = BufferId()); + static const QList &activeNotifications(); public slots: void init(); @@ -66,13 +77,17 @@ protected slots: void disconnectedFromCore(); private: - MainWin *mainWin; - static ActionCollection *_actionCollection; + AbstractActionProvider *_actionProvider; + + static QPointer _mainWin; + static QHash _actionCollections; static QtUiStyle *_style; - static QSet _notificationBackends; + static QList _notificationBackends; + static QList _notifications; }; -ActionCollection *QtUi::actionCollection() { return _actionCollection; } QtUiStyle *QtUi::style() { return _style; } +MainWin *QtUi::mainWindow() { return _mainWin; } +AbstractActionProvider *QtUi::actionProvider() const { return _actionProvider; } #endif