00001 #ifndef IDNodeImpl_HEADER_GUARD_
00002 #define IDNodeImpl_HEADER_GUARD_
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
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00091 #include <xercesc/util/XercesDefs.hpp>
00092
00093 class IDOM_NamedNodeMap;
00094 class IDOM_NodeList;
00095 class IDOM_Node;
00096 class IDOM_Document;
00097
00098 class CDOM_EXPORT IDNodeImpl {
00099 public:
00100
00101
00102 IDOM_Node *fOwnerNode;
00103 unsigned short flags;
00104
00105 static const unsigned short READONLY;
00106 static const unsigned short SYNCDATA;
00107 static const unsigned short SYNCCHILDREN;
00108 static const unsigned short OWNED;
00109 static const unsigned short FIRSTCHILD;
00110 static const unsigned short SPECIFIED;
00111 static const unsigned short IGNORABLEWS;
00112 static const unsigned short SETVALUE;
00113 static const unsigned short ID_ATTR;
00114 static const unsigned short USERDATA;
00115 static const unsigned short LEAFNODETYPE;
00116 static const unsigned short CHILDNODE;
00117
00118
00119 public:
00120 IDNodeImpl(IDOM_Node *ownerDocument);
00121 IDNodeImpl(const IDNodeImpl &other);
00122 ~IDNodeImpl();
00123
00124 IDOM_Node *appendChild(IDOM_Node *newChild);
00125 IDOM_NamedNodeMap * getAttributes() const;
00126 IDOM_NodeList * getChildNodes() const;
00127 IDOM_Node * getFirstChild() const;
00128 IDOM_Node * getLastChild() const;
00129 const XMLCh * getLocalName() const;
00130 const XMLCh * getNamespaceURI() const;
00131 IDOM_Node * getNextSibling() const;
00132 const XMLCh * getNodeValue() const;
00133 IDOM_Document * getOwnerDocument() const;
00134 IDOM_Node * getParentNode() const;
00135 const XMLCh * getPrefix() const;
00136 IDOM_Node * getPreviousSibling() const;
00137 void * getUserData() const;
00138 bool hasChildNodes() const;
00139 IDOM_Node * insertBefore(IDOM_Node *newChild, IDOM_Node *refChild);
00140 void normalize();
00141 IDOM_Node * removeChild(IDOM_Node *oldChild);
00142 IDOM_Node * replaceChild(IDOM_Node *newChild, IDOM_Node *oldChild);
00143 void setNodeValue(const XMLCh *value);
00144 void setPrefix(const XMLCh *fPrefix);
00145 void setReadOnly(bool readOnly, bool deep);
00146 void setUserData(void *value);
00147 bool isSupported(const XMLCh *feature, const XMLCh *version) const;
00148 bool hasAttributes() const;
00149
00150 static bool isKidOK(IDOM_Node *parent, IDOM_Node *child);
00151
00152
00153 static const XMLCh * mapPrefix(const XMLCh *prefix,
00154 const XMLCh *namespaceURI, short nType);
00155
00156 static const XMLCh *getXmlnsString();
00157 static const XMLCh *getXmlnsURIString();
00158 static const XMLCh *getXmlString();
00159 static const XMLCh *getXmlURIString();
00160
00161 public:
00162
00163 void setOwnerDocument(IDOM_Document *doc);
00164
00165
00166
00167
00168
00169 inline bool isReadOnly() const {
00170 return (flags & READONLY) != 0;
00171 }
00172
00173 inline void isReadOnly(bool value) {
00174 flags = (value ? flags | READONLY : flags & ~READONLY);
00175 }
00176
00177 inline bool needsSyncData() const {
00178 return (flags & SYNCDATA) != 0;
00179 }
00180
00181 inline void needsSyncData(bool value) {
00182 flags = (value ? flags | SYNCDATA : flags & ~SYNCDATA);
00183 }
00184
00185 inline bool needsSyncChildren() const {
00186 return (flags & SYNCCHILDREN) != 0;
00187 }
00188
00189 inline void needsSyncChildren(bool value) {
00190 flags = (value ? flags | SYNCCHILDREN : flags & ~SYNCCHILDREN);
00191 }
00192
00193
00194
00195 inline bool isOwned() const {
00196 return (flags & OWNED) != 0;
00197 }
00198
00199 inline void isOwned(bool value) {
00200 flags = (value ? flags | OWNED : flags & ~OWNED);
00201 }
00202
00203 inline bool isFirstChild() const {
00204 return (flags & FIRSTCHILD) != 0;
00205 }
00206
00207 inline void isFirstChild(bool value) {
00208 flags = (value ? flags | FIRSTCHILD : flags & ~FIRSTCHILD);
00209 }
00210
00211 inline bool isSpecified() const {
00212 return (flags & SPECIFIED) != 0;
00213 }
00214
00215 inline void isSpecified(bool value) {
00216 flags = (value ? flags | SPECIFIED : flags & ~SPECIFIED);
00217 }
00218
00219 inline bool ignorableWhitespace() const {
00220 return (flags & IGNORABLEWS) != 0;
00221 }
00222
00223 inline void ignorableWhitespace(bool value) {
00224 flags = (value ? flags | IGNORABLEWS : flags & ~IGNORABLEWS);
00225 }
00226
00227 inline bool setValue() const {
00228 return (flags & SETVALUE) != 0;
00229 }
00230
00231 inline void setValue(bool value) {
00232 flags = (value ? flags | SETVALUE : flags & ~SETVALUE);
00233 }
00234
00235 inline bool isIdAttr() const {
00236 return (flags & ID_ATTR) != 0;
00237 }
00238
00239 inline void isIdAttr(bool value) {
00240 flags = (value ? flags | ID_ATTR : flags & ~ID_ATTR);
00241 }
00242
00243 inline bool hasUserData() const {
00244 return (flags & USERDATA) != 0;
00245 }
00246
00247 inline void hasUserData(bool value) {
00248 flags = (value ? flags | USERDATA : flags & ~USERDATA);
00249 }
00250
00251
00252
00253
00254
00255
00256 inline bool isLeafNode() const {
00257 return (flags & LEAFNODETYPE) != 0;
00258 }
00259
00260 inline void setIsLeafNode(bool value) {
00261 flags = (value ? flags | LEAFNODETYPE : flags & ~LEAFNODETYPE);
00262 }
00263
00264
00265
00266
00267
00268
00269
00270 inline bool isChildNode() const {
00271 return (flags & CHILDNODE) != 0;
00272 }
00273
00274 inline void setIsChildNode(bool value) {
00275 flags = (value ? flags | CHILDNODE : flags & ~CHILDNODE);
00276 }
00277 };
00278
00279
00280
00281
00282
00283
00284
00285 #define IDOM_NODE_FUNCTIONS \
00286 virtual IDOM_Node *appendChild(IDOM_Node *newChild) ;\
00287 virtual IDOM_Node *cloneNode(bool deep) const ;\
00288 virtual IDOM_NamedNodeMap *getAttributes() const ;\
00289 virtual IDOM_NodeList *getChildNodes() const ;\
00290 virtual IDOM_Node *getFirstChild() const ;\
00291 virtual IDOM_Node *getLastChild() const ;\
00292 virtual const XMLCh * getLocalName() const ;\
00293 virtual const XMLCh * getNamespaceURI() const ;\
00294 virtual IDOM_Node *getNextSibling() const ;\
00295 virtual const XMLCh *getNodeName() const ;\
00296 virtual short getNodeType() const ;\
00297 virtual const XMLCh *getNodeValue() const ;\
00298 virtual IDOM_Document *getOwnerDocument() const ;\
00299 virtual const XMLCh * getPrefix() const ;\
00300 virtual IDOM_Node *getParentNode() const ;\
00301 virtual IDOM_Node *getPreviousSibling() const ;\
00302 virtual bool hasChildNodes() const ;\
00303 virtual IDOM_Node *insertBefore(IDOM_Node *newChild, IDOM_Node *refChild) ;\
00304 virtual void normalize() ;\
00305 virtual IDOM_Node *removeChild(IDOM_Node *oldChild) ;\
00306 virtual IDOM_Node *replaceChild(IDOM_Node *newChild, IDOM_Node *oldChild) ;\
00307 virtual void setNodeValue(const XMLCh *nodeValue) ;\
00308 virtual bool isSupported(const XMLCh *feature, const XMLCh *version) const ;\
00309 virtual bool hasAttributes() const ;\
00310 virtual void setPrefix(const XMLCh * prefix)
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348 #endif