1// Copyright (C) 2016 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 QT3DANIMATION_QABSTRACTANIMATION_H
5#define QT3DANIMATION_QABSTRACTANIMATION_H
6
7#include <QtCore/qlist.h>
8#include <QtCore/qobject.h>
9
10#include <Qt3DAnimation/qt3danimation_global.h>
11
12QT_BEGIN_NAMESPACE
13
14namespace Qt3DAnimation {
15
16class QAbstractAnimationPrivate;
17
18class Q_3DANIMATIONSHARED_EXPORT QAbstractAnimation : public QObject
19{
20 Q_OBJECT
21 Q_PROPERTY(QString animationName READ animationName WRITE setAnimationName NOTIFY animationNameChanged)
22 Q_PROPERTY(AnimationType animationType READ animationType CONSTANT)
23 Q_PROPERTY(float position READ position WRITE setPosition NOTIFY positionChanged)
24 Q_PROPERTY(float duration READ duration NOTIFY durationChanged)
25
26public:
27 enum AnimationType {
28 KeyframeAnimation = 1,
29 MorphingAnimation = 2,
30 VertexBlendAnimation = 3,
31 };
32 Q_ENUM(AnimationType)
33
34 QString animationName() const;
35 QAbstractAnimation::AnimationType animationType() const;
36 float position() const;
37 float duration() const;
38
39public Q_SLOTS:
40 void setAnimationName(const QString &name);
41 void setPosition(float position);
42
43protected:
44 explicit QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = nullptr);
45
46 void setDuration(float duration);
47
48Q_SIGNALS:
49 void animationNameChanged(const QString &name);
50 void positionChanged(float position);
51 void durationChanged(float duration);
52
53private:
54 Q_DECLARE_PRIVATE(QAbstractAnimation)
55};
56
57} // Qt3DAnimation
58
59QT_END_NAMESPACE
60
61#endif // QT3DANIMATION_QABSTRACTANIMATION_H
62

source code of qt3d/src/animation/frontend/qabstractanimation.h