msxml3: A stub for MXXMLWriter class.
[wine/multimedia.git] / dlls / msxml3 / mxwriter.c
blobcb827b4d108627111bce82de586a88e0f311bf11
1 /*
2 * MXWriter implementation
4 * Copyright 2011 Nikolay Sivov for CodeWeaversы
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #define COBJMACROS
22 #include "config.h"
24 #include <stdarg.h>
25 #ifdef HAVE_LIBXML2
26 # include <libxml/parser.h>
27 #endif
29 #include "windef.h"
30 #include "winbase.h"
31 #include "ole2.h"
33 #include "msxml6.h"
35 #include "wine/debug.h"
37 #include "msxml_private.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
41 typedef struct _mxwriter
43 IMXWriter IMXWriter_iface;
44 LONG ref;
45 } mxwriter;
47 static inline mxwriter *impl_from_IMXWriter(IMXWriter *iface)
49 return CONTAINING_RECORD(iface, mxwriter, IMXWriter_iface);
52 static HRESULT WINAPI mxwriter_QueryInterface(IMXWriter *iface, REFIID riid, void **obj)
54 mxwriter *This = impl_from_IMXWriter( iface );
56 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), obj);
58 if ( IsEqualGUID( riid, &IID_IMXWriter ) ||
59 IsEqualGUID( riid, &IID_IDispatch ) ||
60 IsEqualGUID( riid, &IID_IUnknown ) )
62 *obj = &This->IMXWriter_iface;
64 else
66 ERR("interface %s not implemented\n", debugstr_guid(riid));
67 *obj = NULL;
68 return E_NOINTERFACE;
71 IMXWriter_AddRef(iface);
72 return S_OK;
75 static ULONG WINAPI mxwriter_AddRef(IMXWriter *iface)
77 mxwriter *This = impl_from_IMXWriter( iface );
78 LONG ref = InterlockedIncrement(&This->ref);
80 TRACE("(%p)->(%d)\n", This, ref);
82 return ref;
85 static ULONG WINAPI mxwriter_Release(IMXWriter *iface)
87 mxwriter *This = impl_from_IMXWriter( iface );
88 ULONG ref = InterlockedDecrement(&This->ref);
90 TRACE("(%p)->(%d)\n", This, ref);
92 if(!ref)
93 heap_free(This);
95 return ref;
98 static HRESULT WINAPI mxwriter_GetTypeInfoCount(IMXWriter *iface, UINT* pctinfo)
100 mxwriter *This = impl_from_IMXWriter( iface );
102 TRACE("(%p)->(%p)\n", This, pctinfo);
104 *pctinfo = 1;
106 return S_OK;
109 static HRESULT WINAPI mxwriter_GetTypeInfo(
110 IMXWriter *iface,
111 UINT iTInfo, LCID lcid,
112 ITypeInfo** ppTInfo )
114 mxwriter *This = impl_from_IMXWriter( iface );
116 TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
118 return get_typeinfo(IMXWriter_tid, ppTInfo);
121 static HRESULT WINAPI mxwriter_GetIDsOfNames(
122 IMXWriter *iface,
123 REFIID riid, LPOLESTR* rgszNames,
124 UINT cNames, LCID lcid, DISPID* rgDispId )
126 mxwriter *This = impl_from_IMXWriter( iface );
127 ITypeInfo *typeinfo;
128 HRESULT hr;
130 TRACE("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
131 lcid, rgDispId);
133 if(!rgszNames || cNames == 0 || !rgDispId)
134 return E_INVALIDARG;
136 hr = get_typeinfo(IMXWriter_tid, &typeinfo);
137 if(SUCCEEDED(hr))
139 hr = ITypeInfo_GetIDsOfNames(typeinfo, rgszNames, cNames, rgDispId);
140 ITypeInfo_Release(typeinfo);
143 return hr;
146 static HRESULT WINAPI mxwriter_Invoke(
147 IMXWriter *iface,
148 DISPID dispIdMember, REFIID riid, LCID lcid,
149 WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult,
150 EXCEPINFO* pExcepInfo, UINT* puArgErr )
152 mxwriter *This = impl_from_IMXWriter( iface );
153 ITypeInfo *typeinfo;
154 HRESULT hr;
156 TRACE("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
157 lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
159 hr = get_typeinfo(IMXWriter_tid, &typeinfo);
160 if(SUCCEEDED(hr))
162 hr = ITypeInfo_Invoke(typeinfo, &This->IMXWriter_iface, dispIdMember, wFlags,
163 pDispParams, pVarResult, pExcepInfo, puArgErr);
164 ITypeInfo_Release(typeinfo);
167 return hr;
170 static HRESULT WINAPI mxwriter_put_output(IMXWriter *iface, VARIANT dest)
172 mxwriter *This = impl_from_IMXWriter( iface );
173 FIXME("(%p)->(%s)\n", This, debugstr_variant(&dest));
174 return E_NOTIMPL;
177 static HRESULT WINAPI mxwriter_get_output(IMXWriter *iface, VARIANT *dest)
179 mxwriter *This = impl_from_IMXWriter( iface );
180 FIXME("(%p)->(%p)\n", This, dest);
181 return E_NOTIMPL;
184 static HRESULT WINAPI mxwriter_put_encoding(IMXWriter *iface, BSTR encoding)
186 mxwriter *This = impl_from_IMXWriter( iface );
187 FIXME("(%p)->(%s)\n", This, debugstr_w(encoding));
188 return E_NOTIMPL;
191 static HRESULT WINAPI mxwriter_get_encoding(IMXWriter *iface, BSTR *encoding)
193 mxwriter *This = impl_from_IMXWriter( iface );
194 FIXME("(%p)->(%p)\n", This, encoding);
195 return E_NOTIMPL;
198 static HRESULT WINAPI mxwriter_put_byteOrderMark(IMXWriter *iface, VARIANT_BOOL writeBOM)
200 mxwriter *This = impl_from_IMXWriter( iface );
201 FIXME("(%p)->(%d)\n", This, writeBOM);
202 return E_NOTIMPL;
205 static HRESULT WINAPI mxwriter_get_byteOrderMark(IMXWriter *iface, VARIANT_BOOL *writeBOM)
207 mxwriter *This = impl_from_IMXWriter( iface );
208 FIXME("(%p)->(%p)\n", This, writeBOM);
209 return E_NOTIMPL;
212 static HRESULT WINAPI mxwriter_put_indent(IMXWriter *iface, VARIANT_BOOL indent)
214 mxwriter *This = impl_from_IMXWriter( iface );
215 FIXME("(%p)->(%d)\n", This, indent);
216 return E_NOTIMPL;
219 static HRESULT WINAPI mxwriter_get_indent(IMXWriter *iface, VARIANT_BOOL *indent)
221 mxwriter *This = impl_from_IMXWriter( iface );
222 FIXME("(%p)->(%p)\n", This, indent);
223 return E_NOTIMPL;
226 static HRESULT WINAPI mxwriter_put_standalone(IMXWriter *iface, VARIANT_BOOL value)
228 mxwriter *This = impl_from_IMXWriter( iface );
229 FIXME("(%p)->(%d)\n", This, value);
230 return E_NOTIMPL;
233 static HRESULT WINAPI mxwriter_get_standalone(IMXWriter *iface, VARIANT_BOOL *value)
235 mxwriter *This = impl_from_IMXWriter( iface );
236 FIXME("(%p)->(%p)\n", This, value);
237 return E_NOTIMPL;
240 static HRESULT WINAPI mxwriter_put_omitXMLDeclaration(IMXWriter *iface, VARIANT_BOOL value)
242 mxwriter *This = impl_from_IMXWriter( iface );
243 FIXME("(%p)->(%d)\n", This, value);
244 return E_NOTIMPL;
247 static HRESULT WINAPI mxwriter_get_omitXMLDeclaration(IMXWriter *iface, VARIANT_BOOL *value)
249 mxwriter *This = impl_from_IMXWriter( iface );
250 FIXME("(%p)->(%p)\n", This, value);
251 return E_NOTIMPL;
254 static HRESULT WINAPI mxwriter_put_version(IMXWriter *iface, BSTR version)
256 mxwriter *This = impl_from_IMXWriter( iface );
257 FIXME("(%p)->(%s)\n", This, debugstr_w(version));
258 return E_NOTIMPL;
261 static HRESULT WINAPI mxwriter_get_version(IMXWriter *iface, BSTR *version)
263 mxwriter *This = impl_from_IMXWriter( iface );
264 FIXME("(%p)->(%p)\n", This, version);
265 return E_NOTIMPL;
268 static HRESULT WINAPI mxwriter_put_disableOutputEscaping(IMXWriter *iface, VARIANT_BOOL value)
270 mxwriter *This = impl_from_IMXWriter( iface );
271 FIXME("(%p)->(%d)\n", This, value);
272 return E_NOTIMPL;
275 static HRESULT WINAPI mxwriter_get_disableOutputEscaping(IMXWriter *iface, VARIANT_BOOL *value)
277 mxwriter *This = impl_from_IMXWriter( iface );
278 FIXME("(%p)->(%p)\n", This, value);
279 return E_NOTIMPL;
282 static HRESULT WINAPI mxwriter_flush(IMXWriter *iface)
284 mxwriter *This = impl_from_IMXWriter( iface );
285 FIXME("(%p)\n", This);
286 return E_NOTIMPL;
289 static const struct IMXWriterVtbl mxwriter_vtbl =
291 mxwriter_QueryInterface,
292 mxwriter_AddRef,
293 mxwriter_Release,
294 mxwriter_GetTypeInfoCount,
295 mxwriter_GetTypeInfo,
296 mxwriter_GetIDsOfNames,
297 mxwriter_Invoke,
298 mxwriter_put_output,
299 mxwriter_get_output,
300 mxwriter_put_encoding,
301 mxwriter_get_encoding,
302 mxwriter_put_byteOrderMark,
303 mxwriter_get_byteOrderMark,
304 mxwriter_put_indent,
305 mxwriter_get_indent,
306 mxwriter_put_standalone,
307 mxwriter_get_standalone,
308 mxwriter_put_omitXMLDeclaration,
309 mxwriter_get_omitXMLDeclaration,
310 mxwriter_put_version,
311 mxwriter_get_version,
312 mxwriter_put_disableOutputEscaping,
313 mxwriter_get_disableOutputEscaping,
314 mxwriter_flush
317 HRESULT MXWriter_create(IUnknown *pUnkOuter, void **ppObj)
319 mxwriter *This;
321 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
323 if (pUnkOuter) FIXME("support aggregation, outer\n");
325 This = heap_alloc( sizeof (*This) );
326 if(!This)
327 return E_OUTOFMEMORY;
329 This->IMXWriter_iface.lpVtbl = &mxwriter_vtbl;
330 This->ref = 1;
332 *ppObj = &This->IMXWriter_iface;
334 TRACE("returning iface %p\n", *ppObj);
336 return S_OK;