dRonin  adbada4
dRonin GCS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
pluginspec.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 PLUGINSPEC_H
29 #define PLUGINSPEC_H
30 
31 #include "extensionsystem_global.h"
32 
33 #include <QtCore/QString>
34 #include <QtCore/QList>
35 
36 QT_BEGIN_NAMESPACE
37 class QStringList;
38 QT_END_NAMESPACE
39 
40 namespace ExtensionSystem {
41 
42 namespace Internal {
43  class PluginSpecPrivate;
44  class PluginManagerPrivate;
45 }
46 
47 class IPlugin;
48 
49 struct EXTENSIONSYSTEM_EXPORT PluginDependency
50 {
51  QString name;
52  QString version;
53  bool operator==(const PluginDependency &other);
54 };
55 
56 struct EXTENSIONSYSTEM_EXPORT PluginArgumentDescription
57 {
58  QString name;
59  QString parameter;
60  QString description;
61 };
62 
63 class EXTENSIONSYSTEM_EXPORT PluginSpec
64 {
65 public:
66  enum State { Invalid, Read, Resolved, Loaded, Initialized, Running, Stopped, Deleted};
67 
68  ~PluginSpec();
69 
70  // information from the xml file, valid after 'Read' state is reached
71  QString name() const;
72  QString version() const;
73  QString compatVersion() const;
74  QString vendor() const;
75  QString copyright() const;
76  QString license() const;
77  QString description() const;
78  QString url() const;
79  QList<PluginDependency> dependencies() const;
80 
82  PluginArgumentDescriptions argumentDescriptions() const;
83 
84  // other information, valid after 'Read' state is reached
85  QString location() const;
86  QString filePath() const;
87 
88  QStringList arguments() const;
89  void setArguments(const QStringList &arguments);
90  void addArgument(const QString &argument);
91 
92  bool provides(const QString &pluginName, const QString &version) const;
93 
94  // dependency specs, valid after 'Resolved' state is reached
95  QList<PluginSpec *> dependencySpecs() const;
96 
97  // linked plugin instance, valid after 'Loaded' state is reached
98  IPlugin *plugin() const;
99 
100  // state
101  State state() const;
102  bool hasError() const;
103  QString errorString() const;
104 
105 private:
106  PluginSpec();
107 
110 };
111 
112 } // namespace ExtensionSystem
113 
114 #endif // PLUGINSPEC_H
115 
bool operator==(Point const &lhs, Point const &rhs)
Definition: point.cpp:49
QList< PluginArgumentDescription > PluginArgumentDescriptions
Definition: pluginspec.h:81
Contains the information of the plugins xml description file and information about the plugin's curre...
Definition: pluginspec.h:63
Struct that contains the name and required compatible version number of a plugin's dependency...
Definition: pluginspec.h:49
Definition: icore.h:39
Base class for all plugins.
Definition: iplugin.h:45