2021-05-22 21:29:43 +08:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Copyright (C) 2020, 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/>.
|
|
|
|
*
|
|
|
|
* Authors: zhangjiaping <zhangjiaping@kylinos.cn>
|
|
|
|
*
|
|
|
|
*/
|
2021-07-23 16:10:30 +08:00
|
|
|
#ifndef SEARCHRESULTPAGE_H
|
|
|
|
#define SEARCHRESULTPAGE_H
|
2021-05-22 21:29:43 +08:00
|
|
|
|
|
|
|
#include <QSplitter>
|
|
|
|
#include "search-page-section.h"
|
|
|
|
|
2021-12-14 14:43:35 +08:00
|
|
|
namespace UkuiSearch {
|
2021-07-23 16:10:30 +08:00
|
|
|
class SearchResultPage : public QWidget
|
2021-05-22 21:29:43 +08:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2021-07-23 16:10:30 +08:00
|
|
|
explicit SearchResultPage(QWidget *parent = nullptr);
|
|
|
|
~SearchResultPage() = default;
|
|
|
|
void setInternalPlugins();
|
2021-05-22 21:29:43 +08:00
|
|
|
void appendPlugin(const QString &plugin_id);
|
2022-11-22 10:17:36 +08:00
|
|
|
void movePlugin(const QString &plugin_id, int index);
|
2021-08-18 14:23:14 +08:00
|
|
|
void pressEnter();
|
|
|
|
void pressUp();
|
|
|
|
void pressDown();
|
|
|
|
bool getSelectedState();
|
|
|
|
void sendResizeWidthSignal(int size);
|
2022-12-13 11:22:30 +08:00
|
|
|
void setWidth(int width);
|
2021-05-22 21:29:43 +08:00
|
|
|
|
2021-07-23 16:10:30 +08:00
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *event);
|
2021-05-22 21:29:43 +08:00
|
|
|
private:
|
|
|
|
void initUi();
|
|
|
|
void initConnections();
|
|
|
|
void setupConnectionsForWidget(ResultWidget *);
|
|
|
|
QSplitter * m_splitter = nullptr;
|
2021-08-02 13:46:59 +08:00
|
|
|
QHBoxLayout * m_hlayout = nullptr;
|
2021-05-22 21:29:43 +08:00
|
|
|
ResultArea * m_resultArea = nullptr;
|
|
|
|
DetailArea * m_detailArea = nullptr;
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void startSearch(const QString &);
|
|
|
|
void stopSearch();
|
|
|
|
void currentRowChanged(const QString &, const SearchPluginIface::ResultInfo&);
|
2021-05-27 10:25:15 +08:00
|
|
|
void effectiveSearch();
|
2021-08-02 13:46:59 +08:00
|
|
|
void resizeHeight(int height);
|
2021-08-12 14:57:25 +08:00
|
|
|
void resizeWidth(const int &);
|
2021-08-18 14:23:14 +08:00
|
|
|
void setSelectionInfo(QString &);
|
2021-05-22 21:29:43 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-07-23 16:10:30 +08:00
|
|
|
#endif // SEARCHRESULTPAGE_H
|