| 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 |
|
| 22 |
#ifndef MAINWIDGET_H |
| 23 |
#define MAINWIDGET_H |
| 24 |
|
| 25 |
#include "bottomtoolbar.h" |
| 26 |
#include "extensionpanel.h" |
| 27 |
#include "toptoolbar.h" |
| 28 |
#include "controller/signalmanager.h" |
| 29 |
#include "module/view/viewpanel.h" |
| 30 |
|
| 31 |
#include <QFrame> |
| 32 |
#include <QStackedWidget> |
| 33 |
|
| 34 |
class MainWidget : public QFrame |
| 35 |
{ |
| 36 |
Q_OBJECT |
| 37 |
public: |
| 38 |
MainWidget(bool manager, QWidget *parent = nullptr); |
| 39 |
~MainWidget() override; |
| 40 |
|
| 41 |
protected: |
| 42 |
void resizeEvent(QResizeEvent *e) override; |
| 43 |
void showEvent(QShowEvent *event) override; |
| 44 |
|
| 45 |
private slots: |
| 46 |
void onGotoPanel(ModulePanel *panel); |
| 47 |
void onBackToMainPanel(); |
| 48 |
void onActiveWindow(); |
| 49 |
void onShowInFileManager(const QString &path); |
| 50 |
void onMouseMove(bool show); |
| 51 |
void onShowFullScreen(); |
| 52 |
void onUpdateBottomToolbar(bool wideMode); |
| 53 |
void onUpdateBottomToolbarContent(QWidget *c, bool wideMode); |
| 54 |
void onShowBottomToolbar(); |
| 55 |
void onHideBottomToolbar(bool immediately); |
| 56 |
void onUpdateExtensionPanelContent(QWidget *c); |
| 57 |
void onShowExtensionPanel(); |
| 58 |
|
| 59 |
private: |
| 60 |
void initBottomToolbar(); |
| 61 |
void initExtensionPanel(); |
| 62 |
void initTopToolbar(); |
| 63 |
void initConnection(); |
| 64 |
void initPanelStack(bool manager); |
| 65 |
|
| 66 |
private: |
| 67 |
QStackedWidget *m_panelStack; |
| 68 |
|
| 69 |
#ifndef LITE_DIV |
| 70 |
bool m_manager; |
| 71 |
#endif |
| 72 |
ExtensionPanel *m_extensionPanel; |
| 73 |
BottomToolbar *m_bottomToolbar; |
| 74 |
TopToolbar *m_topToolbar; |
| 75 |
QLabel *m_topSeparatorLine; |
| 76 |
QLabel *m_btmSeparatorLine; |
| 77 |
ViewPanel *m_viewPanel; |
| 78 |
}; |
| 79 |
|
| 80 |
#endif // MAINWIDGET_H |