Qt 4.8
qdeclarativedom_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 QDECLARATIVEDOM_P_H
43 #define QDECLARATIVEDOM_P_H
44 
45 //
46 // W A R N I N G
47 // -------------
48 //
49 // This file is not part of the Qt API. It exists purely as an
50 // implementation detail. This header file may change from version to
51 // version without notice, or even be removed.
52 //
53 // We mean it.
54 //
55 
56 #include "qdeclarativeerror.h"
57 
58 #include <QtCore/qlist.h>
59 #include <QtCore/qshareddata.h>
60 
61 #include <private/qdeclarativeglobal_p.h>
62 
64 
66 
67 QT_MODULE(Declarative)
68 
69 class QString;
70 class QByteArray;
74 class QDeclarativeEngine;
77 class QIODevice;
78 
80 
82 {
83 public:
88 
89  QList<QDeclarativeDomImport> imports() const;
90 
91  QList<QDeclarativeError> errors() const;
92  bool load(QDeclarativeEngine *, const QByteArray &, const QUrl & = QUrl());
93 
95 
96 private:
98 };
99 
102 {
103 public:
108 
109  bool isValid() const;
110 
111  QByteArray propertyName() const;
112  QList<QByteArray> propertyNameParts() const;
113 
114  bool isDefaultProperty() const;
115 
116  QDeclarativeDomValue value() const;
117 
118  int position() const;
119  int length() const;
120 
121 private:
122  friend class QDeclarativeDomObject;
125 };
126 
129 {
130 public:
135 
136  bool isValid() const;
137 
138  QByteArray propertyName() const;
139  int propertyType() const;
140  QByteArray propertyTypeName() const;
141 
142  bool isDefaultProperty() const;
143  QDeclarativeDomProperty defaultValue() const;
144 
145  bool isAlias() const;
146 
147  int position() const;
148  int length() const;
149 
150 private:
151  friend class QDeclarativeDomObject;
153 };
154 
157 {
158 public:
162  QDeclarativeDomObject &operator=(const QDeclarativeDomObject &);
163 
164  bool isValid() const;
165 
166  QByteArray objectType() const;
167  QByteArray objectClassName() const;
168 
169  int objectTypeMajorVersion() const;
170  int objectTypeMinorVersion() const;
171 
172  QString objectId() const;
173 
176 
177  QList<QDeclarativeDomDynamicProperty> dynamicProperties() const;
178  QDeclarativeDomDynamicProperty dynamicProperty(const QByteArray &) const;
179 
180  bool isCustomType() const;
181  QByteArray customTypeData() const;
182 
183  bool isComponent() const;
184  QDeclarativeDomComponent toComponent() const;
185 
186  int position() const;
187  int length() const;
188 
189  QUrl url() const;
190 private:
193  friend class QDeclarativeDomValue;
197 };
198 
202 {
203 public:
208 
209  QString literal() const;
210 
211 private:
212  friend class QDeclarativeDomValue;
214 };
215 
217 {
218 public:
223 
224  QString binding() const;
225 
226 private:
227  friend class QDeclarativeDomValue;
229 };
230 
232 {
233 public:
238 
239  QDeclarativeDomObject object() const;
240 
241 private:
242  friend class QDeclarativeDomValue;
244 };
245 
247 {
248 public:
253 
254  QDeclarativeDomObject object() const;
255 
256 private:
257  friend class QDeclarativeDomValue;
259 };
260 
261 
263 {
264 public:
269 
270  QDeclarativeDomObject componentRoot() const;
271 };
272 
274 {
275 public:
276  enum Type {
283  List
284  };
285 
289  QDeclarativeDomValue &operator=(const QDeclarativeDomValue &);
290 
291  Type type() const;
292 
293  bool isInvalid() const;
294  bool isLiteral() const;
295  bool isBinding() const;
296  bool isValueSource() const;
297  bool isValueInterceptor() const;
298  bool isObject() const;
299  bool isList() const;
300 
301  QDeclarativeDomValueLiteral toLiteral() const;
302  QDeclarativeDomValueBinding toBinding() const;
303  QDeclarativeDomValueValueSource toValueSource() const;
304  QDeclarativeDomValueValueInterceptor toValueInterceptor() const;
305  QDeclarativeDomObject toObject() const;
306  QDeclarativeDomList toList() const;
307 
308  int position() const;
309  int length() const;
310 
311 private:
313  friend class QDeclarativeDomList;
315 };
316 
318 {
319 public:
323  QDeclarativeDomList &operator=(const QDeclarativeDomList &);
324 
326 
327  int position() const;
328  int length() const;
329 
330  QList<int> commaPositions() const;
331 
332 private:
333  friend class QDeclarativeDomValue;
335 };
336 
339 {
340 public:
341  enum Type { Library, File };
342 
346  QDeclarativeDomImport &operator=(const QDeclarativeDomImport &);
347 
348  Type type() const;
349  QString uri() const;
350  QString version() const;
351  QString qualifier() const;
352 
353 private:
356 };
357 
359 
361 
362 #endif // QDECLARATIVEDOM_P_H
Type
The type of the QDeclarativeDomValue node.
The QDeclarativeDomProperty class represents one property assignment in the QML DOM tree...
int type
Definition: qmetatype.cpp:239
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
#define QT_MODULE(x)
Definition: qglobal.h:2783
The QDeclarativeDomImport class represents an import statement.
The QDeclarativeDomList class represents a list of values assigned to a QML property.
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
QSharedDataPointer< QDeclarativeDomImportPrivate > d
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QSharedDataPointer< QDeclarativeDomValuePrivate > d
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
The QDeclarativeDomDocument class represents the root of a QML document.
static QObject * rootObject
The QUrl class provides a convenient interface for working with URLs.
Definition: qurl.h:61
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QDeclarativeDomValueBinding class represents a property binding.
static QList< QVariant > toList(char **buf, int count, T *=0)
Definition: qsql_ibase.cpp:472
The QDeclarativeDomValue class represents a generic Qml value.
The QDeclarativeDomComponent class represents sub-component within a QML document.
QSharedDataPointer< QDeclarativeDomObjectPrivate > d
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
QSharedDataPointer< QDeclarativeDomValuePrivate > d
QSharedDataPointer< QDeclarativeDomDocumentPrivate > d
#define Q_DECLARATIVE_PRIVATE_EXPORT
quint16 values[128]
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d
QSharedDataPointer< QDeclarativeDomPropertyPrivate > d
friend class QDeclarativeDomComponent
#define load(x)
The QDeclarativeEngine class provides an environment for instantiating QML components.
The QDeclarativeDomValueLiteral class represents a literal value.
The QDeclarativeDomValueValueInterceptor class represents a value interceptor assignment value...
QDeclarativeDomObject & operator=(const QDeclarativeDomObject &)
Assign other to this QDeclarativeDomObject.
QSharedDataPointer< QDeclarativeDomDynamicPropertyPrivate > d
const char * property
Definition: qwizard.cpp:138
The QDeclarativeDomObject class represents an object instantiation.
static const QCssKnownValue properties[NumProperties - 1]
Definition: qcssparser.cpp:67
The QDeclarativeDomValueValueSource class represents a value source assignment value.
The QIODevice class is the base interface class of all I/O devices in Qt.
Definition: qiodevice.h:66
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d
#define QT_END_HEADER
Definition: qglobal.h:137
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d
QSharedDataPointer< QDeclarativeDomBasicValuePrivate > d