1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QDOM_H |
5 | #define QDOM_H |
6 | |
7 | #include <QtXml/qtxmlglobal.h> |
8 | #include <QtCore/qstring.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | |
13 | #ifndef QT_NO_DOM |
14 | |
15 | class QIODevice; |
16 | class QTextStream; |
17 | |
18 | class QDomDocumentPrivate; |
19 | class QDomDocumentTypePrivate; |
20 | class QDomDocumentFragmentPrivate; |
21 | class QDomNodePrivate; |
22 | class QDomNodeListPrivate; |
23 | class QDomImplementationPrivate; |
24 | class QDomElementPrivate; |
25 | class QDomNotationPrivate; |
26 | class QDomEntityPrivate; |
27 | class QDomEntityReferencePrivate; |
28 | class QDomProcessingInstructionPrivate; |
29 | class QDomAttrPrivate; |
30 | class QDomCharacterDataPrivate; |
31 | class QDomTextPrivate; |
32 | class ; |
33 | class QDomCDATASectionPrivate; |
34 | class QDomNamedNodeMapPrivate; |
35 | class QDomImplementationPrivate; |
36 | |
37 | class QDomNodeList; |
38 | class QDomElement; |
39 | class QDomText; |
40 | class QDomComment; |
41 | class QDomCDATASection; |
42 | class QDomProcessingInstruction; |
43 | class QDomAttr; |
44 | class QDomEntityReference; |
45 | class QDomDocument; |
46 | class QDomNamedNodeMap; |
47 | class QDomDocument; |
48 | class QDomDocumentFragment; |
49 | class QDomDocumentType; |
50 | class QDomImplementation; |
51 | class QDomNode; |
52 | class QDomEntity; |
53 | class QDomNotation; |
54 | class QDomCharacterData; |
55 | class QXmlStreamReader; |
56 | |
57 | class Q_XML_EXPORT QDomImplementation |
58 | { |
59 | public: |
60 | QDomImplementation(); |
61 | QDomImplementation(const QDomImplementation&); |
62 | ~QDomImplementation(); |
63 | QDomImplementation& operator= (const QDomImplementation&); |
64 | bool operator== (const QDomImplementation&) const; |
65 | bool operator!= (const QDomImplementation&) const; |
66 | |
67 | // functions |
68 | bool hasFeature(const QString& feature, const QString& version) const; |
69 | QDomDocumentType createDocumentType(const QString& qName, const QString& publicId, const QString& systemId); |
70 | QDomDocument createDocument(const QString& nsURI, const QString& qName, const QDomDocumentType& doctype); |
71 | |
72 | enum InvalidDataPolicy { AcceptInvalidChars = 0, DropInvalidChars, ReturnNullNode }; |
73 | static InvalidDataPolicy invalidDataPolicy(); |
74 | static void setInvalidDataPolicy(InvalidDataPolicy policy); |
75 | |
76 | // Qt extension |
77 | bool isNull(); |
78 | |
79 | private: |
80 | QDomImplementationPrivate* impl; |
81 | QDomImplementation(QDomImplementationPrivate*); |
82 | |
83 | friend class QDomDocument; |
84 | }; |
85 | |
86 | class Q_XML_EXPORT QDomNode |
87 | { |
88 | public: |
89 | enum NodeType { |
90 | ElementNode = 1, |
91 | AttributeNode = 2, |
92 | TextNode = 3, |
93 | CDATASectionNode = 4, |
94 | EntityReferenceNode = 5, |
95 | EntityNode = 6, |
96 | ProcessingInstructionNode = 7, |
97 | = 8, |
98 | DocumentNode = 9, |
99 | DocumentTypeNode = 10, |
100 | DocumentFragmentNode = 11, |
101 | NotationNode = 12, |
102 | BaseNode = 21,// this is not in the standard |
103 | CharacterDataNode = 22 // this is not in the standard |
104 | }; |
105 | |
106 | enum EncodingPolicy |
107 | { |
108 | EncodingFromDocument = 1, |
109 | EncodingFromTextStream = 2 |
110 | }; |
111 | |
112 | QDomNode(); |
113 | QDomNode(const QDomNode&); |
114 | QDomNode& operator= (const QDomNode&); |
115 | bool operator== (const QDomNode&) const; |
116 | bool operator!= (const QDomNode&) const; |
117 | ~QDomNode(); |
118 | |
119 | // DOM functions |
120 | QDomNode insertBefore(const QDomNode& newChild, const QDomNode& refChild); |
121 | QDomNode insertAfter(const QDomNode& newChild, const QDomNode& refChild); |
122 | QDomNode replaceChild(const QDomNode& newChild, const QDomNode& oldChild); |
123 | QDomNode removeChild(const QDomNode& oldChild); |
124 | QDomNode appendChild(const QDomNode& newChild); |
125 | bool hasChildNodes() const; |
126 | QDomNode cloneNode(bool deep = true) const; |
127 | void normalize(); |
128 | bool isSupported(const QString& feature, const QString& version) const; |
129 | |
130 | // DOM read-only attributes |
131 | QString nodeName() const; |
132 | NodeType nodeType() const; |
133 | QDomNode parentNode() const; |
134 | QDomNodeList childNodes() const; |
135 | QDomNode firstChild() const; |
136 | QDomNode lastChild() const; |
137 | QDomNode previousSibling() const; |
138 | QDomNode nextSibling() const; |
139 | QDomNamedNodeMap attributes() const; |
140 | QDomDocument ownerDocument() const; |
141 | QString namespaceURI() const; |
142 | QString localName() const; |
143 | bool hasAttributes() const; |
144 | |
145 | // DOM attributes |
146 | QString nodeValue() const; |
147 | void setNodeValue(const QString&); |
148 | QString prefix() const; |
149 | void setPrefix(const QString& pre); |
150 | |
151 | // Qt extensions |
152 | bool isAttr() const; |
153 | bool isCDATASection() const; |
154 | bool isDocumentFragment() const; |
155 | bool isDocument() const; |
156 | bool isDocumentType() const; |
157 | bool isElement() const; |
158 | bool isEntityReference() const; |
159 | bool isText() const; |
160 | bool isEntity() const; |
161 | bool isNotation() const; |
162 | bool isProcessingInstruction() const; |
163 | bool isCharacterData() const; |
164 | bool () const; |
165 | |
166 | /** |
167 | * Shortcut to avoid dealing with QDomNodeList |
168 | * all the time. |
169 | */ |
170 | QDomNode namedItem(const QString& name) const; |
171 | |
172 | bool isNull() const; |
173 | void clear(); |
174 | |
175 | QDomAttr toAttr() const; |
176 | QDomCDATASection toCDATASection() const; |
177 | QDomDocumentFragment toDocumentFragment() const; |
178 | QDomDocument toDocument() const; |
179 | QDomDocumentType toDocumentType() const; |
180 | QDomElement toElement() const; |
181 | QDomEntityReference toEntityReference() const; |
182 | QDomText toText() const; |
183 | QDomEntity toEntity() const; |
184 | QDomNotation toNotation() const; |
185 | QDomProcessingInstruction toProcessingInstruction() const; |
186 | QDomCharacterData toCharacterData() const; |
187 | QDomComment () const; |
188 | |
189 | void save(QTextStream&, int, EncodingPolicy=QDomNode::EncodingFromDocument) const; |
190 | |
191 | QDomElement firstChildElement(const QString &tagName = QString(), const QString &namespaceURI = QString()) const; |
192 | QDomElement lastChildElement(const QString &tagName = QString(), const QString &namespaceURI = QString()) const; |
193 | QDomElement previousSiblingElement(const QString &tagName = QString(), const QString &namespaceURI = QString()) const; |
194 | QDomElement nextSiblingElement(const QString &taName = QString(), const QString &namespaceURI = QString()) const; |
195 | |
196 | int lineNumber() const; |
197 | int columnNumber() const; |
198 | |
199 | protected: |
200 | QDomNodePrivate* impl; |
201 | QDomNode(QDomNodePrivate*); |
202 | |
203 | private: |
204 | friend class QDomDocument; |
205 | friend class QDomDocumentType; |
206 | friend class QDomNodeList; |
207 | friend class QDomNamedNodeMap; |
208 | }; |
209 | |
210 | class Q_XML_EXPORT QDomNodeList |
211 | { |
212 | public: |
213 | QDomNodeList(); |
214 | QDomNodeList(const QDomNodeList&); |
215 | QDomNodeList& operator= (const QDomNodeList&); |
216 | bool operator== (const QDomNodeList&) const; |
217 | bool operator!= (const QDomNodeList&) const; |
218 | ~QDomNodeList(); |
219 | |
220 | // DOM functions |
221 | QDomNode item(int index) const; |
222 | inline QDomNode at(int index) const { return item(index); } // Qt API consistency |
223 | |
224 | // DOM read only attributes |
225 | int length() const; |
226 | inline int count() const { return length(); } // Qt API consitancy |
227 | inline int size() const { return length(); } // Qt API consistency |
228 | inline bool isEmpty() const { return length() == 0; } // Qt API consistency |
229 | |
230 | private: |
231 | QDomNodeListPrivate* impl; |
232 | QDomNodeList(QDomNodeListPrivate*); |
233 | |
234 | friend class QDomNode; |
235 | friend class QDomElement; |
236 | friend class QDomDocument; |
237 | }; |
238 | |
239 | class Q_XML_EXPORT QDomDocumentType : public QDomNode |
240 | { |
241 | public: |
242 | QDomDocumentType(); |
243 | QDomDocumentType(const QDomDocumentType& x); |
244 | QDomDocumentType& operator= (const QDomDocumentType&); |
245 | |
246 | // DOM read only attributes |
247 | QString name() const; |
248 | QDomNamedNodeMap entities() const; |
249 | QDomNamedNodeMap notations() const; |
250 | QString publicId() const; |
251 | QString systemId() const; |
252 | QString internalSubset() const; |
253 | |
254 | // Overridden from QDomNode |
255 | inline QDomNode::NodeType nodeType() const { return DocumentTypeNode; } |
256 | |
257 | private: |
258 | QDomDocumentType(QDomDocumentTypePrivate*); |
259 | |
260 | friend class QDomImplementation; |
261 | friend class QDomDocument; |
262 | friend class QDomNode; |
263 | }; |
264 | |
265 | class Q_XML_EXPORT QDomDocument : public QDomNode |
266 | { |
267 | public: |
268 | enum class ParseOption { |
269 | Default = 0x00, |
270 | UseNamespaceProcessing = 0x01, |
271 | PreserveSpacingOnlyNodes = 0x02, |
272 | }; |
273 | Q_DECLARE_FLAGS(ParseOptions, ParseOption) |
274 | |
275 | struct ParseResult |
276 | { |
277 | QString errorMessage; |
278 | qsizetype errorLine = 0; |
279 | qsizetype errorColumn = 0; |
280 | |
281 | explicit operator bool() const noexcept { return errorMessage.isEmpty(); } |
282 | }; |
283 | |
284 | QDomDocument(); |
285 | explicit QDomDocument(const QString& name); |
286 | explicit QDomDocument(const QDomDocumentType& doctype); |
287 | QDomDocument(const QDomDocument& x); |
288 | QDomDocument& operator= (const QDomDocument&); |
289 | ~QDomDocument(); |
290 | |
291 | // DOM functions |
292 | QDomElement createElement(const QString& tagName); |
293 | QDomDocumentFragment createDocumentFragment(); |
294 | QDomText createTextNode(const QString& data); |
295 | QDomComment (const QString& data); |
296 | QDomCDATASection createCDATASection(const QString& data); |
297 | QDomProcessingInstruction createProcessingInstruction(const QString& target, const QString& data); |
298 | QDomAttr createAttribute(const QString& name); |
299 | QDomEntityReference createEntityReference(const QString& name); |
300 | QDomNodeList elementsByTagName(const QString& tagname) const; |
301 | QDomNode importNode(const QDomNode& importedNode, bool deep); |
302 | QDomElement createElementNS(const QString& nsURI, const QString& qName); |
303 | QDomAttr createAttributeNS(const QString& nsURI, const QString& qName); |
304 | QDomNodeList elementsByTagNameNS(const QString& nsURI, const QString& localName); |
305 | QDomElement elementById(const QString& elementId); |
306 | |
307 | // DOM read only attributes |
308 | QDomDocumentType doctype() const; |
309 | QDomImplementation implementation() const; |
310 | QDomElement documentElement() const; |
311 | |
312 | // Overridden from QDomNode |
313 | inline QDomNode::NodeType nodeType() const { return DocumentNode; } |
314 | |
315 | // Qt extensions |
316 | #if QT_DEPRECATED_SINCE(6, 8) |
317 | QT_DEPRECATED_VERSION_X_6_8("Use the overload taking ParseOptions instead." ) |
318 | bool setContent(const QByteArray &text, bool namespaceProcessing, QString *errorMsg = nullptr, int *errorLine = nullptr, int *errorColumn = nullptr); |
319 | QT_DEPRECATED_VERSION_X_6_8("Use the overload taking ParseOptions instead." ) |
320 | bool setContent(const QString &text, bool namespaceProcessing, QString *errorMsg = nullptr, int *errorLine = nullptr, int *errorColumn = nullptr); |
321 | QT_DEPRECATED_VERSION_X_6_8("Use the overload taking ParseOptions instead." ) |
322 | bool setContent(QIODevice *dev, bool namespaceProcessing, QString *errorMsg = nullptr, int *errorLine = nullptr, int *errorColumn = nullptr); |
323 | QT_DEPRECATED_VERSION_X_6_8("Use the overload returning ParseResult instead." ) |
324 | bool setContent(const QByteArray &text, QString *errorMsg, int *errorLine = nullptr, int *errorColumn = nullptr); |
325 | QT_DEPRECATED_VERSION_X_6_8("Use the overload returning ParseResult instead." ) |
326 | bool setContent(const QString &text, QString *errorMsg, int *errorLine = nullptr, int *errorColumn = nullptr); |
327 | QT_DEPRECATED_VERSION_X_6_8("Use the overload returning ParseResult instead." ) |
328 | bool setContent(QIODevice *dev, QString *errorMsg, int *errorLine = nullptr, int *errorColumn = nullptr); |
329 | QT_DEPRECATED_VERSION_X_6_8("Use the overload taking ParseOptions instead." ) |
330 | bool setContent(QXmlStreamReader *reader, bool namespaceProcessing, QString *errorMsg = nullptr, |
331 | int *errorLine = nullptr, int *errorColumn = nullptr); |
332 | #endif // QT_DEPRECATED_SINCE(6, 8) |
333 | |
334 | Q_WEAK_OVERLOAD |
335 | ParseResult setContent(const QByteArray &data, ParseOptions options = ParseOption::Default) |
336 | { return setContentImpl(data, options); } |
337 | ParseResult setContent(QAnyStringView data, ParseOptions options = ParseOption::Default); |
338 | ParseResult setContent(QIODevice *device, ParseOptions options = ParseOption::Default); |
339 | ParseResult setContent(QXmlStreamReader *reader, ParseOptions options = ParseOption::Default); |
340 | |
341 | // Qt extensions |
342 | QString toString(int = 1) const; |
343 | QByteArray toByteArray(int = 1) const; |
344 | |
345 | private: |
346 | ParseResult setContentImpl(const QByteArray &data, ParseOptions options); |
347 | |
348 | QDomDocument(QDomDocumentPrivate*); |
349 | |
350 | friend class QDomNode; |
351 | }; |
352 | |
353 | class Q_XML_EXPORT QDomNamedNodeMap |
354 | { |
355 | public: |
356 | QDomNamedNodeMap(); |
357 | QDomNamedNodeMap(const QDomNamedNodeMap&); |
358 | QDomNamedNodeMap& operator= (const QDomNamedNodeMap&); |
359 | bool operator== (const QDomNamedNodeMap&) const; |
360 | bool operator!= (const QDomNamedNodeMap&) const; |
361 | ~QDomNamedNodeMap(); |
362 | |
363 | // DOM functions |
364 | QDomNode namedItem(const QString& name) const; |
365 | QDomNode setNamedItem(const QDomNode& newNode); |
366 | QDomNode removeNamedItem(const QString& name); |
367 | QDomNode item(int index) const; |
368 | QDomNode namedItemNS(const QString& nsURI, const QString& localName) const; |
369 | QDomNode setNamedItemNS(const QDomNode& newNode); |
370 | QDomNode removeNamedItemNS(const QString& nsURI, const QString& localName); |
371 | |
372 | // DOM read only attributes |
373 | int length() const; |
374 | int count() const { return length(); } // Qt API consitancy |
375 | inline int size() const { return length(); } // Qt API consistency |
376 | inline bool isEmpty() const { return length() == 0; } // Qt API consistency |
377 | |
378 | // Qt extension |
379 | bool contains(const QString& name) const; |
380 | |
381 | private: |
382 | QDomNamedNodeMapPrivate* impl; |
383 | QDomNamedNodeMap(QDomNamedNodeMapPrivate*); |
384 | |
385 | friend class QDomNode; |
386 | friend class QDomDocumentType; |
387 | friend class QDomElement; |
388 | }; |
389 | |
390 | class Q_XML_EXPORT QDomDocumentFragment : public QDomNode |
391 | { |
392 | public: |
393 | QDomDocumentFragment(); |
394 | QDomDocumentFragment(const QDomDocumentFragment& x); |
395 | QDomDocumentFragment& operator= (const QDomDocumentFragment&); |
396 | |
397 | // Overridden from QDomNode |
398 | inline QDomNode::NodeType nodeType() const { return DocumentFragmentNode; } |
399 | |
400 | private: |
401 | QDomDocumentFragment(QDomDocumentFragmentPrivate*); |
402 | |
403 | friend class QDomDocument; |
404 | friend class QDomNode; |
405 | }; |
406 | |
407 | class Q_XML_EXPORT QDomCharacterData : public QDomNode |
408 | { |
409 | public: |
410 | QDomCharacterData(); |
411 | QDomCharacterData(const QDomCharacterData& x); |
412 | QDomCharacterData& operator= (const QDomCharacterData&); |
413 | |
414 | // DOM functions |
415 | QString substringData(unsigned long offset, unsigned long count); |
416 | void appendData(const QString& arg); |
417 | void insertData(unsigned long offset, const QString& arg); |
418 | void deleteData(unsigned long offset, unsigned long count); |
419 | void replaceData(unsigned long offset, unsigned long count, const QString& arg); |
420 | |
421 | // DOM read only attributes |
422 | int length() const; |
423 | |
424 | // DOM attributes |
425 | QString data() const; |
426 | void setData(const QString&); |
427 | |
428 | // Overridden from QDomNode |
429 | QDomNode::NodeType nodeType() const; |
430 | |
431 | private: |
432 | QDomCharacterData(QDomCharacterDataPrivate*); |
433 | |
434 | friend class QDomDocument; |
435 | friend class QDomText; |
436 | friend class QDomComment; |
437 | friend class QDomNode; |
438 | }; |
439 | |
440 | class Q_XML_EXPORT QDomAttr : public QDomNode |
441 | { |
442 | public: |
443 | QDomAttr(); |
444 | QDomAttr(const QDomAttr& x); |
445 | QDomAttr& operator= (const QDomAttr&); |
446 | |
447 | // DOM read only attributes |
448 | QString name() const; |
449 | bool specified() const; |
450 | QDomElement ownerElement() const; |
451 | |
452 | // DOM attributes |
453 | QString value() const; |
454 | void setValue(const QString&); |
455 | |
456 | // Overridden from QDomNode |
457 | inline QDomNode::NodeType nodeType() const { return AttributeNode; } |
458 | |
459 | private: |
460 | QDomAttr(QDomAttrPrivate*); |
461 | |
462 | friend class QDomDocument; |
463 | friend class QDomElement; |
464 | friend class QDomNode; |
465 | }; |
466 | |
467 | class Q_XML_EXPORT QDomElement : public QDomNode |
468 | { |
469 | public: |
470 | QDomElement(); |
471 | QDomElement(const QDomElement& x); |
472 | QDomElement& operator= (const QDomElement&); |
473 | |
474 | // DOM functions |
475 | QString attribute(const QString& name, const QString& defValue = QString() ) const; |
476 | void setAttribute(const QString& name, const QString& value); |
477 | void setAttribute(const QString& name, qlonglong value); |
478 | void setAttribute(const QString& name, qulonglong value); |
479 | inline void setAttribute(const QString& name, int value) |
480 | { setAttribute(name, value: qlonglong(value)); } |
481 | inline void setAttribute(const QString& name, uint value) |
482 | { setAttribute(name, value: qulonglong(value)); } |
483 | void setAttribute(const QString& name, float value); |
484 | void setAttribute(const QString& name, double value); |
485 | void removeAttribute(const QString& name); |
486 | QDomAttr attributeNode(const QString& name); |
487 | QDomAttr setAttributeNode(const QDomAttr& newAttr); |
488 | QDomAttr removeAttributeNode(const QDomAttr& oldAttr); |
489 | QDomNodeList elementsByTagName(const QString& tagname) const; |
490 | bool hasAttribute(const QString& name) const; |
491 | |
492 | QString attributeNS(const QString& nsURI, const QString& localName, const QString& defValue = QString()) const; |
493 | void setAttributeNS(const QString& nsURI, const QString& qName, const QString& value); |
494 | inline void setAttributeNS(const QString& nsURI, const QString& qName, int value) |
495 | { setAttributeNS(nsURI, qName, value: qlonglong(value)); } |
496 | inline void setAttributeNS(const QString& nsURI, const QString& qName, uint value) |
497 | { setAttributeNS(nsURI, qName, value: qulonglong(value)); } |
498 | void setAttributeNS(const QString& nsURI, const QString& qName, qlonglong value); |
499 | void setAttributeNS(const QString& nsURI, const QString& qName, qulonglong value); |
500 | void setAttributeNS(const QString& nsURI, const QString& qName, double value); |
501 | void removeAttributeNS(const QString& nsURI, const QString& localName); |
502 | QDomAttr attributeNodeNS(const QString& nsURI, const QString& localName); |
503 | QDomAttr setAttributeNodeNS(const QDomAttr& newAttr); |
504 | QDomNodeList elementsByTagNameNS(const QString& nsURI, const QString& localName) const; |
505 | bool hasAttributeNS(const QString& nsURI, const QString& localName) const; |
506 | |
507 | // DOM read only attributes |
508 | QString tagName() const; |
509 | void setTagName(const QString& name); // Qt extension |
510 | |
511 | // Overridden from QDomNode |
512 | QDomNamedNodeMap attributes() const; |
513 | inline QDomNode::NodeType nodeType() const { return ElementNode; } |
514 | |
515 | QString text() const; |
516 | |
517 | private: |
518 | QDomElement(QDomElementPrivate*); |
519 | |
520 | friend class QDomDocument; |
521 | friend class QDomNode; |
522 | friend class QDomAttr; |
523 | }; |
524 | |
525 | class Q_XML_EXPORT QDomText : public QDomCharacterData |
526 | { |
527 | public: |
528 | QDomText(); |
529 | QDomText(const QDomText& x); |
530 | QDomText& operator= (const QDomText&); |
531 | |
532 | // DOM functions |
533 | QDomText splitText(int offset); |
534 | |
535 | // Overridden from QDomCharacterData |
536 | inline QDomNode::NodeType nodeType() const { return TextNode; } |
537 | |
538 | private: |
539 | QDomText(QDomTextPrivate*); |
540 | |
541 | friend class QDomCDATASection; |
542 | friend class QDomDocument; |
543 | friend class QDomNode; |
544 | }; |
545 | |
546 | class Q_XML_EXPORT : public QDomCharacterData |
547 | { |
548 | public: |
549 | (); |
550 | (const QDomComment& x); |
551 | QDomComment& (const QDomComment&); |
552 | |
553 | // Overridden from QDomCharacterData |
554 | inline QDomNode::NodeType () const { return CommentNode; } |
555 | |
556 | private: |
557 | (QDomCommentPrivate*); |
558 | |
559 | friend class QDomDocument; |
560 | friend class QDomNode; |
561 | }; |
562 | |
563 | class Q_XML_EXPORT QDomCDATASection : public QDomText |
564 | { |
565 | public: |
566 | QDomCDATASection(); |
567 | QDomCDATASection(const QDomCDATASection& x); |
568 | QDomCDATASection& operator= (const QDomCDATASection&); |
569 | |
570 | // Overridden from QDomText |
571 | inline QDomNode::NodeType nodeType() const { return CDATASectionNode; } |
572 | |
573 | private: |
574 | QDomCDATASection(QDomCDATASectionPrivate*); |
575 | |
576 | friend class QDomDocument; |
577 | friend class QDomNode; |
578 | }; |
579 | |
580 | class Q_XML_EXPORT QDomNotation : public QDomNode |
581 | { |
582 | public: |
583 | QDomNotation(); |
584 | QDomNotation(const QDomNotation& x); |
585 | QDomNotation& operator= (const QDomNotation&); |
586 | |
587 | // DOM read only attributes |
588 | QString publicId() const; |
589 | QString systemId() const; |
590 | |
591 | // Overridden from QDomNode |
592 | inline QDomNode::NodeType nodeType() const { return NotationNode; } |
593 | |
594 | private: |
595 | QDomNotation(QDomNotationPrivate*); |
596 | |
597 | friend class QDomDocument; |
598 | friend class QDomNode; |
599 | }; |
600 | |
601 | class Q_XML_EXPORT QDomEntity : public QDomNode |
602 | { |
603 | public: |
604 | QDomEntity(); |
605 | QDomEntity(const QDomEntity& x); |
606 | QDomEntity& operator= (const QDomEntity&); |
607 | |
608 | // DOM read only attributes |
609 | QString publicId() const; |
610 | QString systemId() const; |
611 | QString notationName() const; |
612 | |
613 | // Overridden from QDomNode |
614 | inline QDomNode::NodeType nodeType() const { return EntityNode; } |
615 | |
616 | private: |
617 | QDomEntity(QDomEntityPrivate*); |
618 | |
619 | friend class QDomNode; |
620 | }; |
621 | |
622 | class Q_XML_EXPORT QDomEntityReference : public QDomNode |
623 | { |
624 | public: |
625 | QDomEntityReference(); |
626 | QDomEntityReference(const QDomEntityReference& x); |
627 | QDomEntityReference& operator= (const QDomEntityReference&); |
628 | |
629 | // Overridden from QDomNode |
630 | inline QDomNode::NodeType nodeType() const { return EntityReferenceNode; } |
631 | |
632 | private: |
633 | QDomEntityReference(QDomEntityReferencePrivate*); |
634 | |
635 | friend class QDomDocument; |
636 | friend class QDomNode; |
637 | }; |
638 | |
639 | class Q_XML_EXPORT QDomProcessingInstruction : public QDomNode |
640 | { |
641 | public: |
642 | QDomProcessingInstruction(); |
643 | QDomProcessingInstruction(const QDomProcessingInstruction& x); |
644 | QDomProcessingInstruction& operator= (const QDomProcessingInstruction&); |
645 | |
646 | // DOM read only attributes |
647 | QString target() const; |
648 | |
649 | // DOM attributes |
650 | QString data() const; |
651 | void setData(const QString& d); |
652 | |
653 | // Overridden from QDomNode |
654 | inline QDomNode::NodeType nodeType() const { return ProcessingInstructionNode; } |
655 | |
656 | private: |
657 | QDomProcessingInstruction(QDomProcessingInstructionPrivate*); |
658 | |
659 | friend class QDomDocument; |
660 | friend class QDomNode; |
661 | }; |
662 | |
663 | |
664 | Q_XML_EXPORT QTextStream& operator<<(QTextStream&, const QDomNode&); |
665 | |
666 | #endif // QT_NO_DOM |
667 | |
668 | QT_END_NAMESPACE |
669 | |
670 | #endif // QDOM_H |
671 | |