2 * Copyright 2005 Jacek Caban
3 * Copyright 2010 Ilya Shpigor
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "wine/debug.h"
23 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
25 /**********************************************************************
26 * Implement the IViewObject interface
29 static inline WebBrowser *impl_from_IViewObject2(IViewObject2 *iface)
31 return CONTAINING_RECORD(iface, WebBrowser, IViewObject2_iface);
34 static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
36 WebBrowser *This = impl_from_IViewObject2(iface);
37 return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
40 static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
42 WebBrowser *This = impl_from_IViewObject2(iface);
43 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
46 static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
48 WebBrowser *This = impl_from_IViewObject2(iface);
49 return IWebBrowser2_Release(&This->IWebBrowser2_iface);
52 static HRESULT WINAPI ViewObject_Draw(IViewObject2 *iface, DWORD dwDrawAspect,
53 LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev,
54 HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds,
55 BOOL (STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR),
58 WebBrowser *This = impl_from_IViewObject2(iface);
59 FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %08lx)\n", This, dwDrawAspect, lindex,
60 pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue,
65 static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwAspect,
66 LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev,
67 LOGPALETTE **ppColorSet)
69 WebBrowser *This = impl_from_IViewObject2(iface);
70 FIXME("(%p)->(%d %d %p %p %p %p)\n", This, dwAspect, lindex, pvAspect, ptd,
71 hicTargetDev, ppColorSet);
75 static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
76 void *pvAspect, DWORD *pdwFreeze)
78 WebBrowser *This = impl_from_IViewObject2(iface);
79 FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
83 static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
85 WebBrowser *This = impl_from_IViewObject2(iface);
86 FIXME("(%p)->(%d)\n", This, dwFreeze);
90 static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf,
91 IAdviseSink *pAdvSink)
93 WebBrowser *This = impl_from_IViewObject2(iface);
94 FIXME("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink);
98 static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects,
99 DWORD *pAdvf, IAdviseSink **ppAdvSink)
101 WebBrowser *This = impl_from_IViewObject2(iface);
102 FIXME("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
106 static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex,
107 DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
109 WebBrowser *This = impl_from_IViewObject2(iface);
110 FIXME("(%p)->(%d %d %p %p)\n", This, dwAspect, lindex, ptd, lpsizel);
114 static const IViewObject2Vtbl ViewObjectVtbl = {
115 ViewObject_QueryInterface,
119 ViewObject_GetColorSet,
122 ViewObject_SetAdvise,
123 ViewObject_GetAdvise,
127 /**********************************************************************
128 * Implement the IDataObject interface
131 static inline WebBrowser *impl_from_IDataObject(IDataObject *iface)
133 return CONTAINING_RECORD(iface, WebBrowser, IDataObject_iface);
136 static HRESULT WINAPI DataObject_QueryInterface(LPDATAOBJECT iface, REFIID riid, LPVOID * ppvObj)
138 WebBrowser *This = impl_from_IDataObject(iface);
139 return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppvObj);
142 static ULONG WINAPI DataObject_AddRef(LPDATAOBJECT iface)
144 WebBrowser *This = impl_from_IDataObject(iface);
145 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
148 static ULONG WINAPI DataObject_Release(LPDATAOBJECT iface)
150 WebBrowser *This = impl_from_IDataObject(iface);
151 return IWebBrowser2_Release(&This->IWebBrowser2_iface);
154 static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
156 WebBrowser *This = impl_from_IDataObject(iface);
157 FIXME("(%p)->()\n", This);
161 static HRESULT WINAPI DataObject_GetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
163 WebBrowser *This = impl_from_IDataObject(iface);
164 FIXME("(%p)->()\n", This);
168 static HRESULT WINAPI DataObject_QueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
170 WebBrowser *This = impl_from_IDataObject(iface);
171 FIXME("(%p)->()\n", This);
175 static HRESULT WINAPI DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
177 WebBrowser *This = impl_from_IDataObject(iface);
178 FIXME("(%p)->()\n", This);
182 static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
184 WebBrowser *This = impl_from_IDataObject(iface);
185 FIXME("(%p)->()\n", This);
189 static HRESULT WINAPI DataObject_EnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
191 WebBrowser *This = impl_from_IDataObject(iface);
192 FIXME("(%p)->()\n", This);
196 static HRESULT WINAPI DataObject_DAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
198 WebBrowser *This = impl_from_IDataObject(iface);
199 FIXME("(%p)->()\n", This);
203 static HRESULT WINAPI DataObject_DUnadvise(LPDATAOBJECT iface, DWORD dwConnection)
205 WebBrowser *This = impl_from_IDataObject(iface);
206 FIXME("(%p)->()\n", This);
210 static HRESULT WINAPI DataObject_EnumDAdvise(LPDATAOBJECT iface, IEnumSTATDATA **ppenumAdvise)
212 WebBrowser *This = impl_from_IDataObject(iface);
213 FIXME("(%p)->()\n", This);
217 static const IDataObjectVtbl DataObjectVtbl = {
218 DataObject_QueryInterface,
222 DataObject_GetDataHere,
223 DataObject_QueryGetData,
224 DataObject_GetCanonicalFormatEtc,
226 DataObject_EnumFormatEtc,
228 DataObject_DUnadvise,
229 DataObject_EnumDAdvise
232 void WebBrowser_ViewObject_Init(WebBrowser *This)
234 This->IViewObject2_iface.lpVtbl = &ViewObjectVtbl;
235 This->IDataObject_iface.lpVtbl = &DataObjectVtbl;