ukui-search/libsearch/plugininterface/search-task-plugin-iface.h

33 lines
943 B
C
Raw Normal View History

2021-12-28 15:56:41 +08:00
#ifndef SEARCHTASKPLUGINIFACE_H
#define SEARCHTASKPLUGINIFACE_H
2021-12-31 17:38:02 +08:00
#define SearchTaskPluginIface_iid "org.ukui.ukui-search.plugin-iface.SearchTaskPluginIface"
#define SEARCH_TASK_PLUGIN_IFACE_VERSION "1.0.0"
2021-12-28 15:56:41 +08:00
#include <QObject>
#include <QtPlugin>
#include "plugin-iface.h"
#include "search-result-property.h"
2021-12-31 17:38:02 +08:00
#include "search-controller.h"
2021-12-28 15:56:41 +08:00
namespace UkuiSearch {
2021-12-31 17:38:02 +08:00
class SearchTaskPluginIface : public QObject, public PluginInterface
2021-12-28 15:56:41 +08:00
{
Q_OBJECT
public:
2021-12-31 17:38:02 +08:00
virtual QString getCustomSearchType() = 0;
virtual SearchProperty::SearchType getSearchType() = 0;
2021-12-28 15:56:41 +08:00
//Asynchronous,multithread.
virtual void startSearch(std::shared_ptr<SearchController> searchController) = 0;
2021-12-28 15:56:41 +08:00
virtual void stop() = 0;
Q_SIGNALS:
void searchFinished(size_t searchId);
void searchError(size_t searchId, QString msg = {});
2021-12-28 15:56:41 +08:00
};
}
2021-12-31 17:38:02 +08:00
Q_DECLARE_INTERFACE(UkuiSearch::SearchTaskPluginIface, SearchTaskPluginIface_iid)
2021-12-28 15:56:41 +08:00
#endif // SEARCHTASKPLUGINIFACE_H