Sync trunk.
[reactos.git] / dll / win32 / shdocvw / view.c
1 /*
2 * Copyright 2005 Jacek Caban
3 * Copyright 2010 Ilya Shpigor
4 *
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.
9 *
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.
14 *
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
18 */
19
20 #include "wine/debug.h"
21 #include "shdocvw.h"
22
23 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
24
25 /**********************************************************************
26 * Implement the IViewObject interface
27 */
28
29 #define VIEWOBJ_THIS(iface) DEFINE_THIS(WebBrowser, ViewObject, iface)
30
31 static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
32 {
33 WebBrowser *This = VIEWOBJ_THIS(iface);
34 return IWebBrowser2_QueryInterface(WEBBROWSER(This), riid, ppv);
35 }
36
37 static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
38 {
39 WebBrowser *This = VIEWOBJ_THIS(iface);
40 return IWebBrowser2_AddRef(WEBBROWSER(This));
41 }
42
43 static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
44 {
45 WebBrowser *This = VIEWOBJ_THIS(iface);
46 return IWebBrowser2_Release(WEBBROWSER(This));
47 }
48
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),
53 ULONG_PTR dwContinue)
54 {
55 WebBrowser *This = VIEWOBJ_THIS(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,
58 dwContinue);
59 return E_NOTIMPL;
60 }
61
62 static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwAspect,
63 LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev,
64 LOGPALETTE **ppColorSet)
65 {
66 WebBrowser *This = VIEWOBJ_THIS(iface);
67 FIXME("(%p)->(%d %d %p %p %p %p)\n", This, dwAspect, lindex, pvAspect, ptd,
68 hicTargetDev, ppColorSet);
69 return E_NOTIMPL;
70 }
71
72 static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
73 void *pvAspect, DWORD *pdwFreeze)
74 {
75 WebBrowser *This = VIEWOBJ_THIS(iface);
76 FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
77 return E_NOTIMPL;
78 }
79
80 static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
81 {
82 WebBrowser *This = VIEWOBJ_THIS(iface);
83 FIXME("(%p)->(%d)\n", This, dwFreeze);
84 return E_NOTIMPL;
85 }
86
87 static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf,
88 IAdviseSink *pAdvSink)
89 {
90 WebBrowser *This = VIEWOBJ_THIS(iface);
91 FIXME("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink);
92 return E_NOTIMPL;
93 }
94
95 static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects,
96 DWORD *pAdvf, IAdviseSink **ppAdvSink)
97 {
98 WebBrowser *This = VIEWOBJ_THIS(iface);
99 FIXME("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
100 return E_NOTIMPL;
101 }
102
103 static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex,
104 DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
105 {
106 WebBrowser *This = VIEWOBJ_THIS(iface);
107 FIXME("(%p)->(%d %d %p %p)\n", This, dwAspect, lindex, ptd, lpsizel);
108 return E_NOTIMPL;
109 }
110
111 static const IViewObject2Vtbl ViewObjectVtbl = {
112 ViewObject_QueryInterface,
113 ViewObject_AddRef,
114 ViewObject_Release,
115 ViewObject_Draw,
116 ViewObject_GetColorSet,
117 ViewObject_Freeze,
118 ViewObject_Unfreeze,
119 ViewObject_SetAdvise,
120 ViewObject_GetAdvise,
121 ViewObject_GetExtent
122 };
123
124 #undef VIEWOBJ_THIS
125
126 void WebBrowser_ViewObject_Init(WebBrowser *This)
127 {
128 This->lpViewObjectVtbl = &ViewObjectVtbl;
129 }
130
131 /**********************************************************************
132 * Implement the IDataObject interface
133 */
134
135 #define DATAOBJ_THIS(iface) DEFINE_THIS(WebBrowser, DataObject, iface)
136
137 static HRESULT WINAPI DataObject_QueryInterface(LPDATAOBJECT iface, REFIID riid, LPVOID * ppvObj)
138 {
139 WebBrowser *This = DATAOBJ_THIS(iface);
140 return IWebBrowser2_QueryInterface(WEBBROWSER(This), riid, ppvObj);
141 }
142
143 static ULONG WINAPI DataObject_AddRef(LPDATAOBJECT iface)
144 {
145 WebBrowser *This = DATAOBJ_THIS(iface);
146 return IWebBrowser2_AddRef(WEBBROWSER(This));
147 }
148
149 static ULONG WINAPI DataObject_Release(LPDATAOBJECT iface)
150 {
151 WebBrowser *This = DATAOBJ_THIS(iface);
152 return IWebBrowser2_Release(WEBBROWSER(This));
153 }
154
155 static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
156 {
157 WebBrowser *This = DATAOBJ_THIS(iface);
158 FIXME("(%p)->()\n", This);
159 return E_NOTIMPL;
160 }
161
162 static HRESULT WINAPI DataObject_GetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
163 {
164 WebBrowser *This = DATAOBJ_THIS(iface);
165 FIXME("(%p)->()\n", This);
166 return E_NOTIMPL;
167 }
168
169 static HRESULT WINAPI DataObject_QueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
170 {
171 WebBrowser *This = DATAOBJ_THIS(iface);
172 FIXME("(%p)->()\n", This);
173 return E_NOTIMPL;
174 }
175
176 static HRESULT WINAPI DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
177 {
178 WebBrowser *This = DATAOBJ_THIS(iface);
179 FIXME("(%p)->()\n", This);
180 return E_NOTIMPL;
181 }
182
183 static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
184 {
185 WebBrowser *This = DATAOBJ_THIS(iface);
186 FIXME("(%p)->()\n", This);
187 return E_NOTIMPL;
188 }
189
190 static HRESULT WINAPI DataObject_EnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
191 {
192 WebBrowser *This = DATAOBJ_THIS(iface);
193 FIXME("(%p)->()\n", This);
194 return E_NOTIMPL;
195 }
196
197 static HRESULT WINAPI DataObject_DAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
198 {
199 WebBrowser *This = DATAOBJ_THIS(iface);
200 FIXME("(%p)->()\n", This);
201 return E_NOTIMPL;
202 }
203
204 static HRESULT WINAPI DataObject_DUnadvise(LPDATAOBJECT iface, DWORD dwConnection)
205 {
206 WebBrowser *This = DATAOBJ_THIS(iface);
207 FIXME("(%p)->()\n", This);
208 return E_NOTIMPL;
209 }
210
211 static HRESULT WINAPI DataObject_EnumDAdvise(LPDATAOBJECT iface, IEnumSTATDATA **ppenumAdvise)
212 {
213 WebBrowser *This = DATAOBJ_THIS(iface);
214 FIXME("(%p)->()\n", This);
215 return E_NOTIMPL;
216 }
217
218 static const IDataObjectVtbl DataObjectVtbl = {
219 DataObject_QueryInterface,
220 DataObject_AddRef,
221 DataObject_Release,
222 DataObject_GetData,
223 DataObject_GetDataHere,
224 DataObject_QueryGetData,
225 DataObject_GetCanonicalFormatEtc,
226 DataObject_SetData,
227 DataObject_EnumFormatEtc,
228 DataObject_DAdvise,
229 DataObject_DUnadvise,
230 DataObject_EnumDAdvise
231 };
232
233 #undef DATAOBJ_THIS
234
235 void WebBrowser_DataObject_Init(WebBrowser *This)
236 {
237 This->lpDataObjectVtbl = &DataObjectVtbl;
238 }