aboutsummaryrefslogtreecommitdiffstats
path: root/src/labs/stylekit/qqstylekitcontrolproperties_p.h
blob: 5bd04c3fd9042555922b5f756187129e90e29510 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
// Qt-Security score:significant reason:default

#ifndef QQSTYLEKITCONTROLPROPERTIES_P_H
#define QQSTYLEKITCONTROLPROPERTIES_P_H

//
//  W A R N I N G
//  -------------
//
// This file is not part of the Qt API.  It exists purely as an
// implementation detail.  This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
//

#include <QtQml/QtQml>
#include <QtGui/QColor>
#include <QtQuick/private/qquickrectangle_p.h>
#include <QtQuick/private/qquickimage_p.h>
#include <QtQuick/private/qquicktransition_p.h>
#include <QtQuick/private/qquicktext_p.h>

#include "qqstylekitglobal_p.h"
#include "qqstylekitpropertyresolver_p.h"

QT_BEGIN_NAMESPACE

using namespace Qt::StringLiterals;

class QQStyleKitStyle;
class QQStyleKitControl;
class QQStyleKitControlState;
class QQStyleKitReader;
class QQStyleKitControlProperties;
class QQStyleKitDelegateProperties;

class QQStyleKitPropertyGroup: public QObject
{
    Q_OBJECT

public:
    QQStyleKitPropertyGroup(QQSK::PropertyGroup group, QObject *parent);

    inline bool isControlProperties() const { return m_group == QQSK::PropertyGroup::Control; }
    inline bool isPathFlag() const { return m_group == QQSK::PropertyGroup::globalFlag; }
    inline bool isDelegateSubType() const {
        return m_group == QQSK::PropertyGroup::DelegateSubType1 ||
               m_group == QQSK::PropertyGroup::DelegateSubType2;
    }

    inline QQSK::PropertyGroup group() const { return m_group; }

    template<typename T>
    inline T styleProperty(
        QQSK::Property property,
        QQSK::Property alternative = QQSK::Property::NoProperty) const
    {
        return qvariant_cast<T>(QQStyleKitPropertyResolver::readStyleProperty(this, property, alternative));
    }

    template<typename T>
    inline T styleProperty(QQSK::Property property, const T &defaultValue) const
    {
        const QVariant value = QQStyleKitPropertyResolver::readStyleProperty(this, property);
        return value.isValid() ? qvariant_cast<T>(value) : defaultValue;
    }

    template<typename T>
    inline bool setStyleProperty(QQSK::Property property, T value)
    {
        // This function will return true if the new value differes from the old one
        return QQStyleKitPropertyResolver::writeStyleProperty(this, property, QVariant::fromValue(value));
    }

    template<typename SUBCLASS>
    inline void handleStylePropertyChanged(void (SUBCLASS::*changedSignal)());

    template <typename SUBCLASS, typename... CHANGED_SIGNALS>
    inline void handleStylePropertiesChanged(CHANGED_SIGNALS... changedSignals);

    template <typename T>
    inline T *lazyCreateGroup(T *const &ptr, QQSK::PropertyGroup group) const
    {
        return QQSK::lazyCreate(ptr, this, group);
    }

    void emitChangedForAllStylePropertiesRecursive();

    const QQStyleKitControlProperties *controlProperties() const;

    std::tuple<
        const QQStyleKitControlProperties *,
        const QQSK::PropertyGroup,
        const QQSK::PathFlags> inspectGroupPath() const;

    inline QQStyleKitPropertyGroup *parentGroup() const {
        Q_ASSERT(!parent() || qobject_cast<QQStyleKitPropertyGroup *>(parent()));
        return static_cast<QQStyleKitPropertyGroup *>(parent());
    }

    const QQStyleKitControlProperties *asControlProperties() const;

private:
    bool shouldEmitLocally();
    bool shouldEmitGlobally();

private:
    QQSK::PropertyGroup m_group;
};

// ************* QQStyleKitImageProperties ****************

class QQStyleKitImageProperties : public QQStyleKitPropertyGroup
{
    Q_OBJECT
    Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged FINAL)
    Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
    Q_PROPERTY(QQuickImage::FillMode fillMode READ fillMode WRITE setFillMode NOTIFY fillModeChanged FINAL)
    QML_UNCREATABLE("This component can only be instantiated by StyleKit")
    QML_NAMED_ELEMENT(StyleKitImageProperties)

