1// Copyright (C) 2016 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 QQUICKSYSTEMPALETTE_H
5#define QQUICKSYSTEMPALETTE_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 <private/qtquickglobal_p.h>
19
20#include <QtCore/qobject.h>
21
22#include <QtGui/qpalette.h>
23
24#include <QtQml/qqml.h>
25
26QT_BEGIN_NAMESPACE
27
28class QQuickSystemPalettePrivate;
29class Q_QUICK_PRIVATE_EXPORT QQuickSystemPalette : public QObject
30{
31 Q_OBJECT
32 Q_DECLARE_PRIVATE(QQuickSystemPalette)
33
34 Q_PROPERTY(QQuickSystemPalette::ColorGroup colorGroup READ colorGroup WRITE setColorGroup NOTIFY paletteChanged FINAL)
35 Q_PROPERTY(QColor window READ window NOTIFY paletteChanged FINAL)
36 Q_PROPERTY(QColor windowText READ windowText NOTIFY paletteChanged FINAL)
37 Q_PROPERTY(QColor base READ base NOTIFY paletteChanged FINAL)
38 Q_PROPERTY(QColor text READ text NOTIFY paletteChanged FINAL)
39 Q_PROPERTY(QColor alternateBase READ alternateBase NOTIFY paletteChanged FINAL)
40 Q_PROPERTY(QColor button READ button NOTIFY paletteChanged FINAL)
41 Q_PROPERTY(QColor buttonText READ buttonText NOTIFY paletteChanged FINAL)
42 Q_PROPERTY(QColor light READ light NOTIFY paletteChanged FINAL)
43 Q_PROPERTY(QColor midlight READ midlight NOTIFY paletteChanged FINAL)
44 Q_PROPERTY(QColor dark READ dark NOTIFY paletteChanged FINAL)
45 Q_PROPERTY(QColor mid READ mid NOTIFY paletteChanged FINAL)
46 Q_PROPERTY(QColor shadow READ shadow NOTIFY paletteChanged FINAL)
47 Q_PROPERTY(QColor highlight READ highlight NOTIFY paletteChanged FINAL)
48 Q_PROPERTY(QColor highlightedText READ highlightedText NOTIFY paletteChanged FINAL)
49 Q_PROPERTY(QColor placeholderText READ placeholderText NOTIFY paletteChanged REVISION(6, 2) FINAL)
50 QML_NAMED_ELEMENT(SystemPalette)
51 QML_ADDED_IN_VERSION(2, 0)
52
53public:
54 QQuickSystemPalette(QObject *parent=nullptr);
55
56 enum ColorGroup { Active = QPalette::Active, Inactive = QPalette::Inactive, Disabled = QPalette::Disabled };
57 Q_ENUM(ColorGroup)
58
59 QColor window() const;
60 QColor windowText() const;
61
62 QColor base() const;
63 QColor text() const;
64 QColor alternateBase() const;
65
66 QColor button() const;
67 QColor buttonText() const;
68
69 QColor light() const;
70 QColor midlight() const;
71 QColor dark() const;
72 QColor mid() const;
73 QColor shadow() const;
74
75 QColor highlight() const;
76 QColor highlightedText() const;
77
78 QColor placeholderText() const;
79
80 QQuickSystemPalette::ColorGroup colorGroup() const;
81 void setColorGroup(QQuickSystemPalette::ColorGroup);
82
83Q_SIGNALS:
84 void paletteChanged();
85};
86
87QT_END_NAMESPACE
88
89QML_DECLARE_TYPE(QQuickSystemPalette)
90
91#endif // QQUICKSYSTEMPALETTE_H
92

source code of qtdeclarative/src/quick/util/qquicksystempalette_p.h