1// qtimeline.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 QTimeLine : QObject 24{ 25%TypeHeaderCode 26#include <qtimeline.h> 27%End 28 29public: 30 enum CurveShape 31 { 32 EaseInCurve, 33 EaseOutCurve, 34 EaseInOutCurve, 35 LinearCurve, 36 SineCurve, 37 CosineCurve, 38 }; 39 40 enum Direction 41 { 42 Forward, 43 Backward, 44 }; 45 46 enum State 47 { 48 NotRunning, 49 Paused, 50 Running, 51 }; 52 53 QTimeLine(int duration = 1000, QObject *parent /TransferThis/ = 0); 54 virtual ~QTimeLine(); 55 QTimeLine::State state() const; 56 int loopCount() const; 57 void setLoopCount(int count); 58 QTimeLine::Direction direction() const; 59 void setDirection(QTimeLine::Direction direction); 60 int duration() const; 61 void setDuration(int duration); 62 int startFrame() const; 63 void setStartFrame(int frame); 64 int endFrame() const; 65 void setEndFrame(int frame); 66 void setFrameRange(int startFrame, int endFrame); 67 int updateInterval() const; 68 void setUpdateInterval(int interval); 69 QTimeLine::CurveShape curveShape() const; 70 void setCurveShape(QTimeLine::CurveShape shape); 71 int currentTime() const; 72 int currentFrame() const; 73 qreal currentValue() const; 74 int frameForTime(int msec) const; 75 virtual qreal valueForTime(int msec) const; 76 77public slots: 78 void resume(); 79 void setCurrentTime(int msec); 80 void setPaused(bool paused); 81 void start(); 82 void stop(); 83 void toggleDirection(); 84 85signals: 86 void finished(); 87 void frameChanged(int); 88 void stateChanged(QTimeLine::State newState); 89 void valueChanged(qreal x); 90 91protected: 92 virtual void timerEvent(QTimerEvent *event); 93 94public: 95 QEasingCurve easingCurve() const; 96 void setEasingCurve(const QEasingCurve &curve); 97}; 98