1 | /*
|
---|
2 | * Copyright (C) 2010 Nikolay Sivov
|
---|
3 | *
|
---|
4 | * This library is free software; you can redistribute it and/or
|
---|
5 | * modify it under the terms of the GNU Lesser General Public
|
---|
6 | * License as published by the Free Software Foundation; either
|
---|
7 | * version 2.1 of the License, or (at your option) any later version.
|
---|
8 | *
|
---|
9 | * This library is distributed in the hope that it will be useful,
|
---|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
12 | * Lesser General Public License for more details.
|
---|
13 | *
|
---|
14 | * You should have received a copy of the GNU Lesser General Public
|
---|
15 | * License along with this library; if not, write to the Free Software
|
---|
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | /*
|
---|
20 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | import "unknwn.idl";
|
---|
29 | import "objidl.idl";
|
---|
30 | import "oaidl.idl";
|
---|
31 |
|
---|
32 | typedef enum XmlNodeType {
|
---|
33 | XmlNodeType_None = 0,
|
---|
34 | XmlNodeType_Element = 1,
|
---|
35 | XmlNodeType_Attribute = 2,
|
---|
36 | XmlNodeType_Text = 3,
|
---|
37 | XmlNodeType_CDATA = 4,
|
---|
38 | XmlNodeType_ProcessingInstruction = 7,
|
---|
39 | XmlNodeType_Comment = 8,
|
---|
40 | XmlNodeType_DocumentType = 10,
|
---|
41 | XmlNodeType_Whitespace = 13,
|
---|
42 | XmlNodeType_EndElement = 15,
|
---|
43 | XmlNodeType_XmlDeclaration = 17,
|
---|
44 | _XmlNodeType_Last = 17
|
---|
45 | } XmlNodeType;
|
---|
46 |
|
---|
47 | /* IXmlReader */
|
---|
48 | [
|
---|
49 | local,
|
---|
50 | object,
|
---|
51 | uuid(7279fc81-709d-4095-b63d-69fe4b0d9030),
|
---|
52 | pointer_default(unique)
|
---|
53 | ]
|
---|
54 | interface IXmlReader : IUnknown
|
---|
55 | {
|
---|
56 | HRESULT SetInput( [in] IUnknown *input);
|
---|
57 | HRESULT GetProperty( [in] UINT property, [out] LONG_PTR *value);
|
---|
58 | HRESULT SetProperty( [in] UINT property, [in] LONG_PTR value);
|
---|
59 | HRESULT Read( [out] XmlNodeType *node_type);
|
---|
60 | HRESULT GetNodeType( [out] XmlNodeType *node_type);
|
---|
61 | HRESULT MoveToFirstAttribute(void);
|
---|
62 | HRESULT MoveToNextAttribute(void);
|
---|
63 | HRESULT MoveToAttributeByName( [in] LPCWSTR local_name,
|
---|
64 | [in] LPCWSTR namespaceUri);
|
---|
65 | HRESULT MoveToElement(void);
|
---|
66 | HRESULT GetQualifiedName( [out] LPCWSTR *qualifiedName,
|
---|
67 | [out] UINT *qualifiedName_length);
|
---|
68 | HRESULT GetNamespaceUri( [out] LPCWSTR *namespaceUri,
|
---|
69 | [out] UINT *nnamespaceUri_length);
|
---|
70 | HRESULT GetLocalName( [out] LPCWSTR *local_name,
|
---|
71 | [out] UINT *locale_name_length);
|
---|
72 | HRESULT GetPrefix( [out] LPCWSTR *prefix,
|
---|
73 | [out] UINT *prefix_length);
|
---|
74 | HRESULT GetValue( [out] LPCWSTR *value,
|
---|
75 | [out] UINT *value_length);
|
---|
76 | HRESULT ReadValueChunk( [out] WCHAR *buffer,
|
---|
77 | [in] UINT chunk_size,
|
---|
78 | [in,out] UINT *read);
|
---|
79 | HRESULT GetBaseUri( [out] LPCWSTR *baseUri,
|
---|
80 | [out] UINT *baseUri_length);
|
---|
81 | BOOL IsDefault(void);
|
---|
82 | BOOL IsEmptyElement(void);
|
---|
83 | HRESULT GetLineNumber( [out] UINT *lineNumber);
|
---|
84 | HRESULT GetLinePosition( [out] UINT *linePosition);
|
---|
85 | HRESULT GetAttributeCount( [out] UINT *attributeCount);
|
---|
86 | HRESULT GetDepth( [out] UINT *depth);
|
---|
87 | BOOL IsEOF(void);
|
---|
88 | }
|
---|
89 |
|
---|
90 | /* IXmlResolver */
|
---|
91 | [
|
---|
92 | local,
|
---|
93 | object,
|
---|
94 | uuid(7279fc82-709d-4095-b63d-69fe4b0d9030),
|
---|
95 | pointer_default(unique)
|
---|
96 | ]
|
---|
97 | interface IXmlResolver : IUnknown
|
---|
98 | {
|
---|
99 | HRESULT ResolveUri([in] LPCWSTR base_uri,
|
---|
100 | [in] LPCWSTR public_id,
|
---|
101 | [in] LPCWSTR system_id,
|
---|
102 | [out] IUnknown **input);
|
---|
103 | }
|
---|
104 |
|
---|
105 | /* IXmlReader state */
|
---|
106 | typedef enum XmlReadState
|
---|
107 | {
|
---|
108 | XmlReadState_Initial,
|
---|
109 | XmlReadState_Interactive,
|
---|
110 | XmlReadState_Error,
|
---|
111 | XmlReadState_EndOfFile,
|
---|
112 | XmlReadState_Closed
|
---|
113 | } XmlReadState;
|
---|
114 |
|
---|
115 | /* conformance levels */
|
---|
116 | typedef enum XmlConformanceLevel
|
---|
117 | {
|
---|
118 | XmlConformanceLevel_Auto,
|
---|
119 | XmlConformanceLevel_Fragment,
|
---|
120 | XmlConformanceLevel_Document,
|
---|
121 | _XmlConformanceLevel_Last = XmlConformanceLevel_Document
|
---|
122 | } XmlConformanceLevel;
|
---|
123 |
|
---|
124 | /* DTD processing mode */
|
---|
125 | typedef enum DtdProcessing
|
---|
126 | {
|
---|
127 | DtdProcessing_Prohibit,
|
---|
128 | DtdProcessing_Parse,
|
---|
129 | _DtdProcessing_Last = DtdProcessing_Parse
|
---|
130 | } DtdProcessing;
|
---|
131 |
|
---|
132 | /* IXmlReader properties */
|
---|
133 | typedef enum XmlReaderProperty
|
---|
134 | {
|
---|
135 | XmlReaderProperty_MultiLanguage,
|
---|
136 | XmlReaderProperty_ConformanceLevel,
|
---|
137 | XmlReaderProperty_RandomAccess,
|
---|
138 | XmlReaderProperty_XmlResolver,
|
---|
139 | XmlReaderProperty_DtdProcessing,
|
---|
140 | XmlReaderProperty_ReadState,
|
---|
141 | XmlReaderProperty_MaxElementDepth,
|
---|
142 | XmlReaderProperty_MaxEntityExpansion,
|
---|
143 | _XmlReaderProperty_Last = XmlReaderProperty_MaxEntityExpansion
|
---|
144 | } XmlReaderProperty;
|
---|
145 |
|
---|
146 | /* reader error codes */
|
---|
147 | typedef enum XmlError
|
---|
148 | {
|
---|
149 | MX_E_MX = 0xc00cee00,
|
---|
150 | MX_E_INPUTEND,
|
---|
151 | MX_E_ENCODING,
|
---|
152 | MX_E_ENCODINGSWITCH,
|
---|
153 | MX_E_ENCODINGSIGNATURE,
|
---|
154 | WC_E_WC = 0xc00cee20,
|
---|
155 | WC_E_WHITESPACE,
|
---|
156 | WC_E_SEMICOLON,
|
---|
157 | WC_E_GREATERTHAN,
|
---|
158 | WC_E_QUOTE,
|
---|
159 | WC_E_EQUAL,
|
---|
160 | WC_E_LESSTHAN,
|
---|
161 | WC_E_HEXDIGIT,
|
---|
162 | WC_E_DIGIT,
|
---|
163 | WC_E_LEFTBRACKET,
|
---|
164 | WC_E_LEFTPAREN,
|
---|
165 | WC_E_XMLCHARACTER,
|
---|
166 | WC_E_NAMECHARACTER,
|
---|
167 | WC_E_SYNTAX,
|
---|
168 | WC_E_CDSECT,
|
---|
169 | WC_E_COMMENT,
|
---|
170 | WC_E_CONDSECT,
|
---|
171 | WC_E_DECLATTLIST,
|
---|
172 | WC_E_DECLDOCTYPE,
|
---|
173 | WC_E_DECLELEMENT,
|
---|
174 | WC_E_DECLENTITY,
|
---|
175 | WC_E_DECLNOTATION,
|
---|
176 | WC_E_NDATA,
|
---|
177 | WC_E_PUBLIC,
|
---|
178 | WC_E_SYSTEM,
|
---|
179 | WC_E_NAME,
|
---|
180 | WC_E_ROOTELEMENT,
|
---|
181 | WC_E_ELEMENTMATCH,
|
---|
182 | WC_E_UNIQUEATTRIBUTE,
|
---|
183 | WC_E_TEXTXMLDECL,
|
---|
184 | WC_E_LEADINGXML,
|
---|
185 | WC_E_TEXTDECL,
|
---|
186 | WC_E_XMLDECL,
|
---|
187 | WC_E_ENCNAME,
|
---|
188 | WC_E_PUBLICID,
|
---|
189 | WC_E_PESINTERNALSUBSET,
|
---|
190 | WC_E_PESBETWEENDECLS,
|
---|
191 | WC_E_NORECURSION,
|
---|
192 | WC_E_ENTITYCONTENT,
|
---|
193 | WC_E_UNDECLAREDENTITY,
|
---|
194 | WC_E_PARSEDENTITY,
|
---|
195 | WC_E_NOEXTERNALENTITYREF,
|
---|
196 | WC_E_PI,
|
---|
197 | WC_E_SYSTEMID,
|
---|
198 | WC_E_QUESTIONMARK,
|
---|
199 | WC_E_CDSECTEND,
|
---|
200 | WC_E_MOREDATA,
|
---|
201 | WC_E_DTDPROHIBITED,
|
---|
202 | WC_E_INVALIDXMLSPACE,
|
---|
203 | NC_E_NC = 0xc00cee60,
|
---|
204 | NC_E_QNAMECHARACTER,
|
---|
205 | NC_E_QNAMECOLON,
|
---|
206 | NC_E_NAMECOLON,
|
---|
207 | NC_E_DECLAREDPREFIX,
|
---|
208 | NC_E_UNDECLAREDPREFIX,
|
---|
209 | NC_E_EMPTYURI,
|
---|
210 | NC_E_XMLPREFIXRESERVED,
|
---|
211 | NC_E_XMLNSPREFIXRESERVED,
|
---|
212 | NC_E_XMLURIRESERVED,
|
---|
213 | NC_E_XMLNSURIRESERVED,
|
---|
214 | SC_E_SC = 0xc00cee80,
|
---|
215 | SC_E_MAXELEMENTDEPTH,
|
---|
216 | SC_E_MAXENTITYEXPANSION,
|
---|
217 | WR_E_WR = 0xc00cef00,
|
---|
218 | WR_E_NONWHITESPACE,
|
---|
219 | WR_E_NSPREFIXDECLARED,
|
---|
220 | WR_E_NSPREFIXWITHEMPTYNSURI,
|
---|
221 | WR_E_DUPLICATEATTRIBUTE,
|
---|
222 | WR_E_XMLNSPREFIXDECLARATION,
|
---|
223 | WR_E_XMLPREFIXDECLARATION,
|
---|
224 | WR_E_XMLURIDECLARATION,
|
---|
225 | WR_E_XMLNSURIDECLARATION,
|
---|
226 | WR_E_NAMESPACEUNDECLARED,
|
---|
227 | WR_E_INVALIDXMLSPACE,
|
---|
228 | WR_E_INVALIDACTION,
|
---|
229 | WR_E_INVALIDSURROGATEPAIR,
|
---|
230 | XML_E_INVALID_DECIMAL = 0xc00ce01d,
|
---|
231 | XML_E_INVALID_HEXIDECIMAL,
|
---|
232 | XML_E_INVALID_UNICODE,
|
---|
233 | XML_E_INVALIDENCODING = 0xc00ce06e
|
---|
234 | } XmlError;
|
---|
235 |
|
---|
236 | /* IXmlReader construction */
|
---|
237 | cpp_quote("STDAPI CreateXmlReader(REFIID riid, void **ppvObject, IMalloc *pMalloc);")
|
---|
238 |
|
---|
239 | cpp_quote("typedef IUnknown IXmlReaderInput;")
|
---|
240 | cpp_quote("STDAPI CreateXmlReaderInputWithEncodingName(IUnknown *stream, IMalloc *pMalloc,")
|
---|
241 | cpp_quote(" LPCWSTR encoding, BOOL hint,")
|
---|
242 | cpp_quote(" LPCWSTR base_uri, IXmlReaderInput **ppInput);")
|
---|
243 |
|
---|
244 | typedef enum XmlStandalone
|
---|
245 | {
|
---|
246 | XmlStandalone_Omit,
|
---|
247 | XmlStandalone_Yes,
|
---|
248 | XmlStandalone_No,
|
---|
249 | _XmlStandalone_Last = XmlStandalone_No
|
---|
250 | } XmlStandalone;
|
---|
251 |
|
---|
252 | typedef enum XmlWriterProperty
|
---|
253 | {
|
---|
254 | XmlWriterProperty_MultiLanguage,
|
---|
255 | XmlWriterProperty_Indent,
|
---|
256 | XmlWriterProperty_ByteOrderMark,
|
---|
257 | XmlWriterProperty_OmitXmlDeclaration,
|
---|
258 | XmlWriterProperty_ConformanceLevel,
|
---|
259 | _XmlWriterProperty_Last = XmlWriterProperty_OmitXmlDeclaration
|
---|
260 | } XmlWriterProperty;
|
---|
261 |
|
---|
262 | /* IXmlWriter */
|
---|
263 | [
|
---|
264 | local,
|
---|
265 | object,
|
---|
266 | uuid(7279FC88-709D-4095-B63D-69FE4B0D9030),
|
---|
267 | pointer_default(unique)
|
---|
268 | ]
|
---|
269 | interface IXmlWriter : IUnknown
|
---|
270 | {
|
---|
271 | HRESULT SetOutput([in] IUnknown *pOutput);
|
---|
272 | HRESULT GetProperty([in] UINT nProperty, [out] LONG_PTR *ppValue);
|
---|
273 | HRESULT SetProperty([in] UINT nProperty, [in] LONG_PTR pValue);
|
---|
274 | HRESULT WriteAttributes([in] IXmlReader *pReader, [in] BOOL fWriteDefaultAttributes);
|
---|
275 | HRESULT WriteAttributeString([in] LPCWSTR pwszPrefix, [in] LPCWSTR pwszLocalName,
|
---|
276 | [in] LPCWSTR pwszNamespaceUri, [in] LPCWSTR pwszValue);
|
---|
277 | HRESULT WriteCData([in] LPCWSTR pwszText);
|
---|
278 | HRESULT WriteCharEntity([in] WCHAR wch);
|
---|
279 | HRESULT WriteChars([in] const WCHAR *pwch, [in] UINT cwch);
|
---|
280 | HRESULT WriteComment([in] LPCWSTR pwszComment);
|
---|
281 | HRESULT WriteDocType([in] LPCWSTR pwszName, [in] LPCWSTR pwszPublicId,
|
---|
282 | [in] LPCWSTR pwszSystemId, [in] LPCWSTR pwszSubset);
|
---|
283 | HRESULT WriteElementString([in] LPCWSTR pwszPrefix, [in] LPCWSTR pwszLocalName,
|
---|
284 | [in] LPCWSTR pwszNamespaceUri, [in] LPCWSTR pwszValue);
|
---|
285 | HRESULT WriteEndDocument();
|
---|
286 | HRESULT WriteEndElement();
|
---|
287 | HRESULT WriteEntityRef([in] LPCWSTR pwszName);
|
---|
288 | HRESULT WriteFullEndElement();
|
---|
289 | HRESULT WriteName([in] LPCWSTR pwszName);
|
---|
290 | HRESULT WriteNmToken([in] LPCWSTR pwszNmToken);
|
---|
291 | HRESULT WriteNode([in] IXmlReader *pReader, [in] BOOL fWriteDefaultAttributes);
|
---|
292 | HRESULT WriteNodeShallow([in] IXmlReader *pReader, [in] BOOL fWriteDefaultAttributes);
|
---|
293 | HRESULT WriteProcessingInstruction([in] LPCWSTR pwszName, [in] LPCWSTR pwszText);
|
---|
294 | HRESULT WriteQualifiedName([in] LPCWSTR pwszLocalName, [in] LPCWSTR pwszNamespaceUri);
|
---|
295 | HRESULT WriteRaw([in] LPCWSTR pwszData);
|
---|
296 | HRESULT WriteRawChars([in] const WCHAR *pwch, [in] UINT cwch);
|
---|
297 | HRESULT WriteStartDocument([in] XmlStandalone standalone);
|
---|
298 | HRESULT WriteStartElement([in] LPCWSTR pwszPrefix, [in] LPCWSTR pwszLocalName,
|
---|
299 | [in] LPCWSTR pwszNamespaceUri);
|
---|
300 | HRESULT WriteString([in] LPCWSTR pwszText);
|
---|
301 | HRESULT WriteSurrogateCharEntity([in] WCHAR wchLow, [in] WCHAR wchHigh);
|
---|
302 | HRESULT WriteWhitespace([in] LPCWSTR pwszWhitespace);
|
---|
303 | HRESULT Flush();
|
---|
304 | }
|
---|