1 | /*
|
---|
2 | * Copyright 1999-2002,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Id: DOM_DOMImplementation.hpp,v 1.6 2004/09/08 13:55:42 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 | #ifndef DOM_DOMImplementation_HEADER_GUARD_
|
---|
22 | #define DOM_DOMImplementation_HEADER_GUARD_
|
---|
23 |
|
---|
24 | #include <xercesc/util/PlatformUtils.hpp>
|
---|
25 | #include "DOMString.hpp"
|
---|
26 |
|
---|
27 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
28 |
|
---|
29 |
|
---|
30 | class DOM_Document;
|
---|
31 | class DOM_DocumentType;
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * This class provides a way to query the capabilities of an implementation
|
---|
35 | * of the DOM
|
---|
36 | */
|
---|
37 |
|
---|
38 |
|
---|
39 | class DEPRECATED_DOM_EXPORT DOM_DOMImplementation {
|
---|
40 | private:
|
---|
41 | DOM_DOMImplementation(const DOM_DOMImplementation &other);
|
---|
42 |
|
---|
43 | public:
|
---|
44 | /** @name Constructors and assignment operators */
|
---|
45 | //@{
|
---|
46 | /**
|
---|
47 | * Construct a DOM_Implementation reference variable, which should
|
---|
48 | * be assigned to the return value from
|
---|
49 | * <code>DOM_Implementation::getImplementation()</code>.
|
---|
50 | */
|
---|
51 | DOM_DOMImplementation();
|
---|
52 |
|
---|
53 | /**
|
---|
54 | * Assignment operator
|
---|
55 | *
|
---|
56 | */
|
---|
57 | DOM_DOMImplementation & operator = (const DOM_DOMImplementation &other);
|
---|
58 | //@}
|
---|
59 |
|
---|
60 | /** @name Destructor */
|
---|
61 | //@{
|
---|
62 | /**
|
---|
63 | * Destructor. The object being destroyed is a reference to the DOMImplemenentation,
|
---|
64 | * not the underlying DOMImplementation object itself, which is owned by
|
---|
65 | * the implementation code.
|
---|
66 | *
|
---|
67 | */
|
---|
68 |
|
---|
69 | ~DOM_DOMImplementation();
|
---|
70 | //@}
|
---|
71 |
|
---|
72 | /** @name Getter functions */
|
---|
73 | //@{
|
---|
74 |
|
---|
75 | /**
|
---|
76 | * Test if the DOM implementation implements a specific feature.
|
---|
77 | *
|
---|
78 | * @param feature The string of the feature to test (case-insensitive). The legal
|
---|
79 | * values are defined throughout this specification. The string must be
|
---|
80 | * an <EM>XML name</EM> (see also Compliance).
|
---|
81 | * @param version This is the version number of the package name to test.
|
---|
82 | * In Level 1, this is the string "1.0". If the version is not specified,
|
---|
83 | * supporting any version of the feature will cause the method to return
|
---|
84 | * <code>true</code>.
|
---|
85 | * @return <code>true</code> if the feature is implemented in the specified
|
---|
86 | * version, <code>false</code> otherwise.
|
---|
87 | */
|
---|
88 | bool hasFeature(const DOMString &feature, const DOMString &version);
|
---|
89 |
|
---|
90 |
|
---|
91 | /** Return a reference to a DOM_Implementation object for this
|
---|
92 | * DOM implementation.
|
---|
93 | *
|
---|
94 | * Intended to support applications that may be
|
---|
95 | * using DOMs retrieved from several different sources, potentially
|
---|
96 | * with different underlying implementations.
|
---|
97 | */
|
---|
98 | static DOM_DOMImplementation &getImplementation();
|
---|
99 |
|
---|
100 | //@}
|
---|
101 |
|
---|
102 | /** @name Functions introduced in DOM Level 2. */
|
---|
103 | //@{
|
---|
104 | /**
|
---|
105 | * Creates an empty <code>DOM_DocumentType</code> node.
|
---|
106 | * Entity declarations and notations are not made available.
|
---|
107 | * Entity reference expansions and default attribute additions
|
---|
108 | * do not occur. It is expected that a future version of the DOM
|
---|
109 | * will provide a way for populating a <code>DOM_DocumentType</code>.
|
---|
110 | *
|
---|
111 | * @param qualifiedName The <em>qualified name</em>
|
---|
112 | * of the document type to be created.
|
---|
113 | * @param publicId The external subset public identifier.
|
---|
114 | * @param systemId The external subset system identifier.
|
---|
115 | * @return A new <code>DOM_DocumentType</code> node with
|
---|
116 | * <code>Node.ownerDocument</code> set to <code>null</code>.
|
---|
117 | * @exception DOMException
|
---|
118 | * INVALID_CHARACTER_ERR: Raised if the specified qualified name
|
---|
119 | * contains an illegal character.
|
---|
120 | * <br>
|
---|
121 | * NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is malformed.
|
---|
122 | */
|
---|
123 | DOM_DocumentType createDocumentType(const DOMString &qualifiedName,
|
---|
124 | const DOMString &publicId, const DOMString &systemId);
|
---|
125 |
|
---|
126 | /**
|
---|
127 | * Creates an XML <code>DOM_Document</code> object of the specified type
|
---|
128 | * with its document element.
|
---|
129 | *
|
---|
130 | * @param namespaceURI The <em>namespace URI</em> of
|
---|
131 | * the document element to create, or <code>null</code>.
|
---|
132 | * @param qualifiedName The <em>qualified name</em>
|
---|
133 | * of the document element to be created.
|
---|
134 | * @param doctype The type of document to be created or <code>null</code>.
|
---|
135 | * <p>When <code>doctype</code> is not <code>null</code>, its
|
---|
136 | * <code>Node.ownerDocument</code> attribute is set to the document
|
---|
137 | * being created.
|
---|
138 | * @return A new <code>DOM_Document</code> object.
|
---|
139 | * @exception DOMException
|
---|
140 | * INVALID_CHARACTER_ERR: Raised if the specified qualified name
|
---|
141 | * contains an illegal character.
|
---|
142 | * <br>
|
---|
143 | * NAMESPACE_ERR: Raised if the <CODE>qualifiedName</CODE> is
|
---|
144 | * malformed, or if the <CODE>qualifiedName</CODE> has a prefix that is
|
---|
145 | * "xml" and the <CODE>namespaceURI</CODE> is different from
|
---|
146 | * "http://www.w3.org/XML/1998/namespace".
|
---|
147 | * <br>
|
---|
148 | * WRONG_DOCUMENT_ERR: Raised if <code>doctype</code> has already
|
---|
149 | * been used with a different document.
|
---|
150 | */
|
---|
151 | DOM_Document createDocument(const DOMString &namespaceURI,
|
---|
152 | const DOMString &qualifiedName, const DOM_DocumentType &doctype,
|
---|
153 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
---|
154 | //@}
|
---|
155 |
|
---|
156 | // -----------------------------------------------------------------------
|
---|
157 | // Notification that lazy data has been deleted
|
---|
158 | // -----------------------------------------------------------------------
|
---|
159 | static void reinitDOM_DOMImplementation();
|
---|
160 | };
|
---|
161 |
|
---|
162 | XERCES_CPP_NAMESPACE_END
|
---|
163 |
|
---|
164 | #endif
|
---|