| 1 | // Copyright (C) 2019 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QQUICKTIMELINEANIMATION_H |
| 5 | #define QQUICKTIMELINEANIMATION_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 "qtquicktimelineglobal_p.h" |
| 19 | |
| 20 | #include <QtQuick/private/qquickanimation_p.h> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class Q_QUICKTIMELINE_EXPORT QQuickTimelineAnimation : public QQuickNumberAnimation |
| 25 | { |
| 26 | Q_OBJECT |
| 27 | |
| 28 | Q_PROPERTY(bool pingPong READ pingPong WRITE setPingPong NOTIFY pingPongChanged) |
| 29 | QML_NAMED_ELEMENT(TimelineAnimation) |
| 30 | QML_ADDED_IN_VERSION(1, 0) |
| 31 | |
| 32 | public: |
| 33 | explicit QQuickTimelineAnimation(QObject *parent = nullptr); |
| 34 | |
| 35 | void setPingPong(bool b); |
| 36 | bool pingPong() const; |
| 37 | |
| 38 | Q_SIGNALS: |
| 39 | void pingPongChanged(); |
| 40 | void finished(); |
| 41 | |
| 42 | private: |
| 43 | void handleStarted(); |
| 44 | void handleStopped(); |
| 45 | |
| 46 | bool m_pinpong = false; |
| 47 | bool m_reversed = false; |
| 48 | bool m_originalStart = true; |
| 49 | int m_currentLoop = 0; |
| 50 | int m_originalLoop = 0; |
| 51 | }; |
| 52 | |
| 53 | QT_END_NAMESPACE |
| 54 | |
| 55 | #endif // QQUICKTIMELINEANIMATION_H |
| 56 | |