1 | #ifndef DOMImplementationLS_HEADER_GUARD_ |
---|
2 | #define DOMImplementationLS_HEADER_GUARD_ |
---|
3 | |
---|
4 | /* |
---|
5 | * Licensed to the Apache Software Foundation (ASF) under one or more |
---|
6 | * contributor license agreements. See the NOTICE file distributed with |
---|
7 | * this work for additional information regarding copyright ownership. |
---|
8 | * The ASF licenses this file to You under the Apache License, Version 2.0 |
---|
9 | * (the "License"); you may not use this file except in compliance with |
---|
10 | * the License. You may obtain a copy of the License at |
---|
11 | * |
---|
12 | * http://www.apache.org/licenses/LICENSE-2.0 |
---|
13 | * |
---|
14 | * Unless required by applicable law or agreed to in writing, software |
---|
15 | * distributed under the License is distributed on an "AS IS" BASIS, |
---|
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
17 | * See the License for the specific language governing permissions and |
---|
18 | * limitations under the License. |
---|
19 | */ |
---|
20 | |
---|
21 | /* |
---|
22 | * $Id: DOMImplementationLS.hpp 568078 2007-08-21 11:43:25Z amassari $ |
---|
23 | */ |
---|
24 | |
---|
25 | |
---|
26 | #include <xercesc/util/PlatformUtils.hpp> |
---|
27 | |
---|
28 | XERCES_CPP_NAMESPACE_BEGIN |
---|
29 | |
---|
30 | |
---|
31 | class DOMBuilder; |
---|
32 | class DOMWriter; |
---|
33 | class DOMInputSource; |
---|
34 | class MemoryManager; |
---|
35 | class XMLGrammarPool; |
---|
36 | |
---|
37 | /** |
---|
38 | * <p><code>DOMImplementationLS</code> contains the factory methods for |
---|
39 | * creating objects that implement the <code>DOMBuilder</code> (parser) and |
---|
40 | * <code>DOMWriter</code> (serializer) interfaces.</p> |
---|
41 | * |
---|
42 | * <p>An object that implements DOMImplementationLS is obtained by doing a |
---|
43 | * binding specific cast from DOMImplementation to DOMImplementationLS. |
---|
44 | * Implementations supporting the Load and Save feature must implement the |
---|
45 | * DOMImplementationLS interface on whatever object implements the |
---|
46 | * DOMImplementation interface.</p> |
---|
47 | * |
---|
48 | * @since DOM Level 3 |
---|
49 | */ |
---|
50 | class CDOM_EXPORT DOMImplementationLS |
---|
51 | { |
---|
52 | protected: |
---|
53 | // ----------------------------------------------------------------------- |
---|
54 | // Hidden constructors |
---|
55 | // ----------------------------------------------------------------------- |
---|
56 | /** @name Hidden constructors */ |
---|
57 | //@{ |
---|
58 | DOMImplementationLS() {}; |
---|
59 | //@} |
---|
60 | |
---|
61 | private: |
---|
62 | // ----------------------------------------------------------------------- |
---|
63 | // Unimplemented constructors and operators |
---|
64 | // ----------------------------------------------------------------------- |
---|
65 | /** @name Unimplemented constructors and operators */ |
---|
66 | //@{ |
---|
67 | DOMImplementationLS(const DOMImplementationLS &); |
---|
68 | DOMImplementationLS & operator = (const DOMImplementationLS &); |
---|
69 | //@} |
---|
70 | |
---|
71 | public: |
---|
72 | // ----------------------------------------------------------------------- |
---|
73 | // All constructors are hidden, just the destructor is available |
---|
74 | // ----------------------------------------------------------------------- |
---|
75 | /** @name Destructor */ |
---|
76 | //@{ |
---|
77 | /** |
---|
78 | * Destructor |
---|
79 | * |
---|
80 | */ |
---|
81 | virtual ~DOMImplementationLS() {}; |
---|
82 | //@} |
---|
83 | |
---|
84 | // ----------------------------------------------------------------------- |
---|
85 | // Public constants |
---|
86 | // ----------------------------------------------------------------------- |
---|
87 | /** @name Public constants */ |
---|
88 | //@{ |
---|
89 | /** |
---|
90 | * Create a synchronous or an asynchronous <code>DOMBuilder</code>. |
---|
91 | * @see createDOMBuilder(const short mode, const XMLCh* const schemaType) |
---|
92 | * @since DOM Level 3 |
---|
93 | * |
---|
94 | */ |
---|
95 | enum |
---|
96 | { |
---|
97 | MODE_SYNCHRONOUS = 1, |
---|
98 | MODE_ASYNCHRONOUS = 2 |
---|
99 | }; |
---|
100 | //@} |
---|
101 | |
---|
102 | // ----------------------------------------------------------------------- |
---|
103 | // Virtual DOMImplementation LS interface |
---|
104 | // ----------------------------------------------------------------------- |
---|
105 | /** @name Functions introduced in DOM Level 3 */ |
---|
106 | //@{ |
---|
107 | // ----------------------------------------------------------------------- |
---|
108 | // Factory create methods |
---|
109 | // ----------------------------------------------------------------------- |
---|
110 | /** |
---|
111 | * Create a new DOMBuilder. The newly constructed parser may then be |
---|
112 | * configured by means of its setFeature method, and used to parse |
---|
113 | * documents by means of its parse method. |
---|
114 | * |
---|
115 | * <p><b>"Experimental - subject to change"</b></p> |
---|
116 | * |
---|
117 | * @param mode The mode argument is either <code>MODE_SYNCHRONOUS</code> or |
---|
118 | * <code>MODE_ASYNCHRONOUS</code>, if mode is <code>MODE_SYNCHRONOUS</code> |
---|
119 | * then the <code>DOMBuilder</code> that is created will operate in |
---|
120 | * synchronous mode, if it's <code>MODE_ASYNCHRONOUS</code> then the |
---|
121 | * <code>DOMBuilder</code> that is created will operate in asynchronous |
---|
122 | * mode. |
---|
123 | * @param schemaType An absolute URI representing the type of the schema |
---|
124 | * language used during the load of a DOMDocument using the newly created |
---|
125 | * <code>DOMBuilder</code>. Note that no lexical checking is done on the |
---|
126 | * absolute URI. In order to create a DOMBuilder for any kind of schema |
---|
127 | * types (i.e. the DOMBuilder will be free to use any schema found), use |
---|
128 | * the value <code>null</code>. |
---|
129 | * @param manager Pointer to the memory manager to be used to |
---|
130 | * allocate objects. |
---|
131 | * @param gramPool The collection of cached grammers. |
---|
132 | * @return The newly created <code>DOMBuilder</code> object. This |
---|
133 | * <code>DOMBuilder</code> is either synchronous or asynchronous depending |
---|
134 | * on the value of the <code>mode</code> argument. |
---|
135 | * @exception DOMException NOT_SUPPORTED_ERR: Raised if the requested mode |
---|
136 | * or schema type is not supported. |
---|
137 | * |
---|
138 | * @see DOMBuilder |
---|
139 | * @since DOM Level 3 |
---|
140 | */ |
---|
141 | virtual DOMBuilder* createDOMBuilder(const short mode, |
---|
142 | const XMLCh* const schemaType, |
---|
143 | MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager, |
---|
144 | XMLGrammarPool* const gramPool = 0) = 0; |
---|
145 | |
---|
146 | |
---|
147 | /** |
---|
148 | * Create a new DOMWriter. DOMWriters are used to serialize a DOM tree |
---|
149 | * back into an XML document. |
---|
150 | * |
---|
151 | * <p><b>"Experimental - subject to change"</b></p> |
---|
152 | * |
---|
153 | * @return The newly created <code>DOMWriter</code> object. |
---|
154 | * |
---|
155 | * @see DOMWriter |
---|
156 | * @since DOM Level 3 |
---|
157 | */ |
---|
158 | virtual DOMWriter* createDOMWriter(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager) = 0; |
---|
159 | |
---|
160 | /** |
---|
161 | * Create a new "empty" DOMInputSource. |
---|
162 | * |
---|
163 | * <p><b>"Experimental - subject to change"</b></p> |
---|
164 | * |
---|
165 | * @return The newly created <code>DOMInputSource</code> object. |
---|
166 | * @exception DOMException NOT_SUPPORTED_ERR: Raised if this function is not |
---|
167 | * supported by implementation |
---|
168 | * |
---|
169 | * @see DOMInputSource |
---|
170 | * @since DOM Level 3 |
---|
171 | */ |
---|
172 | virtual DOMInputSource* createDOMInputSource() = 0; |
---|
173 | |
---|
174 | //@} |
---|
175 | }; |
---|
176 | |
---|
177 | |
---|
178 | XERCES_CPP_NAMESPACE_END |
---|
179 | |
---|
180 | #endif |
---|