[INTRIN]
[reactos.git] / reactos / base / shell / ie / ieframe / 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 "ieframe.h"
21
22 /**********************************************************************
23 * Implement the IViewObject interface
24 */
25
26 static inline WebBrowser *impl_from_IViewObject2(IViewObject2 *iface)
27 {
28 return CONTAINING_RECORD(iface, WebBrowser, IViewObject2_iface);
29 }
30
31 static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
32 {
33 WebBrowser *This = impl_from_IViewObject2(iface);
34 return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
35 }
36
37 static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
38 {
39 WebBrowser *This = impl_from_IViewObject2(iface);
40 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
41 }
42
43 static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
44 {
45 WebBrowser *This = impl_from_IViewObject2(iface);
46 return IWebBrowser2_Release(&This->IWebBrowser2_iface);
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 = 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,
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 = impl_from_IViewObject2(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 = impl_from_IViewObject2(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 = impl_from_IViewObject2(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 = impl_from_IViewObject2(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 = impl_from_IViewObject2(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 = impl_from_IViewObject2(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 /**********************************************************************
125 * Implement the IDataObject interface
126 */
127
128 static inline WebBrowser *impl_from_IDataObject(IDataObject *iface)
129 {
130 return CONTAINING_RECORD(iface, WebBrowser, IDataObject_iface);
131 }
132
133 static HRESULT WINAPI DataObject_QueryInterface(LPDATAOBJECT iface, REFIID riid, LPVOID * ppvObj)
134 {
135 WebBrowser *This = impl_from_IDataObject(iface);
136 return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppvObj);
137 }
138
139 static ULONG WINAPI DataObject_AddRef(LPDATAOBJECT iface)
140 {
141 WebBrowser *This = impl_from_IDataObject(iface);
142 return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
143 }
144
145 static ULONG WINAPI DataObject_Release(LPDATAOBJECT iface)
146 {
147 WebBrowser *This = impl_from_IDataObject(iface);
148 return IWebBrowser2_Release(&This->IWebBrowser2_iface);
149 }
150
151 static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
152 {
153 WebBrowser *This = impl_from_IDataObject(iface);
154 FIXME("(%p)->()\n", This);
155 return E_NOTIMPL;
156 }
157
158 static HRESULT WINAPI DataObject_GetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
159 {
160 WebBrowser *This = impl_from_IDataObject(iface);
161 FIXME("(%p)->()\n", This);
162 return E_NOTIMPL;
163 }
164
165 static HRESULT WINAPI DataObject_QueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
166 {
167 WebBrowser *This = impl_from_IDataObject(iface);
168 FIXME("(%p)->()\n", This);
169 return E_NOTIMPL;
170 }
171
172 static HRESULT WINAPI DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
173 {
174 WebBrowser *This = impl_from_IDataObject(iface);
175 FIXME("(%p)->()\n", This);
176 return E_NOTIMPL;
177 }
178
179 static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
180 {
181 WebBrowser *This = impl_from_IDataObject(iface);
182 FIXME("(%p)->()\n", This);
183 return E_NOTIMPL;
184 }
185
186 static HRESULT WINAPI DataObject_EnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
187 {
188 WebBrowser *This = impl_from_IDataObject(iface);
189 FIXME("(%p)->()\n", This);
190 return E_NOTIMPL;
191 }
192
193 static HRESULT WINAPI DataObject_DAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
194 {
195 WebBrowser *This = impl_from_IDataObject(iface);
196 FIXME("(%p)->()\n", This);
197 return E_NOTIMPL;
198 }
199
200 static HRESULT WINAPI DataObject_DUnadvise(LPDATAOBJECT iface, DWORD dwConnection)
201 {
202 WebBrowser *This = impl_from_IDataObject(iface);
203 FIXME("(%p)->()\n", This);
204 return E_NOTIMPL;
205 }
206
207 static HRESULT WINAPI DataObject_EnumDAdvise(LPDATAOBJECT iface, IEnumSTATDATA **ppenumAdvise)
208 {
209 WebBrowser *This = impl_from_IDataObject(iface);
210 FIXME("(%p)->()\n", This);
211 return E_NOTIMPL;
212 }
213
214 static const IDataObjectVtbl DataObjectVtbl = {
215 DataObject_QueryInterface,
216 DataObject_AddRef,
217 DataObject_Release,
218 DataObject_GetData,
219 DataObject_GetDataHere,
220 DataObject_QueryGetData,
221 DataObject_GetCanonicalFormatEtc,
222 DataObject_SetData,
223 DataObject_EnumFormatEtc,
224 DataObject_DAdvise,
225 DataObject_DUnadvise,
226 DataObject_EnumDAdvise
227 };
228
229 void WebBrowser_ViewObject_Init(WebBrowser *This)
230 {
231 This->IViewObject2_iface.lpVtbl = &ViewObjectVtbl;
232 This->IDataObject_iface.lpVtbl = &DataObjectVtbl;
233 }