| 1 | // Copyright (C) 2017 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QQUICKTHEME_P_H |
| 5 | #define QQUICKTHEME_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <QtQuickTemplates2/private/qtquicktemplates2global_p.h> |
| 19 | #include <QtCore/qscopedpointer.h> |
| 20 | #include <QtGui/qfont.h> |
| 21 | #include <QtGui/qpalette.h> |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | class QQuickThemePrivate; |
| 26 | |
| 27 | class Q_QUICKTEMPLATES2_EXPORT QQuickTheme |
| 28 | { |
| 29 | public: |
| 30 | QQuickTheme(); |
| 31 | ~QQuickTheme(); |
| 32 | |
| 33 | static QQuickTheme *instance(); |
| 34 | |
| 35 | enum Scope { |
| 36 | System, |
| 37 | Button, |
| 38 | CheckBox, |
| 39 | ComboBox, |
| 40 | GroupBox, |
| 41 | ItemView, |
| 42 | Label, |
| 43 | ListView, |
| 44 | , |
| 45 | , |
| 46 | RadioButton, |
| 47 | SpinBox, |
| 48 | Switch, |
| 49 | TabBar, |
| 50 | TextArea, |
| 51 | TextField, |
| 52 | ToolBar, |
| 53 | ToolTip, |
| 54 | Tumbler |
| 55 | }; |
| 56 | |
| 57 | static QFont font(Scope scope); |
| 58 | static QPalette palette(Scope scope); |
| 59 | |
| 60 | void setFont(Scope scope, const QFont &font); |
| 61 | void setPalette(Scope scope, const QPalette &palette); |
| 62 | |
| 63 | void setUsePlatformPalette(const bool enable) { preferPlatformTheme = enable; } |
| 64 | bool usePlatformPalette() { return preferPlatformTheme; } |
| 65 | |
| 66 | private: |
| 67 | Q_DISABLE_COPY(QQuickTheme) |
| 68 | Q_DECLARE_PRIVATE(QQuickTheme) |
| 69 | QScopedPointer<QQuickThemePrivate> d_ptr; |
| 70 | bool preferPlatformTheme = false; |
| 71 | }; |
| 72 | |
| 73 | QT_END_NAMESPACE |
| 74 | |
| 75 | #endif // QQUICKTHEME_P_H |
| 76 | |