5#ifndef QQUICKANIMATION2_P_H
6#define QQUICKANIMATION2_P_H
21#include <private/qqmlnullablevalue_p.h>
24#include <qqmlcontext.h>
26#include <private/qvariantanimation_p.h>
27#include "private/qpauseanimationjob_p.h"
30#include <private/qobject_p.h>
31#include "private/qanimationgroupjob_p.h"
34#include <private/qobject_p.h>
35#include <QtCore/qpointer.h>
51template<
class T,
void (T::*method)(),
void (T::*debugMethod)(QDebug,
int)
const>
56 void doAction()
override { (m_instance->*method)(); }
57 void debugAction(QDebug d,
int indentLevel)
const override { (m_instance->*debugMethod)(d, indentLevel); }
65 Q_DISABLE_COPY(QActionAnimation)
69 QActionAnimation(QAbstractAnimationAction *action);
70 ~QActionAnimation() override;
72 int duration()
const override;
73 void setAnimAction(QAbstractAnimationAction *action);
76 void updateCurrentTime(
int) override;
77 void updateState(State newState, State oldState) override;
78 void debugAnimation(QDebug d)
const override;
81 QAbstractAnimationAction *animAction;
95 Q_DISABLE_COPY(QQuickBulkValueAnimator)
97 QQuickBulkValueAnimator();
98 ~QQuickBulkValueAnimator() override;
100 void setAnimValue(QQuickBulkValueUpdater *value);
101 QQuickBulkValueUpdater *getAnimValue()
const {
return animValue; }
103 void setFromIsSourcedValue(
bool *value) { fromIsSourced = value; }
105 int duration()
const override {
return m_duration; }
106 void setDuration(
int msecs) { m_duration = msecs; }
108 QEasingCurve easingCurve()
const {
return easing; }
109 void setEasingCurve(
const QEasingCurve &curve) { easing = curve; }
112 void updateCurrentTime(
int currentTime) override;
113 void topLevelAnimationLoopChanged() override;
114 void debugAnimation(QDebug d)
const override;
117 QQuickBulkValueUpdater *animValue;
124template<
class T,
void (T::*method)(
int)>
140 Q_DECLARE_PUBLIC(QQuickAbstractAnimation)
142 QQuickAbstractAnimationPrivate()
143 : running(
false), paused(
false), alwaysRunToEnd(
false),
144 componentComplete(
true),
145 avoidPropertyValueSourceStart(
false), disableUserControl(
false),
146 needsDeferredSetRunning(
false), loopCount(1), group(
nullptr), animationInstance(
nullptr) {}
150 bool alwaysRunToEnd:1;
152 bool componentComplete:1;
153 bool avoidPropertyValueSourceStart:1;
154 bool disableUserControl:1;
155 bool needsDeferredSetRunning:1;
160 void animationFinished(QAbstractAnimationJob *) override;
162 QQmlProperty defaultProperty;
164 QQuickAnimationGroup *group;
165 QAbstractAnimationJob* animationInstance;
167 static QQmlProperty createProperty(QObject *obj,
const QString &str, QObject *infoObj, QString *errorMessage =
nullptr);
168 void animationGroupDirty();
173 Q_DECLARE_PUBLIC(QQuickPauseAnimation)
183 Q_DECLARE_PUBLIC(QQuickScriptAction)
203 Q_DECLARE_PUBLIC(QQuickPropertyAction)
219 Q_DECLARE_PUBLIC(QQuickAnimationGroup)
227 static void clear_animation(QQmlListProperty<QQuickAbstractAnimation> *list);
228 static void replace_animation(QQmlListProperty<QQuickAbstractAnimation> *list, qsizetype index,
229 QQuickAbstractAnimation *role);
240 Q_DECLARE_PUBLIC(QQuickPropertyAnimation)
242 QQuickPropertyAnimationPrivate()
243 : QQuickAbstractAnimationPrivate(), target(
nullptr), fromIsDefined(
false), toIsDefined(
false), ourPropertiesDirty(
false),
244 defaultToInterpolatorType(0), interpolatorType(0), interpolator(
nullptr), extendedInterpolator(
nullptr), duration(250), actions(
nullptr) {}
246 void animationCurrentLoopChanged(QAbstractAnimationJob *job) override;
252 QString propertyName;
254 QList<QPointer<QObject>> targets;
255 QList<QObject *> exclude;
256 QString defaultProperties;
258 bool fromIsDefined:1;
260 bool ourPropertiesDirty : 1;
261 bool defaultToInterpolatorType:1;
262 int interpolatorType;
263 QVariantAnimation::Interpolator interpolator;
264 typedef QVariant (*ExtendedInterpolator)(
const void *from,
const void *to,
const QVariant ¤tValue, qreal progress);
265 ExtendedInterpolator extendedInterpolator;
270 QQuickStateActions *actions;
272 static void convertVariant(QVariant &variant, QMetaType type);
277 Q_DECLARE_PUBLIC(QQuickRotationAnimation)
287 QQuickAnimationPropertyUpdater() : interpolatorType(0), interpolator(
nullptr), extendedInterpolator(
nullptr), prevInterpolatorType(0), reverse(
false), fromIsSourced(
false), fromIsDefined(
false), wasDeleted(
nullptr) {}
288 ~QQuickAnimationPropertyUpdater() override;
290 void setValue(qreal v) override;
292 void debugUpdater(QDebug d,
int indentLevel)
const override;
294 QQuickStateActions actions;
295 int interpolatorType;
296 QVariantAnimation::Interpolator interpolator;
297 QQuickPropertyAnimationPrivate::ExtendedInterpolator extendedInterpolator;
298 int prevInterpolatorType;
virtual void debugAction(QDebug, int) const
virtual void doAction()=0
virtual ~QAbstractAnimationAction()
QAnimationActionProxy(T *instance)
void debugAction(QDebug d, int indentLevel) const override
The QQmlScriptString class encapsulates a script and its context.
static qsizetype count_animation(QQmlListProperty< QQuickAbstractAnimation > *list)
QList< QQuickAbstractAnimation * > animations
void animationCurrentLoopChanged(QAbstractAnimationJob *job) override
static void replace_animation(QQmlListProperty< QQuickAbstractAnimation > *list, qsizetype index, QQuickAbstractAnimation *role)
static void removeLast_animation(QQmlListProperty< QQuickAbstractAnimation > *list)
static QQuickAbstractAnimation * at_animation(QQmlListProperty< QQuickAbstractAnimation > *list, qsizetype index)
static void clear_animation(QQmlListProperty< QQuickAbstractAnimation > *list)
void restartFromCurrentLoop()
virtual void debugUpdater(QDebug, int) const
virtual ~QQuickBulkValueUpdater()
virtual void setValue(qreal value)=0
QQmlNullableValue< QVariant > value
QList< QObject * > exclude
QList< QObject * > targets
QQmlScriptString runScriptScript
QAbstractAnimationAction * createAction()
QAnimationActionProxy< QQuickScriptActionPrivate, &QQuickScriptActionPrivate::execute, &QQuickScriptActionPrivate::debugAction > Proxy
void debugAction(QDebug d, int indentLevel) const
QVariant _q_interpolateClockwiseRotation(qreal &f, qreal &t, qreal progress)
QVariant _q_interpolateShortestRotation(qreal &f, qreal &t, qreal progress)
\qmltype RotationAnimation \nativetype QQuickRotationAnimation \inqmlmodule QtQuick\inherits Property...
QVariant _q_interpolateCounterclockwiseRotation(qreal &f, qreal &t, qreal progress)
QQuickStateOperation::ActionList QQuickStateActions