QSkinny 0.8.0
C++/Qt UI toolkit
Loading...
Searching...
No Matches
QskHintAnimator.h
1/******************************************************************************
2 * QSkinny - Copyright (C) The authors
3 * SPDX-License-Identifier: BSD-3-Clause
4 *****************************************************************************/
5
6#ifndef QSK_HINT_ANIMATOR_H
7#define QSK_HINT_ANIMATOR_H
8
9#include "QskAspect.h"
10#include "QskVariantAnimator.h"
11#include "QskAnimationHint.h"
12
13#include <qpointer.h>
14
15class QskControl;
16
17class QSK_EXPORT QskHintAnimator : public QskVariantAnimator
18{
20
21 public:
22 QskHintAnimator() noexcept;
23 QskHintAnimator( QskAspect, int index ) noexcept;
24
25 ~QskHintAnimator() override;
26
27 void setAspect( QskAspect ) noexcept;
28 QskAspect aspect() const noexcept;
29
30 void setIndex( int ) noexcept;
31 int index() const noexcept;
32
33 void setControl( QskControl* ) noexcept;
34 QskControl* control() const noexcept;
35
36 void setUpdateFlags( QskAnimationHint::UpdateFlags ) noexcept;
37 QskAnimationHint::UpdateFlags updateFlags() const noexcept;
38
39 void advance( qreal value ) override;
40
41 bool operator<( const QskHintAnimator& ) const noexcept;
42
43 private:
44 QskAspect m_aspect;
45 int m_index;
46 QskAnimationHint::UpdateFlags m_updateFlags;
47 QPointer< QskControl > m_control;
48};
49
50#ifndef QT_NO_DEBUG_STREAM
51
52class QDebug;
53QSK_EXPORT QDebug operator<<( QDebug, const QskHintAnimator& );
54
55#endif
56
57class QSK_EXPORT QskHintAnimatorTable
58{
59 public:
62
63 void start( QskControl*, QskAspect, int index,
64 QskAnimationHint, const QVariant& from, const QVariant& to );
65
66 const QskHintAnimator* animator( QskAspect, int index = -1 ) const;
67 QVariant currentValue( QskAspect, int index = -1 ) const;
68
69 bool cleanup();
70 bool isEmpty() const;
71
72 private:
73 void reset();
74
75 class PrivateData;
76 PrivateData* m_data = nullptr;
77};
78
79inline QskAspect QskHintAnimator::aspect() const noexcept
80{
81 return m_aspect;
82}
83
84inline int QskHintAnimator::index() const noexcept
85{
86 return m_index;
87}
88
89inline QskAnimationHint::UpdateFlags QskHintAnimator::updateFlags() const noexcept
90{
91 return m_updateFlags;
92}
93
94inline QskControl* QskHintAnimator::control() const noexcept
95{
96 return m_control;
97}
98
99inline bool QskHintAnimator::operator<( const QskHintAnimator& other ) const noexcept
100{
101 return m_aspect < other.m_aspect;
102}
103
104inline bool QskHintAnimatorTable::isEmpty() const
105{
106 return m_data == nullptr;
107}
108
109#endif
Lookup key for a QskSkinHintTable.
Definition QskAspect.h:15
Base class of all controls.
Definition QskControl.h:23