2 * Copyright 2005 Jacek Caban
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
34 #include "wine/debug.h"
36 #include "mshtml_private.h"
39 WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
41 DEFINE_OLEGUID(CGID_DocHostCmdPriv, 0x000214D4L, 0, 0);
42 #define DOCHOST_DOCCANNAVIGATE 0
44 /**********************************************************
45 * IOleObject implementation
48 #define OLEOBJ_THIS(iface) DEFINE_THIS(HTMLDocument, OleObject, iface)
50 static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, void **ppvObject)
52 HTMLDocument *This = OLEOBJ_THIS(iface);
53 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
56 static ULONG WINAPI OleObject_AddRef(IOleObject *iface)
58 HTMLDocument *This = OLEOBJ_THIS(iface);
59 return IHTMLDocument2_AddRef(HTMLDOC(This));
62 static ULONG WINAPI OleObject_Release(IOleObject *iface)
64 HTMLDocument *This = OLEOBJ_THIS(iface);
65 return IHTMLDocument2_Release(HTMLDOC(This));
68 static void update_hostinfo(HTMLDocumentObj *This, DOCHOSTUIINFO *hostinfo)
70 nsIScrollable *scrollable;
73 if(!This->nscontainer)
76 nsres = nsIWebBrowser_QueryInterface(This->nscontainer->webbrowser, &IID_nsIScrollable, (void**)&scrollable);
77 if(NS_SUCCEEDED(nsres)) {
78 nsres = nsIScrollable_SetDefaultScrollbarPreferences(scrollable, ScrollOrientation_Y,
79 (hostinfo->dwFlags & DOCHOSTUIFLAG_SCROLL_NO) ? Scrollbar_Never : Scrollbar_Always);
81 ERR("Could not set default Y scrollbar prefs: %08x\n", nsres);
83 nsres = nsIScrollable_SetDefaultScrollbarPreferences(scrollable, ScrollOrientation_X,
84 hostinfo->dwFlags & DOCHOSTUIFLAG_SCROLL_NO ? Scrollbar_Never : Scrollbar_Auto);
86 ERR("Could not set default X scrollbar prefs: %08x\n", nsres);
88 nsIScrollable_Release(scrollable);
90 ERR("Could not get nsIScrollable: %08x\n", nsres);
94 static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite *pClientSite)
96 HTMLDocument *This = OLEOBJ_THIS(iface);
97 IDocHostUIHandler *pDocHostUIHandler = NULL;
98 IOleCommandTarget *cmdtrg = NULL;
103 TRACE("(%p)->(%p)\n", This, pClientSite);
105 if(pClientSite == This->doc_obj->client)
108 if(This->doc_obj->client) {
109 IOleClientSite_Release(This->doc_obj->client);
110 This->doc_obj->client = NULL;
111 This->doc_obj->usermode = UNKNOWN_USERMODE;
114 if(This->doc_obj->hostui) {
115 IDocHostUIHandler_Release(This->doc_obj->hostui);
116 This->doc_obj->hostui = NULL;
119 memset(&This->doc_obj->hostinfo, 0, sizeof(DOCHOSTUIINFO));
124 hostui_setup = This->doc_obj->hostui_setup;
126 hres = IOleObject_QueryInterface(pClientSite, &IID_IDocHostUIHandler, (void**)&pDocHostUIHandler);
127 if(SUCCEEDED(hres)) {
128 DOCHOSTUIINFO hostinfo;
129 LPOLESTR key_path = NULL, override_key_path = NULL;
130 IDocHostUIHandler2 *pDocHostUIHandler2;
132 memset(&hostinfo, 0, sizeof(DOCHOSTUIINFO));
133 hostinfo.cbSize = sizeof(DOCHOSTUIINFO);
134 hres = IDocHostUIHandler_GetHostInfo(pDocHostUIHandler, &hostinfo);
135 if(SUCCEEDED(hres)) {
136 TRACE("hostinfo = {%u %08x %08x %s %s}\n",
137 hostinfo.cbSize, hostinfo.dwFlags, hostinfo.dwDoubleClick,
138 debugstr_w(hostinfo.pchHostCss), debugstr_w(hostinfo.pchHostNS));
139 update_hostinfo(This->doc_obj, &hostinfo);
140 This->doc_obj->hostinfo = hostinfo;
144 hres = IDocHostUIHandler_GetOptionKeyPath(pDocHostUIHandler, &key_path, 0);
145 if(hres == S_OK && key_path) {
147 /* FIXME: use key_path */
148 TRACE("key_path = %s\n", debugstr_w(key_path));
150 CoTaskMemFree(key_path);
153 hres = IDocHostUIHandler_QueryInterface(pDocHostUIHandler, &IID_IDocHostUIHandler2,
154 (void**)&pDocHostUIHandler2);
155 if(SUCCEEDED(hres)) {
156 hres = IDocHostUIHandler2_GetOverrideKeyPath(pDocHostUIHandler2, &override_key_path, 0);
157 if(hres == S_OK && override_key_path && override_key_path[0]) {
158 if(override_key_path[0]) {
159 /*FIXME: use override_key_path */
160 TRACE("override_key_path = %s\n", debugstr_w(override_key_path));
162 CoTaskMemFree(override_key_path);
164 IDocHostUIHandler2_Release(pDocHostUIHandler2);
167 This->doc_obj->hostui_setup = TRUE;
171 /* Native calls here GetWindow. What is it for?
172 * We don't have anything to do with it here (yet). */
174 IOleWindow *pOleWindow = NULL;
177 hres = IOleClientSite_QueryInterface(pClientSite, &IID_IOleWindow, (void**)&pOleWindow);
178 if(SUCCEEDED(hres)) {
179 IOleWindow_GetWindow(pOleWindow, &hwnd);
180 IOleWindow_Release(pOleWindow);
184 hres = IOleClientSite_QueryInterface(pClientSite, &IID_IOleCommandTarget, (void**)&cmdtrg);
185 if(SUCCEEDED(hres)) {
187 OLECMD cmd = {OLECMDID_SETPROGRESSTEXT, 0};
190 V_VT(&var) = VT_UNKNOWN;
191 V_UNKNOWN(&var) = (IUnknown*)HTMLWINDOW2(This->window);
192 IOleCommandTarget_Exec(cmdtrg, &CGID_DocHostCmdPriv, DOCHOST_DOCCANNAVIGATE, 0, &var, NULL);
195 IOleCommandTarget_QueryStatus(cmdtrg, NULL, 1, &cmd, NULL);
199 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSMAX,
200 OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
201 IOleCommandTarget_Exec(cmdtrg, NULL, OLECMDID_SETPROGRESSPOS,
202 OLECMDEXECOPT_DONTPROMPTUSER, &var, NULL);
204 IOleCommandTarget_Release(cmdtrg);
207 IOleClientSite_AddRef(pClientSite);
208 This->doc_obj->client = pClientSite;
209 This->doc_obj->hostui = pDocHostUIHandler;
211 if(This->doc_obj->usermode == UNKNOWN_USERMODE)
212 IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERMODE);
214 IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
216 hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_SILENT, &silent);
217 if(SUCCEEDED(hres)) {
218 if(V_VT(&silent) != VT_BOOL)
219 WARN("V_VT(silent) = %d\n", V_VT(&silent));
220 else if(V_BOOL(&silent))
221 FIXME("silent == true\n");
224 IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_USERAGENT);
225 IOleControl_OnAmbientPropertyChange(CONTROL(This), DISPID_AMBIENT_PALETTE);
230 static HRESULT WINAPI OleObject_GetClientSite(IOleObject *iface, IOleClientSite **ppClientSite)
232 HTMLDocument *This = OLEOBJ_THIS(iface);
234 TRACE("(%p)->(%p)\n", This, ppClientSite);
239 if(This->doc_obj->client)
240 IOleClientSite_AddRef(This->doc_obj->client);
241 *ppClientSite = This->doc_obj->client;
246 static HRESULT WINAPI OleObject_SetHostNames(IOleObject *iface, LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)
248 HTMLDocument *This = OLEOBJ_THIS(iface);
249 FIXME("(%p)->(%s %s)\n", This, debugstr_w(szContainerApp), debugstr_w(szContainerObj));
253 static HRESULT WINAPI OleObject_Close(IOleObject *iface, DWORD dwSaveOption)
255 HTMLDocument *This = OLEOBJ_THIS(iface);
257 TRACE("(%p)->(%08x)\n", This, dwSaveOption);
259 if(dwSaveOption == OLECLOSE_PROMPTSAVE)
260 FIXME("OLECLOSE_PROMPTSAVE not implemented\n");
262 if(This->doc_obj->in_place_active)
263 IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This));
265 HTMLDocument_LockContainer(This->doc_obj, FALSE);
267 if(This->advise_holder)
268 IOleAdviseHolder_SendOnClose(This->advise_holder);
273 static HRESULT WINAPI OleObject_SetMoniker(IOleObject *iface, DWORD dwWhichMoniker, IMoniker *pmk)
275 HTMLDocument *This = OLEOBJ_THIS(iface);
276 FIXME("(%p %d %p)->()\n", This, dwWhichMoniker, pmk);
280 static HRESULT WINAPI OleObject_GetMoniker(IOleObject *iface, DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk)
282 HTMLDocument *This = OLEOBJ_THIS(iface);
283 FIXME("(%p)->(%d %d %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
287 static HRESULT WINAPI OleObject_InitFromData(IOleObject *iface, IDataObject *pDataObject, BOOL fCreation,
290 HTMLDocument *This = OLEOBJ_THIS(iface);
291 FIXME("(%p)->(%p %x %d)\n", This, pDataObject, fCreation, dwReserved);
295 static HRESULT WINAPI OleObject_GetClipboardData(IOleObject *iface, DWORD dwReserved, IDataObject **ppDataObject)
297 HTMLDocument *This = OLEOBJ_THIS(iface);
298 FIXME("(%p)->(%d %p)\n", This, dwReserved, ppDataObject);
302 static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, LPMSG lpmsg, IOleClientSite *pActiveSite,
303 LONG lindex, HWND hwndParent, LPCRECT lprcPosRect)
305 HTMLDocument *This = OLEOBJ_THIS(iface);
306 IOleDocumentSite *pDocSite;
309 TRACE("(%p)->(%d %p %p %d %p %p)\n", This, iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect);
311 if(iVerb != OLEIVERB_SHOW && iVerb != OLEIVERB_UIACTIVATE && iVerb != OLEIVERB_INPLACEACTIVATE) {
312 FIXME("iVerb = %d not supported\n", iVerb);
317 pActiveSite = This->doc_obj->client;
319 hres = IOleClientSite_QueryInterface(pActiveSite, &IID_IOleDocumentSite, (void**)&pDocSite);
320 if(SUCCEEDED(hres)) {
321 HTMLDocument_LockContainer(This->doc_obj, TRUE);
323 /* FIXME: Create new IOleDocumentView. See CreateView for more info. */
324 hres = IOleDocumentSite_ActivateMe(pDocSite, DOCVIEW(This));
325 IOleDocumentSite_Release(pDocSite);
327 hres = IOleDocumentView_UIActivate(DOCVIEW(This), TRUE);
328 if(SUCCEEDED(hres)) {
330 RECT rect; /* We need to pass rect as not const pointer */
332 IOleDocumentView_SetRect(DOCVIEW(This), &rect);
334 IOleDocumentView_Show(DOCVIEW(This), TRUE);
341 static HRESULT WINAPI OleObject_EnumVerbs(IOleObject *iface, IEnumOLEVERB **ppEnumOleVerb)
343 HTMLDocument *This = OLEOBJ_THIS(iface);
344 FIXME("(%p)->(%p)\n", This, ppEnumOleVerb);
348 static HRESULT WINAPI OleObject_Update(IOleObject *iface)
350 HTMLDocument *This = OLEOBJ_THIS(iface);
351 FIXME("(%p)\n", This);
355 static HRESULT WINAPI OleObject_IsUpToDate(IOleObject *iface)
357 HTMLDocument *This = OLEOBJ_THIS(iface);
358 FIXME("(%p)\n", This);
362 static HRESULT WINAPI OleObject_GetUserClassID(IOleObject *iface, CLSID *pClsid)
364 HTMLDocument *This = OLEOBJ_THIS(iface);
366 TRACE("(%p)->(%p)\n", This, pClsid);
371 *pClsid = CLSID_HTMLDocument;
375 static HRESULT WINAPI OleObject_GetUserType(IOleObject *iface, DWORD dwFormOfType, LPOLESTR *pszUserType)
377 HTMLDocument *This = OLEOBJ_THIS(iface);
378 FIXME("(%p)->(%d %p)\n", This, dwFormOfType, pszUserType);
382 static HRESULT WINAPI OleObject_SetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
384 HTMLDocument *This = OLEOBJ_THIS(iface);
385 FIXME("(%p)->(%d %p)\n", This, dwDrawAspect, psizel);
389 static HRESULT WINAPI OleObject_GetExtent(IOleObject *iface, DWORD dwDrawAspect, SIZEL *psizel)
391 HTMLDocument *This = OLEOBJ_THIS(iface);
392 FIXME("(%p)->(%d %p)\n", This, dwDrawAspect, psizel);
396 static HRESULT WINAPI OleObject_Advise(IOleObject *iface, IAdviseSink *pAdvSink, DWORD *pdwConnection)
398 HTMLDocument *This = OLEOBJ_THIS(iface);
399 TRACE("(%p)->(%p %p)\n", This, pAdvSink, pdwConnection);
409 if(!This->advise_holder) {
410 CreateOleAdviseHolder(&This->advise_holder);
411 if(!This->advise_holder)
412 return E_OUTOFMEMORY;
415 return IOleAdviseHolder_Advise(This->advise_holder, pAdvSink, pdwConnection);
418 static HRESULT WINAPI OleObject_Unadvise(IOleObject *iface, DWORD dwConnection)
420 HTMLDocument *This = OLEOBJ_THIS(iface);
421 TRACE("(%p)->(%d)\n", This, dwConnection);
423 if(!This->advise_holder)
424 return OLE_E_NOCONNECTION;
426 return IOleAdviseHolder_Unadvise(This->advise_holder, dwConnection);
429 static HRESULT WINAPI OleObject_EnumAdvise(IOleObject *iface, IEnumSTATDATA **ppenumAdvise)
431 HTMLDocument *This = OLEOBJ_THIS(iface);
433 if(!This->advise_holder) {
434 *ppenumAdvise = NULL;
438 return IOleAdviseHolder_EnumAdvise(This->advise_holder, ppenumAdvise);
441 static HRESULT WINAPI OleObject_GetMiscStatus(IOleObject *iface, DWORD dwAspect, DWORD *pdwStatus)
443 HTMLDocument *This = OLEOBJ_THIS(iface);
444 FIXME("(%p)->(%d %p)\n", This, dwAspect, pdwStatus);
448 static HRESULT WINAPI OleObject_SetColorScheme(IOleObject *iface, LOGPALETTE *pLogpal)
450 HTMLDocument *This = OLEOBJ_THIS(iface);
451 FIXME("(%p)->(%p)\n", This, pLogpal);
457 static const IOleObjectVtbl OleObjectVtbl = {
458 OleObject_QueryInterface,
461 OleObject_SetClientSite,
462 OleObject_GetClientSite,
463 OleObject_SetHostNames,
465 OleObject_SetMoniker,
466 OleObject_GetMoniker,
467 OleObject_InitFromData,
468 OleObject_GetClipboardData,
472 OleObject_IsUpToDate,
473 OleObject_GetUserClassID,
474 OleObject_GetUserType,
479 OleObject_EnumAdvise,
480 OleObject_GetMiscStatus,
481 OleObject_SetColorScheme
484 /**********************************************************
485 * IOleDocument implementation
488 #define OLEDOC_THIS(iface) DEFINE_THIS(HTMLDocument, OleDocument, iface)
490 static HRESULT WINAPI OleDocument_QueryInterface(IOleDocument *iface, REFIID riid, void **ppvObject)
492 HTMLDocument *This = OLEDOC_THIS(iface);
493 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
496 static ULONG WINAPI OleDocument_AddRef(IOleDocument *iface)
498 HTMLDocument *This = OLEDOC_THIS(iface);
499 return IHTMLDocument2_AddRef(HTMLDOC(This));
502 static ULONG WINAPI OleDocument_Release(IOleDocument *iface)
504 HTMLDocument *This = OLEDOC_THIS(iface);
505 return IHTMLDocument2_Release(HTMLDOC(This));
508 static HRESULT WINAPI OleDocument_CreateView(IOleDocument *iface, IOleInPlaceSite *pIPSite, IStream *pstm,
509 DWORD dwReserved, IOleDocumentView **ppView)
511 HTMLDocument *This = OLEDOC_THIS(iface);
514 TRACE("(%p)->(%p %p %d %p)\n", This, pIPSite, pstm, dwReserved, ppView);
520 * Windows implementation creates new IOleDocumentView when function is called for the
521 * first time and returns E_FAIL when it is called for the second time, but it doesn't matter
522 * if the application uses returned interfaces, passed to ActivateMe or returned by
523 * QueryInterface, so there is no reason to create new interface. This needs more testing.
527 hres = IOleDocumentView_SetInPlaceSite(DOCVIEW(This), pIPSite);
533 FIXME("pstm is not supported\n");
535 IOleDocumentView_AddRef(DOCVIEW(This));
536 *ppView = DOCVIEW(This);
540 static HRESULT WINAPI OleDocument_GetDocMiscStatus(IOleDocument *iface, DWORD *pdwStatus)
542 HTMLDocument *This = OLEDOC_THIS(iface);
543 FIXME("(%p)->(%p)\n", This, pdwStatus);
547 static HRESULT WINAPI OleDocument_EnumViews(IOleDocument *iface, IEnumOleDocumentViews **ppEnum,
548 IOleDocumentView **ppView)
550 HTMLDocument *This = OLEDOC_THIS(iface);
551 FIXME("(%p)->(%p %p)\n", This, ppEnum, ppView);
557 static const IOleDocumentVtbl OleDocumentVtbl = {
558 OleDocument_QueryInterface,
561 OleDocument_CreateView,
562 OleDocument_GetDocMiscStatus,
563 OleDocument_EnumViews
566 /**********************************************************
567 * IOleControl implementation
570 #define CONTROL_THIS(iface) DEFINE_THIS(HTMLDocument, OleControl, iface)
572 static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface, REFIID riid, void **ppv)
574 HTMLDocument *This = CONTROL_THIS(iface);
575 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppv);
578 static ULONG WINAPI OleControl_AddRef(IOleControl *iface)
580 HTMLDocument *This = CONTROL_THIS(iface);
581 return IHTMLDocument2_AddRef(HTMLDOC(This));
584 static ULONG WINAPI OleControl_Release(IOleControl *iface)
586 HTMLDocument *This = CONTROL_THIS(iface);
587 return IHTMLDocument_Release(HTMLDOC(This));
590 static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *pCI)
592 HTMLDocument *This = CONTROL_THIS(iface);
593 FIXME("(%p)->(%p)\n", This, pCI);
597 static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, MSG *pMsg)
599 HTMLDocument *This = CONTROL_THIS(iface);
600 FIXME("(%p)->(%p)\n", This, pMsg);
604 HRESULT get_client_disp_property(IOleClientSite *client, DISPID dispid, VARIANT *res)
606 IDispatch *disp = NULL;
607 DISPPARAMS dispparams = {NULL, 0};
611 hres = IOleClientSite_QueryInterface(client, &IID_IDispatch, (void**)&disp);
613 TRACE("Could not get IDispatch\n");
619 hres = IDispatch_Invoke(disp, dispid, &IID_NULL, LOCALE_SYSTEM_DEFAULT,
620 DISPATCH_PROPERTYGET, &dispparams, res, NULL, &err);
622 IDispatch_Release(disp);
627 static HRESULT on_change_dlcontrol(HTMLDocument *This)
632 hres = get_client_disp_property(This->doc_obj->client, DISPID_AMBIENT_DLCONTROL, &res);
634 FIXME("unsupported dlcontrol %08x\n", V_I4(&res));
639 static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID dispID)
641 HTMLDocument *This = CONTROL_THIS(iface);
642 IOleClientSite *client;
646 client = This->doc_obj->client;
648 TRACE("client = NULL\n");
653 case DISPID_AMBIENT_USERMODE:
654 TRACE("(%p)->(DISPID_AMBIENT_USERMODE)\n", This);
655 hres = get_client_disp_property(client, DISPID_AMBIENT_USERMODE, &res);
659 if(V_VT(&res) == VT_BOOL) {
661 This->doc_obj->usermode = BROWSEMODE;
663 FIXME("edit mode is not supported\n");
664 This->doc_obj->usermode = EDITMODE;
667 FIXME("V_VT(res)=%d\n", V_VT(&res));
670 case DISPID_AMBIENT_DLCONTROL:
671 TRACE("(%p)->(DISPID_AMBIENT_DLCONTROL)\n", This);
672 return on_change_dlcontrol(This);
673 case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED:
674 TRACE("(%p)->(DISPID_AMBIENT_OFFLINEIFNOTCONNECTED)\n", This);
675 on_change_dlcontrol(This);
676 hres = get_client_disp_property(client, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED, &res);
680 if(V_VT(&res) == VT_BOOL) {
682 FIXME("offline connection is not supported\n");
686 FIXME("V_VT(res)=%d\n", V_VT(&res));
689 case DISPID_AMBIENT_SILENT:
690 TRACE("(%p)->(DISPID_AMBIENT_SILENT)\n", This);
691 on_change_dlcontrol(This);
692 hres = get_client_disp_property(client, DISPID_AMBIENT_SILENT, &res);
696 if(V_VT(&res) == VT_BOOL) {
698 FIXME("silent mode is not supported\n");
702 FIXME("V_VT(res)=%d\n", V_VT(&res));
705 case DISPID_AMBIENT_USERAGENT:
706 TRACE("(%p)->(DISPID_AMBIENT_USERAGENT)\n", This);
707 hres = get_client_disp_property(client, DISPID_AMBIENT_USERAGENT, &res);
711 FIXME("not supported AMBIENT_USERAGENT\n");
714 case DISPID_AMBIENT_PALETTE:
715 TRACE("(%p)->(DISPID_AMBIENT_PALETTE)\n", This);
716 hres = get_client_disp_property(client, DISPID_AMBIENT_PALETTE, &res);
720 FIXME("not supported AMBIENT_PALETTE\n");
725 FIXME("(%p) unsupported dispID=%d\n", This, dispID);
729 static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL bFreeze)
731 HTMLDocument *This = CONTROL_THIS(iface);
732 FIXME("(%p)->(%x)\n", This, bFreeze);
738 static const IOleControlVtbl OleControlVtbl = {
739 OleControl_QueryInterface,
742 OleControl_GetControlInfo,
743 OleControl_OnMnemonic,
744 OleControl_OnAmbientPropertyChange,
745 OleControl_FreezeEvents
748 /**********************************************************
749 * IObjectWithSite implementation
752 #define OBJSITE_THIS(iface) DEFINE_THIS(HTMLDocument, ObjectWithSite, iface)
754 static HRESULT WINAPI ObjectWithSite_QueryInterface(IObjectWithSite *iface, REFIID riid, void **ppvObject)
756 HTMLDocument *This = OBJSITE_THIS(iface);
757 return IHTMLDocument2_QueryInterface(HTMLDOC(This), riid, ppvObject);
760 static ULONG WINAPI ObjectWithSite_AddRef(IObjectWithSite *iface)
762 HTMLDocument *This = OBJSITE_THIS(iface);
763 return IHTMLDocument2_AddRef(HTMLDOC(This));
766 static ULONG WINAPI ObjectWithSite_Release(IObjectWithSite *iface)
768 HTMLDocument *This = OBJSITE_THIS(iface);
769 return IHTMLDocument2_Release(HTMLDOC(This));
772 static HRESULT WINAPI ObjectWithSite_SetSite(IObjectWithSite *iface, IUnknown *pUnkSite)
774 HTMLDocument *This = OBJSITE_THIS(iface);
775 FIXME("(%p)->(%p)\n", This, pUnkSite);
779 static HRESULT WINAPI ObjectWithSite_GetSite(IObjectWithSite* iface, REFIID riid, PVOID *ppvSite)
781 HTMLDocument *This = OBJSITE_THIS(iface);
782 FIXME("(%p)->(%p)\n", This, ppvSite);
788 static const IObjectWithSiteVtbl ObjectWithSiteVtbl = {
789 ObjectWithSite_QueryInterface,
790 ObjectWithSite_AddRef,
791 ObjectWithSite_Release,
792 ObjectWithSite_SetSite,
793 ObjectWithSite_GetSite
796 void HTMLDocument_LockContainer(HTMLDocumentObj *This, BOOL fLock)
798 IOleContainer *container;
801 if(!This->client || This->container_locked == fLock)
804 hres = IOleClientSite_GetContainer(This->client, &container);
805 if(SUCCEEDED(hres)) {
806 IOleContainer_LockContainer(container, fLock);
807 This->container_locked = fLock;
808 IOleContainer_Release(container);
812 void HTMLDocument_OleObj_Init(HTMLDocument *This)
814 This->lpOleObjectVtbl = &OleObjectVtbl;
815 This->lpOleDocumentVtbl = &OleDocumentVtbl;
816 This->lpOleControlVtbl = &OleControlVtbl;
817 This->lpObjectWithSiteVtbl = &ObjectWithSiteVtbl;