2023-04-11 10:19:35 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright (C) 2023, KylinSoft Co., Ltd.
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
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
|