| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifndef KSNIP_PLUGINMANAGER_H |
| 21 |
#define KSNIP_PLUGINMANAGER_H |
| 22 |
|
| 23 |
#include <QSharedPointer> |
| 24 |
|
| 25 |
#include "IPluginManager.h" |
| 26 |
#include "IPluginLoader.h" |
| 27 |
#include "PluginInfo.h" |
| 28 |
#include "src/backend/config/IConfig.h" |
| 29 |
#include "src/logging/ILogger.h" |
| 30 |
#include "src/common/helper/EnumTranslator.h" |
| 31 |
|
| 32 |
class PluginManager : public IPluginManager |
| 33 |
{ |
| 34 |
public: |
| 35 |
explicit PluginManager(const QSharedPointer<IConfig> &config, const QSharedPointer<IPluginLoader> &loader, const QSharedPointer<ILogger> &logger); |
| 36 |
~PluginManager() override = default; |
| 37 |
bool isAvailable(PluginType type) const override; |
| 38 |
QSharedPointer<QObject> get(PluginType type) const override; |
| 39 |
QString getPath(PluginType type) const override; |
| 40 |
|
| 41 |
private: |
| 42 |
QSharedPointer<IConfig> mConfig; |
| 43 |
QSharedPointer<IPluginLoader> mLoader; |
| 44 |
QSharedPointer<ILogger> mLogger; |
| 45 |
QMap<PluginType, QSharedPointer<QObject>> mPluginMap; |
| 46 |
QMap<PluginType, QString> mPluginPathMap; |
| 47 |
|
| 48 |
private slots: |
| 49 |
void loadPlugins(); |
| 50 |
}; |
| 51 |
|
| 52 |
#endif |