fixed layout and escape quotes
[quassel.git] / src / uisupport / graphicalui.h
index b4f8669..9832d10 100644 (file)
 
 #include "abstractui.h"
 
+class ActionCollection;
 class ContextMenuActionProvider;
 class ToolBarActionProvider;
+class UiStyle;
 
 class GraphicalUi : public AbstractUi {
   Q_OBJECT
@@ -32,17 +34,40 @@ class GraphicalUi : public AbstractUi {
 public:
   GraphicalUi(QObject *parent = 0);
 
+  //! 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 GraphicalUi::actionCollection(cat)->add\<Action\>().
+  *  @param category The category (default: "General")
+  */
+  static ActionCollection *actionCollection(const QString &category = "General");
+
   inline static ContextMenuActionProvider *contextMenuActionProvider();
   inline static ToolBarActionProvider *toolBarActionProvider();
+  inline static UiStyle *uiStyle();
+  inline static QWidget *mainWidget();
+
+  //! Force the main widget to the front and focus it (may not work in all window systems)
+  static void activateMainWidget();
+
+  //! Hide main widget (storing the current desktop if possible)
+  static void hideMainWidget();
 
 protected:
+  //! This is the widget we associate global actions with, typically the main window
+  void setMainWidget(QWidget *);
+
   void setContextMenuActionProvider(ContextMenuActionProvider *);
   void setToolBarActionProvider(ToolBarActionProvider *);
+  void setUiStyle(UiStyle *);
 
 private:
+  static QWidget *_mainWidget;
+  static QHash<QString, ActionCollection *> _actionCollections;
   static ContextMenuActionProvider *_contextMenuActionProvider;
   static ToolBarActionProvider *_toolBarActionProvider;
-
+  static UiStyle *_uiStyle;
+  static bool _onAllDesktops;
 };
 
 ContextMenuActionProvider *GraphicalUi::contextMenuActionProvider() {
@@ -53,4 +78,12 @@ ToolBarActionProvider *GraphicalUi::toolBarActionProvider() {
   return _toolBarActionProvider;
 }
 
+UiStyle *GraphicalUi::uiStyle() {
+  return _uiStyle;
+}
+
+QWidget *GraphicalUi::mainWidget() {
+  return _mainWidget;
+}
+
 #endif