1// qabstractanimation.sip generated by MetaSIP
2//
3// This file is part of the QtCore Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QAbstractAnimation : QObject
24{
25%TypeHeaderCode
26#include <qabstractanimation.h>
27%End
28
29public:
30    enum Direction
31    {
32        Forward,
33        Backward,
34    };
35
36    enum State
37    {
38        Stopped,
39        Paused,
40        Running,
41    };
42
43    enum DeletionPolicy
44    {
45        KeepWhenStopped,
46        DeleteWhenStopped,
47    };
48
49    QAbstractAnimation(QObject *parent /TransferThis/ = 0);
50    virtual ~QAbstractAnimation();
51    QAbstractAnimation::State state() const;
52    QAnimationGroup *group() const;
53    QAbstractAnimation::Direction direction() const;
54    void setDirection(QAbstractAnimation::Direction direction);
55    int currentTime() const;
56    int currentLoopTime() const;
57    int loopCount() const;
58    void setLoopCount(int loopCount);
59    int currentLoop() const;
60    virtual int duration() const = 0;
61    int totalDuration() const;
62
63signals:
64    void finished();
65    void stateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
66    void currentLoopChanged(int currentLoop);
67    void directionChanged(QAbstractAnimation::Direction);
68
69public slots:
70    void start(QAbstractAnimation::DeletionPolicy policy = QAbstractAnimation::KeepWhenStopped);
71    void pause();
72    void resume();
73    void setPaused(bool);
74    void stop();
75    void setCurrentTime(int msecs);
76
77protected:
78    virtual bool event(QEvent *event);
79    virtual void updateCurrentTime(int currentTime) = 0;
80    virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
81    virtual void updateDirection(QAbstractAnimation::Direction direction);
82};
83