ukui-search/frontend/control/stack-pages/search-result-page.h

67 lines
2.0 KiB
C
Raw Normal View History

/*
*
* 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
#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
{
Q_OBJECT
public:
2021-07-23 16:10:30 +08:00
explicit SearchResultPage(QWidget *parent = nullptr);
~SearchResultPage() = default;
void setInternalPlugins();
void appendPlugin(const QString &plugin_id);
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);
void setWidth(int width);
2021-07-23 16:10:30 +08:00
protected:
void paintEvent(QPaintEvent *event);
private:
void initUi();
void initConnections();
void setupConnectionsForWidget(ResultWidget *);
QSplitter * m_splitter = nullptr;
2021-08-02 13:46:59 +08:00
QHBoxLayout * m_hlayout = nullptr;
ResultArea * m_resultArea = nullptr;
DetailArea * m_detailArea = nullptr;
Q_SIGNALS:
void startSearch(const QString &);
void stopSearch();
void currentRowChanged(const QString &, const SearchPluginIface::ResultInfo&);
void effectiveSearch();
2021-08-02 13:46:59 +08:00
void resizeHeight(int height);
void resizeWidth(const int &);
2021-08-18 14:23:14 +08:00
void setSelectionInfo(QString &);
};
}
2021-07-23 16:10:30 +08:00
#endif // SEARCHRESULTPAGE_H