public:
    QQStyleKitImageProperties(QQSK::PropertyGroup group, QQStyleKitPropertyGroup *parent = nullptr);

    template <typename... CHANGED_SIGNALS>
    void emitGlobally(CHANGED_SIGNALS... changedSignals) const;

    QUrl source() const;
    void setSource(const QUrl &source);

    QColor color() const;
    void setColor(const QColor &color);

    QQuickImage::FillMode fillMode() const;
    void setFillMode(QQuickImage::FillMode fillMode);

signals:
    void sourceChanged();
    void colorChanged();
    void fillModeChanged();
};

// ************* QQStyleKitBorderProperties ****************

class QQStyleKitBorderProperties : public QQStyleKitPropertyGroup
{
    Q_OBJECT
    Q_PROPERTY(qreal width READ width WRITE setWidth NOTIFY widthChanged FINAL)
    Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
    QML_UNCREATABLE("This component can only be instantiated by StyleKit")
    QML_NAMED_ELEMENT(StyleKitBorderProperties)

public:
    QQStyleKitBorderProperties(QQSK::PropertyGroup group, QQStyleKitPropertyGroup *parent = nullptr);

    template <typename... CHANGED_SIGNALS>
    void emitGlobally(CHANGED_SIGNALS... changedSignals) const;

    qreal width() const;
    void setWidth(qreal width);

    QColor color() const;
    void setColor(const QColor &color);

signals:
    void widthChanged();
    void colorChanged();
};

// ************* QQStyleKitShadowProperties ****************

class QQStyleKitShadowProperties : public QQStyleKitPropertyGroup
{
    Q_OBJECT
    Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
    Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL)
    Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged FINAL)
    Q_PROPERTY(qreal verticalOffset READ verticalOffset WRITE setVerticalOffset NOTIFY verticalOffsetChanged FINAL)
    Q_PROPERTY(qreal horizontalOffset READ horizontalOffset WRITE setHorizontalOffset NOTIFY horizontalOffsetChanged FINAL)
    Q_PROPERTY(qreal blur READ blur WRITE setBlur NOTIFY blurChanged FINAL)
    Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged FINAL)
    Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
    QML_UNCREATABLE("This component can only be instantiated by StyleKit")
    QML_NAMED_ELEMENT(StyleKitShadowProperties)

public:
    QQStyleKitShadowProperties(QQSK::PropertyGroup group, QQStyleKitPropertyGroup *parent = nullptr);

    template <typename... CHANGED_SIGNALS>
    void emitGlobally(CHANGED_SIGNALS... changedSignals) const;

    QColor color() const;
    void setColor(QColor color);

    qreal opacity() const;
    void setOpacity(qreal opacity);

    qreal scale() const;
    void setScale(qreal scale);

    qreal verticalOffset() const;
    void setVerticalOffset(qreal verticalOffset);

    qreal horizontalOffset() const;
    void setHorizontalOffset(qreal horizontalOffset);

    qreal blur() const;
    void setBlur(qreal blur);

    bool visible() const;
    void setVisible(bool visible);

    QQmlComponent *delegate() const;
    void setDelegate(QQmlComponent *delegate);

signals:
    void colorChanged();
    void opacityChanged();
    void scaleChanged();
    void verticalOffsetChanged();
    void horizontalOffsetChanged();
    void blurChanged();
    void visibleChanged();
    void delegateChanged();
};

// ************* QQStyleKitDelegateProperties ****************

