2021-04-30 16:28:50 +08:00
|
|
|
#ifndef SEARCHPLUGINIFACE_H
|
|
|
|
#define SEARCHPLUGINIFACE_H
|
|
|
|
#define SearchPluginIface_iid "org.ukui.ukui-search.plugin-iface.SearchPluginInterface"
|
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
#include <QIcon>
|
2021-05-27 21:10:11 +08:00
|
|
|
#include <QList>
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QtPlugin>
|
2021-04-30 16:28:50 +08:00
|
|
|
#include "plugin-iface.h"
|
2021-05-27 21:10:11 +08:00
|
|
|
#include "data-queue.h"
|
2021-04-30 16:28:50 +08:00
|
|
|
|
|
|
|
namespace Zeeker {
|
|
|
|
class SearchPluginIface : public PluginInterface
|
|
|
|
{
|
|
|
|
public:
|
2021-05-12 16:27:24 +08:00
|
|
|
struct DescriptionInfo
|
|
|
|
{
|
|
|
|
QString key;
|
|
|
|
QString value;
|
|
|
|
};
|
2021-05-27 21:10:11 +08:00
|
|
|
struct Actioninfo
|
|
|
|
{
|
|
|
|
int actionkey;
|
|
|
|
QString displayName;
|
|
|
|
};
|
2021-05-03 00:21:36 +08:00
|
|
|
/**
|
2021-05-12 16:27:24 +08:00
|
|
|
* @brief The ResultInfo struct
|
2021-05-03 00:21:36 +08:00
|
|
|
*/
|
2021-05-12 16:27:24 +08:00
|
|
|
struct ResultInfo
|
2021-04-30 16:28:50 +08:00
|
|
|
{
|
|
|
|
QIcon icon;
|
|
|
|
QString name;
|
2021-05-12 16:27:24 +08:00
|
|
|
QVector<DescriptionInfo> description;
|
2021-05-27 21:10:11 +08:00
|
|
|
QString actionKey;
|
|
|
|
int type;
|
2021-04-30 16:28:50 +08:00
|
|
|
};
|
2021-05-27 21:10:11 +08:00
|
|
|
|
2021-05-03 00:21:36 +08:00
|
|
|
virtual ~SearchPluginIface() {}
|
2021-04-30 16:28:50 +08:00
|
|
|
virtual QString getPluginName() = 0;
|
2021-05-27 21:10:11 +08:00
|
|
|
virtual void KeywordSearch(QString keyword,DataQueue<ResultInfo> *searchResult) = 0;
|
|
|
|
virtual QList<Actioninfo> getActioninfo(int type) = 0;
|
|
|
|
virtual void openAction(int actionkey, QString key) = 0;
|
2021-04-30 16:28:50 +08:00
|
|
|
|
|
|
|
};
|
|
|
|
}
|
2021-05-06 20:23:36 +08:00
|
|
|
|
2021-05-03 00:21:36 +08:00
|
|
|
Q_DECLARE_INTERFACE(Zeeker::SearchPluginIface, SearchPluginIface_iid)
|
2021-04-30 16:28:50 +08:00
|
|
|
|
|
|
|
#endif // SEARCHPLUGINIFACE_H
|