cutter/src/plugins/PluginManager.h

49 lines
992 B
C
Raw Normal View History

2019-02-09 13:05:06 +00:00
#ifndef PLUGINMANAGER_H
#define PLUGINMANAGER_H
#include <QObject>
#include <QDir>
class CutterPlugin;
class PluginManager: public QObject
{
Q_OBJECT
public:
static PluginManager *getInstance();
PluginManager();
~PluginManager();
2019-03-06 20:30:39 +00:00
/**
* @brief Load all plugins, should be called once on application start
2019-02-09 13:05:06 +00:00
*/
void loadPlugins();
2019-03-06 20:30:39 +00:00
/**
* @brief Destroy all loaded plugins, should be called once on application shutdown
2019-02-09 13:05:06 +00:00
*/
void destroyPlugins();
const QList<CutterPlugin *> &getPlugins() { return plugins; }
QString getPluginsDirectory() const;
2019-02-09 13:05:06 +00:00
private:
QList<CutterPlugin *> plugins;
void loadNativePlugins(const QDir &directory);
void loadPluginsFromDir(const QDir &pluginsDir);
2019-02-09 13:05:06 +00:00
2019-02-13 22:24:22 +00:00
#ifdef CUTTER_ENABLE_PYTHON_BINDINGS
2019-02-09 13:05:06 +00:00
void loadPythonPlugins(const QDir &directory);
CutterPlugin *loadPythonPlugin(const char *moduleName);
#endif
};
#define Plugins() (PluginManager::getInstance())
#endif //PLUGINMANAGER_H