1
/****************************************************************************
3
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
6
** This file is part of the QtCore module of the Qt Toolkit.
8
** $QT_BEGIN_LICENSE:LGPL$
9
** Commercial License Usage
10
** Licensees holding valid commercial Qt licenses may use this file in
11
** accordance with the commercial license agreement provided with the
12
** Software or, alternatively, in accordance with the terms contained in
13
** a written agreement between you and Digia. For licensing terms and
14
** conditions see http://qt.digia.com/licensing. For further information
15
** use the contact form at http://qt.digia.com/contact-us.
17
** GNU Lesser General Public License Usage
18
** Alternatively, this file may be used under the terms of the GNU Lesser
19
** General Public License version 2.1 as published by the Free Software
20
** Foundation and appearing in the file LICENSE.LGPL included in the
21
** packaging of this file. Please review the following information to
22
** ensure the GNU Lesser General Public License version 2.1 requirements
23
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25
** In addition, as a special exception, Digia gives you certain additional
26
** rights. These rights are described in the Digia Qt LGPL Exception
27
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29
** GNU General Public License Usage
30
** Alternatively, this file may be used under the terms of the GNU
31
** General Public License version 3.0 as published by the Free Software
32
** Foundation and appearing in the file LICENSE.GPL included in the
33
** packaging of this file. Please review the following information to
34
** ensure the GNU General Public License version 3.0 requirements will be
35
** met: http://www.gnu.org/copyleft/gpl.html.
40
****************************************************************************/
42
#ifndef QABSTRACTANIMATION_H
43
#define QABSTRACTANIMATION_H
45
#include <QtCore/qobject.h>
52
#ifndef QT_NO_ANIMATION
54
class QAnimationGroup;
55
class QSequentialAnimationGroup;
56
class QAnimationDriver;
58
class QAbstractAnimationPrivate;
59
class Q_CORE_EXPORT QAbstractAnimation : public QObject
64
Q_PROPERTY(State state READ state NOTIFY stateChanged)
65
Q_PROPERTY(int loopCount READ loopCount WRITE setLoopCount)
66
Q_PROPERTY(int currentTime READ currentTime WRITE setCurrentTime)
67
Q_PROPERTY(int currentLoop READ currentLoop NOTIFY currentLoopChanged)
68
Q_PROPERTY(Direction direction READ direction WRITE setDirection NOTIFY directionChanged)
69
Q_PROPERTY(int duration READ duration)
88
QAbstractAnimation(QObject *parent = 0);
89
virtual ~QAbstractAnimation();
93
QAnimationGroup *group() const;
95
Direction direction() const;
96
void setDirection(Direction direction);
98
int currentTime() const;
99
int currentLoopTime() const;
101
int loopCount() const;
102
void setLoopCount(int loopCount);
103
int currentLoop() const;
105
virtual int duration() const = 0;
106
int totalDuration() const;
110
void stateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
111
void currentLoopChanged(int currentLoop);
112
void directionChanged(QAbstractAnimation::Direction);
115
void start(QAbstractAnimation::DeletionPolicy policy = KeepWhenStopped);
118
void setPaused(bool);
120
void setCurrentTime(int msecs);
123
QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = 0);
124
bool event(QEvent *event);
126
virtual void updateCurrentTime(int currentTime) = 0;
127
virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState);
128
virtual void updateDirection(QAbstractAnimation::Direction direction);
131
Q_DISABLE_COPY(QAbstractAnimation)
132
Q_DECLARE_PRIVATE(QAbstractAnimation)
135
class QAnimationDriverPrivate;
136
class Q_CORE_EXPORT QAnimationDriver : public QObject
139
Q_DECLARE_PRIVATE(QAnimationDriver)
142
QAnimationDriver(QObject *parent = 0);
145
virtual void advance();
150
bool isRunning() const;
152
virtual qint64 elapsed() const;
154
void setStartTime(qint64 startTime);
155
qint64 startTime() const;
162
void advanceAnimation(qint64 timeStep = -1);
163
virtual void start();
166
QAnimationDriver(QAnimationDriverPrivate &dd, QObject *parent = 0);
169
friend class QUnifiedTimer;
176
#endif //QT_NO_ANIMATION
182
#endif // QABSTRACTANIMATION_H