Create window in SetClientSite and return it in
[wine/dcerpc.git] / dlls / shdocvw / client.c
blobd616b90e47fadea0048a3a153145ba20c48d5459
1 /*
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"
20 #include "shdocvw.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
24 #define CLIENTSITE_THIS(iface) DEFINE_THIS(WebBrowser, OleClientSite, iface)
26 static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppv)
28 WebBrowser *This = CLIENTSITE_THIS(iface);
30 *ppv = NULL;
32 if(IsEqualGUID(&IID_IUnknown, riid)) {
33 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
34 *ppv = CLIENTSITE(This);
35 }else if(IsEqualGUID(&IID_IOleClientSite, riid)) {
36 TRACE("(%p)->(IID_IOleClientSite %p)\n", This, ppv);
37 *ppv = CLIENTSITE(This);
38 }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
39 TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
40 *ppv = INPLACESITE(This);
41 }else if(IsEqualGUID(&IID_IOleInPlaceSite, riid)) {
42 TRACE("(%p)->(IID_IOleInPlaceSite %p)\n", This, ppv);
43 *ppv = INPLACESITE(This);
44 }else if(IsEqualGUID(&IID_IDocHostUIHandler, riid)) {
45 TRACE("(%p)->(IID_IDocHostUIHandler %p)\n", This, ppv);
46 *ppv = DOCHOSTUI(This);
47 }else if(IsEqualGUID(&IID_IDocHostUIHandler2, riid)) {
48 TRACE("(%p)->(IID_IDocHostUIHandler2 %p)\n", This, ppv);
49 *ppv = DOCHOSTUI2(This);
52 if(*ppv) {
53 IWebBrowser2_AddRef(WEBBROWSER(This));
54 return S_OK;
57 WARN("Unsupported intrface %s\n", debugstr_guid(riid));
59 return E_NOINTERFACE;
62 static ULONG WINAPI ClientSite_AddRef(IOleClientSite *iface)
64 WebBrowser *This = CLIENTSITE_THIS(iface);
65 return IWebBrowser2_AddRef(WEBBROWSER(This));
68 static ULONG WINAPI ClientSite_Release(IOleClientSite *iface)
70 WebBrowser *This = CLIENTSITE_THIS(iface);
71 return IWebBrowser2_Release(WEBBROWSER(This));
74 static HRESULT WINAPI ClientSite_SaveObject(IOleClientSite *iface)
76 WebBrowser *This = CLIENTSITE_THIS(iface);
77 FIXME("(%p)\n", This);
78 return E_NOTIMPL;
81 static HRESULT WINAPI ClientSite_GetMoniker(IOleClientSite *iface, DWORD dwAssign,
82 DWORD dwWhichMoniker, IMoniker **ppmk)
84 WebBrowser *This = CLIENTSITE_THIS(iface);
85 FIXME("(%p)->(%ld %ld %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
86 return E_NOTIMPL;
89 static HRESULT WINAPI ClientSite_GetContainer(IOleClientSite *iface, IOleContainer **ppContainer)
91 WebBrowser *This = CLIENTSITE_THIS(iface);
92 FIXME("(%p)->(%p)\n", This, ppContainer);
93 return E_NOTIMPL;
96 static HRESULT WINAPI ClientSite_ShowObject(IOleClientSite *iface)
98 WebBrowser *This = CLIENTSITE_THIS(iface);
99 FIXME("(%p)\n", This);
100 return E_NOTIMPL;
103 static HRESULT WINAPI ClientSite_OnShowWindow(IOleClientSite *iface, BOOL fShow)
105 WebBrowser *This = CLIENTSITE_THIS(iface);
106 FIXME("(%p)->(%x)\n", This, fShow);
107 return E_NOTIMPL;
110 static HRESULT WINAPI ClientSite_RequestNewObjectLayout(IOleClientSite *iface)
112 WebBrowser *This = CLIENTSITE_THIS(iface);
113 FIXME("(%p)\n", This);
114 return E_NOTIMPL;
117 #undef CLIENTSITE_THIS
119 static const IOleClientSiteVtbl OleClientSiteVtbl = {
120 ClientSite_QueryInterface,
121 ClientSite_AddRef,
122 ClientSite_Release,
123 ClientSite_SaveObject,
124 ClientSite_GetMoniker,
125 ClientSite_GetContainer,
126 ClientSite_ShowObject,
127 ClientSite_OnShowWindow,
128 ClientSite_RequestNewObjectLayout
131 #define INPLACESITE_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceSite, iface)
133 static HRESULT WINAPI InPlaceSite_QueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppv)
135 WebBrowser *This = INPLACESITE_THIS(iface);
136 return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
139 static ULONG WINAPI InPlaceSite_AddRef(IOleInPlaceSite *iface)
141 WebBrowser *This = INPLACESITE_THIS(iface);
142 return IOleClientSite_AddRef(CLIENTSITE(This));
145 static ULONG WINAPI InPlaceSite_Release(IOleInPlaceSite *iface)
147 WebBrowser *This = INPLACESITE_THIS(iface);
148 return IOleClientSite_Release(CLIENTSITE(This));
151 static HRESULT WINAPI InPlaceSite_GetWindow(IOleInPlaceSite *iface, HWND *phwnd)
153 WebBrowser *This = INPLACESITE_THIS(iface);
155 TRACE("(%p)->(%p)\n", This, phwnd);
157 *phwnd = This->doc_view_hwnd;
158 return S_OK;
161 static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode)
163 WebBrowser *This = INPLACESITE_THIS(iface);
164 FIXME("(%p)->(%x)\n", This, fEnterMode);
165 return E_NOTIMPL;
168 static HRESULT WINAPI InPlaceSite_CanInPlaceActivate(IOleInPlaceSite *iface)
170 WebBrowser *This = INPLACESITE_THIS(iface);
171 FIXME("(%p)\n", This);
172 return E_NOTIMPL;
175 static HRESULT WINAPI InPlaceSite_OnInPlaceActivate(IOleInPlaceSite *iface)
177 WebBrowser *This = INPLACESITE_THIS(iface);
178 FIXME("(%p)\n", This);
179 return E_NOTIMPL;
182 static HRESULT WINAPI InPlaceSite_OnUIActivate(IOleInPlaceSite *iface)
184 WebBrowser *This = INPLACESITE_THIS(iface);
185 FIXME("(%p)\n", This);
186 return E_NOTIMPL;
189 static HRESULT WINAPI InPlaceSite_GetWindowContext(IOleInPlaceSite *iface,
190 IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
191 LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
193 WebBrowser *This = INPLACESITE_THIS(iface);
194 FIXME("(%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect,
195 lprcClipRect, lpFrameInfo);
196 return E_NOTIMPL;
199 static HRESULT WINAPI InPlaceSite_Scroll(IOleInPlaceSite *iface, SIZE scrollExtent)
201 WebBrowser *This = INPLACESITE_THIS(iface);
202 FIXME("(%p)->({%ld %ld})\n", This, scrollExtent.cx, scrollExtent.cy);
203 return E_NOTIMPL;
206 static HRESULT WINAPI InPlaceSite_OnUIDeactivate(IOleInPlaceSite *iface, BOOL fUndoable)
208 WebBrowser *This = INPLACESITE_THIS(iface);
209 FIXME("(%p)->(%x)\n", This, fUndoable);
210 return E_NOTIMPL;
213 static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate(IOleInPlaceSite *iface)
215 WebBrowser *This = INPLACESITE_THIS(iface);
216 FIXME("(%p)\n", This);
217 return E_NOTIMPL;
220 static HRESULT WINAPI InPlaceSite_DiscardUndoState(IOleInPlaceSite *iface)
222 WebBrowser *This = INPLACESITE_THIS(iface);
223 FIXME("(%p)\n", This);
224 return E_NOTIMPL;
227 static HRESULT WINAPI InPlaceSite_DeactivateAndUndo(IOleInPlaceSite *iface)
229 WebBrowser *This = INPLACESITE_THIS(iface);
230 FIXME("(%p)\n", This);
231 return E_NOTIMPL;
234 static HRESULT WINAPI InPlaceSite_OnPosRectChange(IOleInPlaceSite *iface,
235 LPCRECT lprcPosRect)
237 WebBrowser *This = INPLACESITE_THIS(iface);
238 FIXME("(%p)->(%p)\n", This, lprcPosRect);
239 return E_NOTIMPL;
242 #undef INPLACESITE_THIS
244 static const IOleInPlaceSiteVtbl OleInPlaceSiteVtbl = {
245 InPlaceSite_QueryInterface,
246 InPlaceSite_AddRef,
247 InPlaceSite_Release,
248 InPlaceSite_GetWindow,
249 InPlaceSite_ContextSensitiveHelp,
250 InPlaceSite_CanInPlaceActivate,
251 InPlaceSite_OnInPlaceActivate,
252 InPlaceSite_OnUIActivate,
253 InPlaceSite_GetWindowContext,
254 InPlaceSite_Scroll,
255 InPlaceSite_OnUIDeactivate,
256 InPlaceSite_OnInPlaceDeactivate,
257 InPlaceSite_DiscardUndoState,
258 InPlaceSite_DeactivateAndUndo,
259 InPlaceSite_OnPosRectChange
262 void WebBrowser_ClientSite_Init(WebBrowser *This)
264 This->lpOleClientSiteVtbl = &OleClientSiteVtbl;
265 This->lpOleInPlaceSiteVtbl = &OleInPlaceSiteVtbl;