2 ******************************************************************************
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009.
8 * @see The GNU Public License (GPL) Version 3
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
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
32 #include "extensionsystem_global.h"
34 #include <QtCore/QString>
35 #include <QtCore/QList>
41 namespace ExtensionSystem
{
43 class PluginSpecPrivate
;
44 class PluginManagerPrivate
;
49 struct EXTENSIONSYSTEM_EXPORT PluginDependency
{
52 bool operator==(const PluginDependency
&other
);
55 struct EXTENSIONSYSTEM_EXPORT PluginArgumentDescription
{
61 class EXTENSIONSYSTEM_EXPORT PluginSpec
{
63 enum State
{ Invalid
, Read
, Resolved
, Loaded
, Initialized
, Running
, Stopped
, Deleted
};
67 // information from the xml file, valid after 'Read' state is reached
69 QString
version() const;
70 QString
compatVersion() const;
71 QString
vendor() const;
72 QString
copyright() const;
73 QString
license() const;
74 QString
description() 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;
99 bool hasError() const;
100 QString
errorString() const;
105 Internal::PluginSpecPrivate
*d
;
106 friend class Internal::PluginManagerPrivate
;
108 } // namespace ExtensionSystem
110 #endif // PLUGINSPEC_H