class QQStyleKitDelegateProperties : public QQStyleKitPropertyGroup
{
    Q_OBJECT
    Q_PROPERTY(qreal implicitWidth READ implicitWidth WRITE setImplicitWidth NOTIFY implicitWidthChanged FINAL)
    Q_PROPERTY(qreal implicitHeight READ implicitHeight WRITE setImplicitHeight NOTIFY implicitHeightChanged FINAL)
    Q_PROPERTY(qreal minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged FINAL)
    Q_PROPERTY(qreal margins READ margins WRITE setMargins NOTIFY marginsChanged FINAL)
    Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged FINAL)
    Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged FINAL)
    Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged FINAL)
    Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged FINAL)
    Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged FINAL)
    Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged FINAL)
    Q_PROPERTY(qreal topLeftRadius READ topLeftRadius WRITE setTopLeftRadius NOTIFY topLeftRadiusChanged FINAL)
    Q_PROPERTY(qreal topRightRadius READ topRightRadius WRITE setTopRightRadius NOTIFY topRightRadiusChanged FINAL)
    Q_PROPERTY(qreal bottomLeftRadius READ bottomLeftRadius WRITE setBottomLeftRadius NOTIFY bottomLeftRadiusChanged FINAL)
    Q_PROPERTY(qreal bottomRightRadius READ bottomRightRadius WRITE setBottomRightRadius NOTIFY bottomRightRadiusChanged FINAL)
    Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged FINAL)
    Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged FINAL)
    Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged FINAL)
    Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
    Q_PROPERTY(bool visible READ visible WRITE setVisible NOTIFY visibleChanged FINAL)
    Q_PROPERTY(bool clip READ clip WRITE setClip NOTIFY clipChanged FINAL)
    Q_PROPERTY(QQuickGradient *gradient READ gradient WRITE setGradient NOTIFY gradientChanged FINAL)
    Q_PROPERTY(QQStyleKitImageProperties *image READ image NOTIFY imageChanged FINAL)
    Q_PROPERTY(QQStyleKitBorderProperties *border READ border NOTIFY borderChanged FINAL)
    Q_PROPERTY(QQStyleKitShadowProperties *shadow READ shadow NOTIFY shadowChanged FINAL)
    Q_PROPERTY(QObject *data READ data WRITE setData NOTIFY dataChanged FINAL)
    Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL)
    QML_UNCREATABLE("This component can only be instantiated by StyleKit")
    QML_NAMED_ELEMENT(StyleKitDelegateProperties)

public:
    QQStyleKitDelegateProperties(QQSK::PropertyGroup group, QQStyleKitPropertyGroup *parent = nullptr);

    template <typename... CHANGED_SIGNALS>
    void emitGlobally(CHANGED_SIGNALS... changedSignals) const;

    qreal radius() const;
    void setRadius(qreal radius);

    qreal topLeftRadius() const;
    void setTopLeftRadius(qreal radius);

    qreal topRightRadius() const;
    void setTopRightRadius(qreal radius);

    qreal bottomLeftRadius() const;
    void setBottomLeftRadius(qreal radius);

    qreal bottomRightRadius() const;
    void setBottomRightRadius(qreal radius);

    qreal scale() const;
    void setScale(qreal scale);

    qreal rotation() const;
    void setRotation(qreal rotation);

    qreal implicitWidth() const;
    void setImplicitWidth(qreal width);

    qreal implicitHeight() const;
    void setImplicitHeight(qreal height);

    qreal minimumWidth() const;
    void setMinimumWidth(qreal width);

    qreal margins() const;
    void setMargins(qreal margins);

    qreal leftMargin() const;
    void setLeftMargin(qreal margin);

    qreal rightMargin() const;
    void setRightMargin(qreal margin);

    qreal topMargin() const;
    void setTopMargin(qreal margin);

    qreal bottomMargin() const;
    void setBottomMargin(qreal margin);

    Qt::Alignment alignment() const;
    void setAlignment(Qt::Alignment alignment);

    qreal opacity() const;
    void setOpacity(qreal opacity);

    QColor color() const;
    void setColor(const QColor &color);

    bool visible() const;
    void setVisible(bool visible);

    bool clip() const;
    void setClip(bool clip);

    QQuickGradient *gradient() const;
    void setGradient(QQuickGradient *gradient);

    QObject *data() const;
    void setData(QObject *data);

    QQmlComponent *delegate() const;
    void setDelegate(QQmlComponent *delegate);

    QQStyleKitImageProperties *image() const;
    QQStyleKitBorderProperties *border() const;
    QQStyleKitShadowProperties *shadow() const;

signals:
    void colorChanged();
    void radiusChanged();
    void topLeftRadiusChanged();
    void topRightRadiusChanged();
    void bottomLeftRadiusChanged();
    void bottomRightRadiusChanged();
    void scaleChanged();
    void rotationChanged();
    void visibleChanged();
    void clipChanged();
    void borderChanged();
    void shadowChanged();
    void imageChanged();
    void gradientChanged();
    void colorImageChanged();
    void implicitWidthChanged();
    void implicitHeightChanged();
    void minimumWidthChanged();
    void marginsChanged();
    void leftMarginChanged();
    void rightMarginChanged();
    void topMarginChanged();
    void bottomMarginChanged();
    void alignmentChanged();
    void opacityChanged();
    void dataChanged();
    void delegateChanged();

private:
    QPointer<QQuickGradient> m_gradient;
    QQStyleKitBorderProperties *m_border = nullptr;
    QQStyleKitShadowProperties *m_shadow = nullptr;
    QQStyleKitImageProperties *m_image = nullptr;
};

// ************* QQStyleKitHandleProperties ****************

