| 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 | // Qt-Security score:significant reason:default |
| 4 | |
| 5 | #ifndef QSEQUENTIALANIMATIONGROUP_H |
| 6 | #define QSEQUENTIALANIMATIONGROUP_H |
| 7 | |
| 8 | #include <QtCore/qanimationgroup.h> |
| 9 | |
| 10 | QT_REQUIRE_CONFIG(animation); |
| 11 | |
| 12 | QT_BEGIN_NAMESPACE |
| 13 | |
| 14 | class QPauseAnimation; |
| 15 | class QSequentialAnimationGroupPrivate; |
| 16 | |
| 17 | class Q_CORE_EXPORT QSequentialAnimationGroup : public QAnimationGroup |
| 18 | { |
| 19 | Q_OBJECT |
| 20 | Q_PROPERTY(QAbstractAnimation *currentAnimation READ currentAnimation |
| 21 | NOTIFY currentAnimationChanged BINDABLE bindableCurrentAnimation) |
| 22 | |
| 23 | public: |
| 24 | QSequentialAnimationGroup(QObject *parent = nullptr); |
| 25 | ~QSequentialAnimationGroup(); |
| 26 | |
| 27 | QPauseAnimation *addPause(int msecs); |
| 28 | QPauseAnimation *insertPause(int index, int msecs); |
| 29 | |
| 30 | QAbstractAnimation *currentAnimation() const; |
| 31 | QBindable<QAbstractAnimation *> bindableCurrentAnimation() const; |
| 32 | int duration() const override; |
| 33 | |
| 34 | Q_SIGNALS: |
| 35 | void currentAnimationChanged(QAbstractAnimation *current); |
| 36 | |
| 37 | protected: |
| 38 | QSequentialAnimationGroup(QSequentialAnimationGroupPrivate &dd, QObject *parent); |
| 39 | bool event(QEvent *event) override; |
| 40 | |
| 41 | void updateCurrentTime(int) override; |
| 42 | void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) override; |
| 43 | void updateDirection(QAbstractAnimation::Direction direction) override; |
| 44 | |
| 45 | private: |
| 46 | Q_DISABLE_COPY(QSequentialAnimationGroup) |
| 47 | Q_DECLARE_PRIVATE(QSequentialAnimationGroup) |
| 48 | Q_PRIVATE_SLOT(d_func(), void _q_uncontrolledAnimationFinished()) |
| 49 | }; |
| 50 | |
| 51 | QT_END_NAMESPACE |
| 52 | |
| 53 | #endif //QSEQUENTIALANIMATIONGROUP_H |
| 54 |
