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"
38 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
40 /**********************************************************
41 * IOleObject implementation
44 #define OLEOBJ_THIS(iface) DEFINE_THIS(HTMLDocument, OleObject, iface)
46 static HRESULT WINAPI
OleObject_QueryInterface(IOleObject
*iface
, REFIID riid
, void **ppvObject
)
48 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
49 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
52 static ULONG WINAPI
OleObject_AddRef(IOleObject
*iface
)
54 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
55 return IHTMLDocument2_AddRef(HTMLDOC(This
));
58 static ULONG WINAPI
OleObject_Release(IOleObject
*iface
)
60 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
61 return IHTMLDocument2_Release(HTMLDOC(This
));
64 static void update_hostinfo(HTMLDocument
*This
, DOCHOSTUIINFO
*hostinfo
)
66 nsIScrollable
*scrollable
;
69 if(!This
->nscontainer
)
72 nsres
= nsIWebBrowser_QueryInterface(This
->nscontainer
->webbrowser
, &IID_nsIScrollable
, (void**)&scrollable
);
73 if(NS_SUCCEEDED(nsres
)) {
74 nsres
= nsIScrollable_SetDefaultScrollbarPreferences(scrollable
, ScrollOrientation_Y
,
75 (hostinfo
->dwFlags
& DOCHOSTUIFLAG_SCROLL_NO
) ? Scrollbar_Never
: Scrollbar_Always
);
77 ERR("Could not set default Y scrollbar prefs: %08x\n", nsres
);
79 nsres
= nsIScrollable_SetDefaultScrollbarPreferences(scrollable
, ScrollOrientation_X
,
80 hostinfo
->dwFlags
& DOCHOSTUIFLAG_SCROLL_NO
? Scrollbar_Never
: Scrollbar_Auto
);
82 ERR("Could not set default X scrollbar prefs: %08x\n", nsres
);
84 nsIScrollable_Release(scrollable
);
86 ERR("Could not get nsIScrollable: %08x\n", nsres
);
90 static HRESULT WINAPI
OleObject_SetClientSite(IOleObject
*iface
, IOleClientSite
*pClientSite
)
92 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
93 IDocHostUIHandler
*pDocHostUIHandler
= NULL
;
94 IOleCommandTarget
*cmdtrg
= NULL
;
98 TRACE("(%p)->(%p)\n", This
, pClientSite
);
100 if(pClientSite
== This
->client
)
104 IOleClientSite_Release(This
->client
);
106 This
->usermode
= UNKNOWN_USERMODE
;
110 IDocHostUIHandler_Release(This
->hostui
);
114 memset(&This
->hostinfo
, 0, sizeof(DOCHOSTUIINFO
));
119 hres
= IOleObject_QueryInterface(pClientSite
, &IID_IDocHostUIHandler
, (void**)&pDocHostUIHandler
);
120 if(SUCCEEDED(hres
)) {
121 DOCHOSTUIINFO hostinfo
;
122 LPOLESTR key_path
= NULL
, override_key_path
= NULL
;
123 IDocHostUIHandler2
*pDocHostUIHandler2
;
125 memset(&hostinfo
, 0, sizeof(DOCHOSTUIINFO
));
126 hostinfo
.cbSize
= sizeof(DOCHOSTUIINFO
);
127 hres
= IDocHostUIHandler_GetHostInfo(pDocHostUIHandler
, &hostinfo
);
128 if(SUCCEEDED(hres
)) {
129 TRACE("hostinfo = {%u %08x %08x %s %s}\n",
130 hostinfo
.cbSize
, hostinfo
.dwFlags
, hostinfo
.dwDoubleClick
,
131 debugstr_w(hostinfo
.pchHostCss
), debugstr_w(hostinfo
.pchHostNS
));
132 update_hostinfo(This
, &hostinfo
);
133 This
->hostinfo
= hostinfo
;
136 if(!This
->has_key_path
) {
137 hres
= IDocHostUIHandler_GetOptionKeyPath(pDocHostUIHandler
, &key_path
, 0);
138 if(hres
== S_OK
&& key_path
) {
140 /* FIXME: use key_path */
141 TRACE("key_path = %s\n", debugstr_w(key_path
));
143 CoTaskMemFree(key_path
);
146 hres
= IDocHostUIHandler_QueryInterface(pDocHostUIHandler
, &IID_IDocHostUIHandler2
,
147 (void**)&pDocHostUIHandler2
);
148 if(SUCCEEDED(hres
)) {
149 hres
= IDocHostUIHandler2_GetOverrideKeyPath(pDocHostUIHandler2
, &override_key_path
, 0);
150 if(hres
== S_OK
&& override_key_path
&& override_key_path
[0]) {
151 if(override_key_path
[0]) {
152 /*FIXME: use override_key_path */
153 TRACE("override_key_path = %s\n", debugstr_w(override_key_path
));
155 CoTaskMemFree(override_key_path
);
157 IDocHostUIHandler2_Release(pDocHostUIHandler2
);
160 This
->has_key_path
= TRUE
;
164 /* Native calls here GetWindow. What is it for?
165 * We don't have anything to do with it here (yet). */
167 IOleWindow
*pOleWindow
= NULL
;
170 hres
= IOleClientSite_QueryInterface(pClientSite
, &IID_IOleWindow
, (void**)&pOleWindow
);
171 if(SUCCEEDED(hres
)) {
172 IOleWindow_GetWindow(pOleWindow
, &hwnd
);
173 IOleWindow_Release(pOleWindow
);
177 hres
= IOleClientSite_QueryInterface(pClientSite
, &IID_IOleCommandTarget
, (void**)&cmdtrg
);
178 if(SUCCEEDED(hres
)) {
180 OLECMD cmd
= {OLECMDID_SETPROGRESSTEXT
, 0};
182 IOleCommandTarget_QueryStatus(cmdtrg
, NULL
, 1, &cmd
, NULL
);
186 IOleCommandTarget_Exec(cmdtrg
, NULL
, OLECMDID_SETPROGRESSMAX
,
187 OLECMDEXECOPT_DONTPROMPTUSER
, &var
, NULL
);
188 IOleCommandTarget_Exec(cmdtrg
, NULL
, OLECMDID_SETPROGRESSPOS
,
189 OLECMDEXECOPT_DONTPROMPTUSER
, &var
, NULL
);
191 IOleCommandTarget_Release(cmdtrg
);
194 IOleClientSite_AddRef(pClientSite
);
195 This
->client
= pClientSite
;
196 This
->hostui
= pDocHostUIHandler
;
198 if(This
->usermode
== UNKNOWN_USERMODE
)
199 IOleControl_OnAmbientPropertyChange(CONTROL(This
), DISPID_AMBIENT_USERMODE
);
201 IOleControl_OnAmbientPropertyChange(CONTROL(This
), DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
);
203 hres
= get_client_disp_property(This
->client
, DISPID_AMBIENT_SILENT
, &silent
);
204 if(SUCCEEDED(hres
)) {
205 if(V_VT(&silent
) != VT_BOOL
)
206 WARN("V_VT(silent) = %d\n", V_VT(&silent
));
207 else if(V_BOOL(&silent
))
208 FIXME("silent == true\n");
211 IOleControl_OnAmbientPropertyChange(CONTROL(This
), DISPID_AMBIENT_USERAGENT
);
212 IOleControl_OnAmbientPropertyChange(CONTROL(This
), DISPID_AMBIENT_PALETTE
);
217 static HRESULT WINAPI
OleObject_GetClientSite(IOleObject
*iface
, IOleClientSite
**ppClientSite
)
219 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
221 TRACE("(%p)->(%p)\n", This
, ppClientSite
);
227 IOleClientSite_AddRef(This
->client
);
228 *ppClientSite
= This
->client
;
233 static HRESULT WINAPI
OleObject_SetHostNames(IOleObject
*iface
, LPCOLESTR szContainerApp
, LPCOLESTR szContainerObj
)
235 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
236 FIXME("(%p)->(%s %s)\n", This
, debugstr_w(szContainerApp
), debugstr_w(szContainerObj
));
240 static HRESULT WINAPI
OleObject_Close(IOleObject
*iface
, DWORD dwSaveOption
)
242 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
244 TRACE("(%p)->(%08x)\n", This
, dwSaveOption
);
246 if(dwSaveOption
== OLECLOSE_PROMPTSAVE
)
247 FIXME("OLECLOSE_PROMPTSAVE not implemented\n");
249 if(This
->in_place_active
)
250 IOleInPlaceObjectWindowless_InPlaceDeactivate(INPLACEWIN(This
));
252 HTMLDocument_LockContainer(This
, FALSE
);
257 static HRESULT WINAPI
OleObject_SetMoniker(IOleObject
*iface
, DWORD dwWhichMoniker
, IMoniker
*pmk
)
259 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
260 FIXME("(%p %d %p)->()\n", This
, dwWhichMoniker
, pmk
);
264 static HRESULT WINAPI
OleObject_GetMoniker(IOleObject
*iface
, DWORD dwAssign
, DWORD dwWhichMoniker
, IMoniker
**ppmk
)
266 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
267 FIXME("(%p)->(%d %d %p)\n", This
, dwAssign
, dwWhichMoniker
, ppmk
);
271 static HRESULT WINAPI
OleObject_InitFromData(IOleObject
*iface
, IDataObject
*pDataObject
, BOOL fCreation
,
274 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
275 FIXME("(%p)->(%p %x %d)\n", This
, pDataObject
, fCreation
, dwReserved
);
279 static HRESULT WINAPI
OleObject_GetClipboardData(IOleObject
*iface
, DWORD dwReserved
, IDataObject
**ppDataObject
)
281 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
282 FIXME("(%p)->(%d %p)\n", This
, dwReserved
, ppDataObject
);
286 static HRESULT WINAPI
OleObject_DoVerb(IOleObject
*iface
, LONG iVerb
, LPMSG lpmsg
, IOleClientSite
*pActiveSite
,
287 LONG lindex
, HWND hwndParent
, LPCRECT lprcPosRect
)
289 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
290 IOleDocumentSite
*pDocSite
;
293 TRACE("(%p)->(%d %p %p %d %p %p)\n", This
, iVerb
, lpmsg
, pActiveSite
, lindex
, hwndParent
, lprcPosRect
);
295 if(iVerb
!= OLEIVERB_SHOW
&& iVerb
!= OLEIVERB_UIACTIVATE
&& iVerb
!= OLEIVERB_INPLACEACTIVATE
) {
296 FIXME("iVerb = %d not supported\n", iVerb
);
301 pActiveSite
= This
->client
;
303 hres
= IOleClientSite_QueryInterface(pActiveSite
, &IID_IOleDocumentSite
, (void**)&pDocSite
);
304 if(SUCCEEDED(hres
)) {
305 HTMLDocument_LockContainer(This
, TRUE
);
307 /* FIXME: Create new IOleDocumentView. See CreateView for more info. */
308 hres
= IOleDocumentSite_ActivateMe(pDocSite
, DOCVIEW(This
));
309 IOleDocumentSite_Release(pDocSite
);
311 hres
= IOleDocumentView_UIActivate(DOCVIEW(This
), TRUE
);
312 if(SUCCEEDED(hres
)) {
314 RECT rect
; /* We need to pass rect as not const pointer */
316 IOleDocumentView_SetRect(DOCVIEW(This
), &rect
);
318 IOleDocumentView_Show(DOCVIEW(This
), TRUE
);
325 static HRESULT WINAPI
OleObject_EnumVerbs(IOleObject
*iface
, IEnumOLEVERB
**ppEnumOleVerb
)
327 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
328 FIXME("(%p)->(%p)\n", This
, ppEnumOleVerb
);
332 static HRESULT WINAPI
OleObject_Update(IOleObject
*iface
)
334 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
335 FIXME("(%p)\n", This
);
339 static HRESULT WINAPI
OleObject_IsUpToDate(IOleObject
*iface
)
341 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
342 FIXME("(%p)\n", This
);
346 static HRESULT WINAPI
OleObject_GetUserClassID(IOleObject
*iface
, CLSID
*pClsid
)
348 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
350 TRACE("(%p)->(%p)\n", This
, pClsid
);
355 *pClsid
= CLSID_HTMLDocument
;
359 static HRESULT WINAPI
OleObject_GetUserType(IOleObject
*iface
, DWORD dwFormOfType
, LPOLESTR
*pszUserType
)
361 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
362 FIXME("(%p)->(%d %p)\n", This
, dwFormOfType
, pszUserType
);
366 static HRESULT WINAPI
OleObject_SetExtent(IOleObject
*iface
, DWORD dwDrawAspect
, SIZEL
*psizel
)
368 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
369 FIXME("(%p)->(%d %p)\n", This
, dwDrawAspect
, psizel
);
373 static HRESULT WINAPI
OleObject_GetExtent(IOleObject
*iface
, DWORD dwDrawAspect
, SIZEL
*psizel
)
375 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
376 FIXME("(%p)->(%d %p)\n", This
, dwDrawAspect
, psizel
);
380 static HRESULT WINAPI
OleObject_Advise(IOleObject
*iface
, IAdviseSink
*pAdvSink
, DWORD
*pdwConnection
)
382 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
383 FIXME("(%p)->(%p %p)\n", This
, pAdvSink
, pdwConnection
);
387 static HRESULT WINAPI
OleObject_Unadvise(IOleObject
*iface
, DWORD dwConnection
)
389 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
390 FIXME("(%p)->(%d)\n", This
, dwConnection
);
394 static HRESULT WINAPI
OleObject_EnumAdvise(IOleObject
*iface
, IEnumSTATDATA
**ppenumAdvise
)
396 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
397 FIXME("(%p)->(%p)\n", This
, ppenumAdvise
);
401 static HRESULT WINAPI
OleObject_GetMiscStatus(IOleObject
*iface
, DWORD dwAspect
, DWORD
*pdwStatus
)
403 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
404 FIXME("(%p)->(%d %p)\n", This
, dwAspect
, pdwStatus
);
408 static HRESULT WINAPI
OleObject_SetColorScheme(IOleObject
*iface
, LOGPALETTE
*pLogpal
)
410 HTMLDocument
*This
= OLEOBJ_THIS(iface
);
411 FIXME("(%p)->(%p)\n", This
, pLogpal
);
417 static const IOleObjectVtbl OleObjectVtbl
= {
418 OleObject_QueryInterface
,
421 OleObject_SetClientSite
,
422 OleObject_GetClientSite
,
423 OleObject_SetHostNames
,
425 OleObject_SetMoniker
,
426 OleObject_GetMoniker
,
427 OleObject_InitFromData
,
428 OleObject_GetClipboardData
,
432 OleObject_IsUpToDate
,
433 OleObject_GetUserClassID
,
434 OleObject_GetUserType
,
439 OleObject_EnumAdvise
,
440 OleObject_GetMiscStatus
,
441 OleObject_SetColorScheme
444 /**********************************************************
445 * IOleDocument implementation
448 #define OLEDOC_THIS(iface) DEFINE_THIS(HTMLDocument, OleDocument, iface)
450 static HRESULT WINAPI
OleDocument_QueryInterface(IOleDocument
*iface
, REFIID riid
, void **ppvObject
)
452 HTMLDocument
*This
= OLEDOC_THIS(iface
);
453 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppvObject
);
456 static ULONG WINAPI
OleDocument_AddRef(IOleDocument
*iface
)
458 HTMLDocument
*This
= OLEDOC_THIS(iface
);
459 return IHTMLDocument2_AddRef(HTMLDOC(This
));
462 static ULONG WINAPI
OleDocument_Release(IOleDocument
*iface
)
464 HTMLDocument
*This
= OLEDOC_THIS(iface
);
465 return IHTMLDocument2_Release(HTMLDOC(This
));
468 static HRESULT WINAPI
OleDocument_CreateView(IOleDocument
*iface
, IOleInPlaceSite
*pIPSite
, IStream
*pstm
,
469 DWORD dwReserved
, IOleDocumentView
**ppView
)
471 HTMLDocument
*This
= OLEDOC_THIS(iface
);
474 TRACE("(%p)->(%p %p %d %p)\n", This
, pIPSite
, pstm
, dwReserved
, ppView
);
480 * Windows implementation creates new IOleDocumentView when function is called for the
481 * first time and returns E_FAIL when it is called for the second time, but it doesn't matter
482 * if the application uses returned interfaces, passed to ActivateMe or returned by
483 * QueryInterface, so there is no reason to create new interface. This needs more testing.
487 hres
= IOleDocumentView_SetInPlaceSite(DOCVIEW(This
), pIPSite
);
493 FIXME("pstm is not supported\n");
495 IOleDocumentView_AddRef(DOCVIEW(This
));
496 *ppView
= DOCVIEW(This
);
500 static HRESULT WINAPI
OleDocument_GetDocMiscStatus(IOleDocument
*iface
, DWORD
*pdwStatus
)
502 HTMLDocument
*This
= OLEDOC_THIS(iface
);
503 FIXME("(%p)->(%p)\n", This
, pdwStatus
);
507 static HRESULT WINAPI
OleDocument_EnumViews(IOleDocument
*iface
, IEnumOleDocumentViews
**ppEnum
,
508 IOleDocumentView
**ppView
)
510 HTMLDocument
*This
= OLEDOC_THIS(iface
);
511 FIXME("(%p)->(%p %p)\n", This
, ppEnum
, ppView
);
517 static const IOleDocumentVtbl OleDocumentVtbl
= {
518 OleDocument_QueryInterface
,
521 OleDocument_CreateView
,
522 OleDocument_GetDocMiscStatus
,
523 OleDocument_EnumViews
526 /**********************************************************
527 * IOleControl implementation
530 #define CONTROL_THIS(iface) DEFINE_THIS(HTMLDocument, OleControl, iface)
532 static HRESULT WINAPI
OleControl_QueryInterface(IOleControl
*iface
, REFIID riid
, void **ppv
)
534 HTMLDocument
*This
= CONTROL_THIS(iface
);
535 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppv
);
538 static ULONG WINAPI
OleControl_AddRef(IOleControl
*iface
)
540 HTMLDocument
*This
= CONTROL_THIS(iface
);
541 return IHTMLDocument2_AddRef(HTMLDOC(This
));
544 static ULONG WINAPI
OleControl_Release(IOleControl
*iface
)
546 HTMLDocument
*This
= CONTROL_THIS(iface
);
547 return IHTMLDocument_Release(HTMLDOC(This
));
550 static HRESULT WINAPI
OleControl_GetControlInfo(IOleControl
*iface
, CONTROLINFO
*pCI
)
552 HTMLDocument
*This
= CONTROL_THIS(iface
);
553 FIXME("(%p)->(%p)\n", This
, pCI
);
557 static HRESULT WINAPI
OleControl_OnMnemonic(IOleControl
*iface
, MSG
*pMsg
)
559 HTMLDocument
*This
= CONTROL_THIS(iface
);
560 FIXME("(%p)->(%p)\n", This
, pMsg
);
564 HRESULT
get_client_disp_property(IOleClientSite
*client
, DISPID dispid
, VARIANT
*res
)
566 IDispatch
*disp
= NULL
;
567 DISPPARAMS dispparams
= {NULL
, 0};
571 hres
= IOleClientSite_QueryInterface(client
, &IID_IDispatch
, (void**)&disp
);
573 TRACE("Could not get IDispatch\n");
579 hres
= IDispatch_Invoke(disp
, dispid
, &IID_NULL
, LOCALE_SYSTEM_DEFAULT
,
580 DISPATCH_PROPERTYGET
, &dispparams
, res
, NULL
, &err
);
582 IDispatch_Release(disp
);
587 static HRESULT
on_change_dlcontrol(HTMLDocument
*This
)
592 hres
= get_client_disp_property(This
->client
, DISPID_AMBIENT_DLCONTROL
, &res
);
594 FIXME("unsupported dlcontrol %08x\n", V_I4(&res
));
599 static HRESULT WINAPI
OleControl_OnAmbientPropertyChange(IOleControl
*iface
, DISPID dispID
)
601 HTMLDocument
*This
= CONTROL_THIS(iface
);
606 TRACE("This->client = NULL\n");
611 case DISPID_AMBIENT_USERMODE
:
612 TRACE("(%p)->(DISPID_AMBIENT_USERMODE)\n", This
);
613 hres
= get_client_disp_property(This
->client
, DISPID_AMBIENT_USERMODE
, &res
);
617 if(V_VT(&res
) == VT_BOOL
) {
619 This
->usermode
= BROWSEMODE
;
621 FIXME("edit mode is not supported\n");
622 This
->usermode
= EDITMODE
;
625 FIXME("V_VT(res)=%d\n", V_VT(&res
));
628 case DISPID_AMBIENT_DLCONTROL
:
629 TRACE("(%p)->(DISPID_AMBIENT_DLCONTROL)\n", This
);
630 return on_change_dlcontrol(This
);
631 case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
:
632 TRACE("(%p)->(DISPID_AMBIENT_OFFLINEIFNOTCONNECTED)\n", This
);
633 on_change_dlcontrol(This
);
634 hres
= get_client_disp_property(This
->client
, DISPID_AMBIENT_OFFLINEIFNOTCONNECTED
, &res
);
638 if(V_VT(&res
) == VT_BOOL
) {
640 FIXME("offline connection is not supported\n");
644 FIXME("V_VT(res)=%d\n", V_VT(&res
));
647 case DISPID_AMBIENT_SILENT
:
648 TRACE("(%p)->(DISPID_AMBIENT_SILENT)\n", This
);
649 on_change_dlcontrol(This
);
650 hres
= get_client_disp_property(This
->client
, DISPID_AMBIENT_SILENT
, &res
);
654 if(V_VT(&res
) == VT_BOOL
) {
656 FIXME("silent mode is not supported\n");
660 FIXME("V_VT(res)=%d\n", V_VT(&res
));
663 case DISPID_AMBIENT_USERAGENT
:
664 TRACE("(%p)->(DISPID_AMBIENT_USERAGENT)\n", This
);
665 hres
= get_client_disp_property(This
->client
, DISPID_AMBIENT_USERAGENT
, &res
);
669 FIXME("not supported AMBIENT_USERAGENT\n");
672 case DISPID_AMBIENT_PALETTE
:
673 TRACE("(%p)->(DISPID_AMBIENT_PALETTE)\n", This
);
674 hres
= get_client_disp_property(This
->client
, DISPID_AMBIENT_PALETTE
, &res
);
678 FIXME("not supported AMBIENT_PALETTE\n");
683 FIXME("(%p) unsupported dispID=%d\n", This
, dispID
);
687 static HRESULT WINAPI
OleControl_FreezeEvents(IOleControl
*iface
, BOOL bFreeze
)
689 HTMLDocument
*This
= CONTROL_THIS(iface
);
690 FIXME("(%p)->(%x)\n", This
, bFreeze
);
696 static const IOleControlVtbl OleControlVtbl
= {
697 OleControl_QueryInterface
,
700 OleControl_GetControlInfo
,
701 OleControl_OnMnemonic
,
702 OleControl_OnAmbientPropertyChange
,
703 OleControl_FreezeEvents
706 /**********************************************************
707 * ICustomDoc implementation
710 #define CUSTOMDOC_THIS(iface) DEFINE_THIS(HTMLDocument, CustomDoc, iface)
712 static HRESULT WINAPI
CustomDoc_QueryInterface(ICustomDoc
*iface
, REFIID riid
, void **ppv
)
714 HTMLDocument
*This
= CUSTOMDOC_THIS(iface
);
715 return IHTMLDocument2_QueryInterface(HTMLDOC(This
), riid
, ppv
);
718 static ULONG WINAPI
CustomDoc_AddRef(ICustomDoc
*iface
)
720 HTMLDocument
*This
= CUSTOMDOC_THIS(iface
);
721 return IHTMLDocument2_AddRef(HTMLDOC(This
));
724 static ULONG WINAPI
CustomDoc_Release(ICustomDoc
*iface
)
726 HTMLDocument
*This
= CUSTOMDOC_THIS(iface
);
727 return IHTMLDocument_Release(HTMLDOC(This
));
730 static HRESULT WINAPI
CustomDoc_SetUIHandler(ICustomDoc
*iface
, IDocHostUIHandler
*pUIHandler
)
732 HTMLDocument
*This
= CUSTOMDOC_THIS(iface
);
733 FIXME("(%p)->(%p)\n", This
, pUIHandler
);
737 #undef CUSTOMDOC_THIS
739 static const ICustomDocVtbl CustomDocVtbl
= {
740 CustomDoc_QueryInterface
,
743 CustomDoc_SetUIHandler
746 void HTMLDocument_LockContainer(HTMLDocument
*This
, BOOL fLock
)
748 IOleContainer
*container
;
751 if(!This
->client
|| This
->container_locked
== fLock
)
754 hres
= IOleClientSite_GetContainer(This
->client
, &container
);
755 if(SUCCEEDED(hres
)) {
756 IOleContainer_LockContainer(container
, fLock
);
757 This
->container_locked
= fLock
;
758 IOleContainer_Release(container
);
762 void HTMLDocument_OleObj_Init(HTMLDocument
*This
)
764 This
->lpOleObjectVtbl
= &OleObjectVtbl
;
765 This
->lpOleDocumentVtbl
= &OleDocumentVtbl
;
766 This
->lpOleControlVtbl
= &OleControlVtbl
;
767 This
->lpCustomDocVtbl
= &CustomDocVtbl
;
769 This
->usermode
= UNKNOWN_USERMODE
;
774 This
->has_key_path
= FALSE
;
775 This
->container_locked
= FALSE
;
777 memset(&This
->hostinfo
, 0, sizeof(DOCHOSTUIINFO
));