dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
pluginmanager_p.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  */
27 
28 #ifndef PLUGINMANAGER_P_H
29 #define PLUGINMANAGER_P_H
30 
31 #include "pluginspec.h"
32 
33 #include <QtCore/QList>
34 #include <QtCore/QSet>
35 #include <QtCore/QStringList>
36 #include <QtCore/QObject>
37 
38 namespace ExtensionSystem {
39 
40 class PluginManager;
41 
42 namespace Internal {
43 
44 class PluginSpecPrivate;
45 
46 class EXTENSIONSYSTEM_EXPORT PluginManagerPrivate
47 {
48 public:
49  PluginManagerPrivate(PluginManager *pluginManager);
50  virtual ~PluginManagerPrivate();
51 
52  // Object pool operations
53  void addObject(QObject *obj);
54  void removeObject(QObject *obj);
55 
56  // Plugin operations
57  void loadPlugins();
58  void setPluginPaths(const QStringList &paths);
59  QList<PluginSpec *> loadQueue();
60  void loadPlugin(PluginSpec *spec, PluginSpec::State destState);
61  void resolveDependencies();
62 
65  QStringList pluginPaths;
66  QString extension;
67  QList<QObject *> allObjects; // ### make this a QList<QPointer<QObject> > > ?
68 
69  QStringList arguments;
70 
71  // Look in argument descriptions of the specs for the option.
72  PluginSpec *pluginForOption(const QString &option, bool *requiresArgument) const;
73  PluginSpec *pluginByName(const QString &name) const;
74 
75  // used by tests
76  static PluginSpec *createSpec();
77  static PluginSpecPrivate *privateSpec(PluginSpec *spec);
78 private:
79  PluginManager *q;
80 
81  void readPluginPaths();
82  bool loadQueue(PluginSpec *spec,
83  QList<PluginSpec *> &queue,
84  QList<PluginSpec *> &circularityCheckQueue);
85  void stopAll();
86 };
87 
88 } // namespace Internal
89 } // namespace ExtensionSystem
90 
91 #endif // PLUGINMANAGER_P_H
Core plugin system that manages the plugins, their life cycle and their registered objects...
Definition: pluginmanager.h:53
Contains the information of the plugins xml description file and information about the plugin's curre...
Definition: pluginspec.h:63
Definition: icore.h:39