1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation (qt-info@nokia.com)
|
---|
6 | **
|
---|
7 | ** This file is part of the QtDeclarative module of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
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 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at qt-info@nokia.com.
|
---|
38 | ** $QT_END_LICENSE$
|
---|
39 | **
|
---|
40 | ****************************************************************************/
|
---|
41 |
|
---|
42 | #ifndef QDECLARATIVEANIMATION_H
|
---|
43 | #define QDECLARATIVEANIMATION_H
|
---|
44 |
|
---|
45 | #include "private/qdeclarativetransition_p.h"
|
---|
46 | #include "private/qdeclarativestate_p.h"
|
---|
47 | #include <QtGui/qvector3d.h>
|
---|
48 |
|
---|
49 | #include <qdeclarativepropertyvaluesource.h>
|
---|
50 | #include <qdeclarative.h>
|
---|
51 | #include <qdeclarativescriptstring.h>
|
---|
52 |
|
---|
53 | #include <QtCore/qvariant.h>
|
---|
54 | #include <QtCore/qeasingcurve.h>
|
---|
55 | #include <QtCore/QAbstractAnimation>
|
---|
56 | #include <QtGui/qcolor.h>
|
---|
57 |
|
---|
58 | QT_BEGIN_HEADER
|
---|
59 |
|
---|
60 | QT_BEGIN_NAMESPACE
|
---|
61 |
|
---|
62 | QT_MODULE(Declarative)
|
---|
63 |
|
---|
64 | class QDeclarativeAbstractAnimationPrivate;
|
---|
65 | class QDeclarativeAnimationGroup;
|
---|
66 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeAbstractAnimation : public QObject, public QDeclarativePropertyValueSource, public QDeclarativeParserStatus
|
---|
67 | {
|
---|
68 | Q_OBJECT
|
---|
69 | Q_DECLARE_PRIVATE(QDeclarativeAbstractAnimation)
|
---|
70 |
|
---|
71 | Q_INTERFACES(QDeclarativeParserStatus)
|
---|
72 | Q_INTERFACES(QDeclarativePropertyValueSource)
|
---|
73 | Q_ENUMS(Loops)
|
---|
74 | Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged)
|
---|
75 | Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged)
|
---|
76 | Q_PROPERTY(bool alwaysRunToEnd READ alwaysRunToEnd WRITE setAlwaysRunToEnd NOTIFY alwaysRunToEndChanged)
|
---|
77 | Q_PROPERTY(int loops READ loops WRITE setLoops NOTIFY loopCountChanged)
|
---|
78 | Q_CLASSINFO("DefaultMethod", "start()")
|
---|
79 |
|
---|
80 | public:
|
---|
81 | QDeclarativeAbstractAnimation(QObject *parent=0);
|
---|
82 | virtual ~QDeclarativeAbstractAnimation();
|
---|
83 |
|
---|
84 | enum Loops { Infinite = -2 };
|
---|
85 |
|
---|
86 | bool isRunning() const;
|
---|
87 | void setRunning(bool);
|
---|
88 | bool isPaused() const;
|
---|
89 | void setPaused(bool);
|
---|
90 | bool alwaysRunToEnd() const;
|
---|
91 | void setAlwaysRunToEnd(bool);
|
---|
92 |
|
---|
93 | int loops() const;
|
---|
94 | void setLoops(int);
|
---|
95 |
|
---|
96 | int currentTime();
|
---|
97 | void setCurrentTime(int);
|
---|
98 |
|
---|
99 | QDeclarativeAnimationGroup *group() const;
|
---|
100 | void setGroup(QDeclarativeAnimationGroup *);
|
---|
101 |
|
---|
102 | void setDefaultTarget(const QDeclarativeProperty &);
|
---|
103 | void setDisableUserControl();
|
---|
104 |
|
---|
105 | void classBegin();
|
---|
106 | void componentComplete();
|
---|
107 |
|
---|
108 | Q_SIGNALS:
|
---|
109 | void started();
|
---|
110 | void completed();
|
---|
111 | void runningChanged(bool);
|
---|
112 | void pausedChanged(bool);
|
---|
113 | void alwaysRunToEndChanged(bool);
|
---|
114 | void loopCountChanged(int);
|
---|
115 |
|
---|
116 | public Q_SLOTS:
|
---|
117 | void restart();
|
---|
118 | void start();
|
---|
119 | void pause();
|
---|
120 | void resume();
|
---|
121 | void stop();
|
---|
122 | void complete();
|
---|
123 |
|
---|
124 | protected:
|
---|
125 | QDeclarativeAbstractAnimation(QDeclarativeAbstractAnimationPrivate &dd, QObject *parent);
|
---|
126 |
|
---|
127 | public:
|
---|
128 | enum TransitionDirection { Forward, Backward };
|
---|
129 | virtual void transition(QDeclarativeStateActions &actions,
|
---|
130 | QDeclarativeProperties &modified,
|
---|
131 | TransitionDirection direction);
|
---|
132 | virtual QAbstractAnimation *qtAnimation() = 0;
|
---|
133 |
|
---|
134 | private Q_SLOTS:
|
---|
135 | void timelineComplete();
|
---|
136 | void componentFinalized();
|
---|
137 | private:
|
---|
138 | virtual void setTarget(const QDeclarativeProperty &);
|
---|
139 | void notifyRunningChanged(bool running);
|
---|
140 | friend class QDeclarativeBehavior;
|
---|
141 |
|
---|
142 |
|
---|
143 | };
|
---|
144 |
|
---|
145 | class QDeclarativePauseAnimationPrivate;
|
---|
146 | class Q_AUTOTEST_EXPORT QDeclarativePauseAnimation : public QDeclarativeAbstractAnimation
|
---|
147 | {
|
---|
148 | Q_OBJECT
|
---|
149 | Q_DECLARE_PRIVATE(QDeclarativePauseAnimation)
|
---|
150 |
|
---|
151 | Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
|
---|
152 |
|
---|
153 | public:
|
---|
154 | QDeclarativePauseAnimation(QObject *parent=0);
|
---|
155 | virtual ~QDeclarativePauseAnimation();
|
---|
156 |
|
---|
157 | int duration() const;
|
---|
158 | void setDuration(int);
|
---|
159 |
|
---|
160 | Q_SIGNALS:
|
---|
161 | void durationChanged(int);
|
---|
162 |
|
---|
163 | protected:
|
---|
164 | virtual QAbstractAnimation *qtAnimation();
|
---|
165 | };
|
---|
166 |
|
---|
167 | class QDeclarativeScriptActionPrivate;
|
---|
168 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeScriptAction : public QDeclarativeAbstractAnimation
|
---|
169 | {
|
---|
170 | Q_OBJECT
|
---|
171 | Q_DECLARE_PRIVATE(QDeclarativeScriptAction)
|
---|
172 |
|
---|
173 | Q_PROPERTY(QDeclarativeScriptString script READ script WRITE setScript)
|
---|
174 | Q_PROPERTY(QString scriptName READ stateChangeScriptName WRITE setStateChangeScriptName)
|
---|
175 |
|
---|
176 | public:
|
---|
177 | QDeclarativeScriptAction(QObject *parent=0);
|
---|
178 | virtual ~QDeclarativeScriptAction();
|
---|
179 |
|
---|
180 | QDeclarativeScriptString script() const;
|
---|
181 | void setScript(const QDeclarativeScriptString &);
|
---|
182 |
|
---|
183 | QString stateChangeScriptName() const;
|
---|
184 | void setStateChangeScriptName(const QString &);
|
---|
185 |
|
---|
186 | protected:
|
---|
187 | virtual void transition(QDeclarativeStateActions &actions,
|
---|
188 | QDeclarativeProperties &modified,
|
---|
189 | TransitionDirection direction);
|
---|
190 | virtual QAbstractAnimation *qtAnimation();
|
---|
191 | };
|
---|
192 |
|
---|
193 | class QDeclarativePropertyActionPrivate;
|
---|
194 | class QDeclarativePropertyAction : public QDeclarativeAbstractAnimation
|
---|
195 | {
|
---|
196 | Q_OBJECT
|
---|
197 | Q_DECLARE_PRIVATE(QDeclarativePropertyAction)
|
---|
198 |
|
---|
199 | Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
|
---|
200 | Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged)
|
---|
201 | Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged)
|
---|
202 | Q_PROPERTY(QDeclarativeListProperty<QObject> targets READ targets)
|
---|
203 | Q_PROPERTY(QDeclarativeListProperty<QObject> exclude READ exclude)
|
---|
204 | Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged)
|
---|
205 |
|
---|
206 | public:
|
---|
207 | QDeclarativePropertyAction(QObject *parent=0);
|
---|
208 | virtual ~QDeclarativePropertyAction();
|
---|
209 |
|
---|
210 | QObject *target() const;
|
---|
211 | void setTarget(QObject *);
|
---|
212 |
|
---|
213 | QString property() const;
|
---|
214 | void setProperty(const QString &);
|
---|
215 |
|
---|
216 | QString properties() const;
|
---|
217 | void setProperties(const QString &);
|
---|
218 |
|
---|
219 | QDeclarativeListProperty<QObject> targets();
|
---|
220 | QDeclarativeListProperty<QObject> exclude();
|
---|
221 |
|
---|
222 | QVariant value() const;
|
---|
223 | void setValue(const QVariant &);
|
---|
224 |
|
---|
225 | Q_SIGNALS:
|
---|
226 | void valueChanged(const QVariant &);
|
---|
227 | void propertiesChanged(const QString &);
|
---|
228 | void targetChanged();
|
---|
229 | void propertyChanged();
|
---|
230 |
|
---|
231 | protected:
|
---|
232 | virtual void transition(QDeclarativeStateActions &actions,
|
---|
233 | QDeclarativeProperties &modified,
|
---|
234 | TransitionDirection direction);
|
---|
235 | virtual QAbstractAnimation *qtAnimation();
|
---|
236 | };
|
---|
237 |
|
---|
238 | class QDeclarativeItem;
|
---|
239 | class QDeclarativePropertyAnimationPrivate;
|
---|
240 | class Q_AUTOTEST_EXPORT QDeclarativePropertyAnimation : public QDeclarativeAbstractAnimation
|
---|
241 | {
|
---|
242 | Q_OBJECT
|
---|
243 | Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
|
---|
244 |
|
---|
245 | Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
|
---|
246 | Q_PROPERTY(QVariant from READ from WRITE setFrom NOTIFY fromChanged)
|
---|
247 | Q_PROPERTY(QVariant to READ to WRITE setTo NOTIFY toChanged)
|
---|
248 | Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
|
---|
249 | Q_PROPERTY(QObject *target READ target WRITE setTarget NOTIFY targetChanged)
|
---|
250 | Q_PROPERTY(QString property READ property WRITE setProperty NOTIFY propertyChanged)
|
---|
251 | Q_PROPERTY(QString properties READ properties WRITE setProperties NOTIFY propertiesChanged)
|
---|
252 | Q_PROPERTY(QDeclarativeListProperty<QObject> targets READ targets)
|
---|
253 | Q_PROPERTY(QDeclarativeListProperty<QObject> exclude READ exclude)
|
---|
254 |
|
---|
255 | public:
|
---|
256 | QDeclarativePropertyAnimation(QObject *parent=0);
|
---|
257 | virtual ~QDeclarativePropertyAnimation();
|
---|
258 |
|
---|
259 | virtual int duration() const;
|
---|
260 | virtual void setDuration(int);
|
---|
261 |
|
---|
262 | QVariant from() const;
|
---|
263 | void setFrom(const QVariant &);
|
---|
264 |
|
---|
265 | QVariant to() const;
|
---|
266 | void setTo(const QVariant &);
|
---|
267 |
|
---|
268 | QEasingCurve easing() const;
|
---|
269 | void setEasing(const QEasingCurve &);
|
---|
270 |
|
---|
271 | QObject *target() const;
|
---|
272 | void setTarget(QObject *);
|
---|
273 |
|
---|
274 | QString property() const;
|
---|
275 | void setProperty(const QString &);
|
---|
276 |
|
---|
277 | QString properties() const;
|
---|
278 | void setProperties(const QString &);
|
---|
279 |
|
---|
280 | QDeclarativeListProperty<QObject> targets();
|
---|
281 | QDeclarativeListProperty<QObject> exclude();
|
---|
282 |
|
---|
283 | protected:
|
---|
284 | QDeclarativePropertyAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent);
|
---|
285 | virtual void transition(QDeclarativeStateActions &actions,
|
---|
286 | QDeclarativeProperties &modified,
|
---|
287 | TransitionDirection direction);
|
---|
288 | virtual QAbstractAnimation *qtAnimation();
|
---|
289 |
|
---|
290 | Q_SIGNALS:
|
---|
291 | void durationChanged(int);
|
---|
292 | void fromChanged(QVariant);
|
---|
293 | void toChanged(QVariant);
|
---|
294 | void easingChanged(const QEasingCurve &);
|
---|
295 | void propertiesChanged(const QString &);
|
---|
296 | void targetChanged();
|
---|
297 | void propertyChanged();
|
---|
298 | };
|
---|
299 |
|
---|
300 | class Q_AUTOTEST_EXPORT QDeclarativeColorAnimation : public QDeclarativePropertyAnimation
|
---|
301 | {
|
---|
302 | Q_OBJECT
|
---|
303 | Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
|
---|
304 | Q_PROPERTY(QColor from READ from WRITE setFrom)
|
---|
305 | Q_PROPERTY(QColor to READ to WRITE setTo)
|
---|
306 |
|
---|
307 | public:
|
---|
308 | QDeclarativeColorAnimation(QObject *parent=0);
|
---|
309 | virtual ~QDeclarativeColorAnimation();
|
---|
310 |
|
---|
311 | QColor from() const;
|
---|
312 | void setFrom(const QColor &);
|
---|
313 |
|
---|
314 | QColor to() const;
|
---|
315 | void setTo(const QColor &);
|
---|
316 | };
|
---|
317 |
|
---|
318 | class Q_AUTOTEST_EXPORT QDeclarativeNumberAnimation : public QDeclarativePropertyAnimation
|
---|
319 | {
|
---|
320 | Q_OBJECT
|
---|
321 | Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
|
---|
322 |
|
---|
323 | Q_PROPERTY(qreal from READ from WRITE setFrom)
|
---|
324 | Q_PROPERTY(qreal to READ to WRITE setTo)
|
---|
325 |
|
---|
326 | public:
|
---|
327 | QDeclarativeNumberAnimation(QObject *parent=0);
|
---|
328 | virtual ~QDeclarativeNumberAnimation();
|
---|
329 |
|
---|
330 | qreal from() const;
|
---|
331 | void setFrom(qreal);
|
---|
332 |
|
---|
333 | qreal to() const;
|
---|
334 | void setTo(qreal);
|
---|
335 |
|
---|
336 | protected:
|
---|
337 | QDeclarativeNumberAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent);
|
---|
338 |
|
---|
339 | private:
|
---|
340 | void init();
|
---|
341 | };
|
---|
342 |
|
---|
343 | class Q_AUTOTEST_EXPORT QDeclarativeVector3dAnimation : public QDeclarativePropertyAnimation
|
---|
344 | {
|
---|
345 | Q_OBJECT
|
---|
346 | Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
|
---|
347 |
|
---|
348 | Q_PROPERTY(QVector3D from READ from WRITE setFrom)
|
---|
349 | Q_PROPERTY(QVector3D to READ to WRITE setTo)
|
---|
350 |
|
---|
351 | public:
|
---|
352 | QDeclarativeVector3dAnimation(QObject *parent=0);
|
---|
353 | virtual ~QDeclarativeVector3dAnimation();
|
---|
354 |
|
---|
355 | QVector3D from() const;
|
---|
356 | void setFrom(QVector3D);
|
---|
357 |
|
---|
358 | QVector3D to() const;
|
---|
359 | void setTo(QVector3D);
|
---|
360 | };
|
---|
361 |
|
---|
362 | class QDeclarativeRotationAnimationPrivate;
|
---|
363 | class Q_AUTOTEST_EXPORT QDeclarativeRotationAnimation : public QDeclarativePropertyAnimation
|
---|
364 | {
|
---|
365 | Q_OBJECT
|
---|
366 | Q_DECLARE_PRIVATE(QDeclarativeRotationAnimation)
|
---|
367 | Q_ENUMS(RotationDirection)
|
---|
368 |
|
---|
369 | Q_PROPERTY(qreal from READ from WRITE setFrom)
|
---|
370 | Q_PROPERTY(qreal to READ to WRITE setTo)
|
---|
371 | Q_PROPERTY(RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged)
|
---|
372 |
|
---|
373 | public:
|
---|
374 | QDeclarativeRotationAnimation(QObject *parent=0);
|
---|
375 | virtual ~QDeclarativeRotationAnimation();
|
---|
376 |
|
---|
377 | qreal from() const;
|
---|
378 | void setFrom(qreal);
|
---|
379 |
|
---|
380 | qreal to() const;
|
---|
381 | void setTo(qreal);
|
---|
382 |
|
---|
383 | enum RotationDirection { Numerical, Shortest, Clockwise, Counterclockwise };
|
---|
384 | RotationDirection direction() const;
|
---|
385 | void setDirection(RotationDirection direction);
|
---|
386 |
|
---|
387 | Q_SIGNALS:
|
---|
388 | void directionChanged();
|
---|
389 | };
|
---|
390 |
|
---|
391 | class QDeclarativeAnimationGroupPrivate;
|
---|
392 | class Q_AUTOTEST_EXPORT QDeclarativeAnimationGroup : public QDeclarativeAbstractAnimation
|
---|
393 | {
|
---|
394 | Q_OBJECT
|
---|
395 | Q_DECLARE_PRIVATE(QDeclarativeAnimationGroup)
|
---|
396 |
|
---|
397 | Q_CLASSINFO("DefaultProperty", "animations")
|
---|
398 | Q_PROPERTY(QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations READ animations)
|
---|
399 |
|
---|
400 | public:
|
---|
401 | QDeclarativeAnimationGroup(QObject *parent);
|
---|
402 | virtual ~QDeclarativeAnimationGroup();
|
---|
403 |
|
---|
404 | QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations();
|
---|
405 | friend class QDeclarativeAbstractAnimation;
|
---|
406 |
|
---|
407 | protected:
|
---|
408 | QDeclarativeAnimationGroup(QDeclarativeAnimationGroupPrivate &dd, QObject *parent);
|
---|
409 | };
|
---|
410 |
|
---|
411 | class QDeclarativeSequentialAnimation : public QDeclarativeAnimationGroup
|
---|
412 | {
|
---|
413 | Q_OBJECT
|
---|
414 | Q_DECLARE_PRIVATE(QDeclarativeAnimationGroup)
|
---|
415 |
|
---|
416 | public:
|
---|
417 | QDeclarativeSequentialAnimation(QObject *parent=0);
|
---|
418 | virtual ~QDeclarativeSequentialAnimation();
|
---|
419 |
|
---|
420 | protected:
|
---|
421 | virtual void transition(QDeclarativeStateActions &actions,
|
---|
422 | QDeclarativeProperties &modified,
|
---|
423 | TransitionDirection direction);
|
---|
424 | virtual QAbstractAnimation *qtAnimation();
|
---|
425 | };
|
---|
426 |
|
---|
427 | class QDeclarativeParallelAnimation : public QDeclarativeAnimationGroup
|
---|
428 | {
|
---|
429 | Q_OBJECT
|
---|
430 | Q_DECLARE_PRIVATE(QDeclarativeAnimationGroup)
|
---|
431 |
|
---|
432 | public:
|
---|
433 | QDeclarativeParallelAnimation(QObject *parent=0);
|
---|
434 | virtual ~QDeclarativeParallelAnimation();
|
---|
435 |
|
---|
436 | protected:
|
---|
437 | virtual void transition(QDeclarativeStateActions &actions,
|
---|
438 | QDeclarativeProperties &modified,
|
---|
439 | TransitionDirection direction);
|
---|
440 | virtual QAbstractAnimation *qtAnimation();
|
---|
441 | };
|
---|
442 |
|
---|
443 | class QDeclarativeParentAnimationPrivate;
|
---|
444 | class QDeclarativeParentAnimation : public QDeclarativeAnimationGroup
|
---|
445 | {
|
---|
446 | Q_OBJECT
|
---|
447 | Q_DECLARE_PRIVATE(QDeclarativeParentAnimation)
|
---|
448 |
|
---|
449 | Q_PROPERTY(QDeclarativeItem *target READ target WRITE setTarget NOTIFY targetChanged)
|
---|
450 | Q_PROPERTY(QDeclarativeItem *newParent READ newParent WRITE setNewParent NOTIFY newParentChanged)
|
---|
451 | Q_PROPERTY(QDeclarativeItem *via READ via WRITE setVia NOTIFY viaChanged)
|
---|
452 |
|
---|
453 | public:
|
---|
454 | QDeclarativeParentAnimation(QObject *parent=0);
|
---|
455 | virtual ~QDeclarativeParentAnimation();
|
---|
456 |
|
---|
457 | QDeclarativeItem *target() const;
|
---|
458 | void setTarget(QDeclarativeItem *);
|
---|
459 |
|
---|
460 | QDeclarativeItem *newParent() const;
|
---|
461 | void setNewParent(QDeclarativeItem *);
|
---|
462 |
|
---|
463 | QDeclarativeItem *via() const;
|
---|
464 | void setVia(QDeclarativeItem *);
|
---|
465 |
|
---|
466 | Q_SIGNALS:
|
---|
467 | void targetChanged();
|
---|
468 | void newParentChanged();
|
---|
469 | void viaChanged();
|
---|
470 |
|
---|
471 | protected:
|
---|
472 | virtual void transition(QDeclarativeStateActions &actions,
|
---|
473 | QDeclarativeProperties &modified,
|
---|
474 | TransitionDirection direction);
|
---|
475 | virtual QAbstractAnimation *qtAnimation();
|
---|
476 | };
|
---|
477 |
|
---|
478 | class QDeclarativeAnchorAnimationPrivate;
|
---|
479 | class QDeclarativeAnchorAnimation : public QDeclarativeAbstractAnimation
|
---|
480 | {
|
---|
481 | Q_OBJECT
|
---|
482 | Q_DECLARE_PRIVATE(QDeclarativeAnchorAnimation)
|
---|
483 | Q_PROPERTY(QDeclarativeListProperty<QDeclarativeItem> targets READ targets)
|
---|
484 | Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
|
---|
485 | Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
|
---|
486 |
|
---|
487 | public:
|
---|
488 | QDeclarativeAnchorAnimation(QObject *parent=0);
|
---|
489 | virtual ~QDeclarativeAnchorAnimation();
|
---|
490 |
|
---|
491 | QDeclarativeListProperty<QDeclarativeItem> targets();
|
---|
492 |
|
---|
493 | int duration() const;
|
---|
494 | void setDuration(int);
|
---|
495 |
|
---|
496 | QEasingCurve easing() const;
|
---|
497 | void setEasing(const QEasingCurve &);
|
---|
498 |
|
---|
499 | Q_SIGNALS:
|
---|
500 | void durationChanged(int);
|
---|
501 | void easingChanged(const QEasingCurve&);
|
---|
502 |
|
---|
503 | protected:
|
---|
504 | virtual void transition(QDeclarativeStateActions &actions,
|
---|
505 | QDeclarativeProperties &modified,
|
---|
506 | TransitionDirection direction);
|
---|
507 | virtual QAbstractAnimation *qtAnimation();
|
---|
508 | };
|
---|
509 |
|
---|
510 | QT_END_NAMESPACE
|
---|
511 |
|
---|
512 | QML_DECLARE_TYPE(QDeclarativeAbstractAnimation)
|
---|
513 | QML_DECLARE_TYPE(QDeclarativePauseAnimation)
|
---|
514 | QML_DECLARE_TYPE(QDeclarativeScriptAction)
|
---|
515 | QML_DECLARE_TYPE(QDeclarativePropertyAction)
|
---|
516 | QML_DECLARE_TYPE(QDeclarativePropertyAnimation)
|
---|
517 | QML_DECLARE_TYPE(QDeclarativeColorAnimation)
|
---|
518 | QML_DECLARE_TYPE(QDeclarativeNumberAnimation)
|
---|
519 | QML_DECLARE_TYPE(QDeclarativeSequentialAnimation)
|
---|
520 | QML_DECLARE_TYPE(QDeclarativeParallelAnimation)
|
---|
521 | QML_DECLARE_TYPE(QDeclarativeVector3dAnimation)
|
---|
522 | QML_DECLARE_TYPE(QDeclarativeRotationAnimation)
|
---|
523 | QML_DECLARE_TYPE(QDeclarativeParentAnimation)
|
---|
524 | QML_DECLARE_TYPE(QDeclarativeAnchorAnimation)
|
---|
525 |
|
---|
526 | QT_END_HEADER
|
---|
527 |
|
---|
528 | #endif // QDECLARATIVEANIMATION_H
|
---|