Editor API
UnigineEditor public API
PluginManager.h
1 // Copyright (C), UNIGINE. All rights reserved.
2 #pragma once
3 
4 
5 #include <editor/EditorGlobal.h>
6 
7 #include <UnigineString.h>
8 #include <UnigineVector.h>
9 
10 #include <QObject>
11 
12 
14 // Forward decl.
16 namespace Editor
17 {
18 class PluginInfo;
19 class Application;
20 }
21 
22 
23 namespace Editor
24 {
34 class EDITOR_API PluginManager final : public QObject
35 {
36  Q_OBJECT
37 public:
46  static PluginManager *instance();
47 
53  static void loadPluginSpecs(const Unigine::Vector<Unigine::String> &search_paths);
56  static void loadPlugins();
59  static void unloadPlugins();
60 
63  static bool loadPlugin(PluginInfo *plugin_info);
64 
68  static bool unloadPlugin(PluginInfo *plugin_info);
69 
72  static Unigine::Vector<PluginInfo *> plugins();
73 
77  static bool hasError();
79  static Unigine::Vector<Unigine::String> allErrors();
80 
85  static bool isInitialized();
86 
87 signals:
91  void initializationCompleted();
92 
94  void aboutToBeLoadedPlugin(PluginInfo *plugin_info);
96  void loadedPlugin(PluginInfo *plugin_info);
98  void aboutToBeUnloadedPlugin(PluginInfo *plugin_info);
100  void unloadedPlugin(PluginInfo *plugin_info);
101 
102 private:
103  explicit PluginManager(QObject *parent = nullptr);
104  ~PluginManager() override;
105 
106  friend class Editor::Application; // initialization.
107 };
108 
109 
110 } // namespace Editor
Definition: Actions.h:11
The Editor::PluginManager is the main controller class of the Plugin System, it is responsible for: L...
Definition: PluginManager.h:34
This class it is responsible for plugin loading/unloading and contains all necessary plugin metadata ...
Definition: PluginInfo.h:48