25 Q_PROPERTY(
ColorType themeType READ themeType NOTIFY themeTypeChanged)
26 Q_PROPERTY(
ColorType paletteType READ paletteType WRITE setPaletteType NOTIFY paletteTypeChanged)
27 Q_PROPERTY(
bool hasUserManual READ hasUserManual)
51 UseInactiveColorGroup = 1 << 0,
52 ColorCompositing = 1 << 1,
53 DontSaveApplicationTheme = 1 << 2,
56 ReadOnlyLimit = 1 << 22,
57 IsDeepinPlatformTheme = ReadOnlyLimit << 0,
58 IsDXcbPlatform = ReadOnlyLimit << 1,
59 IsXWindowPlatform = ReadOnlyLimit << 2,
60 IsTableEnvironment = ReadOnlyLimit << 3,
61 IsDeepinEnvironment = ReadOnlyLimit << 4,
62 IsSpecialEffectsEnvironment = ReadOnlyLimit << 5,
63 IsWaylandPlatform = ReadOnlyLimit << 6,
64 IsTreelandPlatform Q_DECL_ENUMERATOR_DEPRECATED_X(
"Use DGuiApplicationHelper::IsWaylandPlatform instead") = IsWaylandPlatform,
65 HasAnimations = ReadOnlyLimit << 7,
66 HasInWindowBlur = ReadOnlyLimit << 8,
69 Q_DECLARE_FLAGS(Attributes, Attribute)
71#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
73 D_DECL_DEPRECATED
static void registerInstanceCreator(HelperCreator creator);
78 static QColor adjustColor(
const QColor &base, qint8 hueFloat, qint8 saturationFloat, qint8 lightnessFloat,
79 qint8 redFloat, qint8 greenFloat, qint8 blueFloat, qint8 alphaFloat);
80 static QImage adjustColor(
const QImage &base, qint8 hueFloat, qint8 saturationFloat, qint8 lightnessFloat,
81 qint8 redFloat, qint8 greenFloat, qint8 blueFloat, qint8 alphaFloat);
82 static QColor blendColor(
const QColor &substrate,
const QColor &superstratum);
83 static DPalette standardPalette(ColorType type);
84 static void generatePaletteColor(
DPalette &base, QPalette::ColorRole role, ColorType type);
86 static void generatePalette(
DPalette &base, ColorType type = UnknownType);
88#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
89 Q_DECL_DEPRECATED_X(
"Use UseInactiveColorGroup enum with setAttribute.") static
void setUseInactiveColorGroup(
bool on);
90 Q_DECL_DEPRECATED_X("Use ColorCompositing enum with setAttribute.") static
void setColorCompositingEnabled(
bool on);
92 static bool isXWindowPlatform();
93 static bool isTabletEnvironment();
94 static bool isSpecialEffectsEnvironment();
95 static void setAttribute(Attribute attribute,
bool enable);
96 static bool testAttribute(Attribute attribute);
100#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
101 D_DECL_DEPRECATED
DPlatformTheme *windowTheme(QWindow *window)
const;
104 DPalette applicationPalette()
const;
105 DPalette applicationPalette(ColorType paletteType)
const;
106 void setApplicationPalette(
const DPalette &palette);
107#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
108 D_DECL_DEPRECATED
DPalette windowPalette(QWindow *window)
const;
113 static ColorType toColorType(
const QColor &color);
114 static ColorType toColorType(
const QPalette &palette);
115 ColorType themeType()
const;
116 ColorType paletteType()
const;
118 static bool setSingleInstance(
const QString &key, SingleScope singleScope = UserScope);
119 static void setSingleInstanceInterval(
int interval = 3000);
120#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
121 D_DECL_DEPRECATED
static void setSingelInstanceInterval(
int interval = 3000);
125 static QStringList userManualPaths(
const QString &appName);
126 bool hasUserManual()
const;
128 static bool loadTranslator(
const QString &fileName,
const QString &appName,
const QList<QLocale> &localeFallback = QList<QLocale>() << QLocale::system());
129 static bool loadTranslator(
const QString &fileName,
const QList<QString> &translateDirs,
const QList<QLocale> &localeFallback);
130 static bool loadTranslator(
const QList<QLocale> &localeFallback = QList<QLocale>() << QLocale::system());
133#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
134 D_DECL_DEPRECATED_X(
"Plase use setPaletteType") void setThemeType(ColorType themeType);
136 void setPaletteType(ColorType paletteType);
137 void handleHelpAction();
138 static void openUrl(
const QString &url);
142 void resetSizeMode();
145 return instance()->sizeMode() == DGuiApplicationHelper::CompactMode;
149 void themeTypeChanged(ColorType themeType);
150 void paletteTypeChanged(ColorType paletteType);
152 void fontChanged(
const QFont &font);
158 virtual void initialize();
161 D_PRIVATE_SLOT(
void _q_initApplicationTheme(
bool))
162 D_PRIVATE_SLOT(
void _q_sizeModeChanged(
int))
163 friend class _DGuiApplicationHelper;