1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation (qt-info@nokia.com)
|
---|
6 | **
|
---|
7 | ** This file is part of the QtDeclarative module of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
14 | ** a written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Lesser General Public License Usage
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
18 | ** General Public License version 2.1 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
20 | ** packaging of this file. Please review the following information to
|
---|
21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
23 | **
|
---|
24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
27 | **
|
---|
28 | ** GNU General Public License Usage
|
---|
29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
30 | ** General Public License version 3.0 as published by the Free Software
|
---|
31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
32 | ** packaging of this file. Please review the following information to
|
---|
33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
35 | **
|
---|
36 | ** If you have questions regarding the use of this file, please contact
|
---|
37 | ** Nokia at qt-info@nokia.com.
|
---|
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 |
|
---|
63 | QT_BEGIN_HEADER
|
---|
64 |
|
---|
65 | QT_BEGIN_NAMESPACE
|
---|
66 |
|
---|
67 | QT_MODULE(Declarative)
|
---|
68 |
|
---|
69 | class QString;
|
---|
70 | class QByteArray;
|
---|
71 | class QDeclarativeDomObject;
|
---|
72 | class QDeclarativeDomList;
|
---|
73 | class QDeclarativeDomValue;
|
---|
74 | class QDeclarativeEngine;
|
---|
75 | class QDeclarativeDomComponent;
|
---|
76 | class QDeclarativeDomImport;
|
---|
77 | class QIODevice;
|
---|
78 |
|
---|
79 | class QDeclarativeDomDocumentPrivate;
|
---|
80 |
|
---|
81 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomDocument
|
---|
82 | {
|
---|
83 | public:
|
---|
84 | QDeclarativeDomDocument();
|
---|
85 | QDeclarativeDomDocument(const QDeclarativeDomDocument &);
|
---|
86 | ~QDeclarativeDomDocument();
|
---|
87 | QDeclarativeDomDocument &operator=(const QDeclarativeDomDocument &);
|
---|
88 |
|
---|
89 | QList<QDeclarativeDomImport> imports() const;
|
---|
90 |
|
---|
91 | QList<QDeclarativeError> errors() const;
|
---|
92 | bool load(QDeclarativeEngine *, const QByteArray &, const QUrl & = QUrl());
|
---|
93 |
|
---|
94 | QDeclarativeDomObject rootObject() const;
|
---|
95 |
|
---|
96 | private:
|
---|
97 | QSharedDataPointer<QDeclarativeDomDocumentPrivate> d;
|
---|
98 | };
|
---|
99 |
|
---|
100 | class QDeclarativeDomPropertyPrivate;
|
---|
101 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomProperty
|
---|
102 | {
|
---|
103 | public:
|
---|
104 | QDeclarativeDomProperty();
|
---|
105 | QDeclarativeDomProperty(const QDeclarativeDomProperty &);
|
---|
106 | ~QDeclarativeDomProperty();
|
---|
107 | QDeclarativeDomProperty &operator=(const QDeclarativeDomProperty &);
|
---|
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;
|
---|
123 | friend class QDeclarativeDomDynamicProperty;
|
---|
124 | QSharedDataPointer<QDeclarativeDomPropertyPrivate> d;
|
---|
125 | };
|
---|
126 |
|
---|
127 | class QDeclarativeDomDynamicPropertyPrivate;
|
---|
128 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomDynamicProperty
|
---|
129 | {
|
---|
130 | public:
|
---|
131 | QDeclarativeDomDynamicProperty();
|
---|
132 | QDeclarativeDomDynamicProperty(const QDeclarativeDomDynamicProperty &);
|
---|
133 | ~QDeclarativeDomDynamicProperty();
|
---|
134 | QDeclarativeDomDynamicProperty &operator=(const QDeclarativeDomDynamicProperty &);
|
---|
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;
|
---|
152 | QSharedDataPointer<QDeclarativeDomDynamicPropertyPrivate> d;
|
---|
153 | };
|
---|
154 |
|
---|
155 | class QDeclarativeDomObjectPrivate;
|
---|
156 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomObject
|
---|
157 | {
|
---|
158 | public:
|
---|
159 | QDeclarativeDomObject();
|
---|
160 | QDeclarativeDomObject(const QDeclarativeDomObject &);
|
---|
161 | ~QDeclarativeDomObject();
|
---|
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 |
|
---|
174 | QList<QDeclarativeDomProperty> properties() const;
|
---|
175 | QDeclarativeDomProperty property(const QByteArray &) const;
|
---|
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:
|
---|
191 | friend class QDeclarativeDomDocument;
|
---|
192 | friend class QDeclarativeDomComponent;
|
---|
193 | friend class QDeclarativeDomValue;
|
---|
194 | friend class QDeclarativeDomValueValueSource;
|
---|
195 | friend class QDeclarativeDomValueValueInterceptor;
|
---|
196 | QSharedDataPointer<QDeclarativeDomObjectPrivate> d;
|
---|
197 | };
|
---|
198 |
|
---|
199 | class QDeclarativeDomValuePrivate;
|
---|
200 | class QDeclarativeDomBasicValuePrivate;
|
---|
201 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomValueLiteral
|
---|
202 | {
|
---|
203 | public:
|
---|
204 | QDeclarativeDomValueLiteral();
|
---|
205 | QDeclarativeDomValueLiteral(const QDeclarativeDomValueLiteral &);
|
---|
206 | ~QDeclarativeDomValueLiteral();
|
---|
207 | QDeclarativeDomValueLiteral &operator=(const QDeclarativeDomValueLiteral &);
|
---|
208 |
|
---|
209 | QString literal() const;
|
---|
210 |
|
---|
211 | private:
|
---|
212 | friend class QDeclarativeDomValue;
|
---|
213 | QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
|
---|
214 | };
|
---|
215 |
|
---|
216 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomValueBinding
|
---|
217 | {
|
---|
218 | public:
|
---|
219 | QDeclarativeDomValueBinding();
|
---|
220 | QDeclarativeDomValueBinding(const QDeclarativeDomValueBinding &);
|
---|
221 | ~QDeclarativeDomValueBinding();
|
---|
222 | QDeclarativeDomValueBinding &operator=(const QDeclarativeDomValueBinding &);
|
---|
223 |
|
---|
224 | QString binding() const;
|
---|
225 |
|
---|
226 | private:
|
---|
227 | friend class QDeclarativeDomValue;
|
---|
228 | QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
|
---|
229 | };
|
---|
230 |
|
---|
231 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomValueValueSource
|
---|
232 | {
|
---|
233 | public:
|
---|
234 | QDeclarativeDomValueValueSource();
|
---|
235 | QDeclarativeDomValueValueSource(const QDeclarativeDomValueValueSource &);
|
---|
236 | ~QDeclarativeDomValueValueSource();
|
---|
237 | QDeclarativeDomValueValueSource &operator=(const QDeclarativeDomValueValueSource &);
|
---|
238 |
|
---|
239 | QDeclarativeDomObject object() const;
|
---|
240 |
|
---|
241 | private:
|
---|
242 | friend class QDeclarativeDomValue;
|
---|
243 | QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
|
---|
244 | };
|
---|
245 |
|
---|
246 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomValueValueInterceptor
|
---|
247 | {
|
---|
248 | public:
|
---|
249 | QDeclarativeDomValueValueInterceptor();
|
---|
250 | QDeclarativeDomValueValueInterceptor(const QDeclarativeDomValueValueInterceptor &);
|
---|
251 | ~QDeclarativeDomValueValueInterceptor();
|
---|
252 | QDeclarativeDomValueValueInterceptor &operator=(const QDeclarativeDomValueValueInterceptor &);
|
---|
253 |
|
---|
254 | QDeclarativeDomObject object() const;
|
---|
255 |
|
---|
256 | private:
|
---|
257 | friend class QDeclarativeDomValue;
|
---|
258 | QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d;
|
---|
259 | };
|
---|
260 |
|
---|
261 |
|
---|
262 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomComponent : public QDeclarativeDomObject
|
---|
263 | {
|
---|
264 | public:
|
---|
265 | QDeclarativeDomComponent();
|
---|
266 | QDeclarativeDomComponent(const QDeclarativeDomComponent &);
|
---|
267 | ~QDeclarativeDomComponent();
|
---|
268 | QDeclarativeDomComponent &operator=(const QDeclarativeDomComponent &);
|
---|
269 |
|
---|
270 | QDeclarativeDomObject componentRoot() const;
|
---|
271 | };
|
---|
272 |
|
---|
273 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomValue
|
---|
274 | {
|
---|
275 | public:
|
---|
276 | enum Type {
|
---|
277 | Invalid,
|
---|
278 | Literal,
|
---|
279 | PropertyBinding,
|
---|
280 | ValueSource,
|
---|
281 | ValueInterceptor,
|
---|
282 | Object,
|
---|
283 | List
|
---|
284 | };
|
---|
285 |
|
---|
286 | QDeclarativeDomValue();
|
---|
287 | QDeclarativeDomValue(const QDeclarativeDomValue &);
|
---|
288 | ~QDeclarativeDomValue();
|
---|
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:
|
---|
312 | friend class QDeclarativeDomProperty;
|
---|
313 | friend class QDeclarativeDomList;
|
---|
314 | QSharedDataPointer<QDeclarativeDomValuePrivate> d;
|
---|
315 | };
|
---|
316 |
|
---|
317 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomList
|
---|
318 | {
|
---|
319 | public:
|
---|
320 | QDeclarativeDomList();
|
---|
321 | QDeclarativeDomList(const QDeclarativeDomList &);
|
---|
322 | ~QDeclarativeDomList();
|
---|
323 | QDeclarativeDomList &operator=(const QDeclarativeDomList &);
|
---|
324 |
|
---|
325 | QList<QDeclarativeDomValue> values() const;
|
---|
326 |
|
---|
327 | int position() const;
|
---|
328 | int length() const;
|
---|
329 |
|
---|
330 | QList<int> commaPositions() const;
|
---|
331 |
|
---|
332 | private:
|
---|
333 | friend class QDeclarativeDomValue;
|
---|
334 | QSharedDataPointer<QDeclarativeDomValuePrivate> d;
|
---|
335 | };
|
---|
336 |
|
---|
337 | class QDeclarativeDomImportPrivate;
|
---|
338 | class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeDomImport
|
---|
339 | {
|
---|
340 | public:
|
---|
341 | enum Type { Library, File };
|
---|
342 |
|
---|
343 | QDeclarativeDomImport();
|
---|
344 | QDeclarativeDomImport(const QDeclarativeDomImport &);
|
---|
345 | ~QDeclarativeDomImport();
|
---|
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:
|
---|
354 | friend class QDeclarativeDomDocument;
|
---|
355 | QSharedDataPointer<QDeclarativeDomImportPrivate> d;
|
---|
356 | };
|
---|
357 |
|
---|
358 | QT_END_NAMESPACE
|
---|
359 |
|
---|
360 | QT_END_HEADER
|
---|
361 |
|
---|
362 | #endif // QDECLARATIVEDOM_P_H
|
---|