mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-22 20:38:50 +00:00
46 lines
888 B
C
46 lines
888 B
C
|
|
||
|
#ifndef PLUGINMANAGER_H
|
||
|
#define PLUGINMANAGER_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <QDir>
|
||
|
|
||
|
class CutterPlugin;
|
||
|
|
||
|
class PluginManager: public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
static PluginManager *getInstance();
|
||
|
|
||
|
PluginManager();
|
||
|
~PluginManager();
|
||
|
|
||
|
/*!
|
||
|
* \brief Load all plugins, should be called once on application start
|
||
|
*/
|
||
|
void loadPlugins();
|
||
|
|
||
|
/*!
|
||
|
* \brief Destroy all loaded plugins, should be called once on application shutdown
|
||
|
*/
|
||
|
void destroyPlugins();
|
||
|
|
||
|
const QList<CutterPlugin *> &getPlugins() { return plugins; }
|
||
|
|
||
|
private:
|
||
|
QList<CutterPlugin *> plugins;
|
||
|
|
||
|
void loadNativePlugins(const QDir &directory);
|
||
|
|
||
|
#ifdef CUTTER_ENABLE_PYTHON
|
||
|
void loadPythonPlugins(const QDir &directory);
|
||
|
CutterPlugin *loadPythonPlugin(const char *moduleName);
|
||
|
#endif
|
||
|
};
|
||
|
|
||
|
#define Plugins() (PluginManager::getInstance())
|
||
|
|
||
|
#endif //PLUGINMANAGER_H
|