| 1 |
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 |
|
| 5 |
#ifndef DXCBPLATFORMINTERFACE_H |
| 6 |
#define DXCBPLATFORMINTERFACE_H |
| 7 |
|
| 8 |
#include "private/dplatforminterface_p.h" |
| 9 |
|
| 10 |
#include <DObject> |
| 11 |
|
| 12 |
DGUI_BEGIN_NAMESPACE |
| 13 |
|
| 14 |
class DXCBPlatformInterfacePrivate; |
| 15 |
class DXCBPlatformInterface : public QObject, public DPlatformInterface, public DCORE_NAMESPACE::DObject |
| 16 |
{ |
| 17 |
Q_OBJECT |
| 18 |
D_DECLARE_PRIVATE(DXCBPlatformInterface) |
| 19 |
public: |
| 20 |
explicit DXCBPlatformInterface(quint32 window, DPlatformTheme *platformTheme); |
| 21 |
|
| 22 |
int cursorBlinkTime() const override; |
| 23 |
int cursorBlinkTimeout() const override; |
| 24 |
bool cursorBlink() const override; |
| 25 |
int doubleClickDistance() const override; |
| 26 |
int doubleClickTime() const override; |
| 27 |
int dndDragThreshold() const override; |
| 28 |
int windowRadius() const override; |
| 29 |
int windowRadius(int defaultValue) const override; |
| 30 |
QByteArray themeName() const override; |
| 31 |
QByteArray iconThemeName() const override; |
| 32 |
QByteArray soundThemeName() const override; |
| 33 |
|
| 34 |
QByteArray fontName() const override; |
| 35 |
QByteArray monoFontName() const override; |
| 36 |
qreal fontPointSize() const override; |
| 37 |
QByteArray gtkFontName() const override; |
| 38 |
|
| 39 |
QColor activeColor() const override; |
| 40 |
QColor darkActiveColor() const override; |
| 41 |
|
| 42 |
#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0) |
| 43 |
QColor window() const override; |
| 44 |
QColor windowText() const override; |
| 45 |
QColor base() const override; |
| 46 |
QColor alternateBase() const override; |
| 47 |
QColor toolTipText() const override; |
| 48 |
QColor toolTipBase() const override; |
| 49 |
QColor text() const override; |
| 50 |
QColor button() const override; |
| 51 |
QColor buttonText() const override; |
| 52 |
QColor brightText() const override; |
| 53 |
QColor light() const override; |
| 54 |
QColor midlight() const override; |
| 55 |
QColor dark() const override; |
| 56 |
QColor mid() const override; |
| 57 |
QColor shadow() const override; |
| 58 |
QColor highlight() const override; |
| 59 |
QColor highlightedText() const override; |
| 60 |
QColor link() const override; |
| 61 |
QColor linkVisited() const override; |
| 62 |
QColor itemBackground() const override; |
| 63 |
QColor textTitle() const override; |
| 64 |
QColor textTips() const override; |
| 65 |
QColor textWarning() const override; |
| 66 |
QColor textLively() const override; |
| 67 |
QColor lightLively() const override; |
| 68 |
QColor darkLively() const override; |
| 69 |
QColor frameBorder() const override; |
| 70 |
#endif |
| 71 |
|
| 72 |
int sizeMode() const override; |
| 73 |
int scrollBarPolicy() const override; |
| 74 |
|
| 75 |
public Q_SLOTS: |
| 76 |
void setCursorBlinkTime(int cursorBlinkTime) override; |
| 77 |
void setCursorBlinkTimeout(int cursorBlinkTimeout) override; |
| 78 |
void setCursorBlink(bool cursorBlink) override; |
| 79 |
void setDoubleClickDistance(int doubleClickDistance) override; |
| 80 |
void setDoubleClickTime(int doubleClickTime) override; |
| 81 |
void setDndDragThreshold(int dndDragThreshold) override; |
| 82 |
void setThemeName(const QByteArray &themeName) override; |
| 83 |
void setIconThemeName(const QByteArray &iconThemeName) override; |
| 84 |
void setSoundThemeName(const QByteArray &soundThemeName) override; |
| 85 |
void setFontName(const QByteArray &fontName) override; |
| 86 |
void setMonoFontName(const QByteArray &monoFontName) override; |
| 87 |
void setFontPointSize(qreal fontPointSize) override; |
| 88 |
void setGtkFontName(const QByteArray &fontName) override; |
| 89 |
void setActiveColor(const QColor activeColor) override; |
| 90 |
void setDarkActiveColor(const QColor &activeColor) override; |
| 91 |
#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0) |
| 92 |
void setWindow(const QColor &window) override; |
| 93 |
void setWindowText(const QColor &windowText) override; |
| 94 |
void setBase(const QColor &base) override; |
| 95 |
void setAlternateBase(const QColor &alternateBase) override; |
| 96 |
void setToolTipBase(const QColor &toolTipBase) override; |
| 97 |
void setToolTipText(const QColor &toolTipText) override; |
| 98 |
void setText(const QColor &text) override; |
| 99 |
void setButton(const QColor &button) override; |
| 100 |
void setButtonText(const QColor &buttonText) override; |
| 101 |
void setBrightText(const QColor &brightText) override; |
| 102 |
void setLight(const QColor &light) override; |
| 103 |
void setMidlight(const QColor &midlight) override; |
| 104 |
void setDark(const QColor &dark) override; |
| 105 |
void setMid(const QColor &mid) override; |
| 106 |
void setShadow(const QColor &shadow) override; |
| 107 |
void setHighlight(const QColor &highlight) override; |
| 108 |
void setHighlightedText(const QColor &highlightedText) override; |
| 109 |
void setLink(const QColor &link) override; |
| 110 |
void setLinkVisited(const QColor &linkVisited) override; |
| 111 |
void setItemBackground(const QColor &itemBackground) override; |
| 112 |
void setTextTitle(const QColor &textTitle) override; |
| 113 |
void setTextTips(const QColor &textTips) override; |
| 114 |
void setTextWarning(const QColor &textWarning) override; |
| 115 |
void setTextLively(const QColor &textLively) override; |
| 116 |
void setLightLively(const QColor &lightLively) override; |
| 117 |
void setDarkLively(const QColor &darkLively) override; |
| 118 |
void setFrameBorder(const QColor &frameBorder) override; |
| 119 |
#endif |
| 120 |
|
| 121 |
int dotsPerInch(const QString &screenName = QString()) const override; |
| 122 |
void setDotsPerInch(const QString &screenName, int dpi) override; |
| 123 |
void setWindowRadius(int windowRadius) override; |
| 124 |
|
| 125 |
private: |
| 126 |
friend class DPlatformThemePrivate; |
| 127 |
D_PRIVATE_SLOT(void _q_onThemePropertyChanged(const QByteArray &name, const QVariant &value)) |
| 128 |
}; |
| 129 |
|
| 130 |
DGUI_END_NAMESPACE |
| 131 |
#endif // DXCBPLATFORMINTERFACE_H |