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