widl: Add support for structures.
[wine.git] / dlls / msxml3 / xmlview.c
blob0705741e8571196ff861165d7a4d0933da45eb91
1 /*
2 * Copyright 2012 Piotr Caban for CodeWeavers
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.
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.
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
19 #include <stdarg.h>
21 #define COBJMACROS
22 #include "windef.h"
23 #include "winbase.h"
24 #include "ole2.h"
25 #include "msxml6.h"
26 #include "mshtml.h"
27 #include "mshtmhst.h"
28 #include "perhist.h"
29 #include "docobj.h"
31 #include "wine/debug.h"
33 #include "msxml_dispex.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(msxml);
37 typedef struct
39 IPersistMoniker IPersistMoniker_iface;
40 IPersistHistory IPersistHistory_iface;
41 IOleCommandTarget IOleCommandTarget_iface;
42 IOleObject IOleObject_iface;
44 LONG ref;
46 IUnknown *html_doc;
47 IMoniker *mon;
48 } XMLView;
50 typedef struct
52 IMoniker IMoniker_iface;
53 LONG ref;
54 IMoniker *mon;
56 IStream *stream;
57 } Moniker;
59 typedef struct
61 IBindStatusCallback IBindStatusCallback_iface;
62 LONG ref;
63 IBindStatusCallback *bsc;
65 IMoniker *mon;
66 IStream *stream;
67 } BindStatusCallback;
69 typedef struct
71 IBinding IBinding_iface;
72 LONG ref;
73 IBinding *binding;
74 } Binding;
76 static inline Binding* impl_from_IBinding(IBinding *iface)
78 return CONTAINING_RECORD(iface, Binding, IBinding_iface);
81 static HRESULT WINAPI XMLView_Binding_QueryInterface(
82 IBinding *iface, REFIID riid, void **ppvObject)
84 Binding *This = impl_from_IBinding(iface);
86 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
88 if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IBinding)) {
89 *ppvObject = iface;
90 IBinding_AddRef(iface);
91 return S_OK;
94 *ppvObject = NULL;
95 return E_NOINTERFACE;
98 static ULONG WINAPI XMLView_Binding_AddRef(IBinding *iface)
100 Binding *This = impl_from_IBinding(iface);
101 ULONG ref = InterlockedIncrement(&This->ref);
103 TRACE("%p, refcount %lu.\n", iface, ref);
105 return ref;
108 static ULONG WINAPI XMLView_Binding_Release(IBinding *iface)
110 Binding *This = impl_from_IBinding(iface);
111 ULONG ref = InterlockedDecrement(&This->ref);
113 TRACE("%p, refcount %lu.\n", iface, ref);
115 if(!ref) {
116 IBinding_Release(This->binding);
117 free(This);
119 return ref;
122 static HRESULT WINAPI XMLView_Binding_Abort(IBinding *iface)
124 Binding *This = impl_from_IBinding(iface);
125 TRACE("(%p)\n", This);
127 return IBinding_Abort(This->binding);
130 static HRESULT WINAPI XMLView_Binding_Suspend(IBinding *iface)
132 Binding *This = impl_from_IBinding(iface);
133 FIXME("(%p)\n", This);
134 return E_NOTIMPL;
137 static HRESULT WINAPI XMLView_Binding_Resume(IBinding *iface)
139 Binding *This = impl_from_IBinding(iface);
140 FIXME("(%p)\n", This);
141 return E_NOTIMPL;
144 static HRESULT WINAPI XMLView_Binding_SetPriority(
145 IBinding *iface, LONG nPriority)
147 Binding *This = impl_from_IBinding(iface);
148 TRACE("%p, %ld.\n", iface, nPriority);
150 return IBinding_SetPriority(This->binding, nPriority);
153 static HRESULT WINAPI XMLView_Binding_GetPriority(
154 IBinding *iface, LONG *pnPriority)
156 Binding *This = impl_from_IBinding(iface);
157 TRACE("(%p)->(%p)\n", This, pnPriority);
159 return IBinding_GetPriority(This->binding, pnPriority);
162 static HRESULT WINAPI XMLView_Binding_GetBindResult(IBinding *iface,
163 CLSID *pclsidProtocol, DWORD *pdwResult, LPOLESTR *pszResult,
164 DWORD *pdwReserved)
166 Binding *This = impl_from_IBinding(iface);
167 FIXME("(%p)->(%s %p %p %p)\n", This, debugstr_guid(pclsidProtocol),
168 pdwResult, pszResult, pdwReserved);
169 return E_NOTIMPL;
172 static IBindingVtbl XMLView_BindingVtbl = {
173 XMLView_Binding_QueryInterface,
174 XMLView_Binding_AddRef,
175 XMLView_Binding_Release,
176 XMLView_Binding_Abort,
177 XMLView_Binding_Suspend,
178 XMLView_Binding_Resume,
179 XMLView_Binding_SetPriority,
180 XMLView_Binding_GetPriority,
181 XMLView_Binding_GetBindResult
184 static inline HRESULT XMLView_Binding_Create(IBinding *binding, IBinding **ret)
186 Binding *bind;
188 bind = calloc(1, sizeof(Binding));
189 if(!bind)
190 return E_OUTOFMEMORY;
192 bind->IBinding_iface.lpVtbl = &XMLView_BindingVtbl;
193 bind->ref = 1;
195 bind->binding = binding;
196 IBinding_AddRef(binding);
198 *ret = &bind->IBinding_iface;
199 return S_OK;
202 static inline BindStatusCallback* impl_from_IBindStatusCallback(
203 IBindStatusCallback *iface)
205 return CONTAINING_RECORD(iface, BindStatusCallback,
206 IBindStatusCallback_iface);
209 static HRESULT WINAPI XMLView_BindStatusCallback_QueryInterface(
210 IBindStatusCallback *iface, REFIID riid, void **ppvObject)
212 BindStatusCallback *This = impl_from_IBindStatusCallback(iface);
214 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
216 if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IBindStatusCallback)) {
217 *ppvObject = iface;
218 IBindStatusCallback_AddRef(iface);
219 return S_OK;
222 *ppvObject = NULL;
223 return E_NOINTERFACE;
226 static ULONG WINAPI XMLView_BindStatusCallback_AddRef(
227 IBindStatusCallback *iface)
229 BindStatusCallback *This = impl_from_IBindStatusCallback(iface);
230 ULONG ref = InterlockedIncrement(&This->ref);
232 TRACE("%p, refcount %lu.\n", iface, ref);
234 return ref;
237 static ULONG WINAPI XMLView_BindStatusCallback_Release(
238 IBindStatusCallback *iface)
240 BindStatusCallback *This = impl_from_IBindStatusCallback(iface);
241 ULONG ref = InterlockedDecrement(&This->ref);
243 TRACE("%p, refcount %lu.\n", iface, ref);
245 if(!ref) {
246 if(This->stream)
247 IStream_Release(This->stream);
248 IBindStatusCallback_Release(This->bsc);
249 IMoniker_Release(This->mon);
250 free(This);
252 return ref;
255 static HRESULT WINAPI XMLView_BindStatusCallback_OnStartBinding(
256 IBindStatusCallback *iface, DWORD dwReserved, IBinding *pib)
258 BindStatusCallback *This = impl_from_IBindStatusCallback(iface);
259 IBinding *binding;
260 HRESULT hres;
262 TRACE("%p, %lx, %p.\n", iface, dwReserved, pib);
264 hres = XMLView_Binding_Create(pib, &binding);
265 if(FAILED(hres)) {
266 IBinding_Abort(pib);
267 return hres;
270 hres = IBindStatusCallback_OnStartBinding(This->bsc, dwReserved, binding);
271 if(FAILED(hres)) {
272 IBinding_Abort(binding);
273 return hres;
276 IBinding_Release(binding);
277 return hres;
280 static HRESULT WINAPI XMLView_BindStatusCallback_GetPriority(
281 IBindStatusCallback *iface, LONG *pnPriority)
283 BindStatusCallback *This = impl_from_IBindStatusCallback(iface);
284 FIXME("(%p)->(%p)\n", This, pnPriority);
285 return E_NOTIMPL;
288 static HRESULT WINAPI XMLView_BindStatusCallback_OnLowResource(
289 IBindStatusCallback *iface, DWORD reserved)
291 FIXME("%p, %lx.\n", iface, reserved);
292 return E_NOTIMPL;
295 static HRESULT WINAPI XMLView_BindStatusCallback_OnProgress(
296 IBindStatusCallback *iface, ULONG ulProgress, ULONG ulProgressMax,
297 ULONG ulStatusCode, LPCWSTR szStatusText)
299 BindStatusCallback *This = impl_from_IBindStatusCallback(iface);
300 TRACE("%p, %lu, %lu, %lu, %s.\n", iface, ulProgress, ulProgressMax,
301 ulStatusCode, debugstr_w(szStatusText));
303 switch(ulStatusCode) {
304 case BINDSTATUS_BEGINDOWNLOADDATA:
305 return IBindStatusCallback_OnProgress(This->bsc, ulProgress,
306 ulProgressMax, ulStatusCode, szStatusText);
307 case BINDSTATUS_MIMETYPEAVAILABLE:
308 return S_OK;
309 default:
310 FIXME("ulStatusCode: %lu\n", ulStatusCode);
311 return E_NOTIMPL;
315 static HRESULT WINAPI XMLView_BindStatusCallback_OnStopBinding(
316 IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError)
318 BindStatusCallback *This = impl_from_IBindStatusCallback(iface);
319 TRACE("%p, %#lx, %s.\n", iface, hresult, debugstr_w(szError));
320 return IBindStatusCallback_OnStopBinding(This->bsc, hresult, szError);
323 static HRESULT WINAPI XMLView_BindStatusCallback_GetBindInfo(
324 IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
326 BindStatusCallback *This = impl_from_IBindStatusCallback(iface);
327 TRACE("(%p)->(%p %p)\n", This, grfBINDF, pbindinfo);
328 return IBindStatusCallback_GetBindInfo(This->bsc, grfBINDF, pbindinfo);
331 static inline HRESULT report_data(BindStatusCallback *This)
333 FORMATETC formatetc = {0, NULL, 1, -1, TYMED_ISTREAM};
334 STGMEDIUM stgmedium;
335 LARGE_INTEGER off;
336 ULARGE_INTEGER size;
337 HRESULT hres;
339 off.QuadPart = 0;
340 hres = IStream_Seek(This->stream, off, STREAM_SEEK_CUR, &size);
341 if(FAILED(hres))
342 return hres;
344 hres = IStream_Seek(This->stream, off, STREAM_SEEK_SET, NULL);
345 if(FAILED(hres))
346 return hres;
348 stgmedium.tymed = TYMED_ISTREAM;
349 stgmedium.pstm = This->stream;
350 stgmedium.pUnkForRelease = NULL;
352 hres = IBindStatusCallback_OnDataAvailable(This->bsc,
353 BSCF_FIRSTDATANOTIFICATION|BSCF_LASTDATANOTIFICATION,
354 size.u.LowPart, &formatetc, &stgmedium);
356 IStream_Release(This->stream);
357 This->stream = NULL;
358 return hres;
361 static inline HRESULT display_error_page(BindStatusCallback *This)
363 FIXME("Error page not implemented yet.\n");
364 return report_data(This);
367 static inline HRESULT handle_xml_load(BindStatusCallback *This)
369 static const WCHAR selectW[] = {'p','r','o','c','e','s','s','i','n','g','-',
370 'i','n','s','t','r','u','c','t','i','o','n','(','\'','x','m','l',
371 '-','s','t','y','l','e','s','h','e','e','t','\'',')',0};
372 static const WCHAR hrefW[] = {'h','r','e','f','=',0};
374 IXMLDOMDocument3 *xml = NULL, *xsl = NULL;
375 IXMLDOMNode *stylesheet;
376 IBindCtx *pbc;
377 IMoniker *mon;
378 LPOLESTR xsl_url;
379 LARGE_INTEGER off;
380 VARIANT_BOOL succ;
381 VARIANT var;
382 WCHAR *href = NULL, *p;
383 BSTR bstr;
384 HRESULT hres;
386 off.QuadPart = 0;
387 hres = IStream_Seek(This->stream, off, STREAM_SEEK_SET, NULL);
388 if(FAILED(hres))
389 return display_error_page(This);
391 hres = dom_document_create(MSXML_DEFAULT, (void **)&xml);
392 if(FAILED(hres))
393 return display_error_page(This);
395 V_VT(&var) = VT_UNKNOWN;
396 V_UNKNOWN(&var) = (IUnknown*)This->stream;
397 hres = IXMLDOMDocument3_load(xml, var, &succ);
398 if(FAILED(hres) || !succ) {
399 IXMLDOMDocument3_Release(xml);
400 return display_error_page(This);
402 V_VT(&var) = VT_EMPTY;
404 bstr = SysAllocString(selectW);
405 hres = IXMLDOMDocument3_selectSingleNode(xml, bstr, &stylesheet);
406 SysFreeString(bstr);
407 if(hres != S_OK) {
408 IXMLDOMDocument3_Release(xml);
409 return display_error_page(This);
412 hres = IXMLDOMNode_get_nodeValue(stylesheet, &var);
413 IXMLDOMNode_Release(stylesheet);
414 if(SUCCEEDED(hres) && V_VT(&var)!=VT_BSTR) {
415 FIXME("Variant type %d not supported\n", V_VT(&var));
416 VariantClear(&var);
417 hres = E_FAIL;
419 if(FAILED(hres)) {
420 IXMLDOMDocument3_Release(xml);
421 return display_error_page(This);
424 /* TODO: fix parsing processing instruction value */
425 if((p = wcsstr(V_BSTR(&var), hrefW))) {
426 p += ARRAY_SIZE(hrefW) - 1;
427 if(*p!='\'' && *p!='\"') p = NULL;
428 else {
429 href = p+1;
430 p = wcschr(href, *p);
433 if(p) {
434 *p = 0;
435 } else {
436 VariantClear(&var);
437 IXMLDOMDocument3_Release(xml);
438 return display_error_page(This);
441 hres = CreateURLMonikerEx(This->mon, href, &mon, 0);
442 VariantClear(&var);
443 if(FAILED(hres)) {
444 IXMLDOMDocument3_Release(xml);
445 return display_error_page(This);
448 hres = CreateBindCtx(0, &pbc);
449 if(SUCCEEDED(hres)) {
450 hres = IMoniker_GetDisplayName(mon, pbc, NULL, &xsl_url);
451 IMoniker_Release(mon);
452 IBindCtx_Release(pbc);
454 if(FAILED(hres)) {
455 IXMLDOMDocument3_Release(xml);
456 return display_error_page(This);
459 V_VT(&var) = VT_BSTR;
460 V_BSTR(&var) = SysAllocString(xsl_url);
461 CoTaskMemFree(xsl_url);
462 if(!V_BSTR(&var)) {
463 IXMLDOMDocument3_Release(xml);
464 return display_error_page(This);
467 hres = dom_document_create(MSXML_DEFAULT, (void **)&xsl);
468 if(FAILED(hres)) {
469 VariantClear(&var);
470 IXMLDOMDocument3_Release(xml);
471 return display_error_page(This);
474 /* TODO: do the binding asynchronously */
475 hres = IXMLDOMDocument3_load(xsl, var, &succ);
476 VariantClear(&var);
477 if(FAILED(hres) || !succ) {
478 IXMLDOMDocument3_Release(xsl);
479 IXMLDOMDocument3_Release(xml);
480 return display_error_page(This);
483 hres = IXMLDOMDocument3_transformNode(xml, (IXMLDOMNode*)xsl, &bstr);
484 IXMLDOMDocument3_Release(xsl);
485 IXMLDOMDocument3_Release(xml);
486 if(FAILED(hres))
487 return display_error_page(This);
489 hres = IStream_Seek(This->stream, off, STREAM_SEEK_SET, NULL);
490 if(FAILED(hres)) {
491 SysFreeString(bstr);
492 return display_error_page(This);
495 hres = IStream_Write(This->stream, (BYTE*)bstr,
496 SysStringLen(bstr)*sizeof(WCHAR), NULL);
497 SysFreeString(bstr);
498 if(FAILED(hres))
499 return display_error_page(This);
501 return report_data(This);
504 static HRESULT WINAPI XMLView_BindStatusCallback_OnDataAvailable(
505 IBindStatusCallback *iface, DWORD grfBSCF, DWORD dwSize,
506 FORMATETC *pformatetc, STGMEDIUM *pstgmed)
508 BindStatusCallback *This = impl_from_IBindStatusCallback(iface);
509 char buf[1024];
510 DWORD size;
511 HRESULT hres;
513 TRACE("%p, %lx, %ld, %p, %p.\n", iface, grfBSCF, dwSize, pformatetc, pstgmed);
515 if(!This->stream)
516 return E_FAIL;
518 do {
519 hres = IStream_Read(pstgmed->pstm, buf, sizeof(buf), &size);
520 IStream_Write(This->stream, buf, size, &size);
521 } while(hres==S_OK && size);
523 if(FAILED(hres) && hres!=E_PENDING)
524 return hres;
525 if(hres != S_FALSE)
526 return S_OK;
528 return handle_xml_load(This);
531 static HRESULT WINAPI XMLView_BindStatusCallback_OnObjectAvailable(
532 IBindStatusCallback *iface, REFIID riid, IUnknown *punk)
534 BindStatusCallback *This = impl_from_IBindStatusCallback(iface);
535 FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), punk);
536 return E_NOTIMPL;
539 static IBindStatusCallbackVtbl XMLView_BindStatusCallbackVtbl = {
540 XMLView_BindStatusCallback_QueryInterface,
541 XMLView_BindStatusCallback_AddRef,
542 XMLView_BindStatusCallback_Release,
543 XMLView_BindStatusCallback_OnStartBinding,
544 XMLView_BindStatusCallback_GetPriority,
545 XMLView_BindStatusCallback_OnLowResource,
546 XMLView_BindStatusCallback_OnProgress,
547 XMLView_BindStatusCallback_OnStopBinding,
548 XMLView_BindStatusCallback_GetBindInfo,
549 XMLView_BindStatusCallback_OnDataAvailable,
550 XMLView_BindStatusCallback_OnObjectAvailable
553 static inline HRESULT XMLView_BindStatusCallback_Create(IBindStatusCallback *bsc_html,
554 IMoniker *mon, IStream *stream, IBindStatusCallback **ret)
556 BindStatusCallback *bsc;
558 bsc = calloc(1, sizeof(BindStatusCallback));
559 if(!bsc)
560 return E_OUTOFMEMORY;
562 bsc->IBindStatusCallback_iface.lpVtbl = &XMLView_BindStatusCallbackVtbl;
563 bsc->ref = 1;
565 bsc->bsc = bsc_html;
566 IBindStatusCallback_AddRef(bsc_html);
567 bsc->stream = stream;
568 IStream_AddRef(bsc->stream);
569 bsc->mon = mon;
570 IMoniker_AddRef(mon);
572 *ret = &bsc->IBindStatusCallback_iface;
573 return S_OK;
576 static inline Moniker* impl_from_IMoniker(IMoniker *iface)
578 return CONTAINING_RECORD(iface, Moniker, IMoniker_iface);
581 static HRESULT WINAPI XMLView_Moniker_QueryInterface(
582 IMoniker *iface, REFIID riid, void **ppvObject)
584 Moniker *This = impl_from_IMoniker(iface);
586 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
588 if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IPersist)
589 || IsEqualGUID(riid, &IID_IPersistStream) || IsEqualGUID(riid, &IID_IMoniker)) {
590 *ppvObject = iface;
591 IMoniker_AddRef(iface);
592 return S_OK;
595 *ppvObject = NULL;
596 return E_NOINTERFACE;
599 static ULONG WINAPI XMLView_Moniker_AddRef(IMoniker *iface)
601 Moniker *This = impl_from_IMoniker(iface);
602 LONG ref = InterlockedIncrement(&This->ref);
604 TRACE("%p, refcount %lu.\n", iface, ref);
606 return ref;
609 static ULONG WINAPI XMLView_Moniker_Release(IMoniker *iface)
611 Moniker *This = impl_from_IMoniker(iface);
612 ULONG ref = InterlockedDecrement(&This->ref);
614 TRACE("%p, refcount %lu.\n", iface, ref);
616 if(!ref) {
617 IMoniker_Release(This->mon);
618 free(This);
620 return ref;
623 static HRESULT WINAPI XMLView_Moniker_GetClassID(IMoniker *iface, CLSID *pClassID)
625 Moniker *This = impl_from_IMoniker(iface);
626 FIXME("(%p)->(%p)\n", This, pClassID);
627 return E_NOTIMPL;
630 static HRESULT WINAPI XMLView_Moniker_IsDirty(IMoniker *iface)
632 Moniker *This = impl_from_IMoniker(iface);
633 FIXME("(%p)\n", This);
634 return E_NOTIMPL;
637 static HRESULT WINAPI XMLView_Moniker_Load(IMoniker *iface, IStream *pStm)
639 Moniker *This = impl_from_IMoniker(iface);
640 FIXME("(%p)->(%p)\n", This, pStm);
641 return E_NOTIMPL;
644 static HRESULT WINAPI XMLView_Moniker_Save(IMoniker *iface,
645 IStream *pStm, BOOL fClearDirty)
647 Moniker *This = impl_from_IMoniker(iface);
648 FIXME("(%p)->(%p %x)\n", This, pStm, fClearDirty);
649 return E_NOTIMPL;
652 static HRESULT WINAPI XMLView_Moniker_GetSizeMax(
653 IMoniker *iface, ULARGE_INTEGER *pcbSize)
655 Moniker *This = impl_from_IMoniker(iface);
656 FIXME("(%p)->(%p)\n", This, pcbSize);
657 return E_NOTIMPL;
660 static HRESULT WINAPI XMLView_Moniker_BindToObject(IMoniker *iface, IBindCtx *pbc,
661 IMoniker *pmkToLeft, REFIID riidResult, void **ppvResult)
663 Moniker *This = impl_from_IMoniker(iface);
664 FIXME("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft,
665 debugstr_guid(riidResult), ppvResult);
666 return E_NOTIMPL;
669 static HRESULT WINAPI XMLView_Moniker_BindToStorage(IMoniker *iface, IBindCtx *pbc,
670 IMoniker *pmkToLeft, REFIID riid, void **ppvObj)
672 Moniker *This = impl_from_IMoniker(iface);
674 TRACE("(%p)->(%p %p %s %p)\n", This, pbc, pmkToLeft, debugstr_guid(riid), ppvObj);
676 if(IsEqualGUID(riid, &IID_IStream)) {
677 if(!This->stream)
678 return E_FAIL;
680 *ppvObj = This->stream;
681 This->stream = NULL;
682 return S_ASYNCHRONOUS;
685 return E_NOTIMPL;
688 static HRESULT WINAPI XMLView_Moniker_Reduce(IMoniker *iface, IBindCtx *pbc,
689 DWORD dwReduceHowFar, IMoniker **ppmkToLeft, IMoniker **ppmkReduced)
691 FIXME("%p, %p, %ld, %p, %p.\n", iface, pbc, dwReduceHowFar, ppmkToLeft, ppmkReduced);
692 return E_NOTIMPL;
695 static HRESULT WINAPI XMLView_Moniker_ComposeWith(IMoniker *iface, IMoniker *pmkRight,
696 BOOL fOnlyIfNotGeneric, IMoniker **ppmkComposite)
698 Moniker *This = impl_from_IMoniker(iface);
699 FIXME("(%p)->(%p %x %p)\n", This, pmkRight, fOnlyIfNotGeneric, ppmkComposite);
700 return E_NOTIMPL;
703 static HRESULT WINAPI XMLView_Moniker_Enum(IMoniker *iface,
704 BOOL fForward, IEnumMoniker **ppenumMoniker)
706 Moniker *This = impl_from_IMoniker(iface);
707 FIXME("(%p)->(%x %p)\n", This, fForward, ppenumMoniker);
708 return E_NOTIMPL;
711 static HRESULT WINAPI XMLView_Moniker_IsEqual(IMoniker *iface,
712 IMoniker *pmkOtherMoniker)
714 Moniker *This = impl_from_IMoniker(iface);
715 FIXME("(%p)->(%p)\n", This, pmkOtherMoniker);
716 return E_NOTIMPL;
719 static HRESULT WINAPI XMLView_Moniker_Hash(IMoniker *iface, DWORD *pdwHash)
721 Moniker *This = impl_from_IMoniker(iface);
722 FIXME("(%p)->(%p)\n", This, pdwHash);
723 return E_NOTIMPL;
726 static HRESULT WINAPI XMLView_Moniker_IsRunning(IMoniker *iface, IBindCtx *pbc,
727 IMoniker *pmkToLeft, IMoniker *pmkNewlyRunning)
729 Moniker *This = impl_from_IMoniker(iface);
730 FIXME("(%p)->(%p %p %p)\n", This, pbc, pmkToLeft, pmkNewlyRunning);
731 return E_NOTIMPL;
734 static HRESULT WINAPI XMLView_Moniker_GetTimeOfLastChange(IMoniker *iface,
735 IBindCtx *pbc, IMoniker *pmkToLeft, FILETIME *pFileTime)
737 Moniker *This = impl_from_IMoniker(iface);
738 FIXME("(%p)->(%p %p %p)\n", This, pbc, pmkToLeft, pFileTime);
739 return E_NOTIMPL;
742 static HRESULT WINAPI XMLView_Moniker_Inverse(IMoniker *iface, IMoniker **ppmk)
744 Moniker *This = impl_from_IMoniker(iface);
745 FIXME("(%p)->(%p)\n", This, ppmk);
746 return E_NOTIMPL;
749 static HRESULT WINAPI XMLView_Moniker_CommonPrefixWith(IMoniker *iface,
750 IMoniker *pmkOther, IMoniker **ppmkPrefix)
752 Moniker *This = impl_from_IMoniker(iface);
753 FIXME("(%p)->(%p %p)\n", This, pmkOther, ppmkPrefix);
754 return E_NOTIMPL;
757 static HRESULT WINAPI XMLView_Moniker_RelativePathTo(IMoniker *iface,
758 IMoniker *pmkOther, IMoniker **ppmkRelPath)
760 Moniker *This = impl_from_IMoniker(iface);
761 FIXME("(%p)->(%p %p)\n", This, pmkOther, ppmkRelPath);
762 return E_NOTIMPL;
765 static HRESULT WINAPI XMLView_Moniker_GetDisplayName(IMoniker *iface,
766 IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR *ppszDisplayName)
768 Moniker *This = impl_from_IMoniker(iface);
769 TRACE("(%p)->(%p %p %p)\n", This, pbc, pmkToLeft, ppszDisplayName);
770 return IMoniker_GetDisplayName(This->mon, pbc, pmkToLeft, ppszDisplayName);
773 static HRESULT WINAPI XMLView_Moniker_ParseDisplayName(IMoniker *iface,
774 IBindCtx *pbc, IMoniker *pmkToLeft, LPOLESTR pszDisplayName,
775 ULONG *pchEaten, IMoniker **ppmkOut)
777 Moniker *This = impl_from_IMoniker(iface);
778 FIXME("(%p)->(%p %p %s %p %p)\n", This, pbc, pmkToLeft,
779 debugstr_w(pszDisplayName), pchEaten, ppmkOut);
780 return E_NOTIMPL;
783 static HRESULT WINAPI XMLView_Moniker_IsSystemMoniker(
784 IMoniker *iface, DWORD *pdwMksys)
786 Moniker *This = impl_from_IMoniker(iface);
787 FIXME("(%p)->(%p)\n", This, pdwMksys);
788 return E_NOTIMPL;
791 static IMonikerVtbl XMLView_MonikerVtbl = {
792 XMLView_Moniker_QueryInterface,
793 XMLView_Moniker_AddRef,
794 XMLView_Moniker_Release,
795 XMLView_Moniker_GetClassID,
796 XMLView_Moniker_IsDirty,
797 XMLView_Moniker_Load,
798 XMLView_Moniker_Save,
799 XMLView_Moniker_GetSizeMax,
800 XMLView_Moniker_BindToObject,
801 XMLView_Moniker_BindToStorage,
802 XMLView_Moniker_Reduce,
803 XMLView_Moniker_ComposeWith,
804 XMLView_Moniker_Enum,
805 XMLView_Moniker_IsEqual,
806 XMLView_Moniker_Hash,
807 XMLView_Moniker_IsRunning,
808 XMLView_Moniker_GetTimeOfLastChange,
809 XMLView_Moniker_Inverse,
810 XMLView_Moniker_CommonPrefixWith,
811 XMLView_Moniker_RelativePathTo,
812 XMLView_Moniker_GetDisplayName,
813 XMLView_Moniker_ParseDisplayName,
814 XMLView_Moniker_IsSystemMoniker
817 static inline HRESULT XMLView_Moniker_Create(IMoniker *mon,
818 IStream *stream, IMoniker **ret)
820 Moniker *wrap;
822 wrap = calloc(1, sizeof(Moniker));
823 if(!wrap)
824 return E_OUTOFMEMORY;
826 wrap->IMoniker_iface.lpVtbl = &XMLView_MonikerVtbl;
827 wrap->ref = 1;
829 wrap->mon = mon;
830 IMoniker_AddRef(mon);
831 wrap->stream = stream;
832 IStream_AddRef(stream);
834 *ret = &wrap->IMoniker_iface;
835 return S_OK;
838 static inline XMLView* impl_from_IPersistMoniker(IPersistMoniker *iface)
840 return CONTAINING_RECORD(iface, XMLView, IPersistMoniker_iface);
843 static HRESULT WINAPI XMLView_PersistMoniker_QueryInterface(
844 IPersistMoniker *iface, REFIID riid, void **ppvObject)
846 XMLView *This = impl_from_IPersistMoniker(iface);
848 TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppvObject);
850 if(IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IPersistMoniker))
851 *ppvObject = &This->IPersistMoniker_iface;
852 else if(IsEqualGUID(riid, &IID_IPersistHistory) ||
853 IsEqualGUID(riid, &IID_IPersist))
854 *ppvObject = &This->IPersistHistory_iface;
855 else if(IsEqualGUID(riid, &IID_IOleCommandTarget))
856 *ppvObject = &This->IOleCommandTarget_iface;
857 else if(IsEqualGUID(riid, &IID_IOleObject))
858 *ppvObject = &This->IOleObject_iface;
859 else
860 return IUnknown_QueryInterface(This->html_doc, riid, ppvObject);
862 IPersistMoniker_AddRef(&This->IPersistMoniker_iface);
863 return S_OK;
866 static ULONG WINAPI XMLView_PersistMoniker_AddRef(IPersistMoniker *iface)
868 XMLView *This = impl_from_IPersistMoniker(iface);
869 ULONG ref = InterlockedIncrement(&This->ref);
871 TRACE("%p, refcount %lu.\n", iface, ref);
873 return ref;
876 static ULONG WINAPI XMLView_PersistMoniker_Release(IPersistMoniker *iface)
878 XMLView *This = impl_from_IPersistMoniker(iface);
879 ULONG ref = InterlockedDecrement(&This->ref);
881 TRACE("%p, refcount %lu.\n", iface, ref);
883 if(!ref) {
884 if(This->mon)
885 IMoniker_Release(This->mon);
886 IUnknown_Release(This->html_doc);
887 free(This);
889 return ref;
892 static HRESULT WINAPI XMLView_PersistMoniker_GetClassID(
893 IPersistMoniker *iface, CLSID *pClassID)
895 XMLView *This = impl_from_IPersistMoniker(iface);
896 FIXME("(%p)->(%p)\n", This, pClassID);
897 return E_NOTIMPL;
900 static HRESULT WINAPI XMLView_PersistMoniker_IsDirty(IPersistMoniker *iface)
902 XMLView *This = impl_from_IPersistMoniker(iface);
903 FIXME("(%p)\n", This);
904 return E_NOTIMPL;
907 static HRESULT WINAPI XMLView_PersistMoniker_Load(IPersistMoniker *iface,
908 BOOL fFullyAvailable, IMoniker *pimkName, LPBC pibc, DWORD grfMode)
910 static const WCHAR XSLParametersW[] = {'X','S','L','P','a','r','a','m','e','t','e','r','s',0};
911 static const WCHAR XMLBufferStreamW[] = {'X','M','L','B','u','f','f','e','r','S','t','r','e','a','m',0};
912 static const WCHAR DWNBINDINFOW[] = {'_','_','D','W','N','B','I','N','D','I','N','F','O',0};
913 static const WCHAR HTMLLOADOPTIONSW[] = {'_','_','H','T','M','L','L','O','A','D','O','P','T','I','O','N','S',0};
914 static const WCHAR BSCBHolderW[] = { '_','B','S','C','B','_','H','o','l','d','e','r','_',0 };
916 XMLView *This = impl_from_IPersistMoniker(iface);
917 IPersistMoniker *html_persist_mon;
918 IBindStatusCallback *bsc, *bsc_html;
919 IBindCtx *bindctx;
920 IStream *stream;
921 IMoniker *mon;
922 IUnknown *unk;
923 HRESULT hres;
925 TRACE("%p, %x, %p, %p, %lx.\n", iface, fFullyAvailable, pimkName, pibc, grfMode);
927 hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)XSLParametersW, &unk);
928 if(SUCCEEDED(hres)) {
929 FIXME("ignoring XSLParameters\n");
930 IUnknown_Release(unk);
932 hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)XMLBufferStreamW, &unk);
933 if(SUCCEEDED(hres)) {
934 FIXME("ignoring XMLBufferStream\n");
935 IUnknown_Release(unk);
938 hres = CreateBindCtx(0, &bindctx);
939 if(FAILED(hres))
940 return hres;
942 hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)DWNBINDINFOW, &unk);
943 if(SUCCEEDED(hres)) {
944 IBindCtx_RegisterObjectParam(bindctx, (LPOLESTR)DWNBINDINFOW, unk);
945 IUnknown_Release(unk);
947 hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)HTMLLOADOPTIONSW, &unk);
948 if(SUCCEEDED(hres)) {
949 IBindCtx_RegisterObjectParam(bindctx, (LPOLESTR)HTMLLOADOPTIONSW, unk);
950 IUnknown_Release(unk);
952 hres = IBindCtx_GetObjectParam(pibc, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM, &unk);
953 if(SUCCEEDED(hres)) {
954 IBindCtx_RegisterObjectParam(bindctx, (LPOLESTR)SZ_HTML_CLIENTSITE_OBJECTPARAM, unk);
955 IUnknown_Release(unk);
958 hres = CreateStreamOnHGlobal(NULL, TRUE, &stream);
959 if(FAILED(hres)) {
960 IBindCtx_Release(bindctx);
961 return hres;
964 if(This->mon)
965 IMoniker_Release(This->mon);
966 This->mon = pimkName;
967 IMoniker_AddRef(This->mon);
969 hres = XMLView_Moniker_Create(This->mon, stream, &mon);
970 if(FAILED(hres)) {
971 IStream_Release(stream);
972 IBindCtx_Release(bindctx);
973 return hres;
976 hres = IUnknown_QueryInterface(This->html_doc,
977 &IID_IPersistMoniker, (void**)&html_persist_mon);
978 if(FAILED(hres)) {
979 IMoniker_Release(mon);
980 IStream_Release(stream);
981 IBindCtx_Release(bindctx);
982 return hres;
985 hres = IPersistMoniker_Load(html_persist_mon, FALSE, mon, bindctx, 0);
986 IPersistMoniker_Release(html_persist_mon);
987 IMoniker_Release(mon);
988 if(FAILED(hres)) {
989 IStream_Release(stream);
990 IBindCtx_Release(bindctx);
991 return hres;
994 hres = IBindCtx_GetObjectParam(bindctx, (LPOLESTR)BSCBHolderW, &unk);
995 IBindCtx_Release(bindctx);
996 if(FAILED(hres)) {
997 IStream_Release(stream);
998 return hres;
1000 hres = IUnknown_QueryInterface(unk, &IID_IBindStatusCallback, (void**)&bsc_html);
1001 IUnknown_Release(unk);
1002 if(FAILED(hres)) {
1003 IStream_Release(stream);
1004 return hres;
1007 hres = XMLView_BindStatusCallback_Create(bsc_html, This->mon, stream, &bsc);
1008 IStream_Release(stream);
1009 if(FAILED(hres)) {
1010 IBindStatusCallback_OnStopBinding(bsc_html, hres, NULL);
1011 IBindStatusCallback_Release(bsc_html);
1012 return hres;
1015 hres = RegisterBindStatusCallback(pibc, bsc, NULL, 0);
1016 IBindStatusCallback_Release(bsc);
1017 if(FAILED(hres)) {
1018 IBindStatusCallback_OnStopBinding(bsc_html, hres, NULL);
1019 IBindStatusCallback_Release(bsc_html);
1020 return hres;
1023 hres = IMoniker_BindToStorage(pimkName, pibc, NULL,
1024 &IID_IStream, (void**)&stream);
1025 if(FAILED(hres)) {
1026 IBindStatusCallback_OnStopBinding(bsc_html, hres, NULL);
1027 IBindStatusCallback_Release(bsc_html);
1028 return hres;
1031 if(stream)
1032 IStream_Release(stream);
1033 IBindStatusCallback_Release(bsc_html);
1034 return S_OK;
1037 static HRESULT WINAPI XMLView_PersistMoniker_Save(IPersistMoniker *iface,
1038 IMoniker *pimkName, LPBC pbc, BOOL fRemember)
1040 XMLView *This = impl_from_IPersistMoniker(iface);
1041 FIXME("(%p)->(%p %p %x)\n", This, pimkName, pbc, fRemember);
1042 return E_NOTIMPL;
1045 static HRESULT WINAPI XMLView_PersistMoniker_SaveCompleted(
1046 IPersistMoniker *iface, IMoniker *pimkName, LPBC pibc)
1048 XMLView *This = impl_from_IPersistMoniker(iface);
1049 FIXME("(%p)->(%p %p)\n", This, pimkName, pibc);
1050 return E_NOTIMPL;
1053 static HRESULT WINAPI XMLView_PersistMoniker_GetCurMoniker(
1054 IPersistMoniker *iface, IMoniker **ppimkName)
1056 XMLView *This = impl_from_IPersistMoniker(iface);
1057 FIXME("(%p)->(%p)\n", This, ppimkName);
1058 return E_NOTIMPL;
1061 static IPersistMonikerVtbl XMLView_PersistMonikerVtbl = {
1062 XMLView_PersistMoniker_QueryInterface,
1063 XMLView_PersistMoniker_AddRef,
1064 XMLView_PersistMoniker_Release,
1065 XMLView_PersistMoniker_GetClassID,
1066 XMLView_PersistMoniker_IsDirty,
1067 XMLView_PersistMoniker_Load,
1068 XMLView_PersistMoniker_Save,
1069 XMLView_PersistMoniker_SaveCompleted,
1070 XMLView_PersistMoniker_GetCurMoniker
1073 static inline XMLView* impl_from_IPersistHistory(IPersistHistory *iface)
1075 return CONTAINING_RECORD(iface, XMLView, IPersistHistory_iface);
1078 static HRESULT WINAPI XMLView_PersistHistory_QueryInterface(
1079 IPersistHistory *iface, REFIID riid, void **ppvObject)
1081 XMLView *This = impl_from_IPersistHistory(iface);
1082 return IPersistMoniker_QueryInterface(&This->IPersistMoniker_iface, riid, ppvObject);
1085 static ULONG WINAPI XMLView_PersistHistory_AddRef(IPersistHistory *iface)
1087 XMLView *This = impl_from_IPersistHistory(iface);
1088 return IPersistMoniker_AddRef(&This->IPersistMoniker_iface);
1091 static ULONG WINAPI XMLView_PersistHistory_Release(IPersistHistory *iface)
1093 XMLView *This = impl_from_IPersistHistory(iface);
1094 return IPersistMoniker_Release(&This->IPersistMoniker_iface);
1097 static HRESULT WINAPI XMLView_PersistHistory_GetClassID(
1098 IPersistHistory *iface, CLSID *pClassID)
1100 XMLView *This = impl_from_IPersistHistory(iface);
1101 FIXME("(%p)->(%p)\n", This, pClassID);
1102 return E_NOTIMPL;
1105 static HRESULT WINAPI XMLView_PersistHistory_LoadHistory(
1106 IPersistHistory *iface, IStream *pStream, IBindCtx *pbc)
1108 XMLView *This = impl_from_IPersistHistory(iface);
1109 FIXME("(%p)->(%p %p)\n", This, pStream, pbc);
1110 return E_NOTIMPL;
1113 static HRESULT WINAPI XMLView_PersistHistory_SaveHistory(
1114 IPersistHistory *iface, IStream *pStream)
1116 XMLView *This = impl_from_IPersistHistory(iface);
1117 FIXME("(%p)->(%p)\n", This, pStream);
1118 return E_NOTIMPL;
1121 static HRESULT WINAPI XMLView_PersistHistory_SetPositionCookie(
1122 IPersistHistory *iface, DWORD dwPositioncookie)
1124 FIXME("%p, %ld.\n", iface, dwPositioncookie);
1125 return E_NOTIMPL;
1128 static HRESULT WINAPI XMLView_PersistHistory_GetPositionCookie(
1129 IPersistHistory *iface, DWORD *pdwPositioncookie)
1131 XMLView *This = impl_from_IPersistHistory(iface);
1132 FIXME("(%p)->(%p)\n", This, pdwPositioncookie);
1133 return E_NOTIMPL;
1136 static IPersistHistoryVtbl XMLView_PersistHistoryVtbl = {
1137 XMLView_PersistHistory_QueryInterface,
1138 XMLView_PersistHistory_AddRef,
1139 XMLView_PersistHistory_Release,
1140 XMLView_PersistHistory_GetClassID,
1141 XMLView_PersistHistory_LoadHistory,
1142 XMLView_PersistHistory_SaveHistory,
1143 XMLView_PersistHistory_SetPositionCookie,
1144 XMLView_PersistHistory_GetPositionCookie
1147 static inline XMLView* impl_from_IOleCommandTarget(IOleCommandTarget *iface)
1149 return CONTAINING_RECORD(iface, XMLView, IOleCommandTarget_iface);
1152 static HRESULT WINAPI XMLView_OleCommandTarget_QueryInterface(
1153 IOleCommandTarget *iface, REFIID riid, void **ppvObject)
1155 XMLView *This = impl_from_IOleCommandTarget(iface);
1156 return IPersistMoniker_QueryInterface(&This->IPersistMoniker_iface, riid, ppvObject);
1159 static ULONG WINAPI XMLView_OleCommandTarget_AddRef(IOleCommandTarget *iface)
1161 XMLView *This = impl_from_IOleCommandTarget(iface);
1162 return IPersistMoniker_AddRef(&This->IPersistMoniker_iface);
1165 static ULONG WINAPI XMLView_OleCommandTarget_Release(IOleCommandTarget *iface)
1167 XMLView *This = impl_from_IOleCommandTarget(iface);
1168 return IPersistMoniker_Release(&This->IPersistMoniker_iface);
1171 static HRESULT WINAPI XMLView_OleCommandTarget_QueryStatus(IOleCommandTarget *iface,
1172 const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
1174 FIXME("%p, %p, %lu, %p, %p.\n", iface, pguidCmdGroup, cCmds, prgCmds, pCmdText);
1175 return E_NOTIMPL;
1178 static HRESULT WINAPI XMLView_OleCommandTarget_Exec(IOleCommandTarget *iface,
1179 const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt,
1180 VARIANT *pvaIn, VARIANT *pvaOut)
1182 FIXME("%p, %p, %ld, %lx, %p, %p.\n", iface, pguidCmdGroup,
1183 nCmdID, nCmdexecopt, pvaIn, pvaOut);
1184 return E_NOTIMPL;
1187 static IOleCommandTargetVtbl XMLView_OleCommandTargetVtbl = {
1188 XMLView_OleCommandTarget_QueryInterface,
1189 XMLView_OleCommandTarget_AddRef,
1190 XMLView_OleCommandTarget_Release,
1191 XMLView_OleCommandTarget_QueryStatus,
1192 XMLView_OleCommandTarget_Exec
1195 static inline XMLView* impl_from_IOleObject(IOleObject *iface)
1197 return CONTAINING_RECORD(iface, XMLView, IOleObject_iface);
1200 static HRESULT WINAPI XMLView_OleObject_QueryInterface(
1201 IOleObject *iface, REFIID riid, void **ppvObject)
1203 XMLView *This = impl_from_IOleObject(iface);
1204 return IPersistMoniker_QueryInterface(&This->IPersistMoniker_iface, riid, ppvObject);
1207 static ULONG WINAPI XMLView_OleObject_AddRef(IOleObject *iface)
1209 XMLView *This = impl_from_IOleObject(iface);
1210 return IPersistMoniker_AddRef(&This->IPersistMoniker_iface);
1213 static ULONG WINAPI XMLView_OleObject_Release(IOleObject *iface)
1215 XMLView *This = impl_from_IOleObject(iface);
1216 return IPersistMoniker_Release(&This->IPersistMoniker_iface);
1219 static HRESULT WINAPI XMLView_OleObject_SetClientSite(
1220 IOleObject *iface, IOleClientSite *pClientSite)
1222 XMLView *This = impl_from_IOleObject(iface);
1223 FIXME("(%p)->(%p)\n", This, pClientSite);
1224 return E_NOTIMPL;
1227 static HRESULT WINAPI XMLView_OleObject_GetClientSite(
1228 IOleObject *iface, IOleClientSite **ppClientSite)
1230 XMLView *This = impl_from_IOleObject(iface);
1231 FIXME("(%p)->(%p)\n", This, ppClientSite);
1232 return E_NOTIMPL;
1235 static HRESULT WINAPI XMLView_OleObject_SetHostNames(IOleObject *iface,
1236 LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)
1238 XMLView *This = impl_from_IOleObject(iface);
1239 FIXME("(%p)->(%s %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj));
1240 return E_NOTIMPL;
1243 static HRESULT WINAPI XMLView_OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
1245 FIXME("%p, %lx.\n", iface, dwSaveOption);
1246 return E_NOTIMPL;
1249 static HRESULT WINAPI XMLView_OleObject_SetMoniker(IOleObject *iface,
1250 DWORD dwWhichMoniker, IMoniker *pmk)
1252 FIXME("%p, %lx, %p.\n", iface, dwWhichMoniker, pmk);
1253 return E_NOTIMPL;
1256 static HRESULT WINAPI XMLView_OleObject_GetMoniker(IOleObject *iface,
1257 DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk)
1259 FIXME("%p, %lx, %lx, %p.\n", iface, dwAssign, dwWhichMoniker, ppmk);
1260 return E_NOTIMPL;
1263 static HRESULT WINAPI XMLView_OleObject_InitFromData(IOleObject *iface,
1264 IDataObject *pDataObject, BOOL fCreation, DWORD dwReserved)
1266 FIXME("%p, %p, %x, %lx.\n", iface, pDataObject, fCreation, dwReserved);
1267 return E_NOTIMPL;
1270 static HRESULT WINAPI XMLView_OleObject_GetClipboardData(IOleObject *iface,
1271 DWORD dwReserved, IDataObject **ppDataObject)
1273 FIXME("%p, %lx, %p.\n", iface, dwReserved, ppDataObject);
1274 return E_NOTIMPL;
1277 static HRESULT WINAPI XMLView_OleObject_DoVerb(IOleObject *iface,
1278 LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite,
1279 LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
1281 FIXME("%p, %ld, %p, %p, %ld, %p, %p.\n", iface, iVerb, lpmsg,
1282 pActiveSite, lindex, hwndParent, lprcPosRect);
1283 return E_NOTIMPL;
1286 static HRESULT WINAPI XMLView_OleObject_EnumVerbs(
1287 IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb)
1289 XMLView *This = impl_from_IOleObject(iface);
1290 FIXME("(%p)->{%p)\n", This, ppEnumOleVerb);
1291 return E_NOTIMPL;
1294 static HRESULT WINAPI XMLView_OleObject_Update(IOleObject *iface)
1296 XMLView *This = impl_from_IOleObject(iface);
1297 FIXME("(%p)\n", This);
1298 return E_NOTIMPL;
1301 static HRESULT WINAPI XMLView_OleObject_IsUpToDate(IOleObject *iface)
1303 XMLView *This = impl_from_IOleObject(iface);
1304 FIXME("(%p)\n", This);
1305 return E_NOTIMPL;
1308 static HRESULT WINAPI XMLView_OleObject_GetUserClassID(IOleObject *iface, CLSID *pClsid)
1310 XMLView *This = impl_from_IOleObject(iface);
1311 FIXME("(%p)->(%p)\n", This, pClsid);
1312 return E_NOTIMPL;
1315 static HRESULT WINAPI XMLView_OleObject_GetUserType(IOleObject *iface,
1316 DWORD dwFormOfType, LPOLESTR *pszUserType)
1318 FIXME("%p, %lx, %p.\n", iface, dwFormOfType, pszUserType);
1319 return E_NOTIMPL;
1322 static HRESULT WINAPI XMLView_OleObject_SetExtent(IOleObject *iface,
1323 DWORD dwDrawAspect, SIZEL *psizel)
1325 FIXME("%p, %lx, %p.\n", iface, dwDrawAspect, psizel);
1326 return E_NOTIMPL;
1329 static HRESULT WINAPI XMLView_OleObject_GetExtent(IOleObject *iface,
1330 DWORD dwDrawAspect, SIZEL *psizel)
1332 FIXME("%p, %lx, %p.\n", iface, dwDrawAspect, psizel);
1333 return E_NOTIMPL;
1336 static HRESULT WINAPI XMLView_OleObject_Advise(IOleObject *iface,
1337 IAdviseSink *pAdvSink, DWORD *pdwConnection)
1339 XMLView *This = impl_from_IOleObject(iface);
1340 FIXME("(%p)->(%p %p)\n", This, pAdvSink, pdwConnection);
1341 return E_NOTIMPL;
1344 static HRESULT WINAPI XMLView_OleObject_Unadvise(
1345 IOleObject *iface, DWORD dwConnection)
1347 FIXME("%p, %ld.\n", iface, dwConnection);
1348 return E_NOTIMPL;
1351 static HRESULT WINAPI XMLView_OleObject_EnumAdvise(
1352 IOleObject *iface, IEnumSTATDATA **ppenumAdvise)
1354 XMLView *This = impl_from_IOleObject(iface);
1355 FIXME("(%p)->(%p)\n", This, ppenumAdvise);
1356 return E_NOTIMPL;
1359 static HRESULT WINAPI XMLView_OleObject_GetMiscStatus(
1360 IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus)
1362 FIXME("%p, %ld, %p.\n", iface, dwAspect, pdwStatus);
1363 return E_NOTIMPL;
1366 static HRESULT WINAPI XMLView_OleObject_SetColorScheme(
1367 IOleObject *iface, LOGPALETTE *pLogpal)
1369 XMLView *This = impl_from_IOleObject(iface);
1370 FIXME("(%p)->(%p)\n", This, pLogpal);
1371 return E_NOTIMPL;
1374 static IOleObjectVtbl XMLView_OleObjectVtbl = {
1375 XMLView_OleObject_QueryInterface,
1376 XMLView_OleObject_AddRef,
1377 XMLView_OleObject_Release,
1378 XMLView_OleObject_SetClientSite,
1379 XMLView_OleObject_GetClientSite,
1380 XMLView_OleObject_SetHostNames,
1381 XMLView_OleObject_Close,
1382 XMLView_OleObject_SetMoniker,
1383 XMLView_OleObject_GetMoniker,
1384 XMLView_OleObject_InitFromData,
1385 XMLView_OleObject_GetClipboardData,
1386 XMLView_OleObject_DoVerb,
1387 XMLView_OleObject_EnumVerbs,
1388 XMLView_OleObject_Update,
1389 XMLView_OleObject_IsUpToDate,
1390 XMLView_OleObject_GetUserClassID,
1391 XMLView_OleObject_GetUserType,
1392 XMLView_OleObject_SetExtent,
1393 XMLView_OleObject_GetExtent,
1394 XMLView_OleObject_Advise,
1395 XMLView_OleObject_Unadvise,
1396 XMLView_OleObject_EnumAdvise,
1397 XMLView_OleObject_GetMiscStatus,
1398 XMLView_OleObject_SetColorScheme
1401 HRESULT XMLView_create(void **ppObj)
1403 XMLView *This;
1404 HRESULT hres;
1406 TRACE("(%p)\n", ppObj);
1408 This = calloc(1, sizeof(*This));
1409 if(!This)
1410 return E_OUTOFMEMORY;
1412 This->IPersistMoniker_iface.lpVtbl = &XMLView_PersistMonikerVtbl;
1413 This->IPersistHistory_iface.lpVtbl = &XMLView_PersistHistoryVtbl;
1414 This->IOleCommandTarget_iface.lpVtbl = &XMLView_OleCommandTargetVtbl;
1415 This->IOleObject_iface.lpVtbl = &XMLView_OleObjectVtbl;
1416 This->ref = 1;
1418 hres = CoCreateInstance(&CLSID_HTMLDocument, (IUnknown*)&This->IPersistMoniker_iface,
1419 CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&This->html_doc);
1420 if(FAILED(hres)) {
1421 free(This);
1422 return hres;
1425 *ppObj = &This->IPersistMoniker_iface;
1426 return S_OK;