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