class QQStyleKitHandleProperties : public QQStyleKitDelegateProperties
{
    Q_OBJECT
    Q_PROPERTY(QQStyleKitDelegateProperties *first READ first NOTIFY firstChanged FINAL)
    Q_PROPERTY(QQStyleKitDelegateProperties *second READ second NOTIFY secondChanged FINAL)
    QML_UNCREATABLE("This component can only be instantiated by StyleKit")
    QML_NAMED_ELEMENT(StyleKitHandleProperties)

public:
    QQStyleKitHandleProperties(QQSK::PropertyGroup group, QQStyleKitPropertyGroup *parent = nullptr);
    QQStyleKitDelegateProperties *first() const;
    QQStyleKitDelegateProperties *second() const;

signals:
    void firstChanged();
    void secondChanged();

private:
    QQStyleKitDelegateProperties *m_first = nullptr;
    QQStyleKitDelegateProperties *m_second = nullptr;

    friend class QQStyleKitReader;
    friend class QQStyleKitControlProperties;
};

// ************* QQStyleKitIndicatorProperties ****************

class QQStyleKitIndicatorProperties : public QQStyleKitDelegateProperties
{
    Q_OBJECT
    Q_PROPERTY(QQStyleKitDelegateProperties *foreground READ foreground NOTIFY foregroundChanged FINAL)
    QML_UNCREATABLE("This component can only be instantiated by StyleKit")
    QML_NAMED_ELEMENT(StyleKitIndicatorProperties)

public:
    QQStyleKitIndicatorProperties(QQSK::PropertyGroup group, QQStyleKitPropertyGroup *parent = nullptr);

    template <typename... CHANGED_SIGNALS>
    void emitGlobally(CHANGED_SIGNALS... changedSignals) const;

    QQStyleKitDelegateProperties *foreground() const;

signals:
    void foregroundChanged();

private:
    QQStyleKitDelegateProperties *m_foreground = nullptr;

    friend class QQStyleKitReader;
    friend class QQStyleKitControlProperties;
};

// ************* QQStyleKitIndicatorWithSubTypes ****************

class QQStyleKitIndicatorWithSubTypes : public QQStyleKitDelegateProperties
{
    Q_OBJECT
    Q_PROPERTY(QQStyleKitDelegateProperties *foreground READ foreground NOTIFY foregroundChanged FINAL)
    Q_PROPERTY(QQStyleKitIndicatorProperties *up READ up NOTIFY upChanged FINAL)
    Q_PROPERTY(QQStyleKitIndicatorProperties *down READ down NOTIFY downChanged FINAL)
    QML_UNCREATABLE("This component can only be instantiated by StyleKit")
    QML_NAMED_ELEMENT(StyleKitIndicatorPropertiesWithSubTypes)

public:
    QQStyleKitIndicatorWithSubTypes(QQSK::PropertyGroup group, QQStyleKitPropertyGroup *parent = nullptr);

    template <typename... CHANGED_SIGNALS>
    void emitGlobally(CHANGED_SIGNALS... changedSignals) const;

    QQStyleKitDelegateProperties *foreground() const;
    QQStyleKitIndicatorProperties *up() const;
    QQStyleKitIndicatorProperties *down() const;

signals:
    void foregroundChanged();
    void upChanged();
    void downChanged();

private:
    QQStyleKitDelegateProperties *m_foreground = nullptr;
    QQStyleKitIndicatorProperties *m_up = nullptr;
    QQStyleKitIndicatorProperties *m_down = nullptr;

    friend class QQStyleKitReader;
    friend class QQStyleKitControlProperties;
};

// ************* QQStyleKitTextProperties ****************

class QQStyleKitTextProperties : public QQStyleKitPropertyGroup
{
    Q_OBJECT
    Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged FINAL)
    Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged FINAL)
    QML_UNCREATABLE("This component can only be instantiated by StyleKit")
    QML_NAMED_ELEMENT(StyleKitTextProperties)

public:
    QQStyleKitTextProperties(QQSK::PropertyGroup group, QQStyleKitPropertyGroup *parent = nullptr);

    template <typename... CHANGED_SIGNALS>
    void emitGlobally(CHANGED_SIGNALS... changedSignals) const;

    QColor color() const;
    void setColor(const QColor &color);

    Qt::Alignment alignment() const;
    void setAlignment(Qt::Alignment alignment);

signals:
    void colorChanged();
    void alignmentChanged();
};

