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,
68 Q_DECLARE_FLAGS(Attributes, Attribute)
70#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
72 D_DECL_DEPRECATED
static void registerInstanceCreator(HelperCreator creator);
77 static QColor adjustColor(
const QColor &base, qint8 hueFloat, qint8 saturationFloat, qint8 lightnessFloat,
78 qint8 redFloat, qint8 greenFloat, qint8 blueFloat, qint8 alphaFloat);
79 static QImage adjustColor(
const QImage &base, qint8 hueFloat, qint8 saturationFloat, qint8 lightnessFloat,
80 qint8 redFloat, qint8 greenFloat, qint8 blueFloat, qint8 alphaFloat);
81 static QColor blendColor(
const QColor &substrate,
const QColor &superstratum);
82 static DPalette standardPalette(ColorType type);
83 static void generatePaletteColor(
DPalette &base, QPalette::ColorRole role, ColorType type);
85 static void generatePalette(
DPalette &base, ColorType type = UnknownType);
87#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
88 Q_DECL_DEPRECATED_X(
"Use UseInactiveColorGroup enum with setAttribute.") static
void setUseInactiveColorGroup(
bool on);
89 Q_DECL_DEPRECATED_X("Use ColorCompositing enum with setAttribute.") static
void setColorCompositingEnabled(
bool on);
91 static bool isXWindowPlatform();
92 static bool isTabletEnvironment();
93 static bool isSpecialEffectsEnvironment();
94 static void setAttribute(Attribute attribute,
bool enable);
95 static bool testAttribute(Attribute attribute);
99#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
100 D_DECL_DEPRECATED
DPlatformTheme *windowTheme(QWindow *window)
const;
103 DPalette applicationPalette()
const;
104 DPalette applicationPalette(ColorType paletteType)
const;
105 void setApplicationPalette(
const DPalette &palette);
106#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
107 D_DECL_DEPRECATED
DPalette windowPalette(QWindow *window)
const;
112 static ColorType toColorType(
const QColor &color);
113 static ColorType toColorType(
const QPalette &palette);
114 ColorType themeType()
const;
115 ColorType paletteType()
const;
117 static bool setSingleInstance(
const QString &key, SingleScope singleScope = UserScope);
118 static void setSingleInstanceInterval(
int interval = 3000);
119#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
120 D_DECL_DEPRECATED
static void setSingelInstanceInterval(
int interval = 3000);
124 static QStringList userManualPaths(
const QString &appName);
125 bool hasUserManual()
const;
127 static bool loadTranslator(
const QString &fileName,
const QList<QString> &translateDirs,
const QList<QLocale> &localeFallback);
128 static bool loadTranslator(
const QList<QLocale> &localeFallback = QList<QLocale>() << QLocale::system());
131#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
132 D_DECL_DEPRECATED_X(
"Plase use setPaletteType") void setThemeType(ColorType themeType);
134 void setPaletteType(ColorType paletteType);
135 void handleHelpAction();
136 static void openUrl(
const QString &url);
140 void resetSizeMode();
143 return instance()->sizeMode() == DGuiApplicationHelper::CompactMode;
147 void themeTypeChanged(ColorType themeType);
148 void paletteTypeChanged(ColorType paletteType);
150 void fontChanged(
const QFont &font);
156 virtual void initialize();
159 D_PRIVATE_SLOT(
void _q_initApplicationTheme(
bool))
160 D_PRIVATE_SLOT(
void _q_sizeModeChanged(
int))
161 friend class _DGuiApplicationHelper;