1 /****************************************************************************
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
6 ** This file is part of the QtCore module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
40 ****************************************************************************/
45 #include <QtCore/qeasingcurve.h>
46 #include <QtCore/qobject.h>
53 class QTimeLinePrivate;
54 class Q_CORE_EXPORT QTimeLine : public QObject
57 Q_PROPERTY(int duration READ duration WRITE setDuration)
58 Q_PROPERTY(int updateInterval READ updateInterval WRITE setUpdateInterval)
59 Q_PROPERTY(int currentTime READ currentTime WRITE setCurrentTime)
60 Q_PROPERTY(Direction direction READ direction WRITE setDirection)
61 Q_PROPERTY(int loopCount READ loopCount WRITE setLoopCount)
62 Q_PROPERTY(CurveShape curveShape READ curveShape WRITE setCurveShape)
63 Q_PROPERTY(QEasingCurve easingCurve READ easingCurve WRITE setEasingCurve)
83 explicit QTimeLine(int duration = 1000, QObject *parent = 0);
88 int loopCount() const;
89 void setLoopCount(int count);
91 Direction direction() const;
92 void setDirection(Direction direction);
95 void setDuration(int duration);
97 int startFrame() const;
98 void setStartFrame(int frame);
100 void setEndFrame(int frame);
101 void setFrameRange(int startFrame, int endFrame);
103 int updateInterval() const;
104 void setUpdateInterval(int interval);
106 CurveShape curveShape() const;
107 void setCurveShape(CurveShape shape);
109 QEasingCurve easingCurve() const;
110 void setEasingCurve(const QEasingCurve &curve);
112 int currentTime() const;
113 int currentFrame() const;
114 qreal currentValue() const;
116 int frameForTime(int msec) const;
117 virtual qreal valueForTime(int msec) const;
123 void setPaused(bool paused);
124 void setCurrentTime(int msec);
125 void toggleDirection();
128 void valueChanged(qreal x);
129 void frameChanged(int);
130 void stateChanged(QTimeLine::State newState);
134 void timerEvent(QTimerEvent *event);
137 Q_DISABLE_COPY(QTimeLine)
138 Q_DECLARE_PRIVATE(QTimeLine)