LP-311 Remove basic/advanced stabilization tab auto-switch (autotune/txpid lock issues)
[librepilot.git] / ground / gcs / src / libs / extensionsystem / pluginspec.h
blob846bb46476c23c340ba872e5fea3b7d62ddfc69d
1 /**
2 ******************************************************************************
4 * @file pluginspec.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
7 * @brief
8 * @see The GNU Public License (GPL) Version 3
9 * @defgroup
10 * @{
12 *****************************************************************************/
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.
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.
24 * You should have received a copy of the GNU General Public License along
25 * with this program; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 #ifndef PLUGINSPEC_H
30 #define PLUGINSPEC_H
32 #include "extensionsystem_global.h"
34 #include <QtCore/QString>
35 #include <QtCore/QList>
37 QT_BEGIN_NAMESPACE
38 class QStringList;
39 QT_END_NAMESPACE
41 namespace ExtensionSystem {
42 namespace Internal {
43 class PluginSpecPrivate;
44 class PluginManagerPrivate;
47 class IPlugin;
49 struct EXTENSIONSYSTEM_EXPORT PluginDependency {
50 QString name;
51 QString version;
52 bool operator==(const PluginDependency &other);
55 struct EXTENSIONSYSTEM_EXPORT PluginArgumentDescription {
56 QString name;
57 QString parameter;
58 QString description;
61 class EXTENSIONSYSTEM_EXPORT PluginSpec {
62 public:
63 enum State { Invalid, Read, Resolved, Loaded, Initialized, Running, Stopped, Deleted };
65 ~PluginSpec();
67 // information from the xml file, valid after 'Read' state is reached
68 QString name() const;
69 QString version() const;
70 QString compatVersion() const;
71 QString vendor() const;
72 QString copyright() const;
73 QString license() const;
74 QString description() const;
75 QString url() const;
76 QList<PluginDependency> dependencies() const;
78 typedef QList<PluginArgumentDescription> PluginArgumentDescriptions;
79 PluginArgumentDescriptions argumentDescriptions() const;
81 // other information, valid after 'Read' state is reached
82 QString location() const;
83 QString filePath() const;
85 QStringList arguments() const;
86 void setArguments(const QStringList &arguments);
87 void addArgument(const QString &argument);
89 bool provides(const QString &pluginName, const QString &version) const;
91 // dependency specs, valid after 'Resolved' state is reached
92 QList<PluginSpec *> dependencySpecs() const;
94 // linked plugin instance, valid after 'Loaded' state is reached
95 IPlugin *plugin() const;
97 // state
98 State state() const;
99 bool hasError() const;
100 QString errorString() const;
102 private:
103 PluginSpec();
105 Internal::PluginSpecPrivate *d;
106 friend class Internal::PluginManagerPrivate;
108 } // namespace ExtensionSystem
110 #endif // PLUGINSPEC_H