X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fqtui.h;h=1fe1114c0c31dcc3ad9264f5af70d65e64c48810;hp=bbe31f7d68a996e9d4000e893c7def76ddd89d3d;hb=0c498574d2f26bae581bc8f9a01e739e1f9c3872;hpb=ef12cc4010e853348474b4ea15c383dd596d4858 diff --git a/src/qtui/qtui.h b/src/qtui/qtui.h index bbe31f7d..1fe1114c 100644 --- a/src/qtui/qtui.h +++ b/src/qtui/qtui.h @@ -18,14 +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 @@ -34,25 +38,51 @@ class MessageModel; class QtUi : public AbstractUi { Q_OBJECT - public: - QtUi(); - ~QtUi(); - //void init(); - MessageModel *createMessageModel(QObject *parent = 0); - AbstractUiMsg *layoutMsg(const Message &); +public: + QtUi(); + ~QtUi(); + + MessageModel *createMessageModel(QObject *parent); + AbstractMessageProcessor *createMessageProcessor(QObject *parent); + + inline static QtUiStyle *style(); + inline static MainWin *mainWindow(); - static QtUiStyle *style(); + //! 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(); - 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 ActionCollection *_actionCollection; + static QtUiStyle *_style; + static QList _notificationBackends; + static QList _notifications; }; +ActionCollection *QtUi::actionCollection() { return _actionCollection; } +QtUiStyle *QtUi::style() { return _style; } +MainWin *QtUi::mainWindow() { return _mainWin; } + #endif