qdom.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2016 The Qt Company Ltd.
  4. ** Contact: https://www.qt.io/licensing/
  5. **
  6. ** This file is part of the QtXml 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 The Qt Company. For licensing terms
  14. ** and conditions see https://www.qt.io/terms-conditions. For further
  15. ** information use the contact form at https://www.qt.io/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 3 as published by the Free Software
  20. ** Foundation and appearing in the file LICENSE.LGPL3 included in the
  21. ** packaging of this file. Please review the following information to
  22. ** ensure the GNU Lesser General Public License version 3 requirements
  23. ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
  24. **
  25. ** GNU General Public License Usage
  26. ** Alternatively, this file may be used under the terms of the GNU
  27. ** General Public License version 2.0 or (at your option) the GNU General
  28. ** Public license version 3 or any later version approved by the KDE Free
  29. ** Qt Foundation. The licenses are as published by the Free Software
  30. ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
  31. ** included in the packaging of this file. Please review the following
  32. ** information to ensure the GNU General Public License requirements will
  33. ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
  34. ** https://www.gnu.org/licenses/gpl-3.0.html.
  35. **
  36. ** $QT_END_LICENSE$
  37. **
  38. ****************************************************************************/
  39. #ifndef QDOM_H
  40. #define QDOM_H
  41. #include <QtXml/qtxmlglobal.h>
  42. #include <QtCore/qstring.h>
  43. QT_BEGIN_NAMESPACE
  44. #ifndef QT_NO_DOM
  45. class QIODevice;
  46. class QTextStream;
  47. class QXmlInputSource;
  48. class QXmlReader;
  49. class QDomDocumentPrivate;
  50. class QDomDocumentTypePrivate;
  51. class QDomDocumentFragmentPrivate;
  52. class QDomNodePrivate;
  53. class QDomNodeListPrivate;
  54. class QDomImplementationPrivate;
  55. class QDomElementPrivate;
  56. class QDomNotationPrivate;
  57. class QDomEntityPrivate;
  58. class QDomEntityReferencePrivate;
  59. class QDomProcessingInstructionPrivate;
  60. class QDomAttrPrivate;
  61. class QDomCharacterDataPrivate;
  62. class QDomTextPrivate;
  63. class QDomCommentPrivate;
  64. class QDomCDATASectionPrivate;
  65. class QDomNamedNodeMapPrivate;
  66. class QDomImplementationPrivate;
  67. class QDomNodeList;
  68. class QDomElement;
  69. class QDomText;
  70. class QDomComment;
  71. class QDomCDATASection;
  72. class QDomProcessingInstruction;
  73. class QDomAttr;
  74. class QDomEntityReference;
  75. class QDomDocument;
  76. class QDomNamedNodeMap;
  77. class QDomDocument;
  78. class QDomDocumentFragment;
  79. class QDomDocumentType;
  80. class QDomImplementation;
  81. class QDomNode;
  82. class QDomEntity;
  83. class QDomNotation;
  84. class QDomCharacterData;
  85. class Q_XML_EXPORT QDomImplementation
  86. {
  87. public:
  88. QDomImplementation();
  89. QDomImplementation(const QDomImplementation&);
  90. ~QDomImplementation();
  91. QDomImplementation& operator= (const QDomImplementation&);
  92. bool operator== (const QDomImplementation&) const;
  93. bool operator!= (const QDomImplementation&) const;
  94. // functions
  95. bool hasFeature(const QString& feature, const QString& version) const;
  96. QDomDocumentType createDocumentType(const QString& qName, const QString& publicId, const QString& systemId);
  97. QDomDocument createDocument(const QString& nsURI, const QString& qName, const QDomDocumentType& doctype);
  98. enum InvalidDataPolicy { AcceptInvalidChars = 0, DropInvalidChars, ReturnNullNode };
  99. static InvalidDataPolicy invalidDataPolicy();
  100. static void setInvalidDataPolicy(InvalidDataPolicy policy);
  101. // Qt extension
  102. bool isNull();
  103. private:
  104. QDomImplementationPrivate* impl;
  105. QDomImplementation(QDomImplementationPrivate*);
  106. friend class QDomDocument;
  107. };
  108. class Q_XML_EXPORT QDomNode
  109. {
  110. public:
  111. enum NodeType {
  112. ElementNode = 1,
  113. AttributeNode = 2,
  114. TextNode = 3,
  115. CDATASectionNode = 4,
  116. EntityReferenceNode = 5,
  117. EntityNode = 6,
  118. ProcessingInstructionNode = 7,
  119. CommentNode = 8,
  120. DocumentNode = 9,
  121. DocumentTypeNode = 10,
  122. DocumentFragmentNode = 11,
  123. NotationNode = 12,
  124. BaseNode = 21,// this is not in the standard
  125. CharacterDataNode = 22 // this is not in the standard
  126. };
  127. enum EncodingPolicy
  128. {
  129. EncodingFromDocument = 1,
  130. EncodingFromTextStream = 2
  131. };
  132. QDomNode();
  133. QDomNode(const QDomNode&);
  134. QDomNode& operator= (const QDomNode&);
  135. bool operator== (const QDomNode&) const;
  136. bool operator!= (const QDomNode&) const;
  137. ~QDomNode();
  138. // DOM functions
  139. QDomNode insertBefore(const QDomNode& newChild, const QDomNode& refChild);
  140. QDomNode insertAfter(const QDomNode& newChild, const QDomNode& refChild);
  141. QDomNode replaceChild(const QDomNode& newChild, const QDomNode& oldChild);
  142. QDomNode removeChild(const QDomNode& oldChild);
  143. QDomNode appendChild(const QDomNode& newChild);
  144. bool hasChildNodes() const;
  145. QDomNode cloneNode(bool deep = true) const;
  146. void normalize();
  147. bool isSupported(const QString& feature, const QString& version) const;
  148. // DOM read-only attributes
  149. QString nodeName() const;
  150. NodeType nodeType() const;
  151. QDomNode parentNode() const;
  152. QDomNodeList childNodes() const;
  153. QDomNode firstChild() const;
  154. QDomNode lastChild() const;
  155. QDomNode previousSibling() const;
  156. QDomNode nextSibling() const;
  157. QDomNamedNodeMap attributes() const;
  158. QDomDocument ownerDocument() const;
  159. QString namespaceURI() const;
  160. QString localName() const;
  161. bool hasAttributes() const;
  162. // DOM attributes
  163. QString nodeValue() const;
  164. void setNodeValue(const QString&);
  165. QString prefix() const;
  166. void setPrefix(const QString& pre);
  167. // Qt extensions
  168. bool isAttr() const;
  169. bool isCDATASection() const;
  170. bool isDocumentFragment() const;
  171. bool isDocument() const;
  172. bool isDocumentType() const;
  173. bool isElement() const;
  174. bool isEntityReference() const;
  175. bool isText() const;
  176. bool isEntity() const;
  177. bool isNotation() const;
  178. bool isProcessingInstruction() const;
  179. bool isCharacterData() const;
  180. bool isComment() const;
  181. /**
  182. * Shortcut to avoid dealing with QDomNodeList
  183. * all the time.
  184. */
  185. QDomNode namedItem(const QString& name) const;
  186. bool isNull() const;
  187. void clear();
  188. QDomAttr toAttr() const;
  189. QDomCDATASection toCDATASection() const;
  190. QDomDocumentFragment toDocumentFragment() const;
  191. QDomDocument toDocument() const;
  192. QDomDocumentType toDocumentType() const;
  193. QDomElement toElement() const;
  194. QDomEntityReference toEntityReference() const;
  195. QDomText toText() const;
  196. QDomEntity toEntity() const;
  197. QDomNotation toNotation() const;
  198. QDomProcessingInstruction toProcessingInstruction() const;
  199. QDomCharacterData toCharacterData() const;
  200. QDomComment toComment() const;
  201. void save(QTextStream&, int, EncodingPolicy=QDomNode::EncodingFromDocument) const;
  202. QDomElement firstChildElement(const QString &tagName = QString()) const;
  203. QDomElement lastChildElement(const QString &tagName = QString()) const;
  204. QDomElement previousSiblingElement(const QString &tagName = QString()) const;
  205. QDomElement nextSiblingElement(const QString &taName = QString()) const;
  206. int lineNumber() const;
  207. int columnNumber() const;
  208. protected:
  209. QDomNodePrivate* impl;
  210. QDomNode(QDomNodePrivate*);
  211. private:
  212. friend class QDomDocument;
  213. friend class QDomDocumentType;
  214. friend class QDomNodeList;
  215. friend class QDomNamedNodeMap;
  216. };
  217. class Q_XML_EXPORT QDomNodeList
  218. {
  219. public:
  220. QDomNodeList();
  221. QDomNodeList(const QDomNodeList&);
  222. QDomNodeList& operator= (const QDomNodeList&);
  223. bool operator== (const QDomNodeList&) const;
  224. bool operator!= (const QDomNodeList&) const;
  225. ~QDomNodeList();
  226. // DOM functions
  227. QDomNode item(int index) const;
  228. inline QDomNode at(int index) const { return item(index); } // Qt API consistency
  229. // DOM read only attributes
  230. int length() const;
  231. inline int count() const { return length(); } // Qt API consitancy
  232. inline int size() const { return length(); } // Qt API consistency
  233. inline bool isEmpty() const { return length() == 0; } // Qt API consistency
  234. private:
  235. QDomNodeListPrivate* impl;
  236. QDomNodeList(QDomNodeListPrivate*);
  237. friend class QDomNode;
  238. friend class QDomElement;
  239. friend class QDomDocument;
  240. };
  241. class Q_XML_EXPORT QDomDocumentType : public QDomNode
  242. {
  243. public:
  244. QDomDocumentType();
  245. QDomDocumentType(const QDomDocumentType& x);
  246. QDomDocumentType& operator= (const QDomDocumentType&);
  247. // DOM read only attributes
  248. QString name() const;
  249. QDomNamedNodeMap entities() const;
  250. QDomNamedNodeMap notations() const;
  251. QString publicId() const;
  252. QString systemId() const;
  253. QString internalSubset() const;
  254. // Overridden from QDomNode
  255. inline QDomNode::NodeType nodeType() const { return DocumentTypeNode; }
  256. private:
  257. QDomDocumentType(QDomDocumentTypePrivate*);
  258. friend class QDomImplementation;
  259. friend class QDomDocument;
  260. friend class QDomNode;
  261. };
  262. class Q_XML_EXPORT QDomDocument : public QDomNode
  263. {
  264. public:
  265. QDomDocument();
  266. explicit QDomDocument(const QString& name);
  267. explicit QDomDocument(const QDomDocumentType& doctype);
  268. QDomDocument(const QDomDocument& x);
  269. QDomDocument& operator= (const QDomDocument&);
  270. ~QDomDocument();
  271. // DOM functions
  272. QDomElement createElement(const QString& tagName);
  273. QDomDocumentFragment createDocumentFragment();
  274. QDomText createTextNode(const QString& data);
  275. QDomComment createComment(const QString& data);
  276. QDomCDATASection createCDATASection(const QString& data);
  277. QDomProcessingInstruction createProcessingInstruction(const QString& target, const QString& data);
  278. QDomAttr createAttribute(const QString& name);
  279. QDomEntityReference createEntityReference(const QString& name);
  280. QDomNodeList elementsByTagName(const QString& tagname) const;
  281. QDomNode importNode(const QDomNode& importedNode, bool deep);
  282. QDomElement createElementNS(const QString& nsURI, const QString& qName);
  283. QDomAttr createAttributeNS(const QString& nsURI, const QString& qName);
  284. QDomNodeList elementsByTagNameNS(const QString& nsURI, const QString& localName);
  285. QDomElement elementById(const QString& elementId);
  286. // DOM read only attributes
  287. QDomDocumentType doctype() const;
  288. QDomImplementation implementation() const;
  289. QDomElement documentElement() const;
  290. // Overridden from QDomNode
  291. inline QDomNode::NodeType nodeType() const { return DocumentNode; }
  292. // Qt extensions
  293. bool setContent(const QByteArray& text, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
  294. bool setContent(const QString& text, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
  295. bool setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
  296. bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
  297. bool setContent(const QByteArray& text, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
  298. bool setContent(const QString& text, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
  299. bool setContent(QIODevice* dev, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
  300. bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg=Q_NULLPTR, int *errorLine=Q_NULLPTR, int *errorColumn=Q_NULLPTR );
  301. // Qt extensions
  302. QString toString(int = 1) const;
  303. QByteArray toByteArray(int = 1) const;
  304. private:
  305. QDomDocument(QDomDocumentPrivate*);
  306. friend class QDomNode;
  307. };
  308. class Q_XML_EXPORT QDomNamedNodeMap
  309. {
  310. public:
  311. QDomNamedNodeMap();
  312. QDomNamedNodeMap(const QDomNamedNodeMap&);
  313. QDomNamedNodeMap& operator= (const QDomNamedNodeMap&);
  314. bool operator== (const QDomNamedNodeMap&) const;
  315. bool operator!= (const QDomNamedNodeMap&) const;
  316. ~QDomNamedNodeMap();
  317. // DOM functions
  318. QDomNode namedItem(const QString& name) const;
  319. QDomNode setNamedItem(const QDomNode& newNode);
  320. QDomNode removeNamedItem(const QString& name);
  321. QDomNode item(int index) const;
  322. QDomNode namedItemNS(const QString& nsURI, const QString& localName) const;
  323. QDomNode setNamedItemNS(const QDomNode& newNode);
  324. QDomNode removeNamedItemNS(const QString& nsURI, const QString& localName);
  325. // DOM read only attributes
  326. int length() const;
  327. int count() const { return length(); } // Qt API consitancy
  328. inline int size() const { return length(); } // Qt API consistency
  329. inline bool isEmpty() const { return length() == 0; } // Qt API consistency
  330. // Qt extension
  331. bool contains(const QString& name) const;
  332. private:
  333. QDomNamedNodeMapPrivate* impl;
  334. QDomNamedNodeMap(QDomNamedNodeMapPrivate*);
  335. friend class QDomNode;
  336. friend class QDomDocumentType;
  337. friend class QDomElement;
  338. };
  339. class Q_XML_EXPORT QDomDocumentFragment : public QDomNode
  340. {
  341. public:
  342. QDomDocumentFragment();
  343. QDomDocumentFragment(const QDomDocumentFragment& x);
  344. QDomDocumentFragment& operator= (const QDomDocumentFragment&);
  345. // Overridden from QDomNode
  346. inline QDomNode::NodeType nodeType() const { return DocumentFragmentNode; }
  347. private:
  348. QDomDocumentFragment(QDomDocumentFragmentPrivate*);
  349. friend class QDomDocument;
  350. friend class QDomNode;
  351. };
  352. class Q_XML_EXPORT QDomCharacterData : public QDomNode
  353. {
  354. public:
  355. QDomCharacterData();
  356. QDomCharacterData(const QDomCharacterData& x);
  357. QDomCharacterData& operator= (const QDomCharacterData&);
  358. // DOM functions
  359. QString substringData(unsigned long offset, unsigned long count);
  360. void appendData(const QString& arg);
  361. void insertData(unsigned long offset, const QString& arg);
  362. void deleteData(unsigned long offset, unsigned long count);
  363. void replaceData(unsigned long offset, unsigned long count, const QString& arg);
  364. // DOM read only attributes
  365. int length() const;
  366. // DOM attributes
  367. QString data() const;
  368. void setData(const QString&);
  369. // Overridden from QDomNode
  370. QDomNode::NodeType nodeType() const;
  371. private:
  372. QDomCharacterData(QDomCharacterDataPrivate*);
  373. friend class QDomDocument;
  374. friend class QDomText;
  375. friend class QDomComment;
  376. friend class QDomNode;
  377. };
  378. class Q_XML_EXPORT QDomAttr : public QDomNode
  379. {
  380. public:
  381. QDomAttr();
  382. QDomAttr(const QDomAttr& x);
  383. QDomAttr& operator= (const QDomAttr&);
  384. // DOM read only attributes
  385. QString name() const;
  386. bool specified() const;
  387. QDomElement ownerElement() const;
  388. // DOM attributes
  389. QString value() const;
  390. void setValue(const QString&);
  391. // Overridden from QDomNode
  392. inline QDomNode::NodeType nodeType() const { return AttributeNode; }
  393. private:
  394. QDomAttr(QDomAttrPrivate*);
  395. friend class QDomDocument;
  396. friend class QDomElement;
  397. friend class QDomNode;
  398. };
  399. class Q_XML_EXPORT QDomElement : public QDomNode
  400. {
  401. public:
  402. QDomElement();
  403. QDomElement(const QDomElement& x);
  404. QDomElement& operator= (const QDomElement&);
  405. // DOM functions
  406. QString attribute(const QString& name, const QString& defValue = QString() ) const;
  407. void setAttribute(const QString& name, const QString& value);
  408. void setAttribute(const QString& name, qlonglong value);
  409. void setAttribute(const QString& name, qulonglong value);
  410. inline void setAttribute(const QString& name, int value)
  411. { setAttribute(name, qlonglong(value)); }
  412. inline void setAttribute(const QString& name, uint value)
  413. { setAttribute(name, qulonglong(value)); }
  414. void setAttribute(const QString& name, float value);
  415. void setAttribute(const QString& name, double value);
  416. void removeAttribute(const QString& name);
  417. QDomAttr attributeNode(const QString& name);
  418. QDomAttr setAttributeNode(const QDomAttr& newAttr);
  419. QDomAttr removeAttributeNode(const QDomAttr& oldAttr);
  420. QDomNodeList elementsByTagName(const QString& tagname) const;
  421. bool hasAttribute(const QString& name) const;
  422. QString attributeNS(const QString nsURI, const QString& localName, const QString& defValue = QString()) const;
  423. void setAttributeNS(const QString nsURI, const QString& qName, const QString& value);
  424. inline void setAttributeNS(const QString nsURI, const QString& qName, int value)
  425. { setAttributeNS(nsURI, qName, qlonglong(value)); }
  426. inline void setAttributeNS(const QString nsURI, const QString& qName, uint value)
  427. { setAttributeNS(nsURI, qName, qulonglong(value)); }
  428. void setAttributeNS(const QString nsURI, const QString& qName, qlonglong value);
  429. void setAttributeNS(const QString nsURI, const QString& qName, qulonglong value);
  430. void setAttributeNS(const QString nsURI, const QString& qName, double value);
  431. void removeAttributeNS(const QString& nsURI, const QString& localName);
  432. QDomAttr attributeNodeNS(const QString& nsURI, const QString& localName);
  433. QDomAttr setAttributeNodeNS(const QDomAttr& newAttr);
  434. QDomNodeList elementsByTagNameNS(const QString& nsURI, const QString& localName) const;
  435. bool hasAttributeNS(const QString& nsURI, const QString& localName) const;
  436. // DOM read only attributes
  437. QString tagName() const;
  438. void setTagName(const QString& name); // Qt extension
  439. // Overridden from QDomNode
  440. QDomNamedNodeMap attributes() const;
  441. inline QDomNode::NodeType nodeType() const { return ElementNode; }
  442. QString text() const;
  443. private:
  444. QDomElement(QDomElementPrivate*);
  445. friend class QDomDocument;
  446. friend class QDomNode;
  447. friend class QDomAttr;
  448. };
  449. class Q_XML_EXPORT QDomText : public QDomCharacterData
  450. {
  451. public:
  452. QDomText();
  453. QDomText(const QDomText& x);
  454. QDomText& operator= (const QDomText&);
  455. // DOM functions
  456. QDomText splitText(int offset);
  457. // Overridden from QDomCharacterData
  458. inline QDomNode::NodeType nodeType() const { return TextNode; }
  459. private:
  460. QDomText(QDomTextPrivate*);
  461. friend class QDomCDATASection;
  462. friend class QDomDocument;
  463. friend class QDomNode;
  464. };
  465. class Q_XML_EXPORT QDomComment : public QDomCharacterData
  466. {
  467. public:
  468. QDomComment();
  469. QDomComment(const QDomComment& x);
  470. QDomComment& operator= (const QDomComment&);
  471. // Overridden from QDomCharacterData
  472. inline QDomNode::NodeType nodeType() const { return CommentNode; }
  473. private:
  474. QDomComment(QDomCommentPrivate*);
  475. friend class QDomDocument;
  476. friend class QDomNode;
  477. };
  478. class Q_XML_EXPORT QDomCDATASection : public QDomText
  479. {
  480. public:
  481. QDomCDATASection();
  482. QDomCDATASection(const QDomCDATASection& x);
  483. QDomCDATASection& operator= (const QDomCDATASection&);
  484. // Overridden from QDomText
  485. inline QDomNode::NodeType nodeType() const { return CDATASectionNode; }
  486. private:
  487. QDomCDATASection(QDomCDATASectionPrivate*);
  488. friend class QDomDocument;
  489. friend class QDomNode;
  490. };
  491. class Q_XML_EXPORT QDomNotation : public QDomNode
  492. {
  493. public:
  494. QDomNotation();
  495. QDomNotation(const QDomNotation& x);
  496. QDomNotation& operator= (const QDomNotation&);
  497. // DOM read only attributes
  498. QString publicId() const;
  499. QString systemId() const;
  500. // Overridden from QDomNode
  501. inline QDomNode::NodeType nodeType() const { return NotationNode; }
  502. private:
  503. QDomNotation(QDomNotationPrivate*);
  504. friend class QDomDocument;
  505. friend class QDomNode;
  506. };
  507. class Q_XML_EXPORT QDomEntity : public QDomNode
  508. {
  509. public:
  510. QDomEntity();
  511. QDomEntity(const QDomEntity& x);
  512. QDomEntity& operator= (const QDomEntity&);
  513. // DOM read only attributes
  514. QString publicId() const;
  515. QString systemId() const;
  516. QString notationName() const;
  517. // Overridden from QDomNode
  518. inline QDomNode::NodeType nodeType() const { return EntityNode; }
  519. private:
  520. QDomEntity(QDomEntityPrivate*);
  521. friend class QDomNode;
  522. };
  523. class Q_XML_EXPORT QDomEntityReference : public QDomNode
  524. {
  525. public:
  526. QDomEntityReference();
  527. QDomEntityReference(const QDomEntityReference& x);
  528. QDomEntityReference& operator= (const QDomEntityReference&);
  529. // Overridden from QDomNode
  530. inline QDomNode::NodeType nodeType() const { return EntityReferenceNode; }
  531. private:
  532. QDomEntityReference(QDomEntityReferencePrivate*);
  533. friend class QDomDocument;
  534. friend class QDomNode;
  535. };
  536. class Q_XML_EXPORT QDomProcessingInstruction : public QDomNode
  537. {
  538. public:
  539. QDomProcessingInstruction();
  540. QDomProcessingInstruction(const QDomProcessingInstruction& x);
  541. QDomProcessingInstruction& operator= (const QDomProcessingInstruction&);
  542. // DOM read only attributes
  543. QString target() const;
  544. // DOM attributes
  545. QString data() const;
  546. void setData(const QString& d);
  547. // Overridden from QDomNode
  548. inline QDomNode::NodeType nodeType() const { return ProcessingInstructionNode; }
  549. private:
  550. QDomProcessingInstruction(QDomProcessingInstructionPrivate*);
  551. friend class QDomDocument;
  552. friend class QDomNode;
  553. };
  554. Q_XML_EXPORT QTextStream& operator<<(QTextStream&, const QDomNode&);
  555. #endif // QT_NO_DOM
  556. QT_END_NAMESPACE
  557. #endif // QDOM_H