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 
67  static bool unloadPlugin(PluginInfo *plugin_info);
68 
71  static Unigine::Vector<PluginInfo *> plugins();
72 
76  static bool hasError();
78  static Unigine::Vector<Unigine::String> allErrors();
79 
84  static bool isInitialized();
85 
86 signals:
90  void initializationCompleted();
91 
92  void aboutToBeLoadedPlugin(PluginInfo *plugin_info);
93  void loadedPlugin(PluginInfo *plugin_info);
94  void aboutToBeUnloadedPlugin(PluginInfo *plugin_info);
95  void unloadedPlugin(PluginInfo *plugin_info);
96 
97 private:
98  explicit PluginManager(QObject *parent = nullptr);
99  ~PluginManager() override;
100 
101  friend class Editor::Application; // initialization.
102 };
103 
104 
105 } // namespace Editor
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