| 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 QQUICKSMOOTHEDANIMATION_H |
| 5 | #define QQUICKSMOOTHEDANIMATION_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists purely as an |
| 12 | // implementation detail. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <qqml.h> |
| 19 | #include "qquickanimation_p.h" |
| 20 | |
| 21 | #include <QtCore/qobject.h> |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | class QQmlProperty; |
| 26 | class QQuickSmoothedAnimationPrivate; |
| 27 | class Q_QUICK_EXPORT QQuickSmoothedAnimation : public QQuickNumberAnimation |
| 28 | { |
| 29 | Q_OBJECT |
| 30 | Q_DECLARE_PRIVATE(QQuickSmoothedAnimation) |
| 31 | |
| 32 | Q_PROPERTY(qreal velocity READ velocity WRITE setVelocity NOTIFY velocityChanged) |
| 33 | Q_PROPERTY(ReversingMode reversingMode READ reversingMode WRITE setReversingMode NOTIFY reversingModeChanged) |
| 34 | Q_PROPERTY(qreal maximumEasingTime READ maximumEasingTime WRITE setMaximumEasingTime NOTIFY maximumEasingTimeChanged) |
| 35 | QML_NAMED_ELEMENT(SmoothedAnimation) |
| 36 | QML_ADDED_IN_VERSION(2, 0) |
| 37 | |
| 38 | public: |
| 39 | enum ReversingMode { Eased, Immediate, Sync }; |
| 40 | Q_ENUM(ReversingMode) |
| 41 | |
| 42 | QQuickSmoothedAnimation(QObject *parent = nullptr); |
| 43 | |
| 44 | ReversingMode reversingMode() const; |
| 45 | void setReversingMode(ReversingMode); |
| 46 | |
| 47 | int duration() const override; |
| 48 | void setDuration(int) override; |
| 49 | |
| 50 | qreal velocity() const; |
| 51 | void setVelocity(qreal); |
| 52 | |
| 53 | int maximumEasingTime() const; |
| 54 | void setMaximumEasingTime(int); |
| 55 | |
| 56 | QAbstractAnimationJob* transition(QQuickStateActions &actions, |
| 57 | QQmlProperties &modified, |
| 58 | TransitionDirection direction, |
| 59 | QObject *defaultTarget = nullptr) override; |
| 60 | Q_SIGNALS: |
| 61 | void velocityChanged(); |
| 62 | void reversingModeChanged(); |
| 63 | void maximumEasingTimeChanged(); |
| 64 | }; |
| 65 | |
| 66 | QT_END_NAMESPACE |
| 67 | |
| 68 | #endif // QQUICKSMOOTHEDANIMATION_H |
| 69 |
