3#include <QtCore/QEasingCurve>
4#include <QtQml/QQmlEngine>
6#include "qml_material/core.hpp"
11class CircularIndicatorUpdator :
public QObject {
15 Q_PROPERTY(
double startFraction READ startFraction NOTIFY updated FINAL)
16 Q_PROPERTY(
double endFraction READ endFraction NOTIFY updated FINAL)
17 Q_PROPERTY(
double rotation READ rotation NOTIFY updated FINAL)
18 Q_PROPERTY(
double progress READ progress WRITE update NOTIFY updated FINAL)
19 Q_PROPERTY(
double completeEndProgress READ completeEndProgress WRITE updateCompleteEndProgress
21 Q_PROPERTY(
double duration READ duration NOTIFY indeterminateAnimationTypeChanged FINAL)
22 Q_PROPERTY(
double completeEndDuration READ completeEndDuration NOTIFY indeterminateAnimationTypeChanged FINAL)
24 IndeterminateAnimationType indeterminateAnimationType READ indeterminateAnimationType WRITE
25 setIndeterminateAnimationType NOTIFY indeterminateAnimationTypeChanged FINAL)
28 CircularIndicatorUpdator(QObject* parent =
nullptr);
30 enum class IndeterminateAnimationType
35 Q_ENUM(IndeterminateAnimationType)
37 auto startFraction() const noexcept ->
double;
38 auto endFraction() const noexcept ->
double;
39 auto rotation() const noexcept ->
double;
41 auto progress() const noexcept ->
double;
42 auto completeEndProgress() const noexcept ->
double;
43 auto duration() const noexcept ->
double;
44 auto completeEndDuration() const noexcept ->
double;
46 auto indeterminateAnimationType() const noexcept -> IndeterminateAnimationType;
47 void setIndeterminateAnimationType(IndeterminateAnimationType t);
49 void updateAdvance(
double progress) noexcept;
50 void updateRetreat(
double progress) noexcept;
52 Q_SLOT
void update(
double progress);
53 Q_SLOT
void updateCompleteEndProgress(
double progress);
54 Q_SIGNAL
void updated();
55 Q_SIGNAL
void indeterminateAnimationTypeChanged();
58 IndeterminateAnimationType m_type;
62 float m_start_fraction;
64 float m_rotation_degree;
66 float m_complete_end_progress;