| 1 |
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 |
|
| 5 |
#ifndef DPLATFORMWINDOWINTERFACE_P_H |
| 6 |
#define DPLATFORMWINDOWINTERFACE_P_H |
| 7 |
|
| 8 |
#include <QPointer> |
| 9 |
#include <QWindow> |
| 10 |
|
| 11 |
#include "dplatformhandle.h" |
| 12 |
|
| 13 |
DGUI_BEGIN_NAMESPACE |
| 14 |
|
| 15 |
class LIBDTKCORESHARED_EXPORT DPlatformWindowInterface |
| 16 |
{ |
| 17 |
public: |
| 18 |
explicit DPlatformWindowInterface(QWindow *window, DPlatformHandle *platformHandle); |
| 19 |
virtual ~DPlatformWindowInterface(); |
| 20 |
|
| 21 |
QWindow* window() const; |
| 22 |
|
| 23 |
virtual void setEnabled(bool enabled); |
| 24 |
virtual bool isEnabled() const; |
| 25 |
|
| 26 |
virtual bool isEnabledNoTitlebar() const; |
| 27 |
virtual bool setEnabledNoTitlebar(bool enable); |
| 28 |
|
| 29 |
virtual void setDisableWindowOverrideCursor(bool disable); |
| 30 |
|
| 31 |
virtual int windowRadius() const; |
| 32 |
virtual void setWindowRadius(int windowRadius); |
| 33 |
|
| 34 |
virtual int borderWidth() const; |
| 35 |
virtual void setBorderWidth(int borderWidth); |
| 36 |
|
| 37 |
virtual QColor borderColor() const; |
| 38 |
virtual void setBorderColor(const QColor &borderColor); |
| 39 |
|
| 40 |
virtual int shadowRadius() const; |
| 41 |
virtual void setShadowRadius(int shadowRadius); |
| 42 |
|
| 43 |
virtual QPoint shadowOffset() const; |
| 44 |
virtual void setShadowOffset(const QPoint &shadowOffset); |
| 45 |
|
| 46 |
virtual QColor shadowColor() const; |
| 47 |
virtual void setShadowColor(const QColor &shadowColor); |
| 48 |
|
| 49 |
virtual DPlatformHandle::EffectScene windowEffect(); |
| 50 |
virtual void setWindowEffect(DPlatformHandle::EffectScenes effectScene); |
| 51 |
|
| 52 |
virtual DPlatformHandle::EffectType windowStartUpEffect(); |
| 53 |
virtual void setWindowStartUpEffect(DPlatformHandle::EffectTypes effectType); |
| 54 |
|
| 55 |
virtual QPainterPath clipPath() const; |
| 56 |
virtual void setClipPath(const QPainterPath &clipPath); |
| 57 |
|
| 58 |
virtual QRegion frameMask() const; |
| 59 |
virtual void setFrameMask(const QRegion &frameMask); |
| 60 |
|
| 61 |
virtual QMargins frameMargins() const; |
| 62 |
|
| 63 |
virtual bool translucentBackground() const; |
| 64 |
virtual void setTranslucentBackground(bool translucentBackground); |
| 65 |
|
| 66 |
virtual bool enableSystemResize() const; |
| 67 |
virtual void setEnableSystemResize(bool enableSystemResize); |
| 68 |
|
| 69 |
virtual bool enableSystemMove() const; |
| 70 |
virtual void setEnableSystemMove(bool enableSystemMove); |
| 71 |
|
| 72 |
virtual bool enableBlurWindow() const; |
| 73 |
virtual void setEnableBlurWindow(bool enableBlurWindow); |
| 74 |
protected: |
| 75 |
QPointer<QWindow> m_window; |
| 76 |
QPointer<DPlatformHandle> m_platformHandle; |
| 77 |
}; |
| 78 |
|
| 79 |
class LIBDTKCORESHARED_EXPORT DPlatformWindowInterfaceFactory { |
| 80 |
public: |
| 81 |
using Creator = DPlatformWindowInterface * (*)(QWindow *, DPlatformHandle*); |
| 82 |
static void registerInterface(Creator creator); |
| 83 |
}; |
| 84 |
|
| 85 |
DGUI_END_NAMESPACE |
| 86 |
#endif // DPLATFORMWINDOWINTERFACE_P_H |