2 * Copyright 2005 Jacek 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include "wine/debug.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw
);
24 #define DOCHOSTUI_THIS(iface) DEFINE_THIS(WebBrowser, DocHostUIHandler, iface)
26 static HRESULT WINAPI
DocHostUIHandler_QueryInterface(IDocHostUIHandler2
*iface
,
27 REFIID riid
, void **ppv
)
29 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
30 return IOleClientSite_QueryInterface(CLIENTSITE(This
), riid
, ppv
);
33 static ULONG WINAPI
DocHostUIHandler_AddRef(IDocHostUIHandler2
*iface
)
35 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
36 return IOleClientSite_AddRef(CLIENTSITE(This
));
39 static ULONG WINAPI
DocHostUIHandler_Release(IDocHostUIHandler2
*iface
)
41 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
42 return IOleClientSite_Release(CLIENTSITE(This
));
45 static HRESULT WINAPI
DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2
*iface
,
46 DWORD dwID
, POINT
*ppt
, IUnknown
*pcmdtReserved
, IDispatch
*pdispReserved
)
48 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
49 FIXME("(%p)->(%ld %p %p %p)\n", This
, dwID
, ppt
, pcmdtReserved
, pdispReserved
);
53 static HRESULT WINAPI
DocHostUIHandler_GetHostInfo(IDocHostUIHandler2
*iface
,
56 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
57 IDocHostUIHandler
*handler
;
60 TRACE("(%p)->(%p)\n", This
, pInfo
);
63 hres
= IOleClientSite_QueryInterface(This
->client
, &IID_IDocHostUIHandler
, (void**)&handler
);
65 hres
= IDocHostUIHandler_GetHostInfo(handler
, pInfo
);
66 IDocHostUIHandler_Release(handler
);
72 pInfo
->dwFlags
= DOCHOSTUIFLAG_DISABLE_HELP_MENU
| DOCHOSTUIFLAG_OPENNEWWIN
73 | DOCHOSTUIFLAG_URL_ENCODING_ENABLE_UTF8
| DOCHOSTUIFLAG_ENABLE_INPLACE_NAVIGATION
74 | DOCHOSTUIFLAG_IME_ENABLE_RECONVERSION
;
78 static HRESULT WINAPI
DocHostUIHandler_ShowUI(IDocHostUIHandler2
*iface
, DWORD dwID
,
79 IOleInPlaceActiveObject
*pActiveObject
, IOleCommandTarget
*pCommandTarget
,
80 IOleInPlaceFrame
*pFrame
, IOleInPlaceUIWindow
*pDoc
)
82 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
83 FIXME("(%p)->(%ld %p %p %p %p)\n", This
, dwID
, pActiveObject
, pCommandTarget
,
88 static HRESULT WINAPI
DocHostUIHandler_HideUI(IDocHostUIHandler2
*iface
)
90 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
91 FIXME("(%p)\n", This
);
95 static HRESULT WINAPI
DocHostUIHandler_UpdateUI(IDocHostUIHandler2
*iface
)
97 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
98 FIXME("(%p)\n", This
);
102 static HRESULT WINAPI
DocHostUIHandler_EnableModeless(IDocHostUIHandler2
*iface
,
105 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
106 FIXME("(%p)->(%x)\n", This
, fEnable
);
110 static HRESULT WINAPI
DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2
*iface
,
113 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
114 FIXME("(%p)->(%x)\n", This
, fActivate
);
118 static HRESULT WINAPI
DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2
*iface
,
121 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
122 FIXME("(%p)->(%x)\n", This
, fActivate
);
126 static HRESULT WINAPI
DocHostUIHandler_ResizeBorder(IDocHostUIHandler2
*iface
,
127 LPCRECT prcBorder
, IOleInPlaceUIWindow
*pUIWindow
, BOOL fRameWindow
)
129 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
130 FIXME("(%p)->(%p %p %X)\n", This
, prcBorder
, pUIWindow
, fRameWindow
);
134 static HRESULT WINAPI
DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2
*iface
,
135 LPMSG lpMsg
, const GUID
*pguidCmdGroup
, DWORD nCmdID
)
137 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
138 FIXME("(%p)->(%p %p %ld)\n", This
, lpMsg
, pguidCmdGroup
, nCmdID
);
142 static HRESULT WINAPI
DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2
*iface
,
143 LPOLESTR
*pchKey
, DWORD dw
)
145 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
146 FIXME("(%p)->(%p %ld)\n", This
, pchKey
, dw
);
150 static HRESULT WINAPI
DocHostUIHandler_GetDropTarget(IDocHostUIHandler2
*iface
,
151 IDropTarget
*pDropTarget
, IDropTarget
**ppDropTarget
)
153 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
154 FIXME("(%p)\n", This
);
158 static HRESULT WINAPI
DocHostUIHandler_GetExternal(IDocHostUIHandler2
*iface
,
159 IDispatch
**ppDispatch
)
161 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
162 FIXME("(%p)->(%p)\n", This
, ppDispatch
);
166 static HRESULT WINAPI
DocHostUIHandler_TranslateUrl(IDocHostUIHandler2
*iface
,
167 DWORD dwTranslate
, OLECHAR
*pchURLIn
, OLECHAR
**ppchURLOut
)
169 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
170 FIXME("(%p)->(%ld %s %p)\n", This
, dwTranslate
, debugstr_w(pchURLIn
), ppchURLOut
);
174 static HRESULT WINAPI
DocHostUIHandler_FilterDataObject(IDocHostUIHandler2
*iface
,
175 IDataObject
*pDO
, IDataObject
**ppDORet
)
177 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
178 FIXME("(%p)->(%p %p)\n", This
, pDO
, ppDORet
);
182 static HRESULT WINAPI
DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2
*iface
,
183 LPOLESTR
*pchKey
, DWORD dw
)
185 WebBrowser
*This
= DOCHOSTUI_THIS(iface
);
186 FIXME("(%p)->(%p %ld)\n", This
, pchKey
, dw
);
190 #undef DOCHOSTUI_THIS
192 static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl
= {
193 DocHostUIHandler_QueryInterface
,
194 DocHostUIHandler_AddRef
,
195 DocHostUIHandler_Release
,
196 DocHostUIHandler_ShowContextMenu
,
197 DocHostUIHandler_GetHostInfo
,
198 DocHostUIHandler_ShowUI
,
199 DocHostUIHandler_HideUI
,
200 DocHostUIHandler_UpdateUI
,
201 DocHostUIHandler_EnableModeless
,
202 DocHostUIHandler_OnDocWindowActivate
,
203 DocHostUIHandler_OnFrameWindowActivate
,
204 DocHostUIHandler_ResizeBorder
,
205 DocHostUIHandler_TranslateAccelerator
,
206 DocHostUIHandler_GetOptionKeyPath
,
207 DocHostUIHandler_GetDropTarget
,
208 DocHostUIHandler_GetExternal
,
209 DocHostUIHandler_TranslateUrl
,
210 DocHostUIHandler_FilterDataObject
,
211 DocHostUIHandler_GetOverrideKeyPath
214 void WebBrowser_DocHost_Init(WebBrowser
*This
)
216 This
->lpDocHostUIHandlerVtbl
= &DocHostUIHandler2Vtbl
;