Qt 4.8
qdeclarativestateoperations_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtDeclarative module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
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.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QDECLARATIVESTATEOPERATIONS_H
43 #define QDECLARATIVESTATEOPERATIONS_H
44 
45 #include "private/qdeclarativestate_p.h"
46 
47 #include <qdeclarativeitem.h>
48 #include <private/qdeclarativeanchors_p.h>
50 
52 
54 
55 QT_MODULE(Declarative)
56 
57 #ifdef Q_OS_WINCE
58 // qgraphicsitem.h includes qfunctions_wince.h.
59 // qfunctions_wince.h defines a missing posix rewind for WinCE,
60 // but this conflicts with rewind method defined in this class.
61 // As a workaround we undefine WinCE posix replacement for rewind here.
62 # undef rewind
63 #endif
64 
67 {
68  Q_OBJECT
70 
79 public:
82 
83  QDeclarativeItem *object() const;
84  void setObject(QDeclarativeItem *);
85 
86  QDeclarativeItem *parent() const;
87  void setParent(QDeclarativeItem *);
88 
89  QDeclarativeItem *originalParent() const;
90 
91  QDeclarativeScriptString x() const;
92  void setX(QDeclarativeScriptString x);
93  bool xIsSet() const;
94 
95  QDeclarativeScriptString y() const;
96  void setY(QDeclarativeScriptString y);
97  bool yIsSet() const;
98 
99  QDeclarativeScriptString width() const;
100  void setWidth(QDeclarativeScriptString width);
101  bool widthIsSet() const;
102 
103  QDeclarativeScriptString height() const;
104  void setHeight(QDeclarativeScriptString height);
105  bool heightIsSet() const;
106 
107  QDeclarativeScriptString scale() const;
108  void setScale(QDeclarativeScriptString scale);
109  bool scaleIsSet() const;
110 
111  QDeclarativeScriptString rotation() const;
112  void setRotation(QDeclarativeScriptString rotation);
113  bool rotationIsSet() const;
114 
115  virtual ActionList actions();
116 
117  virtual void saveOriginals();
118  //virtual void copyOriginals(QDeclarativeActionEvent*);
119  virtual void execute(Reason reason = ActualChange);
120  virtual bool isReversable();
121  virtual void reverse(Reason reason = ActualChange);
122  virtual QString typeName() const;
123  virtual bool override(QDeclarativeActionEvent*other);
124  virtual void rewind();
125  virtual void saveCurrentValues();
126 };
127 
130 {
131  Q_OBJECT
133 
136 
137 public:
140 
141  virtual ActionList actions();
142 
143  virtual QString typeName() const;
144 
145  QDeclarativeScriptString script() const;
146  void setScript(const QDeclarativeScriptString &);
147 
148  QString name() const;
149  void setName(const QString &);
150 
151  virtual void execute(Reason reason = ActualChange);
152 };
153 
157 {
158  Q_OBJECT
159 
160  QDeclarativeScriptString left;
161  QDeclarativeScriptString right;
162  QDeclarativeScriptString horizontalCenter;
163  QDeclarativeScriptString top;
164  QDeclarativeScriptString bottom;
165  QDeclarativeScriptString verticalCenter;
166  QDeclarativeScriptString baseline;
167  //QDeclarativeItem *fill;
168  //QDeclarativeItem *centerIn;
169 
170  /*qreal margins;
171  qreal leftMargin;
172  qreal rightMargin;
173  qreal horizontalCenterOffset;)
174  qreal topMargin;
175  qreal bottomMargin;
176  qreal verticalCenterOffset;)
177  qreal baselineOffset;)*/
178 
179 public:
180  QDeclarativeAnchorSet(QObject *parent=0);
181  virtual ~QDeclarativeAnchorSet();
182 
183  QDeclarativeScriptString left() const;
184  void setLeft(const QDeclarativeScriptString &edge);
185  void resetLeft();
186 
187  QDeclarativeScriptString right() const;
188  void setRight(const QDeclarativeScriptString &edge);
189  void resetRight();
190 
191  QDeclarativeScriptString horizontalCenter() const;
192  void setHorizontalCenter(const QDeclarativeScriptString &edge);
193  void resetHorizontalCenter();
194 
195  QDeclarativeScriptString top() const;
196  void setTop(const QDeclarativeScriptString &edge);
197  void resetTop();
198 
199  QDeclarativeScriptString bottom() const;
200  void setBottom(const QDeclarativeScriptString &edge);
201  void resetBottom();
202 
203  QDeclarativeScriptString verticalCenter() const;
204  void setVerticalCenter(const QDeclarativeScriptString &edge);
205  void resetVerticalCenter();
206 
207  QDeclarativeScriptString baseline() const;
208  void setBaseline(const QDeclarativeScriptString &edge);
209  void resetBaseline();
210 
211  QDeclarativeItem *fill() const;
212  void setFill(QDeclarativeItem *);
213  void resetFill();
214 
215  QDeclarativeItem *centerIn() const;
216  void setCenterIn(QDeclarativeItem *);
217  void resetCenterIn();
218 
219  /*qreal leftMargin() const;
220  void setLeftMargin(qreal);
221 
222  qreal rightMargin() const;
223  void setRightMargin(qreal);
224 
225  qreal horizontalCenterOffset() const;
226  void setHorizontalCenterOffset(qreal);
227 
228  qreal topMargin() const;
229  void setTopMargin(qreal);
230 
231  qreal bottomMargin() const;
232  void setBottomMargin(qreal);
233 
234  qreal margins() const;
235  void setMargins(qreal);
236 
237  qreal verticalCenterOffset() const;
238  void setVerticalCenterOffset(qreal);
239 
240  qreal baselineOffset() const;
241  void setBaselineOffset(qreal);*/
242 
243  QDeclarativeAnchors::Anchors usedAnchors() const;
244 
245 /*Q_SIGNALS:
246  void leftMarginChanged();
247  void rightMarginChanged();
248  void topMarginChanged();
249  void bottomMarginChanged();
250  void marginsChanged();
251  void verticalCenterOffsetChanged();
252  void horizontalCenterOffsetChanged();
253  void baselineOffsetChanged();*/
254 
255 private:
256  friend class QDeclarativeAnchorChanges;
259 };
260 
263 {
264  Q_OBJECT
266 
269 
270 public:
273 
274  virtual ActionList actions();
275 
276  QDeclarativeAnchorSet *anchors();
277 
278  QDeclarativeItem *object() const;
279  void setObject(QDeclarativeItem *);
280 
281  virtual void execute(Reason reason = ActualChange);
282  virtual bool isReversable();
283  virtual void reverse(Reason reason = ActualChange);
284  virtual QString typeName() const;
285  virtual bool override(QDeclarativeActionEvent*other);
286  virtual bool changesBindings();
287  virtual void saveOriginals();
288  virtual bool needsCopy() { return true; }
289  virtual void copyOriginals(QDeclarativeActionEvent*);
290  virtual void clearBindings();
291  virtual void rewind();
292  virtual void saveCurrentValues();
293 
294  QList<QDeclarativeAction> additionalActions();
295  virtual void saveTargetValues();
296 };
297 
299 
304 
306 
307 #endif // QDECLARATIVESTATEOPERATIONS_H
QDeclarativeScriptString bottom
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_MODULE(x)
Definition: qglobal.h:2783
#define QML_DECLARE_TYPE(TYPE)
Definition: qdeclarative.h:56
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
static C reverse(const C &l)
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
Definition: qglobal.h:2523
The QString class provides a Unicode character string.
Definition: qstring.h:83
QDeclarativeScriptString horizontalCenter
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
QDeclarativeScriptString baseline
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
QDeclarativeScriptString verticalCenter
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
The QDeclarativeScriptString class encapsulates a script and its context.
The QDeclarativeItem class provides the most basic of all visual items in QML.
const char * typeName
Definition: qmetatype.cpp:239
const char * name
#define rewind(a)
#define Q_DECLARATIVE_PRIVATE_EXPORT
QDeclarativeScriptString right
Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4)
#define Q_OBJECT
Definition: qobjectdefs.h:157
#define Q_AUTOTEST_EXPORT
Definition: qglobal.h:1510
#define Q_DECLARE_PRIVATE(Class)
Definition: qglobal.h:2467
#define class
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
#define QT_END_HEADER
Definition: qglobal.h:137
virtual void copyOriginals(QDeclarativeActionEvent *)