2 * Copyright 2010 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
31 #include "mshtml_private.h"
32 #include "pluginhost.h"
34 #include "wine/debug.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(mshtml
);
39 IOleInPlaceFrame IOleInPlaceFrame_iface
;
43 static inline InPlaceFrame
*impl_from_IOleInPlaceFrame(IOleInPlaceFrame
*iface
)
45 return CONTAINING_RECORD(iface
, InPlaceFrame
, IOleInPlaceFrame_iface
);
48 static HRESULT WINAPI
InPlaceFrame_QueryInterface(IOleInPlaceFrame
*iface
,
49 REFIID riid
, void **ppv
)
51 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
53 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
55 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
56 *ppv
= &This
->IOleInPlaceFrame_iface
;
57 }else if(IsEqualGUID(&IID_IOleWindow
, riid
)) {
58 *ppv
= &This
->IOleInPlaceFrame_iface
;
59 }else if(IsEqualGUID(&IID_IOleInPlaceUIWindow
, riid
)) {
60 *ppv
= &This
->IOleInPlaceFrame_iface
;
61 }else if(IsEqualGUID(&IID_IOleInPlaceFrame
, riid
)) {
62 *ppv
= &This
->IOleInPlaceFrame_iface
;
64 WARN("Unsopported interface %s\n", debugstr_mshtml_guid(riid
));
69 IUnknown_AddRef((IUnknown
*)*ppv
);
73 static ULONG WINAPI
InPlaceFrame_AddRef(IOleInPlaceFrame
*iface
)
75 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
76 LONG ref
= InterlockedIncrement(&This
->ref
);
78 TRACE("(%p) ref=%d\n", This
, ref
);
83 static ULONG WINAPI
InPlaceFrame_Release(IOleInPlaceFrame
*iface
)
85 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
86 LONG ref
= InterlockedDecrement(&This
->ref
);
88 TRACE("(%p) ref=%d\n", This
, ref
);
96 static HRESULT WINAPI
InPlaceFrame_GetWindow(IOleInPlaceFrame
*iface
, HWND
*phwnd
)
98 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
99 FIXME("(%p)->(%p)\n", This
, phwnd
);
103 static HRESULT WINAPI
InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame
*iface
,
106 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
107 FIXME("(%p)->(%x)\n", This
, fEnterMode
);
111 static HRESULT WINAPI
InPlaceFrame_GetBorder(IOleInPlaceFrame
*iface
, LPRECT lprectBorder
)
113 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
114 FIXME("(%p)->(%p)\n", This
, lprectBorder
);
118 static HRESULT WINAPI
InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame
*iface
,
119 LPCBORDERWIDTHS pborderwidths
)
121 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
122 FIXME("(%p)->(%p)\n", This
, pborderwidths
);
126 static HRESULT WINAPI
InPlaceFrame_SetBorderSpace(IOleInPlaceFrame
*iface
,
127 LPCBORDERWIDTHS pborderwidths
)
129 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
130 FIXME("(%p)->(%p)\n", This
, pborderwidths
);
134 static HRESULT WINAPI
InPlaceFrame_SetActiveObject(IOleInPlaceFrame
*iface
,
135 IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
137 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
138 FIXME("(%p)->(%p %s)\n", This
, pActiveObject
, debugstr_w(pszObjName
));
142 static HRESULT WINAPI
InPlaceFrame_InsertMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
143 LPOLEMENUGROUPWIDTHS lpMenuWidths
)
145 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
146 FIXME("(%p)->(%p %p)\n", This
, hmenuShared
, lpMenuWidths
);
150 static HRESULT WINAPI
InPlaceFrame_SetMenu(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
151 HOLEMENU holemenu
, HWND hwndActiveObject
)
153 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
154 FIXME("(%p)->(%p %p %p)\n", This
, hmenuShared
, holemenu
, hwndActiveObject
);
158 static HRESULT WINAPI
InPlaceFrame_RemoveMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
)
160 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
161 FIXME("(%p)->(%p)\n", This
, hmenuShared
);
165 static HRESULT WINAPI
InPlaceFrame_SetStatusText(IOleInPlaceFrame
*iface
,
166 LPCOLESTR pszStatusText
)
168 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
169 FIXME("(%p)->(%s)\n", This
, debugstr_w(pszStatusText
));
173 static HRESULT WINAPI
InPlaceFrame_EnableModeless(IOleInPlaceFrame
*iface
, BOOL fEnable
)
175 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
176 FIXME("(%p)->(%x)\n", This
, fEnable
);
180 static HRESULT WINAPI
InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame
*iface
, LPMSG lpmsg
,
183 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
184 FIXME("(%p)->(%p %d)\n", This
, lpmsg
, wID
);
188 static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl
= {
189 InPlaceFrame_QueryInterface
,
191 InPlaceFrame_Release
,
192 InPlaceFrame_GetWindow
,
193 InPlaceFrame_ContextSensitiveHelp
,
194 InPlaceFrame_GetBorder
,
195 InPlaceFrame_RequestBorderSpace
,
196 InPlaceFrame_SetBorderSpace
,
197 InPlaceFrame_SetActiveObject
,
198 InPlaceFrame_InsertMenus
,
199 InPlaceFrame_SetMenu
,
200 InPlaceFrame_RemoveMenus
,
201 InPlaceFrame_SetStatusText
,
202 InPlaceFrame_EnableModeless
,
203 InPlaceFrame_TranslateAccelerator
206 HRESULT
create_ip_frame(IOleInPlaceFrame
**ret
)
210 frame
= heap_alloc_zero(sizeof(*frame
));
212 return E_OUTOFMEMORY
;
214 frame
->IOleInPlaceFrame_iface
.lpVtbl
= &OleInPlaceFrameVtbl
;
217 *ret
= &frame
->IOleInPlaceFrame_iface
;
222 IOleInPlaceUIWindow IOleInPlaceUIWindow_iface
;
226 static inline InPlaceUIWindow
*impl_from_IOleInPlaceUIWindow(IOleInPlaceUIWindow
*iface
)
228 return CONTAINING_RECORD(iface
, InPlaceUIWindow
, IOleInPlaceUIWindow_iface
);
231 static HRESULT WINAPI
InPlaceUIWindow_QueryInterface(IOleInPlaceUIWindow
*iface
, REFIID riid
, void **ppv
)
233 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
235 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
237 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
238 *ppv
= &This
->IOleInPlaceUIWindow_iface
;
239 }else if(IsEqualGUID(&IID_IOleWindow
, riid
)) {
240 *ppv
= &This
->IOleInPlaceUIWindow_iface
;
241 }else if(IsEqualGUID(&IID_IOleInPlaceUIWindow
, riid
)) {
242 *ppv
= &This
->IOleInPlaceUIWindow_iface
;
244 WARN("Unsopported interface %s\n", debugstr_mshtml_guid(riid
));
246 return E_NOINTERFACE
;
249 IUnknown_AddRef((IUnknown
*)*ppv
);
253 static ULONG WINAPI
InPlaceUIWindow_AddRef(IOleInPlaceUIWindow
*iface
)
255 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
256 LONG ref
= InterlockedIncrement(&This
->ref
);
258 TRACE("(%p) ref=%d\n", This
, ref
);
263 static ULONG WINAPI
InPlaceUIWindow_Release(IOleInPlaceUIWindow
*iface
)
265 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
266 LONG ref
= InterlockedDecrement(&This
->ref
);
268 TRACE("(%p) ref=%d\n", This
, ref
);
276 static HRESULT WINAPI
InPlaceUIWindow_GetWindow(IOleInPlaceUIWindow
*iface
, HWND
*phwnd
)
278 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
279 FIXME("(%p)->(%p)\n", This
, phwnd
);
283 static HRESULT WINAPI
InPlaceUIWindow_ContextSensitiveHelp(IOleInPlaceUIWindow
*iface
,
286 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
287 FIXME("(%p)->(%x)\n", This
, fEnterMode
);
291 static HRESULT WINAPI
InPlaceUIWindow_GetBorder(IOleInPlaceUIWindow
*iface
, LPRECT lprectBorder
)
293 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
294 FIXME("(%p)->(%p)\n", This
, lprectBorder
);
298 static HRESULT WINAPI
InPlaceUIWindow_RequestBorderSpace(IOleInPlaceUIWindow
*iface
,
299 LPCBORDERWIDTHS pborderwidths
)
301 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
302 FIXME("(%p)->(%p)\n", This
, pborderwidths
);
306 static HRESULT WINAPI
InPlaceUIWindow_SetBorderSpace(IOleInPlaceUIWindow
*iface
,
307 LPCBORDERWIDTHS pborderwidths
)
309 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
310 FIXME("(%p)->(%p)\n", This
, pborderwidths
);
314 static HRESULT WINAPI
InPlaceUIWindow_SetActiveObject(IOleInPlaceUIWindow
*iface
,
315 IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
317 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
318 FIXME("(%p)->(%p %s)\n", This
, pActiveObject
, debugstr_w(pszObjName
));
322 static const IOleInPlaceUIWindowVtbl OleInPlaceUIWindowVtbl
= {
323 InPlaceUIWindow_QueryInterface
,
324 InPlaceUIWindow_AddRef
,
325 InPlaceUIWindow_Release
,
326 InPlaceUIWindow_GetWindow
,
327 InPlaceUIWindow_ContextSensitiveHelp
,
328 InPlaceUIWindow_GetBorder
,
329 InPlaceUIWindow_RequestBorderSpace
,
330 InPlaceUIWindow_SetBorderSpace
,
331 InPlaceUIWindow_SetActiveObject
,
334 HRESULT
create_ip_window(IOleInPlaceUIWindow
**ret
)
336 InPlaceUIWindow
*uiwindow
;
338 uiwindow
= heap_alloc_zero(sizeof(*uiwindow
));
340 return E_OUTOFMEMORY
;
342 uiwindow
->IOleInPlaceUIWindow_iface
.lpVtbl
= &OleInPlaceUIWindowVtbl
;
345 *ret
= &uiwindow
->IOleInPlaceUIWindow_iface
;