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
19 #include "mshtml_private.h"
22 IOleInPlaceFrame IOleInPlaceFrame_iface
;
26 static inline InPlaceFrame
*impl_from_IOleInPlaceFrame(IOleInPlaceFrame
*iface
)
28 return CONTAINING_RECORD(iface
, InPlaceFrame
, IOleInPlaceFrame_iface
);
31 static HRESULT WINAPI
InPlaceFrame_QueryInterface(IOleInPlaceFrame
*iface
,
32 REFIID riid
, void **ppv
)
34 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
36 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
38 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
39 *ppv
= &This
->IOleInPlaceFrame_iface
;
40 }else if(IsEqualGUID(&IID_IOleWindow
, riid
)) {
41 *ppv
= &This
->IOleInPlaceFrame_iface
;
42 }else if(IsEqualGUID(&IID_IOleInPlaceUIWindow
, riid
)) {
43 *ppv
= &This
->IOleInPlaceFrame_iface
;
44 }else if(IsEqualGUID(&IID_IOleInPlaceFrame
, riid
)) {
45 *ppv
= &This
->IOleInPlaceFrame_iface
;
47 WARN("Unsopported interface %s\n", debugstr_mshtml_guid(riid
));
52 IUnknown_AddRef((IUnknown
*)*ppv
);
56 static ULONG WINAPI
InPlaceFrame_AddRef(IOleInPlaceFrame
*iface
)
58 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
59 LONG ref
= InterlockedIncrement(&This
->ref
);
61 TRACE("(%p) ref=%d\n", This
, ref
);
66 static ULONG WINAPI
InPlaceFrame_Release(IOleInPlaceFrame
*iface
)
68 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
69 LONG ref
= InterlockedDecrement(&This
->ref
);
71 TRACE("(%p) ref=%d\n", This
, ref
);
79 static HRESULT WINAPI
InPlaceFrame_GetWindow(IOleInPlaceFrame
*iface
, HWND
*phwnd
)
81 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
82 FIXME("(%p)->(%p)\n", This
, phwnd
);
86 static HRESULT WINAPI
InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame
*iface
,
89 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
90 FIXME("(%p)->(%x)\n", This
, fEnterMode
);
94 static HRESULT WINAPI
InPlaceFrame_GetBorder(IOleInPlaceFrame
*iface
, LPRECT lprectBorder
)
96 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
97 FIXME("(%p)->(%p)\n", This
, lprectBorder
);
101 static HRESULT WINAPI
InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame
*iface
,
102 LPCBORDERWIDTHS pborderwidths
)
104 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
105 FIXME("(%p)->(%p)\n", This
, pborderwidths
);
109 static HRESULT WINAPI
InPlaceFrame_SetBorderSpace(IOleInPlaceFrame
*iface
,
110 LPCBORDERWIDTHS pborderwidths
)
112 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
113 FIXME("(%p)->(%p)\n", This
, pborderwidths
);
117 static HRESULT WINAPI
InPlaceFrame_SetActiveObject(IOleInPlaceFrame
*iface
,
118 IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
120 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
121 FIXME("(%p)->(%p %s)\n", This
, pActiveObject
, debugstr_w(pszObjName
));
125 static HRESULT WINAPI
InPlaceFrame_InsertMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
126 LPOLEMENUGROUPWIDTHS lpMenuWidths
)
128 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
129 FIXME("(%p)->(%p %p)\n", This
, hmenuShared
, lpMenuWidths
);
133 static HRESULT WINAPI
InPlaceFrame_SetMenu(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
134 HOLEMENU holemenu
, HWND hwndActiveObject
)
136 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
137 FIXME("(%p)->(%p %p %p)\n", This
, hmenuShared
, holemenu
, hwndActiveObject
);
141 static HRESULT WINAPI
InPlaceFrame_RemoveMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
)
143 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
144 FIXME("(%p)->(%p)\n", This
, hmenuShared
);
148 static HRESULT WINAPI
InPlaceFrame_SetStatusText(IOleInPlaceFrame
*iface
,
149 LPCOLESTR pszStatusText
)
151 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
152 FIXME("(%p)->(%s)\n", This
, debugstr_w(pszStatusText
));
156 static HRESULT WINAPI
InPlaceFrame_EnableModeless(IOleInPlaceFrame
*iface
, BOOL fEnable
)
158 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
159 FIXME("(%p)->(%x)\n", This
, fEnable
);
163 static HRESULT WINAPI
InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame
*iface
, LPMSG lpmsg
,
166 InPlaceFrame
*This
= impl_from_IOleInPlaceFrame(iface
);
167 FIXME("(%p)->(%p %d)\n", This
, lpmsg
, wID
);
171 static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl
= {
172 InPlaceFrame_QueryInterface
,
174 InPlaceFrame_Release
,
175 InPlaceFrame_GetWindow
,
176 InPlaceFrame_ContextSensitiveHelp
,
177 InPlaceFrame_GetBorder
,
178 InPlaceFrame_RequestBorderSpace
,
179 InPlaceFrame_SetBorderSpace
,
180 InPlaceFrame_SetActiveObject
,
181 InPlaceFrame_InsertMenus
,
182 InPlaceFrame_SetMenu
,
183 InPlaceFrame_RemoveMenus
,
184 InPlaceFrame_SetStatusText
,
185 InPlaceFrame_EnableModeless
,
186 InPlaceFrame_TranslateAccelerator
189 HRESULT
create_ip_frame(IOleInPlaceFrame
**ret
)
193 frame
= heap_alloc_zero(sizeof(*frame
));
195 return E_OUTOFMEMORY
;
197 frame
->IOleInPlaceFrame_iface
.lpVtbl
= &OleInPlaceFrameVtbl
;
200 *ret
= &frame
->IOleInPlaceFrame_iface
;
205 IOleInPlaceUIWindow IOleInPlaceUIWindow_iface
;
209 static inline InPlaceUIWindow
*impl_from_IOleInPlaceUIWindow(IOleInPlaceUIWindow
*iface
)
211 return CONTAINING_RECORD(iface
, InPlaceUIWindow
, IOleInPlaceUIWindow_iface
);
214 static HRESULT WINAPI
InPlaceUIWindow_QueryInterface(IOleInPlaceUIWindow
*iface
, REFIID riid
, void **ppv
)
216 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
218 TRACE("(%p)->(%s %p)\n", This
, debugstr_mshtml_guid(riid
), ppv
);
220 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
221 *ppv
= &This
->IOleInPlaceUIWindow_iface
;
222 }else if(IsEqualGUID(&IID_IOleWindow
, riid
)) {
223 *ppv
= &This
->IOleInPlaceUIWindow_iface
;
224 }else if(IsEqualGUID(&IID_IOleInPlaceUIWindow
, riid
)) {
225 *ppv
= &This
->IOleInPlaceUIWindow_iface
;
227 WARN("Unsopported interface %s\n", debugstr_mshtml_guid(riid
));
229 return E_NOINTERFACE
;
232 IUnknown_AddRef((IUnknown
*)*ppv
);
236 static ULONG WINAPI
InPlaceUIWindow_AddRef(IOleInPlaceUIWindow
*iface
)
238 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
239 LONG ref
= InterlockedIncrement(&This
->ref
);
241 TRACE("(%p) ref=%d\n", This
, ref
);
246 static ULONG WINAPI
InPlaceUIWindow_Release(IOleInPlaceUIWindow
*iface
)
248 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
249 LONG ref
= InterlockedDecrement(&This
->ref
);
251 TRACE("(%p) ref=%d\n", This
, ref
);
259 static HRESULT WINAPI
InPlaceUIWindow_GetWindow(IOleInPlaceUIWindow
*iface
, HWND
*phwnd
)
261 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
262 FIXME("(%p)->(%p)\n", This
, phwnd
);
266 static HRESULT WINAPI
InPlaceUIWindow_ContextSensitiveHelp(IOleInPlaceUIWindow
*iface
,
269 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
270 FIXME("(%p)->(%x)\n", This
, fEnterMode
);
274 static HRESULT WINAPI
InPlaceUIWindow_GetBorder(IOleInPlaceUIWindow
*iface
, LPRECT lprectBorder
)
276 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
277 FIXME("(%p)->(%p)\n", This
, lprectBorder
);
281 static HRESULT WINAPI
InPlaceUIWindow_RequestBorderSpace(IOleInPlaceUIWindow
*iface
,
282 LPCBORDERWIDTHS pborderwidths
)
284 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
285 FIXME("(%p)->(%p)\n", This
, pborderwidths
);
289 static HRESULT WINAPI
InPlaceUIWindow_SetBorderSpace(IOleInPlaceUIWindow
*iface
,
290 LPCBORDERWIDTHS pborderwidths
)
292 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
293 FIXME("(%p)->(%p)\n", This
, pborderwidths
);
297 static HRESULT WINAPI
InPlaceUIWindow_SetActiveObject(IOleInPlaceUIWindow
*iface
,
298 IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
300 InPlaceUIWindow
*This
= impl_from_IOleInPlaceUIWindow(iface
);
301 FIXME("(%p)->(%p %s)\n", This
, pActiveObject
, debugstr_w(pszObjName
));
305 static const IOleInPlaceUIWindowVtbl OleInPlaceUIWindowVtbl
= {
306 InPlaceUIWindow_QueryInterface
,
307 InPlaceUIWindow_AddRef
,
308 InPlaceUIWindow_Release
,
309 InPlaceUIWindow_GetWindow
,
310 InPlaceUIWindow_ContextSensitiveHelp
,
311 InPlaceUIWindow_GetBorder
,
312 InPlaceUIWindow_RequestBorderSpace
,
313 InPlaceUIWindow_SetBorderSpace
,
314 InPlaceUIWindow_SetActiveObject
,
317 HRESULT
create_ip_window(IOleInPlaceUIWindow
**ret
)
319 InPlaceUIWindow
*uiwindow
;
321 uiwindow
= heap_alloc_zero(sizeof(*uiwindow
));
323 return E_OUTOFMEMORY
;
325 uiwindow
->IOleInPlaceUIWindow_iface
.lpVtbl
= &OleInPlaceUIWindowVtbl
;
328 *ret
= &uiwindow
->IOleInPlaceUIWindow_iface
;