author | Eckhart Koeppen <eckhart.koppen@nokia.com> |
Wed, 21 Apr 2010 11:15:19 +0300 | |
branch | RCL_3 |
changeset 11 | 25a739ee40f4 |
parent 4 | 3b1da2848fc7 |
permissions | -rw-r--r-- |
0 | 1 |
/**************************************************************************** |
2 |
** |
|
4
3b1da2848fc7
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
3
diff
changeset
|
3 |
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
0 | 4 |
** All rights reserved. |
5 |
** Contact: Nokia Corporation (qt-info@nokia.com) |
|
6 |
** |
|
7 |
** This file is part of the QtCore module of the Qt Toolkit. |
|
8 |
** |
|
9 |
** $QT_BEGIN_LICENSE:LGPL$ |
|
10 |
** No Commercial Usage |
|
11 |
** This file contains pre-release code and may not be distributed. |
|
12 |
** You may use this file in accordance with the terms and conditions |
|
13 |
** contained in the Technology Preview License Agreement accompanying |
|
14 |
** this package. |
|
15 |
** |
|
16 |
** GNU Lesser General Public License Usage |
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser |
|
18 |
** General Public License version 2.1 as published by the Free Software |
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the |
|
20 |
** packaging of this file. Please review the following information to |
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements |
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
23 |
** |
|
24 |
** In addition, as a special exception, Nokia gives you certain additional |
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception |
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
27 |
** |
|
28 |
** If you have questions regarding the use of this file, please contact |
|
29 |
** Nokia at qt-info@nokia.com. |
|
30 |
** |
|
31 |
** |
|
32 |
** |
|
33 |
** |
|
34 |
** |
|
35 |
** |
|
36 |
** |
|
37 |
** |
|
38 |
** $QT_END_LICENSE$ |
|
39 |
** |
|
40 |
****************************************************************************/ |
|
41 |
||
42 |
#ifndef QABSTRACTANIMATION_H |
|
43 |
#define QABSTRACTANIMATION_H |
|
44 |
||
45 |
#include <QtCore/qobject.h> |
|
46 |
||
47 |
QT_BEGIN_HEADER |
|
48 |
||
49 |
QT_BEGIN_NAMESPACE |
|
50 |
||
51 |
QT_MODULE(Core) |
|
52 |
||
53 |
#ifndef QT_NO_ANIMATION |
|
54 |
||
55 |
class QAnimationGroup; |
|
56 |
class QSequentialAnimationGroup; |
|
57 |
||
58 |
class QAbstractAnimationPrivate; |
|
59 |
class Q_CORE_EXPORT QAbstractAnimation : public QObject |
|
60 |
{ |
|
61 |
Q_OBJECT |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
62 |
Q_ENUMS(State) |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
63 |
Q_ENUMS(Direction) |
0 | 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) |
|
70 |
||
71 |
public: |
|
72 |
enum Direction { |
|
73 |
Forward, |
|
74 |
Backward |
|
75 |
}; |
|
76 |
||
77 |
enum State { |
|
78 |
Stopped, |
|
79 |
Paused, |
|
80 |
Running |
|
81 |
}; |
|
82 |
||
83 |
enum DeletionPolicy { |
|
84 |
KeepWhenStopped = 0, |
|
85 |
DeleteWhenStopped |
|
86 |
}; |
|
87 |
||
88 |
QAbstractAnimation(QObject *parent = 0); |
|
89 |
virtual ~QAbstractAnimation(); |
|
90 |
||
91 |
State state() const; |
|
92 |
||
93 |
QAnimationGroup *group() const; |
|
94 |
||
95 |
Direction direction() const; |
|
96 |
void setDirection(Direction direction); |
|
97 |
||
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
98 |
int currentTime() const; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
99 |
int currentLoopTime() const; |
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
100 |
|
0 | 101 |
int loopCount() const; |
102 |
void setLoopCount(int loopCount); |
|
103 |
int currentLoop() const; |
|
104 |
||
105 |
virtual int duration() const = 0; |
|
106 |
int totalDuration() const; |
|
107 |
||
108 |
Q_SIGNALS: |
|
109 |
void finished(); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
110 |
void stateChanged(QAbstractAnimation::State newState, QAbstractAnimation::State oldState); |
0 | 111 |
void currentLoopChanged(int currentLoop); |
112 |
void directionChanged(QAbstractAnimation::Direction); |
|
113 |
||
114 |
public Q_SLOTS: |
|
115 |
void start(QAbstractAnimation::DeletionPolicy policy = KeepWhenStopped); |
|
116 |
void pause(); |
|
117 |
void resume(); |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
118 |
void setPaused(bool); |
0 | 119 |
void stop(); |
120 |
void setCurrentTime(int msecs); |
|
121 |
||
122 |
protected: |
|
123 |
QAbstractAnimation(QAbstractAnimationPrivate &dd, QObject *parent = 0); |
|
124 |
bool event(QEvent *event); |
|
125 |
||
126 |
virtual void updateCurrentTime(int currentTime) = 0; |
|
3
41300fa6a67c
Revision: 201003
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
0
diff
changeset
|
127 |
virtual void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState); |
0 | 128 |
virtual void updateDirection(QAbstractAnimation::Direction direction); |
129 |
||
130 |
private: |
|
131 |
Q_DISABLE_COPY(QAbstractAnimation) |
|
132 |
Q_DECLARE_PRIVATE(QAbstractAnimation) |
|
133 |
}; |
|
134 |
||
135 |
#endif //QT_NO_ANIMATION |
|
136 |
||
137 |
QT_END_NAMESPACE |
|
138 |
||
139 |
QT_END_HEADER |
|
140 |
||
141 |
#endif // QABSTRACTANIMATION_H |