X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtui.h;h=4baded8985efcc69ebdd016c75e710e5b98949ec;hp=46f21c1764f8d8213be14784fb8f691995ee3009;hb=114f8a14b8bc82669ffda0599ce30fc299be9396;hpb=c7c0c7673942be376bbcab06dcc62b7f15e406a2 diff --git a/src/qtui/qtui.h b/src/qtui/qtui.h index 46f21c17..4baded89 100644 --- a/src/qtui/qtui.h +++ b/src/qtui/qtui.h @@ -18,15 +18,18 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _QTUI_H_ -#define _QTUI_H_ +#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 @@ -35,25 +38,51 @@ class QtUiMessageProcessor; class QtUi : public AbstractUi { Q_OBJECT - public: - QtUi(); - ~QtUi(); - //void init(); - MessageModel *createMessageModel(QObject *parent); - AbstractMessageProcessor *createMessageProcessor(QObject *parent); +public: + QtUi(); + ~QtUi(); + + MessageModel *createMessageModel(QObject *parent); + AbstractMessageProcessor *createMessageProcessor(QObject *parent); + + inline static QtUiStyle *style(); + inline static MainWin *mainWindow(); - static QtUiStyle *style(); + //! 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(cat)->add\(). + * @param category The category (default: "General") + */ + static ActionCollection *actionCollection(const QString &category = "General"); - public slots: - void init(); + /* Notifications */ - protected slots: - void connectedToCore(); - void disconnectedFromCore(); + 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(); - private: - MainWin *mainWin; - static QtUiStyle *_style; +public slots: + void init(); + +protected slots: + void connectedToCore(); + void disconnectedFromCore(); + +private: + static MainWin *_mainWin; + static QHash _actionCollections; + static QtUiStyle *_style; + static QList _notificationBackends; + static QList _notifications; }; +QtUiStyle *QtUi::style() { return _style; } +MainWin *QtUi::mainWindow() { return _mainWin; } + #endif