1 // Commit: e39a2e39451bf106a9845f8a60fc571faaa4dde5
2 /****************************************************************************
4 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
5 ** All rights reserved.
6 ** Contact: http://www.qt-project.org/
8 ** This file is part of the QtDeclarative module of the Qt Toolkit.
10 ** $QT_BEGIN_LICENSE:LGPL$
11 ** GNU Lesser General Public License Usage
12 ** This file may be used under the terms of the GNU Lesser General Public
13 ** License version 2.1 as published by the Free Software Foundation and
14 ** appearing in the file LICENSE.LGPL included in the packaging of this
15 ** file. Please review the following information to ensure the GNU Lesser
16 ** General Public License version 2.1 requirements will be met:
17 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
19 ** In addition, as a special exception, Nokia gives you certain additional
20 ** rights. These rights are described in the Nokia Qt LGPL Exception
21 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
23 ** GNU General Public License Usage
24 ** Alternatively, this file may be used under the terms of the GNU General
25 ** Public License version 3.0 as published by the Free Software Foundation
26 ** and appearing in the file LICENSE.GPL included in the packaging of this
27 ** file. Please review the following information to ensure the GNU General
28 ** Public License version 3.0 requirements will be met:
29 ** http://www.gnu.org/copyleft/gpl.html.
32 ** Alternatively, this file may be used in accordance with the terms and
33 ** conditions contained in a signed written agreement between you and Nokia.
41 ****************************************************************************/
43 #ifndef QQUICKANIMATION_H
44 #define QQUICKANIMATION_H
46 #include "qquickitem.h"
48 #include <QtQuick/private/qdeclarativeanimation_p.h>
50 #include <QtCore/qabstractanimation.h>
56 class QQuickParentAnimationPrivate;
57 class QQuickParentAnimation : public QDeclarativeAnimationGroup
60 Q_DECLARE_PRIVATE(QQuickParentAnimation)
62 Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged)
63 Q_PROPERTY(QQuickItem *newParent READ newParent WRITE setNewParent NOTIFY newParentChanged)
64 Q_PROPERTY(QQuickItem *via READ via WRITE setVia NOTIFY viaChanged)
67 QQuickParentAnimation(QObject *parent=0);
68 virtual ~QQuickParentAnimation();
70 QQuickItem *target() const;
71 void setTarget(QQuickItem *);
73 QQuickItem *newParent() const;
74 void setNewParent(QQuickItem *);
76 QQuickItem *via() const;
77 void setVia(QQuickItem *);
81 void newParentChanged();
85 virtual void transition(QDeclarativeStateActions &actions,
86 QDeclarativeProperties &modified,
87 TransitionDirection direction);
88 virtual QAbstractAnimation *qtAnimation();
91 class QQuickAnchorAnimationPrivate;
92 class QQuickAnchorAnimation : public QDeclarativeAbstractAnimation
95 Q_DECLARE_PRIVATE(QQuickAnchorAnimation)
96 Q_PROPERTY(QDeclarativeListProperty<QQuickItem> targets READ targets)
97 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
98 Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
101 QQuickAnchorAnimation(QObject *parent=0);
102 virtual ~QQuickAnchorAnimation();
104 QDeclarativeListProperty<QQuickItem> targets();
106 int duration() const;
107 void setDuration(int);
109 QEasingCurve easing() const;
110 void setEasing(const QEasingCurve &);
113 void durationChanged(int);
114 void easingChanged(const QEasingCurve&);
117 virtual void transition(QDeclarativeStateActions &actions,
118 QDeclarativeProperties &modified,
119 TransitionDirection direction);
120 virtual QAbstractAnimation *qtAnimation();
124 class QDeclarativePath;
125 class QQuickPathAnimationPrivate;
126 class Q_AUTOTEST_EXPORT QQuickPathAnimation : public QDeclarativeAbstractAnimation
129 Q_DECLARE_PRIVATE(QQuickPathAnimation)
131 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
132 Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
133 Q_PROPERTY(QDeclarativePath *path READ path WRITE setPath NOTIFY pathChanged)
134 Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged)
135 Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
136 Q_PROPERTY(QPointF anchorPoint READ anchorPoint WRITE setAnchorPoint NOTIFY anchorPointChanged)
137 Q_PROPERTY(int orientationEntryDuration READ orientationEntryDuration WRITE setOrientationEntryDuration NOTIFY orientationEntryDurationChanged)
138 Q_PROPERTY(int orientationExitDuration READ orientationExitDuration WRITE setOrientationExitDuration NOTIFY orientationExitDurationChanged)
139 Q_PROPERTY(qreal endRotation READ endRotation WRITE setEndRotation NOTIFY endRotationChanged)
142 QQuickPathAnimation(QObject *parent=0);
143 virtual ~QQuickPathAnimation();
154 int duration() const;
155 void setDuration(int);
157 QEasingCurve easing() const;
158 void setEasing(const QEasingCurve &);
160 QDeclarativePath *path() const;
161 void setPath(QDeclarativePath *);
163 QQuickItem *target() const;
164 void setTarget(QQuickItem *);
166 Orientation orientation() const;
167 void setOrientation(Orientation orientation);
169 QPointF anchorPoint() const;
170 void setAnchorPoint(const QPointF &point);
172 int orientationEntryDuration() const;
173 void setOrientationEntryDuration(int);
175 int orientationExitDuration() const;
176 void setOrientationExitDuration(int);
178 qreal endRotation() const;
179 void setEndRotation(qreal);
182 virtual void transition(QDeclarativeStateActions &actions,
183 QDeclarativeProperties &modified,
184 TransitionDirection direction);
185 virtual QAbstractAnimation *qtAnimation();
188 void durationChanged(int);
189 void easingChanged(const QEasingCurve &);
191 void targetChanged();
192 void orientationChanged(Orientation);
193 void anchorPointChanged(const QPointF &);
194 void orientationEntryDurationChanged(qreal);
195 void orientationExitDurationChanged(qreal);
196 void endRotationChanged(qreal);
201 QML_DECLARE_TYPE(QQuickParentAnimation)
202 QML_DECLARE_TYPE(QQuickAnchorAnimation)
203 QML_DECLARE_TYPE(QQuickPathAnimation)
207 #endif // QQUICKANIMATION_H