GUIApplicationContext.hpp
1 #pragma once
2 #include <score/application/ApplicationContext.hpp>
3 
4 class QMainWindow;
5 namespace score
6 {
15 {
16  explicit GUIApplicationContext(
20  const std::vector<std::unique_ptr<score::SettingsDelegateModel>>& g,
21  QMainWindow* mw);
22 
28  auto panels() const { return components.panels(); }
29 
35  template <typename T>
36  T& panel() const
37  {
38  return components.panel<T>();
39  }
40  template <typename T>
41  T* findPanel() const
42  {
43  return components.findPanel<T>();
44  }
45 
51  const auto& applicationPlugins() const { return components.applicationPlugins(); }
52 
58  const auto& guiApplicationPlugins() const
59  {
60  return components.guiApplicationPlugins();
61  }
62 
68  template <typename T>
69  T& applicationPlugin() const
70  {
71  return components.applicationPlugin<T>();
72  }
73 
74  template <typename T>
75  T* findApplicationPlugin() const
76  {
77  return components.findApplicationPlugin<T>();
78  }
79 
85  template <typename T>
87  {
88  return components.guiApplicationPlugin<T>();
89  }
90 
91  template <typename T>
92  T* findGuiApplicationPlugin() const
93  {
94  return components.findGuiApplicationPlugin<T>();
95  }
96 
97  DocumentManager& docManager;
98 
99  MenuManager& menus;
100  ToolbarManager& toolbars;
101  ActionManager& actions;
102  QMainWindow* mainWindow{};
103  QWidget* documentTabWidget{};
104 };
105 
106 SCORE_LIB_BASE_EXPORT const GUIApplicationContext& GUIAppContext();
107 }
The ActionManager class.
Definition: ActionManager.hpp:19
Definition: ApplicationComponents.hpp:68
Owns the documents.
Definition: DocumentManager.hpp:49
The MenuManager class.
Definition: MenuManager.hpp:15
The ToolbarManager class.
Definition: ToolbarManager.hpp:15
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Used to access all the application-wide state and structures.
Definition: ApplicationContext.hpp:24
Load-time settings.
Definition: ApplicationSettings.hpp:17
Specializes ApplicationContext with the QMainWindow.
Definition: GUIApplicationContext.hpp:15
T & guiApplicationPlugin() const
Access a specific gui application plug-in instance.
Definition: GUIApplicationContext.hpp:86
T & applicationPlugin() const
Access a specific application plug-in instance.
Definition: GUIApplicationContext.hpp:69
const auto & applicationPlugins() const
List of all the application-wide plug-ins.
Definition: GUIApplicationContext.hpp:51
auto panels() const
List of the available GUI panels.
Definition: GUIApplicationContext.hpp:28
T & panel() const
Access to a specific PanelDelegate.
Definition: GUIApplicationContext.hpp:36
const auto & guiApplicationPlugins() const
List of all the gui application-wide plug-ins.
Definition: GUIApplicationContext.hpp:58