1 // Commit: e39a2e39451bf106a9845f8a60fc571faaa4dde5
2 /****************************************************************************
4 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 ** All rights reserved.
6 ** Contact: Nokia Corporation (qt-info@nokia.com)
8 ** This file is part of the QtDeclarative module of the Qt Toolkit.
10 ** $QT_BEGIN_LICENSE:LGPL$
11 ** No Commercial Usage
12 ** This file contains pre-release code and may not be distributed.
13 ** You may use this file in accordance with the terms and conditions
14 ** contained in the Technology Preview License Agreement accompanying
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, Nokia gives you certain additional
26 ** rights. These rights are described in the Nokia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** If you have questions regarding the use of this file, please contact
30 ** Nokia at qt-info@nokia.com.
41 ****************************************************************************/
43 #ifndef QSGANIMATION_H
44 #define QSGANIMATION_H
48 #include <private/qdeclarativeanimation_p.h>
50 #include <QtCore/qabstractanimation.h>
56 QT_MODULE(Declarative)
58 class QSGParentAnimationPrivate;
59 class QSGParentAnimation : public QDeclarativeAnimationGroup
62 Q_DECLARE_PRIVATE(QSGParentAnimation)
64 Q_PROPERTY(QSGItem *target READ target WRITE setTarget NOTIFY targetChanged)
65 Q_PROPERTY(QSGItem *newParent READ newParent WRITE setNewParent NOTIFY newParentChanged)
66 Q_PROPERTY(QSGItem *via READ via WRITE setVia NOTIFY viaChanged)
69 QSGParentAnimation(QObject *parent=0);
70 virtual ~QSGParentAnimation();
72 QSGItem *target() const;
73 void setTarget(QSGItem *);
75 QSGItem *newParent() const;
76 void setNewParent(QSGItem *);
79 void setVia(QSGItem *);
83 void newParentChanged();
87 virtual void transition(QDeclarativeStateActions &actions,
88 QDeclarativeProperties &modified,
89 TransitionDirection direction);
90 virtual QAbstractAnimation *qtAnimation();
93 class QSGAnchorAnimationPrivate;
94 class QSGAnchorAnimation : public QDeclarativeAbstractAnimation
97 Q_DECLARE_PRIVATE(QSGAnchorAnimation)
98 Q_PROPERTY(QDeclarativeListProperty<QSGItem> targets READ targets)
99 Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged)
100 Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged)
103 QSGAnchorAnimation(QObject *parent=0);
104 virtual ~QSGAnchorAnimation();
106 QDeclarativeListProperty<QSGItem> targets();
108 int duration() const;
109 void setDuration(int);
111 QEasingCurve easing() const;
112 void setEasing(const QEasingCurve &);
115 void durationChanged(int);
116 void easingChanged(const QEasingCurve&);
119 virtual void transition(QDeclarativeStateActions &actions,
120 QDeclarativeProperties &modified,
121 TransitionDirection direction);
122 virtual QAbstractAnimation *qtAnimation();
127 QML_DECLARE_TYPE(QSGParentAnimation)
128 QML_DECLARE_TYPE(QSGAnchorAnimation)
132 #endif // QSGANIMATION_H