|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 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 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
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 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
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 QT_BEGIN_HEADER |
|
62 |
|
63 QT_BEGIN_NAMESPACE |
|
64 |
|
65 QT_MODULE(Declarative) |
|
66 |
|
67 class QString; |
|
68 class QByteArray; |
|
69 class QDeclarativeDomObject; |
|
70 class QDeclarativeDomList; |
|
71 class QDeclarativeDomValue; |
|
72 class QDeclarativeEngine; |
|
73 class QDeclarativeDomComponent; |
|
74 class QDeclarativeDomImport; |
|
75 class QIODevice; |
|
76 |
|
77 class QDeclarativeDomDocumentPrivate; |
|
78 |
|
79 class Q_DECLARATIVE_EXPORT QDeclarativeDomDocument |
|
80 { |
|
81 public: |
|
82 QDeclarativeDomDocument(); |
|
83 QDeclarativeDomDocument(const QDeclarativeDomDocument &); |
|
84 ~QDeclarativeDomDocument(); |
|
85 QDeclarativeDomDocument &operator=(const QDeclarativeDomDocument &); |
|
86 |
|
87 QList<QDeclarativeDomImport> imports() const; |
|
88 |
|
89 QList<QDeclarativeError> errors() const; |
|
90 bool load(QDeclarativeEngine *, const QByteArray &, const QUrl & = QUrl()); |
|
91 |
|
92 QDeclarativeDomObject rootObject() const; |
|
93 |
|
94 private: |
|
95 QSharedDataPointer<QDeclarativeDomDocumentPrivate> d; |
|
96 }; |
|
97 |
|
98 class QDeclarativeDomPropertyPrivate; |
|
99 class Q_DECLARATIVE_EXPORT QDeclarativeDomProperty |
|
100 { |
|
101 public: |
|
102 QDeclarativeDomProperty(); |
|
103 QDeclarativeDomProperty(const QDeclarativeDomProperty &); |
|
104 ~QDeclarativeDomProperty(); |
|
105 QDeclarativeDomProperty &operator=(const QDeclarativeDomProperty &); |
|
106 |
|
107 bool isValid() const; |
|
108 |
|
109 QByteArray propertyName() const; |
|
110 QList<QByteArray> propertyNameParts() const; |
|
111 |
|
112 bool isDefaultProperty() const; |
|
113 |
|
114 QDeclarativeDomValue value() const; |
|
115 |
|
116 int position() const; |
|
117 int length() const; |
|
118 |
|
119 private: |
|
120 friend class QDeclarativeDomObject; |
|
121 friend class QDeclarativeDomDynamicProperty; |
|
122 QSharedDataPointer<QDeclarativeDomPropertyPrivate> d; |
|
123 }; |
|
124 |
|
125 class QDeclarativeDomDynamicPropertyPrivate; |
|
126 class Q_DECLARATIVE_EXPORT QDeclarativeDomDynamicProperty |
|
127 { |
|
128 public: |
|
129 QDeclarativeDomDynamicProperty(); |
|
130 QDeclarativeDomDynamicProperty(const QDeclarativeDomDynamicProperty &); |
|
131 ~QDeclarativeDomDynamicProperty(); |
|
132 QDeclarativeDomDynamicProperty &operator=(const QDeclarativeDomDynamicProperty &); |
|
133 |
|
134 bool isValid() const; |
|
135 |
|
136 QByteArray propertyName() const; |
|
137 int propertyType() const; |
|
138 QByteArray propertyTypeName() const; |
|
139 |
|
140 bool isDefaultProperty() const; |
|
141 QDeclarativeDomProperty defaultValue() const; |
|
142 |
|
143 bool isAlias() const; |
|
144 |
|
145 int position() const; |
|
146 int length() const; |
|
147 |
|
148 private: |
|
149 friend class QDeclarativeDomObject; |
|
150 QSharedDataPointer<QDeclarativeDomDynamicPropertyPrivate> d; |
|
151 }; |
|
152 |
|
153 class QDeclarativeDomObjectPrivate; |
|
154 class Q_DECLARATIVE_EXPORT QDeclarativeDomObject |
|
155 { |
|
156 public: |
|
157 QDeclarativeDomObject(); |
|
158 QDeclarativeDomObject(const QDeclarativeDomObject &); |
|
159 ~QDeclarativeDomObject(); |
|
160 QDeclarativeDomObject &operator=(const QDeclarativeDomObject &); |
|
161 |
|
162 bool isValid() const; |
|
163 |
|
164 QByteArray objectType() const; |
|
165 QByteArray objectClassName() const; |
|
166 |
|
167 int objectTypeMajorVersion() const; |
|
168 int objectTypeMinorVersion() const; |
|
169 |
|
170 QString objectId() const; |
|
171 |
|
172 QList<QDeclarativeDomProperty> properties() const; |
|
173 QDeclarativeDomProperty property(const QByteArray &) const; |
|
174 |
|
175 QList<QDeclarativeDomDynamicProperty> dynamicProperties() const; |
|
176 QDeclarativeDomDynamicProperty dynamicProperty(const QByteArray &) const; |
|
177 |
|
178 bool isCustomType() const; |
|
179 QByteArray customTypeData() const; |
|
180 |
|
181 bool isComponent() const; |
|
182 QDeclarativeDomComponent toComponent() const; |
|
183 |
|
184 int position() const; |
|
185 int length() const; |
|
186 |
|
187 QUrl url() const; |
|
188 private: |
|
189 friend class QDeclarativeDomDocument; |
|
190 friend class QDeclarativeDomComponent; |
|
191 friend class QDeclarativeDomValue; |
|
192 friend class QDeclarativeDomValueValueSource; |
|
193 friend class QDeclarativeDomValueValueInterceptor; |
|
194 QSharedDataPointer<QDeclarativeDomObjectPrivate> d; |
|
195 }; |
|
196 |
|
197 class QDeclarativeDomValuePrivate; |
|
198 class QDeclarativeDomBasicValuePrivate; |
|
199 class Q_DECLARATIVE_EXPORT QDeclarativeDomValueLiteral |
|
200 { |
|
201 public: |
|
202 QDeclarativeDomValueLiteral(); |
|
203 QDeclarativeDomValueLiteral(const QDeclarativeDomValueLiteral &); |
|
204 ~QDeclarativeDomValueLiteral(); |
|
205 QDeclarativeDomValueLiteral &operator=(const QDeclarativeDomValueLiteral &); |
|
206 |
|
207 QString literal() const; |
|
208 |
|
209 private: |
|
210 friend class QDeclarativeDomValue; |
|
211 QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d; |
|
212 }; |
|
213 |
|
214 class Q_DECLARATIVE_EXPORT QDeclarativeDomValueBinding |
|
215 { |
|
216 public: |
|
217 QDeclarativeDomValueBinding(); |
|
218 QDeclarativeDomValueBinding(const QDeclarativeDomValueBinding &); |
|
219 ~QDeclarativeDomValueBinding(); |
|
220 QDeclarativeDomValueBinding &operator=(const QDeclarativeDomValueBinding &); |
|
221 |
|
222 QString binding() const; |
|
223 |
|
224 private: |
|
225 friend class QDeclarativeDomValue; |
|
226 QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d; |
|
227 }; |
|
228 |
|
229 class Q_DECLARATIVE_EXPORT QDeclarativeDomValueValueSource |
|
230 { |
|
231 public: |
|
232 QDeclarativeDomValueValueSource(); |
|
233 QDeclarativeDomValueValueSource(const QDeclarativeDomValueValueSource &); |
|
234 ~QDeclarativeDomValueValueSource(); |
|
235 QDeclarativeDomValueValueSource &operator=(const QDeclarativeDomValueValueSource &); |
|
236 |
|
237 QDeclarativeDomObject object() const; |
|
238 |
|
239 private: |
|
240 friend class QDeclarativeDomValue; |
|
241 QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d; |
|
242 }; |
|
243 |
|
244 class Q_DECLARATIVE_EXPORT QDeclarativeDomValueValueInterceptor |
|
245 { |
|
246 public: |
|
247 QDeclarativeDomValueValueInterceptor(); |
|
248 QDeclarativeDomValueValueInterceptor(const QDeclarativeDomValueValueInterceptor &); |
|
249 ~QDeclarativeDomValueValueInterceptor(); |
|
250 QDeclarativeDomValueValueInterceptor &operator=(const QDeclarativeDomValueValueInterceptor &); |
|
251 |
|
252 QDeclarativeDomObject object() const; |
|
253 |
|
254 private: |
|
255 friend class QDeclarativeDomValue; |
|
256 QSharedDataPointer<QDeclarativeDomBasicValuePrivate> d; |
|
257 }; |
|
258 |
|
259 |
|
260 class Q_DECLARATIVE_EXPORT QDeclarativeDomComponent : public QDeclarativeDomObject |
|
261 { |
|
262 public: |
|
263 QDeclarativeDomComponent(); |
|
264 QDeclarativeDomComponent(const QDeclarativeDomComponent &); |
|
265 ~QDeclarativeDomComponent(); |
|
266 QDeclarativeDomComponent &operator=(const QDeclarativeDomComponent &); |
|
267 |
|
268 QDeclarativeDomObject componentRoot() const; |
|
269 }; |
|
270 |
|
271 class Q_DECLARATIVE_EXPORT QDeclarativeDomValue |
|
272 { |
|
273 public: |
|
274 enum Type { |
|
275 Invalid, |
|
276 Literal, |
|
277 PropertyBinding, |
|
278 ValueSource, |
|
279 ValueInterceptor, |
|
280 Object, |
|
281 List |
|
282 }; |
|
283 |
|
284 QDeclarativeDomValue(); |
|
285 QDeclarativeDomValue(const QDeclarativeDomValue &); |
|
286 ~QDeclarativeDomValue(); |
|
287 QDeclarativeDomValue &operator=(const QDeclarativeDomValue &); |
|
288 |
|
289 Type type() const; |
|
290 |
|
291 bool isInvalid() const; |
|
292 bool isLiteral() const; |
|
293 bool isBinding() const; |
|
294 bool isValueSource() const; |
|
295 bool isValueInterceptor() const; |
|
296 bool isObject() const; |
|
297 bool isList() const; |
|
298 |
|
299 QDeclarativeDomValueLiteral toLiteral() const; |
|
300 QDeclarativeDomValueBinding toBinding() const; |
|
301 QDeclarativeDomValueValueSource toValueSource() const; |
|
302 QDeclarativeDomValueValueInterceptor toValueInterceptor() const; |
|
303 QDeclarativeDomObject toObject() const; |
|
304 QDeclarativeDomList toList() const; |
|
305 |
|
306 int position() const; |
|
307 int length() const; |
|
308 |
|
309 private: |
|
310 friend class QDeclarativeDomProperty; |
|
311 friend class QDeclarativeDomList; |
|
312 QSharedDataPointer<QDeclarativeDomValuePrivate> d; |
|
313 }; |
|
314 |
|
315 class Q_DECLARATIVE_EXPORT QDeclarativeDomList |
|
316 { |
|
317 public: |
|
318 QDeclarativeDomList(); |
|
319 QDeclarativeDomList(const QDeclarativeDomList &); |
|
320 ~QDeclarativeDomList(); |
|
321 QDeclarativeDomList &operator=(const QDeclarativeDomList &); |
|
322 |
|
323 QList<QDeclarativeDomValue> values() const; |
|
324 |
|
325 int position() const; |
|
326 int length() const; |
|
327 |
|
328 QList<int> commaPositions() const; |
|
329 |
|
330 private: |
|
331 friend class QDeclarativeDomValue; |
|
332 QSharedDataPointer<QDeclarativeDomValuePrivate> d; |
|
333 }; |
|
334 |
|
335 class QDeclarativeDomImportPrivate; |
|
336 class Q_DECLARATIVE_EXPORT QDeclarativeDomImport |
|
337 { |
|
338 public: |
|
339 enum Type { Library, File }; |
|
340 |
|
341 QDeclarativeDomImport(); |
|
342 QDeclarativeDomImport(const QDeclarativeDomImport &); |
|
343 ~QDeclarativeDomImport(); |
|
344 QDeclarativeDomImport &operator=(const QDeclarativeDomImport &); |
|
345 |
|
346 Type type() const; |
|
347 QString uri() const; |
|
348 QString version() const; |
|
349 QString qualifier() const; |
|
350 |
|
351 private: |
|
352 friend class QDeclarativeDomDocument; |
|
353 QSharedDataPointer<QDeclarativeDomImportPrivate> d; |
|
354 }; |
|
355 |
|
356 QT_END_NAMESPACE |
|
357 |
|
358 QT_END_HEADER |
|
359 |
|
360 #endif // QDECLARATIVEDOM_P_H |