2021-05-03 00:21:36 +08:00
|
|
|
#ifndef SEARCHPLUGINFACTORY_H
|
|
|
|
#define SEARCHPLUGINFACTORY_H
|
|
|
|
|
|
|
|
#include <QObject>
|
2021-05-27 21:10:11 +08:00
|
|
|
#include "search-plugin-iface.h"
|
2021-05-03 00:21:36 +08:00
|
|
|
|
2021-12-14 14:43:35 +08:00
|
|
|
namespace UkuiSearch {
|
2021-08-02 13:46:59 +08:00
|
|
|
|
2021-05-03 00:21:36 +08:00
|
|
|
class SearchPluginManager : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
bool registerPlugin(SearchPluginIface *plugin);
|
|
|
|
|
|
|
|
static SearchPluginManager *getInstance();
|
|
|
|
const QStringList getPluginIds();
|
|
|
|
SearchPluginIface *getPlugin(const QString &pluginId);
|
|
|
|
|
|
|
|
void close();
|
|
|
|
|
|
|
|
private:
|
2021-08-03 16:08:30 +08:00
|
|
|
std::map<QString, SearchPluginIface*> m_map;
|
|
|
|
std::map<int, QString> m_plugin_order;//绑定plugin ID和优先级
|
2021-05-03 00:21:36 +08:00
|
|
|
explicit SearchPluginManager(QObject *parent = nullptr);
|
|
|
|
~SearchPluginManager();
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // SEARCHPLUGINFACTORY_H
|