Editor API
UnigineEditor public API
UniginePluginManager.h
1 // Copyright (C), UNIGINE. All rights reserved.
2 #pragma once
3 
4 
5 #include <editor/UnigineEditorGlobal.h>
6 
7 #include <UnigineString.h>
8 #include <UnigineVector.h>
9 
10 #include <QObject>
11 
12 
14 // Forward decl.
16 namespace UnigineEditor
17 {
18 class Application;
19 class PluginInfo;
20 }
21 
22 
23 namespace UnigineEditor
24 {
34 class UNIGINE_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 ::UnigineEditor::Application; // initialization.
107 };
108 
109 } // namespace UnigineEditor
The UnigineEditor::PluginManager is the main controller class of the Plugin System,...
Definition: UniginePluginManager.h:34
This class it is responsible for plugin loading/unloading and contains all necessary plugin metadata ...
Definition: UniginePluginInfo.h:48