/************* QQStyleKitControlProperties ****************
 * QQStyleKitControlProperties (and all other subclasses of QQStyleKitPropertyGroup),
 * is just an empty interface declaring the properties available for styling and reading.
 * It contains as little data as possible since it will be instantiated a lot. E.g a style
 * will instantiate them for every style.button, style.slider, etc defined, the same for a
 * theme, and also each instance of a StyleKitReader. Those are all subclasses of this
 * class. Each subclass will determine if the properties can be written to (as opposed to
 * only be read), and if so, offer a storage for storing those values. That storage is typically
 * a map that stores _only_ the properties that are written to, and nothing else.
 */
class QQStyleKitControlProperties : public QQStyleKitPropertyGroup
{
    Q_OBJECT
    Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged FINAL)
    Q_PROPERTY(qreal padding READ padding WRITE setPadding NOTIFY paddingChanged FINAL)
    Q_PROPERTY(qreal leftPadding READ leftPadding WRITE setLeftPadding NOTIFY leftPaddingChanged FINAL)
    Q_PROPERTY(qreal rightPadding READ rightPadding WRITE setRightPadding NOTIFY rightPaddingChanged FINAL)
    Q_PROPERTY(qreal topPadding READ topPadding WRITE setTopPadding NOTIFY topPaddingChanged FINAL)
    Q_PROPERTY(qreal bottomPadding READ bottomPadding WRITE setBottomPadding NOTIFY bottomPaddingChanged FINAL)
    Q_PROPERTY(QQStyleKitDelegateProperties *background READ background NOTIFY backgroundChanged FINAL)
    Q_PROPERTY(QQStyleKitHandleProperties *handle READ handle NOTIFY handleChanged FINAL)
    Q_PROPERTY(QQStyleKitIndicatorWithSubTypes *indicator READ indicator NOTIFY indicatorChanged FINAL)
    Q_PROPERTY(QQStyleKitTextProperties *text READ text NOTIFY textChanged FINAL)
    Q_PROPERTY(QQuickTransition *transition READ transition WRITE setTransition NOTIFY transitionChanged FINAL)
    QML_UNCREATABLE("This component acts as an interface, and cannot be instantiated")
    QML_NAMED_ELEMENT(StyleKitControlProperties)

public:
    QQStyleKitControlProperties(QQSK::PropertyGroup group, QObject *parent = nullptr);

    void emitChangedForAllStyleProperties();
    template <typename... CHANGED_SIGNALS>
    void emitGlobally(CHANGED_SIGNALS... changedSignals) const;
    void forEachUsedDelegate(
        std::function<void (QQStyleKitDelegateProperties *, QQSK::Delegate, const QString &)> f);

    QQStyleKitStyle *style() const;
    QQSK::Subclass subclass() const;
    QQStyleKitReader *asQQStyleKitReader() const;
    QQStyleKitControlState *asQQStyleKitState() const;
    QQStyleKitControl *asQQStyleKitControl() const;

    qreal spacing() const;
    void setSpacing(qreal spacing);

    qreal padding() const;
    void setPadding(qreal padding);

    qreal leftPadding() const;
    void setLeftPadding(qreal leftPadding);

    qreal rightPadding() const;
    void setRightPadding(qreal rightPadding);

    qreal topPadding() const;
    void setTopPadding(qreal topPadding);

    qreal bottomPadding() const;
    void setBottomPadding(qreal bottomPadding);

    QQuickTransition* transition() const;
    void setTransition(QQuickTransition *transition);

    QQStyleKitTextProperties *text() const;

    QQStyleKitDelegateProperties *background() const;
    QQStyleKitHandleProperties *handle() const;
    QQStyleKitIndicatorWithSubTypes *indicator() const;

signals:
    void backgroundChanged();
    void handleChanged();
    void indicatorChanged();
    void spacingChanged();
    void paddingChanged();
    void leftPaddingChanged();
    void rightPaddingChanged();
    void topPaddingChanged();
    void bottomPaddingChanged();
    void transitionChanged();
    void textChanged();

private:
    Q_DISABLE_COPY(QQStyleKitControlProperties)

    QQStyleKitDelegateProperties *m_background = nullptr;
    QQStyleKitHandleProperties *m_handle = nullptr;
    QQStyleKitIndicatorWithSubTypes *m_indicator = nullptr;
    QQStyleKitTextProperties *m_text = nullptr;

    friend class QQStyleKitPropertyResolver;
    friend class QQStyleKitReader;
};

QT_END_NAMESPACE

#endif // QQSTYLEKITCONTROLPROPERTIES_P_H