Debian Codegraph @

src/album/searchview/searchview.h

raw
1 /*
2 * Copyright (C) 2020 ~ 2021 Uniontech Software Technology Co., Ltd.
3 *
4 * Author: ZhangYong <[email protected]>
5 *
6 * Maintainer: ZhangYong <[email protected]>
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 #ifndef SEARCHVIEW_H
22 #define SEARCHVIEW_H
23
24 #include "application.h"
25 #include "utils/baseutils.h"
26 #include "utils/imageutils.h"
27 #include "controller/configsetter.h"
28 #include "controller/signalmanager.h"
29 #include "dbmanager/dbmanager.h"
30 #include "thumbnail/thumbnaillistview.h"
31
32
33 #include <QWidget>
34 #include <QVBoxLayout>
35 #include <DLabel>
36 #include <QPixmap>
37 #include <QStandardPaths>
38 #include <QImageReader>
39 #include <DPushButton>
40 #include <QDir>
41 #include <QFileDialog>
42 #include <QFileInfo>
43 #include <DStackedWidget>
44 #include <DSlider>
45 #include <DWidget>
46 #include <DGuiApplicationHelper>
47 #include <QMouseEvent>
48 #include <DBlurEffectWidget>
49
50 DWIDGET_USE_NAMESPACE
51 DGUI_USE_NAMESPACE
52
53 class SearchView : public QWidget
54 {
55 Q_OBJECT
56
57 public:
58 SearchView();
59 void improtSearchResultsIntoThumbnailView(QString s, const QString &album);
60
61 public slots:
62 void onSlideShowBtnClicked();
63 //打开图片
64 void onOpenImage(int row, const QString &path, bool bFullScreen);
65 //幻灯片播放
66 void onSlideShow(const QString &path);
67
68 private:
69 void initConnections();
70 void initNoSearchResultView();
71 void initSearchResultView();
72 void initMainStackWidget();
73 void updateSearchResultsIntoThumbnailView();
74 void changeTheme();
75 void setSliderShowBtnEnable(bool enabled);
76 void onKeyDelete();
77 void resizeEvent(QResizeEvent *e) override;
78 void paintEvent(QPaintEvent *event) Q_DECL_OVERRIDE;
79
80 private:
81 DStackedWidget *m_stackWidget;
82 DWidget *m_pNoSearchResultView;
83 DLabel *m_pNoSearchResultLabel;
84 DWidget *m_pSearchResultWidget = nullptr;
85 DWidget *m_searchResultViewbody;
86 DWidget *m_searchResultViewTop;
87 DPushButton *m_pSlideShowBtn;
88 DLabel *m_pSearchResultLabel;
89 QString m_keywords;
90 DLabel *pNoResult;
91 DLabel *pLabel1;
92 QString m_albumName;
93 int m_currentFontSize;
94 public:
95 int m_searchPicNum;
96 ThumbnailListView *m_pThumbnailListView;
97 };
98
99 #endif // SEARCHVIEW_H