2021-10-27 11:37:55 +08:00
|
|
|
#ifndef WEBSEARCHPLUGIN_H
|
|
|
|
#define WEBSEARCHPLUGIN_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QThreadPool>
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QHBoxLayout>
|
|
|
|
#include <QVBoxLayout>
|
|
|
|
#include <QFrame>
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QAction>
|
|
|
|
#include "action-label.h"
|
|
|
|
#include "search-plugin-iface.h"
|
2022-03-04 11:36:36 +08:00
|
|
|
#include <gio/gdesktopappinfo.h>
|
2021-10-27 11:37:55 +08:00
|
|
|
|
2021-12-14 14:43:35 +08:00
|
|
|
namespace UkuiSearch {
|
2022-03-04 11:36:36 +08:00
|
|
|
|
2021-10-27 11:37:55 +08:00
|
|
|
class LIBSEARCH_EXPORT WebSearchPlugin : public QObject, public SearchPluginIface
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit WebSearchPlugin(QObject *parent = nullptr);
|
|
|
|
PluginType pluginType() {return PluginType::SearchPlugin;}
|
|
|
|
const QString name();
|
|
|
|
const QString description();
|
|
|
|
const QIcon icon() {return QIcon::fromTheme("folder");}
|
|
|
|
void setEnable(bool enable) {m_enable = enable;}
|
|
|
|
bool isEnable() {return m_enable;}
|
|
|
|
QString getPluginName();
|
|
|
|
void KeywordSearch(QString keyword,DataQueue<ResultInfo> *searchResult);
|
2022-02-12 14:20:55 +08:00
|
|
|
void stopSearch();
|
2021-10-27 11:37:55 +08:00
|
|
|
QList<SearchPluginIface::Actioninfo> getActioninfo(int type);
|
|
|
|
void openAction(int actionkey, QString key, int type);
|
|
|
|
QWidget *detailPage(const ResultInfo &ri);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void initDetailPage();
|
|
|
|
QString m_keyWord;
|
|
|
|
QString m_currentActionKey;
|
|
|
|
QWidget *m_detailPage = nullptr;
|
|
|
|
QVBoxLayout *m_detailLyt = nullptr;
|
|
|
|
QLabel *m_iconLabel = nullptr;
|
|
|
|
QFrame *m_actionFrame = nullptr;
|
|
|
|
QVBoxLayout *m_actionFrameLyt = nullptr;
|
|
|
|
ActionLabel *m_actionLabel1 = nullptr;
|
|
|
|
|
|
|
|
QVBoxLayout * m_actionLyt = nullptr;
|
|
|
|
|
|
|
|
bool m_enable = true;
|
|
|
|
QList<WebSearchPlugin::Actioninfo> m_actionInfo;
|
2022-03-04 11:36:36 +08:00
|
|
|
|
|
|
|
QString getDefaultAppId(const char * contentType);
|
2021-10-27 11:37:55 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif // WEBSEARCHPLUGIN_H
|