You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
2.6 KiB
C
89 lines
2.6 KiB
C
14 years ago
|
// Object Viewer Qt - MMORPG Framework <http://dev.ryzom.com/projects/nel/>
|
||
5 years ago
|
// Copyright (C) 2010-2011 Dzmitry KAMIAHIN (dnk-88) <dnk-88@tut.by>
|
||
|
//
|
||
|
// This source file has been modified by the following contributors:
|
||
14 years ago
|
// Copyright (C) 2010 Winch Gate Property Limited
|
||
5 years ago
|
// Copyright (C) 2014 Laszlo KIS-ADAM (dfighter) <dfighter1985@gmail.com>
|
||
14 years ago
|
//
|
||
|
// This program is free software: you can redistribute it and/or modify
|
||
|
// it under the terms of the GNU Affero General Public License as
|
||
|
// published by the Free Software Foundation, either version 3 of the
|
||
|
// License, or (at your option) any later version.
|
||
|
//
|
||
|
// This program is distributed in the hope that it will be useful,
|
||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
// GNU Affero General Public License for more details.
|
||
|
//
|
||
|
// You should have received a copy of the GNU Affero General Public License
|
||
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
14 years ago
|
|
||
|
#ifndef PLUGINMANAGER_H
|
||
|
#define PLUGINMANAGER_H
|
||
|
|
||
|
// Qt Include
|
||
|
#include <QtCore/QReadWriteLock>
|
||
|
|
||
|
// Project include
|
||
|
#include "iplugin_manager.h"
|
||
|
|
||
14 years ago
|
namespace ExtensionSystem
|
||
14 years ago
|
{
|
||
|
|
||
|
class IPlugin;
|
||
14 years ago
|
class PluginSpec;
|
||
14 years ago
|
|
||
14 years ago
|
class PluginManager : public IPluginManager
|
||
14 years ago
|
{
|
||
14 years ago
|
Q_OBJECT
|
||
14 years ago
|
|
||
|
public:
|
||
14 years ago
|
PluginManager(QObject *parent = 0);
|
||
|
~PluginManager();
|
||
14 years ago
|
|
||
14 years ago
|
// Object pool operations
|
||
|
virtual void addObject(QObject *obj);
|
||
|
virtual void removeObject(QObject *obj);
|
||
|
virtual QList<QObject *> allObjects() const;
|
||
14 years ago
|
|
||
14 years ago
|
// Plugin operations
|
||
|
virtual void loadPlugins();
|
||
|
virtual QStringList getPluginPaths() const;
|
||
|
virtual void setPluginPaths(const QStringList &paths);
|
||
14 years ago
|
virtual QList<IPluginSpec *> plugins() const;
|
||
14 years ago
|
QList<PluginSpec *> loadQueue();
|
||
14 years ago
|
|
||
11 years ago
|
bool loadPlugin( const QString &plugin );
|
||
11 years ago
|
bool unloadPlugin( ExtensionSystem::IPluginSpec *plugin );
|
||
11 years ago
|
|
||
11 years ago
|
|
||
14 years ago
|
// Settings
|
||
|
virtual void setSettings(QSettings *settings);
|
||
|
virtual QSettings *settings() const;
|
||
|
void readSettings();
|
||
|
void writeSettings();
|
||
14 years ago
|
|
||
|
private:
|
||
11 years ago
|
bool loadPluginSpec( const QString &plugin );
|
||
|
void removePlugin( ExtensionSystem::IPluginSpec *plugin );
|
||
14 years ago
|
void setPluginState(PluginSpec *spec, int destState);
|
||
14 years ago
|
void readPluginPaths();
|
||
14 years ago
|
bool loadQueue(PluginSpec *spec, QList<PluginSpec *> &queue, QList<PluginSpec *> &circularityCheckQueue);
|
||
14 years ago
|
void stopAll();
|
||
14 years ago
|
void deleteAll();
|
||
14 years ago
|
|
||
14 years ago
|
mutable QReadWriteLock m_lock;
|
||
14 years ago
|
|
||
14 years ago
|
QSettings *m_settings;
|
||
14 years ago
|
QString m_extension;
|
||
|
QList<PluginSpec *> m_pluginSpecs;
|
||
14 years ago
|
QList<IPluginSpec *> m_ipluginSpecs;
|
||
|
QStringList m_pluginPaths;
|
||
|
QList<QObject *> m_allObjects;
|
||
14 years ago
|
|
||
14 years ago
|
}; // class PluginManager
|
||
14 years ago
|
|
||
14 years ago
|
} // namespace ExtensionSystem
|
||
14 years ago
|
|
||
|
#endif // PLUGINMANAGER_H
|