Remove "All rights reserved" line from license headers.
[profile/ivi/qtdeclarative.git] / src / qtquick1 / util / qdeclarativestateoperations_p.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the QtDeclarative module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
20 **
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
28 **
29 ** Other Usage
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #ifndef QDECLARATIVESTATEOPERATIONS_H
43 #define QDECLARATIVESTATEOPERATIONS_H
44
45 #include "QtQuick1/private/qdeclarativestate_p.h"
46
47 #include <QtQuick1/qdeclarativeitem.h>
48 #include <QtQuick1/private/qdeclarativeanchors_p.h>
49 #include <QtDeclarative/qdeclarativescriptstring.h>
50
51 QT_BEGIN_HEADER
52
53 QT_BEGIN_NAMESPACE
54
55
56 class QDeclarative1ParentChangePrivate;
57 class Q_AUTOTEST_EXPORT QDeclarative1ParentChange : public QDeclarative1StateOperation, public QDeclarative1ActionEvent
58 {
59     Q_OBJECT
60     Q_DECLARE_PRIVATE(QDeclarative1ParentChange)
61
62     Q_PROPERTY(QDeclarativeItem *target READ object WRITE setObject)
63     Q_PROPERTY(QDeclarativeItem *parent READ parent WRITE setParent)
64     Q_PROPERTY(QDeclarativeScriptString x READ x WRITE setX)
65     Q_PROPERTY(QDeclarativeScriptString y READ y WRITE setY)
66     Q_PROPERTY(QDeclarativeScriptString width READ width WRITE setWidth)
67     Q_PROPERTY(QDeclarativeScriptString height READ height WRITE setHeight)
68     Q_PROPERTY(QDeclarativeScriptString scale READ scale WRITE setScale)
69     Q_PROPERTY(QDeclarativeScriptString rotation READ rotation WRITE setRotation)
70 public:
71     QDeclarative1ParentChange(QObject *parent=0);
72     ~QDeclarative1ParentChange();
73
74     QDeclarativeItem *object() const;
75     void setObject(QDeclarativeItem *);
76
77     QDeclarativeItem *parent() const;
78     void setParent(QDeclarativeItem *);
79
80     QDeclarativeItem *originalParent() const;
81
82     QDeclarativeScriptString x() const;
83     void setX(QDeclarativeScriptString x);
84     bool xIsSet() const;
85
86     QDeclarativeScriptString y() const;
87     void setY(QDeclarativeScriptString y);
88     bool yIsSet() const;
89
90     QDeclarativeScriptString width() const;
91     void setWidth(QDeclarativeScriptString width);
92     bool widthIsSet() const;
93
94     QDeclarativeScriptString height() const;
95     void setHeight(QDeclarativeScriptString height);
96     bool heightIsSet() const;
97
98     QDeclarativeScriptString scale() const;
99     void setScale(QDeclarativeScriptString scale);
100     bool scaleIsSet() const;
101
102     QDeclarativeScriptString rotation() const;
103     void setRotation(QDeclarativeScriptString rotation);
104     bool rotationIsSet() const;
105
106     virtual ActionList actions();
107
108     virtual void saveOriginals();
109     //virtual void copyOriginals(QDeclarative1ActionEvent*);
110     virtual void execute(Reason reason = ActualChange);
111     virtual bool isReversable();
112     virtual void reverse(Reason reason = ActualChange);
113     virtual QString typeName() const;
114     virtual bool override(QDeclarative1ActionEvent*other);
115     virtual void rewind();
116     virtual void saveCurrentValues();
117 };
118
119 class QDeclarative1StateChangeScriptPrivate;
120 class Q_AUTOTEST_EXPORT QDeclarative1StateChangeScript : public QDeclarative1StateOperation, public QDeclarative1ActionEvent
121 {
122     Q_OBJECT
123     Q_DECLARE_PRIVATE(QDeclarative1StateChangeScript)
124
125     Q_PROPERTY(QDeclarativeScriptString script READ script WRITE setScript)
126     Q_PROPERTY(QString name READ name WRITE setName)
127
128 public:
129     QDeclarative1StateChangeScript(QObject *parent=0);
130     ~QDeclarative1StateChangeScript();
131
132     virtual ActionList actions();
133
134     virtual QString typeName() const;
135
136     QDeclarativeScriptString script() const;
137     void setScript(const QDeclarativeScriptString &);
138     
139     QString name() const;
140     void setName(const QString &);
141
142     virtual void execute(Reason reason = ActualChange);
143 };
144
145 class QDeclarative1AnchorChanges;
146 class QDeclarative1AnchorSetPrivate;
147 class Q_AUTOTEST_EXPORT QDeclarative1AnchorSet : public QObject
148 {
149     Q_OBJECT
150
151     Q_PROPERTY(QDeclarativeScriptString left READ left WRITE setLeft RESET resetLeft)
152     Q_PROPERTY(QDeclarativeScriptString right READ right WRITE setRight RESET resetRight)
153     Q_PROPERTY(QDeclarativeScriptString horizontalCenter READ horizontalCenter WRITE setHorizontalCenter RESET resetHorizontalCenter)
154     Q_PROPERTY(QDeclarativeScriptString top READ top WRITE setTop RESET resetTop)
155     Q_PROPERTY(QDeclarativeScriptString bottom READ bottom WRITE setBottom RESET resetBottom)
156     Q_PROPERTY(QDeclarativeScriptString verticalCenter READ verticalCenter WRITE setVerticalCenter RESET resetVerticalCenter)
157     Q_PROPERTY(QDeclarativeScriptString baseline READ baseline WRITE setBaseline RESET resetBaseline)
158     //Q_PROPERTY(QDeclarativeItem *fill READ fill WRITE setFill RESET resetFill)
159     //Q_PROPERTY(QDeclarativeItem *centerIn READ centerIn WRITE setCenterIn RESET resetCenterIn)
160
161     /*Q_PROPERTY(qreal margins READ margins WRITE setMargins NOTIFY marginsChanged)
162     Q_PROPERTY(qreal leftMargin READ leftMargin WRITE setLeftMargin NOTIFY leftMarginChanged)
163     Q_PROPERTY(qreal rightMargin READ rightMargin WRITE setRightMargin NOTIFY rightMarginChanged)
164     Q_PROPERTY(qreal horizontalCenterOffset READ horizontalCenterOffset WRITE setHorizontalCenterOffset NOTIFY horizontalCenterOffsetChanged())
165     Q_PROPERTY(qreal topMargin READ topMargin WRITE setTopMargin NOTIFY topMarginChanged)
166     Q_PROPERTY(qreal bottomMargin READ bottomMargin WRITE setBottomMargin NOTIFY bottomMarginChanged)
167     Q_PROPERTY(qreal verticalCenterOffset READ verticalCenterOffset WRITE setVerticalCenterOffset NOTIFY verticalCenterOffsetChanged())
168     Q_PROPERTY(qreal baselineOffset READ baselineOffset WRITE setBaselineOffset NOTIFY baselineOffsetChanged())*/
169
170 public:
171     QDeclarative1AnchorSet(QObject *parent=0);
172     virtual ~QDeclarative1AnchorSet();
173
174     QDeclarativeScriptString left() const;
175     void setLeft(const QDeclarativeScriptString &edge);
176     void resetLeft();
177
178     QDeclarativeScriptString right() const;
179     void setRight(const QDeclarativeScriptString &edge);
180     void resetRight();
181
182     QDeclarativeScriptString horizontalCenter() const;
183     void setHorizontalCenter(const QDeclarativeScriptString &edge);
184     void resetHorizontalCenter();
185
186     QDeclarativeScriptString top() const;
187     void setTop(const QDeclarativeScriptString &edge);
188     void resetTop();
189
190     QDeclarativeScriptString bottom() const;
191     void setBottom(const QDeclarativeScriptString &edge);
192     void resetBottom();
193
194     QDeclarativeScriptString verticalCenter() const;
195     void setVerticalCenter(const QDeclarativeScriptString &edge);
196     void resetVerticalCenter();
197
198     QDeclarativeScriptString baseline() const;
199     void setBaseline(const QDeclarativeScriptString &edge);
200     void resetBaseline();
201
202     QDeclarativeItem *fill() const;
203     void setFill(QDeclarativeItem *);
204     void resetFill();
205
206     QDeclarativeItem *centerIn() const;
207     void setCenterIn(QDeclarativeItem *);
208     void resetCenterIn();
209
210     /*qreal leftMargin() const;
211     void setLeftMargin(qreal);
212
213     qreal rightMargin() const;
214     void setRightMargin(qreal);
215
216     qreal horizontalCenterOffset() const;
217     void setHorizontalCenterOffset(qreal);
218
219     qreal topMargin() const;
220     void setTopMargin(qreal);
221
222     qreal bottomMargin() const;
223     void setBottomMargin(qreal);
224
225     qreal margins() const;
226     void setMargins(qreal);
227
228     qreal verticalCenterOffset() const;
229     void setVerticalCenterOffset(qreal);
230
231     qreal baselineOffset() const;
232     void setBaselineOffset(qreal);*/
233
234     QDeclarative1Anchors::Anchors usedAnchors() const;
235
236 /*Q_SIGNALS:
237     void leftMarginChanged();
238     void rightMarginChanged();
239     void topMarginChanged();
240     void bottomMarginChanged();
241     void marginsChanged();
242     void verticalCenterOffsetChanged();
243     void horizontalCenterOffsetChanged();
244     void baselineOffsetChanged();*/
245
246 private:
247     friend class QDeclarative1AnchorChanges;
248     Q_DISABLE_COPY(QDeclarative1AnchorSet)
249     Q_DECLARE_PRIVATE(QDeclarative1AnchorSet)
250 };
251
252 class QDeclarative1AnchorChangesPrivate;
253 class Q_AUTOTEST_EXPORT QDeclarative1AnchorChanges : public QDeclarative1StateOperation, public QDeclarative1ActionEvent
254 {
255     Q_OBJECT
256     Q_DECLARE_PRIVATE(QDeclarative1AnchorChanges)
257
258     Q_PROPERTY(QDeclarativeItem *target READ object WRITE setObject)
259     Q_PROPERTY(QDeclarative1AnchorSet *anchors READ anchors CONSTANT)
260
261 public:
262     QDeclarative1AnchorChanges(QObject *parent=0);
263     ~QDeclarative1AnchorChanges();
264
265     virtual ActionList actions();
266
267     QDeclarative1AnchorSet *anchors();
268
269     QDeclarativeItem *object() const;
270     void setObject(QDeclarativeItem *);
271
272     virtual void execute(Reason reason = ActualChange);
273     virtual bool isReversable();
274     virtual void reverse(Reason reason = ActualChange);
275     virtual QString typeName() const;
276     virtual bool override(QDeclarative1ActionEvent*other);
277     virtual bool changesBindings();
278     virtual void saveOriginals();
279     virtual bool needsCopy() { return true; }
280     virtual void copyOriginals(QDeclarative1ActionEvent*);
281     virtual void clearBindings();
282     virtual void rewind();
283     virtual void saveCurrentValues();
284
285     QList<QDeclarative1Action> additionalActions();
286     virtual void saveTargetValues();
287 };
288
289 QT_END_NAMESPACE
290
291 QML_DECLARE_TYPE(QDeclarative1ParentChange)
292 QML_DECLARE_TYPE(QDeclarative1StateChangeScript)
293 QML_DECLARE_TYPE(QDeclarative1AnchorSet)
294 QML_DECLARE_TYPE(QDeclarative1AnchorChanges)
295
296 QT_END_HEADER
297
298 #endif // QDECLARATIVESTATEOPERATIONS_H