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
22 /**********************************************************************
23 * Implement the IViewObject interface
26 static inline WebBrowser
*impl_from_IViewObject2(IViewObject2
*iface
)
28 return CONTAINING_RECORD(iface
, WebBrowser
, IViewObject2_iface
);
31 static HRESULT WINAPI
ViewObject_QueryInterface(IViewObject2
*iface
, REFIID riid
, void **ppv
)
33 WebBrowser
*This
= impl_from_IViewObject2(iface
);
34 return IWebBrowser2_QueryInterface(&This
->IWebBrowser2_iface
, riid
, ppv
);
37 static ULONG WINAPI
ViewObject_AddRef(IViewObject2
*iface
)
39 WebBrowser
*This
= impl_from_IViewObject2(iface
);
40 return IWebBrowser2_AddRef(&This
->IWebBrowser2_iface
);
43 static ULONG WINAPI
ViewObject_Release(IViewObject2
*iface
)
45 WebBrowser
*This
= impl_from_IViewObject2(iface
);
46 return IWebBrowser2_Release(&This
->IWebBrowser2_iface
);
49 static HRESULT WINAPI
ViewObject_Draw(IViewObject2
*iface
, DWORD dwDrawAspect
,
50 LONG lindex
, void *pvAspect
, DVTARGETDEVICE
*ptd
, HDC hdcTargetDev
,
51 HDC hdcDraw
, LPCRECTL lprcBounds
, LPCRECTL lprcWBounds
,
52 BOOL (STDMETHODCALLTYPE
*pfnContinue
)(ULONG_PTR
),
55 WebBrowser
*This
= impl_from_IViewObject2(iface
);
56 FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %08lx)\n", This
, dwDrawAspect
, lindex
,
57 pvAspect
, ptd
, hdcTargetDev
, hdcDraw
, lprcBounds
, lprcWBounds
, pfnContinue
,
62 static HRESULT WINAPI
ViewObject_GetColorSet(IViewObject2
*iface
, DWORD dwAspect
,
63 LONG lindex
, void *pvAspect
, DVTARGETDEVICE
*ptd
, HDC hicTargetDev
,
64 LOGPALETTE
**ppColorSet
)
66 WebBrowser
*This
= impl_from_IViewObject2(iface
);
67 FIXME("(%p)->(%d %d %p %p %p %p)\n", This
, dwAspect
, lindex
, pvAspect
, ptd
,
68 hicTargetDev
, ppColorSet
);
72 static HRESULT WINAPI
ViewObject_Freeze(IViewObject2
*iface
, DWORD dwDrawAspect
, LONG lindex
,
73 void *pvAspect
, DWORD
*pdwFreeze
)
75 WebBrowser
*This
= impl_from_IViewObject2(iface
);
76 FIXME("(%p)->(%d %d %p %p)\n", This
, dwDrawAspect
, lindex
, pvAspect
, pdwFreeze
);
80 static HRESULT WINAPI
ViewObject_Unfreeze(IViewObject2
*iface
, DWORD dwFreeze
)
82 WebBrowser
*This
= impl_from_IViewObject2(iface
);
83 FIXME("(%p)->(%d)\n", This
, dwFreeze
);
87 static HRESULT WINAPI
ViewObject_SetAdvise(IViewObject2
*iface
, DWORD aspects
, DWORD advf
,
88 IAdviseSink
*pAdvSink
)
90 WebBrowser
*This
= impl_from_IViewObject2(iface
);
91 FIXME("(%p)->(%d %08x %p)\n", This
, aspects
, advf
, pAdvSink
);
95 static HRESULT WINAPI
ViewObject_GetAdvise(IViewObject2
*iface
, DWORD
*pAspects
,
96 DWORD
*pAdvf
, IAdviseSink
**ppAdvSink
)
98 WebBrowser
*This
= impl_from_IViewObject2(iface
);
99 FIXME("(%p)->(%p %p %p)\n", This
, pAspects
, pAdvf
, ppAdvSink
);
103 static HRESULT WINAPI
ViewObject_GetExtent(IViewObject2
*iface
, DWORD dwAspect
, LONG lindex
,
104 DVTARGETDEVICE
*ptd
, LPSIZEL lpsizel
)
106 WebBrowser
*This
= impl_from_IViewObject2(iface
);
107 FIXME("(%p)->(%d %d %p %p)\n", This
, dwAspect
, lindex
, ptd
, lpsizel
);
111 static const IViewObject2Vtbl ViewObjectVtbl
= {
112 ViewObject_QueryInterface
,
116 ViewObject_GetColorSet
,
119 ViewObject_SetAdvise
,
120 ViewObject_GetAdvise
,
124 /**********************************************************************
125 * Implement the IDataObject interface
128 static inline WebBrowser
*impl_from_IDataObject(IDataObject
*iface
)
130 return CONTAINING_RECORD(iface
, WebBrowser
, IDataObject_iface
);
133 static HRESULT WINAPI
DataObject_QueryInterface(LPDATAOBJECT iface
, REFIID riid
, LPVOID
* ppvObj
)
135 WebBrowser
*This
= impl_from_IDataObject(iface
);
136 return IWebBrowser2_QueryInterface(&This
->IWebBrowser2_iface
, riid
, ppvObj
);
139 static ULONG WINAPI
DataObject_AddRef(LPDATAOBJECT iface
)
141 WebBrowser
*This
= impl_from_IDataObject(iface
);
142 return IWebBrowser2_AddRef(&This
->IWebBrowser2_iface
);
145 static ULONG WINAPI
DataObject_Release(LPDATAOBJECT iface
)
147 WebBrowser
*This
= impl_from_IDataObject(iface
);
148 return IWebBrowser2_Release(&This
->IWebBrowser2_iface
);
151 static HRESULT WINAPI
DataObject_GetData(LPDATAOBJECT iface
, LPFORMATETC pformatetcIn
, STGMEDIUM
*pmedium
)
153 WebBrowser
*This
= impl_from_IDataObject(iface
);
154 FIXME("(%p)->()\n", This
);
158 static HRESULT WINAPI
DataObject_GetDataHere(LPDATAOBJECT iface
, LPFORMATETC pformatetc
, STGMEDIUM
*pmedium
)
160 WebBrowser
*This
= impl_from_IDataObject(iface
);
161 FIXME("(%p)->()\n", This
);
165 static HRESULT WINAPI
DataObject_QueryGetData(LPDATAOBJECT iface
, LPFORMATETC pformatetc
)
167 WebBrowser
*This
= impl_from_IDataObject(iface
);
168 FIXME("(%p)->()\n", This
);
172 static HRESULT WINAPI
DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface
, LPFORMATETC pformatectIn
, LPFORMATETC pformatetcOut
)
174 WebBrowser
*This
= impl_from_IDataObject(iface
);
175 FIXME("(%p)->()\n", This
);
179 static HRESULT WINAPI
DataObject_SetData(LPDATAOBJECT iface
, LPFORMATETC pformatetc
, STGMEDIUM
*pmedium
, BOOL fRelease
)
181 WebBrowser
*This
= impl_from_IDataObject(iface
);
182 FIXME("(%p)->()\n", This
);
186 static HRESULT WINAPI
DataObject_EnumFormatEtc(LPDATAOBJECT iface
, DWORD dwDirection
, IEnumFORMATETC
**ppenumFormatEtc
)
188 WebBrowser
*This
= impl_from_IDataObject(iface
);
189 FIXME("(%p)->()\n", This
);
193 static HRESULT WINAPI
DataObject_DAdvise(LPDATAOBJECT iface
, FORMATETC
*pformatetc
, DWORD advf
, IAdviseSink
*pAdvSink
, DWORD
*pdwConnection
)
195 WebBrowser
*This
= impl_from_IDataObject(iface
);
196 FIXME("(%p)->()\n", This
);
200 static HRESULT WINAPI
DataObject_DUnadvise(LPDATAOBJECT iface
, DWORD dwConnection
)
202 WebBrowser
*This
= impl_from_IDataObject(iface
);
203 FIXME("(%p)->()\n", This
);
207 static HRESULT WINAPI
DataObject_EnumDAdvise(LPDATAOBJECT iface
, IEnumSTATDATA
**ppenumAdvise
)
209 WebBrowser
*This
= impl_from_IDataObject(iface
);
210 FIXME("(%p)->()\n", This
);
214 static const IDataObjectVtbl DataObjectVtbl
= {
215 DataObject_QueryInterface
,
219 DataObject_GetDataHere
,
220 DataObject_QueryGetData
,
221 DataObject_GetCanonicalFormatEtc
,
223 DataObject_EnumFormatEtc
,
225 DataObject_DUnadvise
,
226 DataObject_EnumDAdvise
229 void WebBrowser_ViewObject_Init(WebBrowser
*This
)
231 This
->IViewObject2_iface
.lpVtbl
= &ViewObjectVtbl
;
232 This
->IDataObject_iface
.lpVtbl
= &DataObjectVtbl
;