1 // Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
2 // Copyright (C) 2010-2011 Dzmitry KAMIAHIN (dnk-88) <dnk-88@tut.by>
4 // This source file has been modified by the following contributors:
5 // Copyright (C) 2010 Winch Gate Property Limited
6 // Copyright (C) 2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
8 // This program is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Affero General Public License as
10 // published by the Free Software Foundation, either version 3 of the
11 // License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU Affero General Public License for more details.
18 // You should have received a copy of the GNU Affero General Public License
19 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #ifndef PLUGINMANAGER_H
22 #define PLUGINMANAGER_H
25 #include <QtCore/QReadWriteLock>
28 #include "iplugin_manager.h"
30 namespace ExtensionSystem
36 class PluginManager
: public IPluginManager
41 PluginManager(QObject
*parent
= 0);
44 // Object pool operations
45 virtual void addObject(QObject
*obj
);
46 virtual void removeObject(QObject
*obj
);
47 virtual QList
<QObject
*> allObjects() const;
50 virtual void loadPlugins();
51 virtual QStringList
getPluginPaths() const;
52 virtual void setPluginPaths(const QStringList
&paths
);
53 virtual QList
<IPluginSpec
*> plugins() const;
54 QList
<PluginSpec
*> loadQueue();
56 bool loadPlugin( const QString
&plugin
);
57 bool unloadPlugin( ExtensionSystem::IPluginSpec
*plugin
);
61 virtual void setSettings(QSettings
*settings
);
62 virtual QSettings
*settings() const;
67 bool loadPluginSpec( const QString
&plugin
);
68 void removePlugin( ExtensionSystem::IPluginSpec
*plugin
);
69 void setPluginState(PluginSpec
*spec
, int destState
);
70 void readPluginPaths();
71 bool loadQueue(PluginSpec
*spec
, QList
<PluginSpec
*> &queue
, QList
<PluginSpec
*> &circularityCheckQueue
);
75 mutable QReadWriteLock m_lock
;
77 QSettings
*m_settings
;
79 QList
<PluginSpec
*> m_pluginSpecs
;
80 QList
<IPluginSpec
*> m_ipluginSpecs
;
81 QStringList m_pluginPaths
;
82 QList
<QObject
*> m_allObjects
;
84 }; // class PluginManager
86 } // namespace ExtensionSystem
88 #endif // PLUGINMANAGER_H