ApplicationRegistrar.hpp
1 #pragma once
3 #include <score/application/GUIApplicationContext.hpp>
4 #include <score/command/Command.hpp>
6 #include <score/plugins/Addon.hpp>
7 #include <score/plugins/Interface.hpp>
8 #include <score/tools/std/HashMap.hpp>
9 
10 #include <QObject>
11 
12 #include <score_lib_base_export.h>
13 
14 #include <utility>
15 namespace score
16 {
17 class DocumentDelegateFactory;
18 class InterfaceListBase;
19 struct GUIApplicationContext;
20 class GUIApplicationPlugin;
22 class SettingsDelegateFactory;
23 struct ApplicationComponentsData;
24 class View;
25 class Settings;
26 class Plugin_QtInterface;
27 
35 class SCORE_LIB_BASE_EXPORT ApplicationRegistrar : public QObject
36 {
37 public:
40 
41  void registerAddons(std::vector<score::Addon> vec);
42  void registerApplicationPlugin(ApplicationPlugin*);
43 
44  void registerCommands(CommandStore&& cmds);
45  void registerCommands(const CommandGroupKey& k, CommandGeneratorMap&& cmds);
46 
47  void registerFactories(
48  score::hash_map<score::InterfaceKey, std::unique_ptr<InterfaceListBase>>&& cmds);
49  void registerFactory(std::unique_ptr<InterfaceListBase> cmds);
50 
51  ApplicationComponentsData& components() const { return m_components; }
52 
53 protected:
54  ApplicationComponentsData& m_components;
55 };
56 
57 class SCORE_LIB_BASE_EXPORT GUIApplicationRegistrar : public ApplicationRegistrar
58 {
59 public:
64 
65  // Register data from plugins
66  void registerGUIApplicationPlugin(GUIApplicationPlugin*);
67  void registerPanel(PanelDelegateFactory&);
68 
69 private:
70  const score::GUIApplicationContext& m_context;
71 
72  MenuManager& m_menuManager;
73  ToolbarManager& m_toolbarManager;
74  ActionManager& m_actionManager;
75 };
76 }
std::vector< std::pair< CommandKey, CommandFactory > > CommandGeneratorMap
The CommandGeneratorMap struct.
Definition: CommandGeneratorMap.hpp:54
Definition: ConsolePanel.hpp:59
Definition: UuidKey.hpp:343
The ActionManager class.
Definition: ActionManager.hpp:19
Definition: GUIApplicationPlugin.hpp:31
Registers the plug-in elements.
Definition: ApplicationRegistrar.hpp:36
Used to extend the software with application-wide data.
Definition: GUIApplicationPlugin.hpp:89
Definition: ApplicationRegistrar.hpp:58
The MenuManager class.
Definition: MenuManager.hpp:15
Reimplement this interface to register new panels.
Definition: PanelDelegateFactory.hpp:10
The ToolbarManager class.
Definition: ToolbarManager.hpp:15
Base toolkit upon which the software is built.
Definition: Application.cpp:90
Definition: ApplicationComponents.hpp:46
Definition: ApplicationComponents.hpp:40
Specializes ApplicationContext with the QMainWindow.
Definition: GUIApplicationContext.hpp:15