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"
|
2022-05-27 09:42:15 +08:00
|
|
|
#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"
|
2023-03-15 16:39:38 +08:00
|
|
|
#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;
|
2023-03-15 16:39:38 +08:00
|
|
|
virtual SearchProperty::SearchType getSearchType() = 0;
|
2021-12-28 15:56:41 +08:00
|
|
|
//Asynchronous,multithread.
|
2022-01-24 09:44:42 +08:00
|
|
|
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);
|
2022-04-26 10:43:02 +08:00
|
|
|
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
|