00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061 #ifndef DOM_Node_HEADER_GUARD_
00062 #define DOM_Node_HEADER_GUARD_
00063
00064 #include <util/XercesDefs.hpp>
00065 #include <dom/DOMString.hpp>
00066
00067 class DOM_NodeList;
00068 class DOM_NamedNodeMap;
00069 class DOM_Document;
00070 class NodeImpl;
00071
00072 class DOM_NullPtr;
00073
00074
00075
00095 class DOM_Node {
00096
00097 public:
00100
00108 DOM_Node();
00109
00115 DOM_Node(const DOM_Node &other);
00116
00122 DOM_Node & operator = (const DOM_Node &other);
00123
00137 DOM_Node & operator = (const DOM_NullPtr *val);
00138
00140
00142
00147 ~DOM_Node();
00148
00150
00152
00163 bool operator == (const DOM_Node & other)const;
00164
00170 bool operator == (const DOM_NullPtr *other) const;
00171
00176 bool operator != (const DOM_Node & other) const;
00177
00183 bool operator != (const DOM_NullPtr * other) const;
00184
00185
00186 enum NodeType {
00187 ELEMENT_NODE = 1,
00188 ATTRIBUTE_NODE = 2,
00189 TEXT_NODE = 3,
00190 CDATA_SECTION_NODE = 4,
00191 ENTITY_REFERENCE_NODE = 5,
00192 ENTITY_NODE = 6,
00193 PROCESSING_INSTRUCTION_NODE = 7,
00194 COMMENT_NODE = 8,
00195 DOCUMENT_NODE = 9,
00196 DOCUMENT_TYPE_NODE = 10,
00197 DOCUMENT_FRAGMENT_NODE = 11,
00198 NOTATION_NODE = 12,
00199 XML_DECL_NODE = 13
00200 };
00201
00203
00205
00209 DOMString getNodeName() const;
00210
00221 DOMString getNodeValue() const;
00222
00226 short getNodeType() const;
00227
00237 DOM_Node getParentNode() const;
00238
00252 DOM_NodeList getChildNodes() const;
00258 DOM_Node getFirstChild() const;
00259
00265 DOM_Node getLastChild() const;
00266
00272 DOM_Node getPreviousSibling() const;
00273
00279 DOM_Node getNextSibling() const;
00280
00285 DOM_NamedNodeMap getAttributes() const;
00286
00299 DOM_Document getOwnerDocument() const;
00300
00309 void *getUserData() const;
00310
00312
00314
00333 DOM_Node cloneNode(bool deep) const;
00334
00336
00338
00365 DOM_Node insertBefore(const DOM_Node &newChild,
00366 const DOM_Node &refChild);
00367
00368
00391 DOM_Node replaceChild(const DOM_Node &newChild,
00392 const DOM_Node &oldChild);
00404 DOM_Node removeChild(const DOM_Node &oldChild);
00405
00425 DOM_Node appendChild(const DOM_Node &newChild);
00426
00428
00430
00438 bool hasChildNodes() const;
00439
00440
00453 bool isNull() const;
00454
00456
00458
00459
00473 void setNodeValue(const DOMString &nodeValue);
00474
00492 void setUserData(void *p);
00493
00495
00497
00519 void normalize();
00520
00537 bool supports(const DOMString &feature,
00538 const DOMString &version) const;
00539
00556 DOMString getNamespaceURI() const;
00557
00565 DOMString getPrefix() const;
00566
00577 DOMString getLocalName() const;
00578
00612 void setPrefix(const DOMString &prefix);
00613
00615
00616 protected:
00617 NodeImpl *fImpl;
00618
00619 DOM_Node(NodeImpl *);
00620
00621 friend class DOM_Document;
00622 friend class DocumentImpl;
00623 friend class TreeWalkerImpl;
00624 friend class NodeIteratorImpl;
00625 friend class DOM_NamedNodeMap;
00626 friend class DOM_NodeList;
00627 friend class DOMParser;
00628 friend class DOM_Entity;
00629 friend class RangeImpl;
00630 friend class CharacterDataImpl;
00631
00632 };
00633
00634
00635 #endif
00636