source: icXML/icXML-devel/src/xercesc/dom/impl/DOMElementImpl.hpp @ 2722

Last change on this file since 2722 was 2722, checked in by cameron, 6 years ago

Original Xerces files with import mods for icxercesc

File size: 5.7 KB
Line 
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements.  See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License.  You may obtain a copy of the License at
8 *
9 *      http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/*
19 * $Id: DOMElementImpl.hpp 792236 2009-07-08 17:22:35Z amassari $
20 */
21
22#if !defined(XERCESC_INCLUDE_GUARD_DOMELEMENTIMPL_HPP)
23#define XERCESC_INCLUDE_GUARD_DOMELEMENTIMPL_HPP
24
25//
26//  This file is part of the internal implementation of the C++ XML DOM.
27//  It should NOT be included or used directly by application programs.
28//
29//  Applications should include the file <xercesc/dom/DOM.hpp> for the entire
30//  DOM API, or xercesc/dom/DOM*.hpp for individual DOM classes, where the class
31//  name is substituded for the *.
32//
33
34
35#include <xercesc/util/XercesDefs.hpp>
36#include <icxercesc/util/XMLString.hpp>
37#include <xercesc/dom/DOMElement.hpp>
38
39#include "DOMChildNode.hpp"
40#include "DOMNodeImpl.hpp"
41#include "DOMParentNode.hpp"
42
43#include "DOMAttrMapImpl.hpp"
44
45XERCES_CPP_NAMESPACE_BEGIN
46
47class DOMTypeInfo;
48class DOMNodeList;
49class DOMAttrMapImpl;
50class DOMDocument;
51
52
53
54
55class CDOM_EXPORT DOMElementImpl: public DOMElement {
56public:
57    DOMNodeImpl       fNode;
58    DOMParentNode     fParent;
59    DOMChildNode      fChild;
60    DOMAttrMapImpl    *fAttributes;
61    DOMAttrMapImpl    *fDefaultAttributes;
62    const XMLCh      *fName;
63
64public:
65    DOMElementImpl(DOMDocument *ownerDoc, const XMLCh *name);
66
67    DOMElementImpl(const DOMElementImpl &other, bool deep=false);
68    virtual ~DOMElementImpl();
69
70public:
71    // Declare functions from DOMNode.  They all must be implemented by this class
72    DOMNODE_FUNCTIONS;
73
74public:
75    // Functions introduced on Element...
76    virtual const XMLCh*      getAttribute(const XMLCh *name) const;
77    virtual DOMAttr*          getAttributeNode(const XMLCh *name) const;
78    virtual DOMNodeList*      getElementsByTagName(const XMLCh *tagname) const;
79    virtual const XMLCh*      getTagName() const;
80    virtual void              removeAttribute(const XMLCh *name);
81    virtual DOMAttr*          removeAttributeNode(DOMAttr * oldAttr);
82    virtual void              setAttribute(const XMLCh *name, const XMLCh *value);
83    virtual DOMAttr*          setAttributeNode(DOMAttr *newAttr);
84    virtual void              setReadOnly(bool readOnly, bool deep);
85
86    //Introduced in DOM Level 2
87    virtual const XMLCh*      getAttributeNS(const XMLCh *namespaceURI,
88                                             const XMLCh *localName) const;
89    virtual void              setAttributeNS(const XMLCh *namespaceURI,
90                                             const XMLCh *qualifiedName,
91                                             const XMLCh *value);
92    virtual void              removeAttributeNS(const XMLCh *namespaceURI,
93                                                const XMLCh *localName);
94    virtual DOMAttr*          getAttributeNodeNS(const XMLCh *namespaceURI,
95                                                 const XMLCh *localName) const;
96    virtual DOMAttr*          setAttributeNodeNS(DOMAttr *newAttr);
97    virtual DOMNodeList*      getElementsByTagNameNS(const XMLCh *namespaceURI,
98                                                     const XMLCh *localName) const;
99    virtual bool              hasAttribute(const XMLCh *name) const;
100    virtual bool              hasAttributeNS(const XMLCh *namespaceURI,
101                                             const XMLCh *localName) const;
102
103    //Introduced in DOM level 3
104    virtual void setIdAttribute(const XMLCh* name, bool isId);
105    virtual void setIdAttributeNS(const XMLCh* namespaceURI, const XMLCh* localName, bool isId);
106    virtual void setIdAttributeNode(const DOMAttr *idAttr, bool isId);
107    virtual const DOMTypeInfo * getSchemaTypeInfo() const;
108
109    // for handling of default attribute
110    virtual DOMAttr*          setDefaultAttributeNode(DOMAttr *newAttr);
111    virtual DOMAttr*          setDefaultAttributeNodeNS(DOMAttr *newAttr);
112    virtual DOMAttrMapImpl*   getDefaultAttributes() const;
113
114    // helper function for DOM Level 3 renameNode
115    virtual DOMNode* rename(const XMLCh* namespaceURI, const XMLCh* name);
116
117    // DOMElementTraversal
118    virtual DOMElement *         getFirstElementChild() const;
119    virtual DOMElement *         getLastElementChild() const;
120    virtual DOMElement *         getPreviousElementSibling() const;
121    virtual DOMElement *         getNextElementSibling() const;
122    virtual XMLSize_t            getChildElementCount() const;
123
124protected:
125    // default attribute helper functions
126    virtual void setupDefaultAttributes();
127
128    // helper function for DOMElementTraversal methods
129    DOMElement* getFirstElementChild(const DOMNode* n) const;
130    DOMElement* getLastElementChild(const DOMNode* n) const;
131    DOMNode* getNextLogicalSibling(const DOMNode* n) const;
132    DOMNode* getPreviousLogicalSibling(const DOMNode* n) const;
133
134private:
135    // -----------------------------------------------------------------------
136    // Unimplemented constructors and operators
137    // -----------------------------------------------------------------------   
138    DOMElementImpl & operator = (const DOMElementImpl &);
139};
140
141XERCES_CPP_NAMESPACE_END
142
143#endif
Note: See TracBrowser for help on using the repository browser.