]> vaikene.ee Git - evaf/blob - src/libs/Plugins/pluginmanager.h
Added more files to the project.
[evaf] / src / libs / Plugins / pluginmanager.h
1 /**
2 * @file plugins/pluginmanager.h
3 * @brief Manager for loadable modules (plugins)
4 *
5 * Copyright (c) 2011 Enar Vaikene
6 *
7 * This file is part of the eVaf C++ cross-platform application development framework.
8 *
9 * This file can be used under the terms of the GNU General Public License
10 * version 3.0 as published by the Free Software Foundation and appearing in
11 * the file LICENSE included in the packaging of this file. Please review the
12 * the following information to ensure the GNU General Public License version
13 * 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14 *
15 * Alternatively, this file may be used in accordance with the Commercial License
16 * Agreement provided with the Software.
17 */
18
19 #ifndef __PLUGINS_PLUGINMANAGER_H
20 #define __PLUGINS_PLUGINMANAGER_H
21
22 #include "libplugins.h"
23
24 #include <version_rc.h>
25
26 #include <QObject>
27
28 /**
29 * Library for managing loadable modules (plugins).
30 *
31 * The Plugins library adds loadable modules (plugins) support to the eVaf application. A module is one
32 * external library (.so or .dll file) that implements one or more plugins. A plugin is an individual object
33 * that is created and initialized as one entirety.
34 *
35 * Modules are loaded and plugins created by the plugin manager. Plugin manager uses the application's
36 * XML file to define which modules should be loaded and which plugins to be created.
37 */
38 namespace Plugins {
39
40 /**
41 * Internal implementation of the plugin manager library.
42 */
43 namespace Internal {
44 class PluginManagerPrivate;
45 }
46
47 /**
48 * Plugin manager for eVaf applications.
49 */
50 class PLUGINS_EXPORT PluginManager : public QObject
51 {
52 Q_OBJECT
53
54 public:
55
56 /// Ctr.
57 PluginManager();
58
59 /// Dtr.
60 virtual ~PluginManager();
61
62 /**
63 * Returns the plugin manager's instance
64 */
65 static PluginManager * instance();
66
67 /**
68 * Initializes the plugin manager.
69 * @return True if ok; false if initialization failed.
70 *
71 * This function initializes the plugin manager. External modules are loaded and plugin objects
72 * created in this function.
73 */
74 bool init();
75
76 /**
77 * Finalizes the plugin manager.
78 *
79 * This function finalizes the plugin manager. Plugin objects are destroyed and external modules
80 * unloaded in this function.
81 */
82 void done();
83
84
85 signals:
86
87 /**
88 * Plugins loaded signal.
89 *
90 * This signal is emitted when all the modules are loaded and plugin objects created.
91 */
92 void pluginsLoaded();
93
94 /**
95 * Plugins unloaded signal.
96 *
97 * This signal is emitted when all the plugin objects are destroyed and modules unloaded.
98 */
99 void pluginsUnloaded();
100
101
102 private:
103
104 Internal::PluginManagerPrivate * dl;
105
106 };
107
108 } // namespace Plugins
109
110
111 #endif // pluginmanager.h