X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtui.h;h=9a00ef4e4e4684bb0e35743e05a01b8c480d63de;hp=9ac3b97b4519d8f7b427e68383f60e48149b729f;hb=d0e9b9ff20a9b8e41b7983c6601aa4e04a50062f;hpb=ba934ceb1bfe30d01d5fb5c072c3197f8080be04 diff --git a/src/qtui/qtui.h b/src/qtui/qtui.h index 9ac3b97b..9a00ef4e 100644 --- a/src/qtui/qtui.h +++ b/src/qtui/qtui.h @@ -23,6 +23,9 @@ #include "quasselui.h" +#include "abstractnotificationbackend.h" +#include "mainwin.h" + class ActionCollection; class MainWin; class MessageModel; @@ -44,13 +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 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(); @@ -60,12 +77,17 @@ protected slots: void disconnectedFromCore(); private: - MainWin *mainWin; - static ActionCollection *_actionCollection; + AbstractActionProvider *_actionProvider; + + static QPointer _mainWin; + static QHash _actionCollections; static QtUiStyle *_style; + 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