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

55 lines
1.7 KiB
C
Raw Permalink Normal View History

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"
#define SEARCH_TASK_PLUGIN_IFACE_VERSION "1.1.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:
virtual void setController(const SearchController &searchController) = 0;
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() = 0;
2021-12-28 15:56:41 +08:00
virtual void stop() = 0;
virtual bool isSearching() = 0;
2021-12-28 15:56:41 +08:00
Q_SIGNALS:
void searchFinished(size_t searchId);
void searchError(size_t searchId, QString msg = {});
void reachInformNum();
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