43 lines
664 B
C
43 lines
664 B
C
|
#ifndef PLUGINMANAGER_H
|
||
|
#define PLUGINMANAGER_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <QDir>
|
||
|
#include <QHash>
|
||
|
|
||
|
|
||
|
class ATBHMIconfig;
|
||
|
class QPluginLoader;
|
||
|
|
||
|
|
||
|
|
||
|
class PluginManager : public QObject
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
explicit PluginManager(ATBHMIconfig *config, QObject *parent = nullptr);
|
||
|
|
||
|
QObject * getInstance(const QString & pluginname);
|
||
|
|
||
|
const QList<QString> listAvailablePlugins();
|
||
|
bool isPluginAvailable(const QString & pluginname);
|
||
|
|
||
|
signals:
|
||
|
|
||
|
public slots:
|
||
|
|
||
|
private:
|
||
|
ATBHMIconfig *config;
|
||
|
|
||
|
QDir pluginsDir;
|
||
|
|
||
|
void loadPlugins();
|
||
|
|
||
|
// Hash to store all plugins
|
||
|
QHash<QString, QPluginLoader*> plugins;
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif // PLUGINMANAGER_H
|