| 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 QANIMATIONGROUPJOB_P_H |
| 5 | #define QANIMATIONGROUPJOB_P_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 <QtQml/private/qabstractanimationjob_p.h> |
| 19 | #include <QtQml/private/qdoubleendedlist_p.h> |
| 20 | #include <QtCore/qdebug.h> |
| 21 | |
| 22 | QT_REQUIRE_CONFIG(qml_animation); |
| 23 | |
| 24 | QT_BEGIN_NAMESPACE |
| 25 | |
| 26 | class Q_QML_EXPORT QAnimationGroupJob : public QAbstractAnimationJob |
| 27 | { |
| 28 | Q_DISABLE_COPY(QAnimationGroupJob) |
| 29 | public: |
| 30 | using Children = QDoubleEndedList<QAbstractAnimationJob>; |
| 31 | |
| 32 | QAnimationGroupJob(); |
| 33 | ~QAnimationGroupJob() override; |
| 34 | |
| 35 | void appendAnimation(QAbstractAnimationJob *animation); |
| 36 | void prependAnimation(QAbstractAnimationJob *animation); |
| 37 | void removeAnimation(QAbstractAnimationJob *animation); |
| 38 | |
| 39 | Children *children() { return &m_children; } |
| 40 | const Children *children() const { return &m_children; } |
| 41 | |
| 42 | virtual void clear(); |
| 43 | |
| 44 | //called by QAbstractAnimationJob |
| 45 | virtual void uncontrolledAnimationFinished(QAbstractAnimationJob *animation); |
| 46 | protected: |
| 47 | void topLevelAnimationLoopChanged() override; |
| 48 | |
| 49 | virtual void animationInserted(QAbstractAnimationJob*) { } |
| 50 | virtual void animationRemoved(QAbstractAnimationJob*, QAbstractAnimationJob*, QAbstractAnimationJob*); |
| 51 | |
| 52 | //TODO: confirm location of these (should any be moved into QAbstractAnimationJob?) |
| 53 | void resetUncontrolledAnimationsFinishTime(); |
| 54 | void resetUncontrolledAnimationFinishTime(QAbstractAnimationJob *anim); |
| 55 | int uncontrolledAnimationFinishTime(const QAbstractAnimationJob *anim) const |
| 56 | { |
| 57 | return anim->m_uncontrolledFinishTime; |
| 58 | } |
| 59 | void setUncontrolledAnimationFinishTime(QAbstractAnimationJob *anim, int time); |
| 60 | |
| 61 | void debugChildren(QDebug d) const; |
| 62 | |
| 63 | void ungroupChild(QAbstractAnimationJob *animation); |
| 64 | void handleAnimationRemoved(QAbstractAnimationJob *animation); |
| 65 | |
| 66 | Children m_children; |
| 67 | }; |
| 68 | |
| 69 | QT_END_NAMESPACE |
| 70 | |
| 71 | #endif //QANIMATIONGROUPJOB_P_H |
| 72 |
