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 QQUICKFUSIONSTYLE_P_H
5#define QQUICKFUSIONSTYLE_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 <QtCore/qobject.h>
19#include <QtGui/qcolor.h>
20#include <QtQml/qqml.h>
21#include <QtQuickControls2Fusion/qtquickcontrols2fusionexports.h>
22
23QT_BEGIN_NAMESPACE
24
25class QQuickPalette;
26
27class Q_QUICKCONTROLS2FUSION_EXPORT QQuickFusionStyle : public QObject
28{
29 Q_OBJECT
30 Q_PROPERTY(QColor lightShade READ lightShade CONSTANT FINAL)
31 Q_PROPERTY(QColor darkShade READ darkShade CONSTANT FINAL)
32 Q_PROPERTY(QColor topShadow READ topShadow CONSTANT FINAL)
33 Q_PROPERTY(QColor innerContrastLine READ innerContrastLine CONSTANT FINAL)
34 Q_PROPERTY(bool highContrast READ isHighContrast NOTIFY highContrastChanged FINAL REVISION(6, 10))
35 QML_NAMED_ELEMENT(Fusion)
36 QML_SINGLETON
37 QML_ADDED_IN_VERSION(2, 3)
38
39public:
40 explicit QQuickFusionStyle(QObject *parent = nullptr);
41
42 static QColor lightShade();
43 static QColor darkShade();
44 static QColor topShadow();
45 static QColor innerContrastLine();
46 static bool isHighContrast();
47
48 Q_INVOKABLE static QColor highlight(QQuickPalette *palette);
49 Q_INVOKABLE static QColor highlightedText(QQuickPalette *palette);
50 Q_INVOKABLE static QColor outline(QQuickPalette *palette);
51 Q_INVOKABLE static QColor highlightedOutline(QQuickPalette *palette);
52 Q_INVOKABLE static QColor tabFrameColor(QQuickPalette *palette);
53 Q_INVOKABLE static QColor buttonColor(QQuickPalette *palette, bool highlighted = false, bool down = false, bool hovered = false);
54 Q_INVOKABLE static QColor buttonOutline(QQuickPalette *palette, bool highlighted = false, bool enabled = true);
55 Q_INVOKABLE static QColor gradientStart(const QColor &baseColor);
56 Q_INVOKABLE static QColor gradientStop(const QColor &baseColor);
57 Q_INVOKABLE static QColor mergedColors(const QColor &colorA, const QColor &colorB, int factor = 50);
58 Q_INVOKABLE static QColor grooveColor(QQuickPalette *palette);
59
60Q_SIGNALS:
61 Q_REVISION(6, 10) void highContrastChanged();
62};
63
64QT_END_NAMESPACE
65
66#endif // QQUICKFUSIONSTYLE_P_H
67

source code of qtdeclarative/src/quickcontrols/fusion/qquickfusionstyle_p.h