cutter/src/plugins/PluginManager.h
2019-02-21 22:57:26 +01:00

46 lines
897 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_BINDINGS
void loadPythonPlugins(const QDir &directory);
CutterPlugin *loadPythonPlugin(const char *moduleName);
#endif
};
#define Plugins() (PluginManager::getInstance())
#endif //PLUGINMANAGER_H