2019-01-15 19:54:13 +08:00
|
|
|
|
/*
|
2018-02-07 11:52:47 +08:00
|
|
|
|
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
|
2017-09-18 14:33:44 +08:00
|
|
|
|
*
|
|
|
|
|
* Author: sbw <sbw@sbw.so>
|
|
|
|
|
*
|
|
|
|
|
* Maintainer: sbw <sbw@sbw.so>
|
2020-05-28 20:45:02 +08:00
|
|
|
|
* zhaolong <zhaolong@uniontech.com>
|
2017-09-18 14:33:44 +08:00
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2016-06-02 09:46:43 +08:00
|
|
|
|
#ifndef MAINWINDOW_H
|
|
|
|
|
#define MAINWINDOW_H
|
|
|
|
|
|
2020-12-16 17:38:41 +08:00
|
|
|
|
#include "xcb_misc.h"
|
|
|
|
|
#include "multiscreenworker.h"
|
|
|
|
|
#include "touchsignalmanager.h"
|
2021-11-05 21:29:32 +08:00
|
|
|
|
#include "imageutil.h"
|
|
|
|
|
#include "utils.h"
|
2022-08-25 19:31:31 +00:00
|
|
|
|
#include "mainwindowbase.h"
|
2017-03-21 15:40:52 +08:00
|
|
|
|
|
|
|
|
|
#include <DPlatformWindowHandle>
|
2020-06-05 16:16:59 +08:00
|
|
|
|
|
|
|
|
|
#include <QWidget>
|
2019-08-22 13:52:02 +08:00
|
|
|
|
|
|
|
|
|
DWIDGET_USE_NAMESPACE
|
2017-03-21 15:40:52 +08:00
|
|
|
|
|
2019-08-16 17:44:57 +08:00
|
|
|
|
class MainPanelControl;
|
2020-06-05 16:16:59 +08:00
|
|
|
|
class QTimer;
|
2020-08-05 19:46:15 +08:00
|
|
|
|
class MenuWorker;
|
2022-08-25 19:31:31 +00:00
|
|
|
|
class QScreen;
|
2020-08-05 19:46:15 +08:00
|
|
|
|
|
2022-08-25 19:31:31 +00:00
|
|
|
|
class MainWindow : public MainWindowBase
|
2016-06-02 09:46:43 +08:00
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2022-08-25 19:31:31 +00:00
|
|
|
|
explicit MainWindow(MultiScreenWorker *multiScreenWorker, QWidget *parent = nullptr);
|
2020-09-25 21:24:00 +08:00
|
|
|
|
void setGeometry(const QRect &rect);
|
2016-06-02 15:43:57 +08:00
|
|
|
|
|
2019-08-16 17:44:57 +08:00
|
|
|
|
friend class MainPanelControl;
|
2018-11-05 11:26:20 +08:00
|
|
|
|
|
2022-08-25 19:31:31 +00:00
|
|
|
|
// 以下接口是实现基类的接口
|
|
|
|
|
// 用来更新子区域的位置,一般用于在执行动画的过程中,根据当前的位置来更新里面panel的大小
|
|
|
|
|
DockWindowType windowType() const override;
|
|
|
|
|
void setPosition(const Dock::Position &position) override;
|
|
|
|
|
void setDisplayMode(const Dock::DisplayMode &displayMode) override;
|
|
|
|
|
void updateParentGeometry(const Dock::Position &pos, const QRect &rect) override;
|
|
|
|
|
QSize suitableSize(const Dock::Position &pos, const int &screenSize, const double &deviceRatio) const override;
|
|
|
|
|
void resetPanelGeometry() override;
|
2017-12-05 13:08:17 +08:00
|
|
|
|
|
2016-06-02 15:43:57 +08:00
|
|
|
|
private:
|
2017-12-05 13:08:17 +08:00
|
|
|
|
using QWidget::show;
|
2020-08-07 23:03:54 +08:00
|
|
|
|
void resizeEvent(QResizeEvent *event) override;
|
2016-06-06 10:59:29 +08:00
|
|
|
|
void initConnections();
|
2021-09-22 13:12:27 +08:00
|
|
|
|
void resizeDockIcon();
|
2019-01-15 19:54:13 +08:00
|
|
|
|
|
2019-09-16 09:21:48 +08:00
|
|
|
|
private:
|
2021-05-13 11:39:46 +08:00
|
|
|
|
MainPanelControl *m_mainPanel; // 任务栏
|
|
|
|
|
MultiScreenWorker *m_multiScreenWorker; // 多屏幕管理
|
2020-08-05 19:46:15 +08:00
|
|
|
|
|
2020-08-20 17:34:30 +08:00
|
|
|
|
QString m_sniHostService;
|
|
|
|
|
|
2020-08-05 19:46:15 +08:00
|
|
|
|
QString m_registerKey;
|
|
|
|
|
QStringList m_registerKeys;
|
2016-06-02 09:46:43 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // MAINWINDOW_H
|