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 if(IsEqualGUID(&IID_IUnknown, riid)) {
54 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
55 *ppv = &This->IOleInPlaceFrame_iface;
56 }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
57 TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
58 *ppv = &This->IOleInPlaceFrame_iface;
59 }else if(IsEqualGUID(&IID_IOleInPlaceUIWindow, riid)) {
60 TRACE("(%p)->(IID_IOleInPlaceUIWindow %p)\n", This, ppv);
61 *ppv = &This->IOleInPlaceFrame_iface;
62 }else if(IsEqualGUID(&IID_IOleInPlaceFrame, riid)) {
63 TRACE("(%p)->(IID_IOleInPlaceFrame %p)\n", This, ppv);
64 *ppv = &This->IOleInPlaceFrame_iface;
66 WARN("Unsopported interface %s\n", debugstr_guid(riid));
71 IUnknown_AddRef((IUnknown*)*ppv);
75 static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface)
77 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
78 LONG ref = InterlockedIncrement(&This->ref);
80 TRACE("(%p) ref=%d\n", This, ref);
85 static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface)
87 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
88 LONG ref = InterlockedDecrement(&This->ref);
90 TRACE("(%p) ref=%d\n", This, ref);
98 static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
100 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
101 FIXME("(%p)->(%p)\n", This, phwnd);
105 static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface,
108 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
109 FIXME("(%p)->(%x)\n", This, fEnterMode);
113 static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder)
115 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
116 FIXME("(%p)->(%p)\n", This, lprectBorder);
120 static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface,
121 LPCBORDERWIDTHS pborderwidths)
123 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
124 FIXME("(%p)->(%p)\n", This, pborderwidths);
128 static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface,
129 LPCBORDERWIDTHS pborderwidths)
131 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
132 FIXME("(%p)->(%p)\n", This, pborderwidths);
136 static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
137 IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
139 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
140 FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName));
144 static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared,
145 LPOLEMENUGROUPWIDTHS lpMenuWidths)
147 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
148 FIXME("(%p)->(%p %p)\n", This, hmenuShared, lpMenuWidths);
152 static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared,
153 HOLEMENU holemenu, HWND hwndActiveObject)
155 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
156 FIXME("(%p)->(%p %p %p)\n", This, hmenuShared, holemenu, hwndActiveObject);
160 static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared)
162 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
163 FIXME("(%p)->(%p)\n", This, hmenuShared);
167 static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface,
168 LPCOLESTR pszStatusText)
170 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
171 FIXME("(%p)->(%s)\n", This, debugstr_w(pszStatusText));
175 static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
177 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
178 FIXME("(%p)->(%x)\n", This, fEnable);
182 static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg,
185 InPlaceFrame *This = impl_from_IOleInPlaceFrame(iface);
186 FIXME("(%p)->(%p %d)\n", This, lpmsg, wID);
190 static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = {
191 InPlaceFrame_QueryInterface,
193 InPlaceFrame_Release,
194 InPlaceFrame_GetWindow,
195 InPlaceFrame_ContextSensitiveHelp,
196 InPlaceFrame_GetBorder,
197 InPlaceFrame_RequestBorderSpace,
198 InPlaceFrame_SetBorderSpace,
199 InPlaceFrame_SetActiveObject,
200 InPlaceFrame_InsertMenus,
201 InPlaceFrame_SetMenu,
202 InPlaceFrame_RemoveMenus,
203 InPlaceFrame_SetStatusText,
204 InPlaceFrame_EnableModeless,
205 InPlaceFrame_TranslateAccelerator
208 HRESULT create_ip_frame(IOleInPlaceFrame **ret)
212 frame = heap_alloc_zero(sizeof(*frame));
214 return E_OUTOFMEMORY;
216 frame->IOleInPlaceFrame_iface.lpVtbl = &OleInPlaceFrameVtbl;
219 *ret = &frame->IOleInPlaceFrame_iface;
224 IOleInPlaceUIWindow IOleInPlaceUIWindow_iface;
228 static inline InPlaceUIWindow *impl_from_IOleInPlaceUIWindow(IOleInPlaceUIWindow *iface)
230 return CONTAINING_RECORD(iface, InPlaceUIWindow, IOleInPlaceUIWindow_iface);
233 static HRESULT WINAPI InPlaceUIWindow_QueryInterface(IOleInPlaceUIWindow *iface, REFIID riid, void **ppv)
235 InPlaceUIWindow *This = impl_from_IOleInPlaceUIWindow(iface);
237 if(IsEqualGUID(&IID_IUnknown, riid)) {
238 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
239 *ppv = &This->IOleInPlaceUIWindow_iface;
240 }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
241 TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
242 *ppv = &This->IOleInPlaceUIWindow_iface;
243 }else if(IsEqualGUID(&IID_IOleInPlaceUIWindow, riid)) {
244 TRACE("(%p)->(IID_IOleInPlaceUIWindow %p)\n", This, ppv);
245 *ppv = &This->IOleInPlaceUIWindow_iface;
247 WARN("Unsopported interface %s\n", debugstr_guid(riid));
249 return E_NOINTERFACE;
252 IUnknown_AddRef((IUnknown*)*ppv);
256 static ULONG WINAPI InPlaceUIWindow_AddRef(IOleInPlaceUIWindow *iface)
258 InPlaceUIWindow *This = impl_from_IOleInPlaceUIWindow(iface);
259 LONG ref = InterlockedIncrement(&This->ref);
261 TRACE("(%p) ref=%d\n", This, ref);
266 static ULONG WINAPI InPlaceUIWindow_Release(IOleInPlaceUIWindow *iface)
268 InPlaceUIWindow *This = impl_from_IOleInPlaceUIWindow(iface);
269 LONG ref = InterlockedDecrement(&This->ref);
271 TRACE("(%p) ref=%d\n", This, ref);
279 static HRESULT WINAPI InPlaceUIWindow_GetWindow(IOleInPlaceUIWindow *iface, HWND *phwnd)
281 InPlaceUIWindow *This = impl_from_IOleInPlaceUIWindow(iface);
282 FIXME("(%p)->(%p)\n", This, phwnd);
286 static HRESULT WINAPI InPlaceUIWindow_ContextSensitiveHelp(IOleInPlaceUIWindow *iface,
289 InPlaceUIWindow *This = impl_from_IOleInPlaceUIWindow(iface);
290 FIXME("(%p)->(%x)\n", This, fEnterMode);
294 static HRESULT WINAPI InPlaceUIWindow_GetBorder(IOleInPlaceUIWindow *iface, LPRECT lprectBorder)
296 InPlaceUIWindow *This = impl_from_IOleInPlaceUIWindow(iface);
297 FIXME("(%p)->(%p)\n", This, lprectBorder);
301 static HRESULT WINAPI InPlaceUIWindow_RequestBorderSpace(IOleInPlaceUIWindow *iface,
302 LPCBORDERWIDTHS pborderwidths)
304 InPlaceUIWindow *This = impl_from_IOleInPlaceUIWindow(iface);
305 FIXME("(%p)->(%p)\n", This, pborderwidths);
309 static HRESULT WINAPI InPlaceUIWindow_SetBorderSpace(IOleInPlaceUIWindow *iface,
310 LPCBORDERWIDTHS pborderwidths)
312 InPlaceUIWindow *This = impl_from_IOleInPlaceUIWindow(iface);
313 FIXME("(%p)->(%p)\n", This, pborderwidths);
317 static HRESULT WINAPI InPlaceUIWindow_SetActiveObject(IOleInPlaceUIWindow *iface,
318 IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
320 InPlaceUIWindow *This = impl_from_IOleInPlaceUIWindow(iface);
321 FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName));
325 static const IOleInPlaceUIWindowVtbl OleInPlaceUIWindowVtbl = {
326 InPlaceUIWindow_QueryInterface,
327 InPlaceUIWindow_AddRef,
328 InPlaceUIWindow_Release,
329 InPlaceUIWindow_GetWindow,
330 InPlaceUIWindow_ContextSensitiveHelp,
331 InPlaceUIWindow_GetBorder,
332 InPlaceUIWindow_RequestBorderSpace,
333 InPlaceUIWindow_SetBorderSpace,
334 InPlaceUIWindow_SetActiveObject,
337 HRESULT create_ip_window(IOleInPlaceUIWindow **ret)
339 InPlaceUIWindow *uiwindow;
341 uiwindow = heap_alloc_zero(sizeof(*uiwindow));
343 return E_OUTOFMEMORY;
345 uiwindow->IOleInPlaceUIWindow_iface.lpVtbl = &OleInPlaceUIWindowVtbl;
348 *ret = &uiwindow->IOleInPlaceUIWindow_iface;