~ubuntu-branches/debian/experimental/quassel/experimental

« back to all changes in this revision

Viewing changes to src/qtui/qtui.h

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Mueller
  • Date: 2009-10-05 23:13:06 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20091005231306-ngiajv5r0gbxjfoq
Tags: 0.5.0~rc2-1
* New upstream release (rc2)
* Make puiparts happy (closes: #538182)
* manageusers.py added (closes: #549296)

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
#include "abstractnotificationbackend.h"
27
27
#include "mainwin.h"
 
28
#include "qtuistyle.h"
28
29
 
29
 
class ActionCollection;
30
30
class MainWin;
31
31
class MessageModel;
32
32
class QtUiMessageProcessor;
33
 
class QtUiStyle;
34
33
 
35
34
//! This class encapsulates Quassel's Qt-based GUI.
36
35
/** This is basically a wrapper around MainWin, which is necessary because we cannot derive MainWin
50
49
  inline static QtUiStyle *style();
51
50
  inline static MainWin *mainWindow();
52
51
 
53
 
  //! Access global ActionCollections.
54
 
  /** These ActionCollections are associated with the main window, i.e. they contain global
55
 
   *  actions (and thus, shortcuts). Widgets providing application-wide shortcuts should
56
 
   *  create appropriate Action objects using QtUi::actionCollection(cat)->add\<Action\>().
57
 
   *  @param category The category (default: "General")
58
 
   */
59
 
  static ActionCollection *actionCollection(const QString &category = "General");
60
 
 
61
52
  /* Notifications */
62
53
 
63
54
  static void registerNotificationBackend(AbstractNotificationBackend *);
64
55
  static void unregisterNotificationBackend(AbstractNotificationBackend *);
65
56
  static void unregisterAllNotificationBackends();
66
57
  static const QList<AbstractNotificationBackend *> &notificationBackends();
67
 
  static uint invokeNotification(BufferId bufId, const QString &sender, const QString &text);
 
58
  static uint invokeNotification(BufferId bufId, AbstractNotificationBackend::NotificationType type, const QString &sender, const QString &text);
68
59
  static void closeNotification(uint notificationId);
69
60
  static void closeNotifications(BufferId bufferId = BufferId());
70
61
  static const QList<AbstractNotificationBackend::Notification> &activeNotifications();
80
71
private:
81
72
  static QPointer<QtUi> _instance;
82
73
  static QPointer<MainWin> _mainWin;
83
 
  static QHash<QString, ActionCollection *> _actionCollections;
84
 
  static QtUiStyle *_style;
85
74
  static QList<AbstractNotificationBackend *> _notificationBackends;
86
75
  static QList<AbstractNotificationBackend::Notification> _notifications;
87
76
};
88
77
 
89
78
QtUi *QtUi::instance() { return _instance ? _instance.data() : new QtUi(); }
90
 
QtUiStyle *QtUi::style() { return _style; }
 
79
QtUiStyle *QtUi::style() { return qobject_cast<QtUiStyle*>(uiStyle()); }
91
80
MainWin *QtUi::mainWindow() { return _mainWin; }
92
81
 
93
82
#endif