Loading...
Searching...
No Matches
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>
15namespace score
16{
17class DocumentDelegateFactory;
18class InterfaceListBase;
19struct GUIApplicationContext;
20class GUIApplicationPlugin;
21class PanelDelegateFactory;
22class SettingsDelegateFactory;
23struct ApplicationComponentsData;
24class View;
25class Settings;
26class Plugin_QtInterface;
27
35class SCORE_LIB_BASE_EXPORT ApplicationRegistrar : public QObject
36{
37public:
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
53protected:
54 ApplicationComponentsData& m_components;
55};
56
57class SCORE_LIB_BASE_EXPORT GUIApplicationRegistrar : public ApplicationRegistrar
58{
59public:
64
65 // Register data from plugins
66 void registerGUIApplicationPlugin(GUIApplicationPlugin*);
67 void registerPanel(PanelDelegateFactory&);
68
69private:
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 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