2 * Copyright 2005 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
21 static inline DocHost
*impl_from_IOleInPlaceFrame(IOleInPlaceFrame
*iface
)
23 return CONTAINING_RECORD(iface
, DocHost
, IOleInPlaceFrame_iface
);
26 static HRESULT WINAPI
InPlaceFrame_QueryInterface(IOleInPlaceFrame
*iface
,
27 REFIID riid
, void **ppv
)
29 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
31 if(IsEqualGUID(&IID_IUnknown
, riid
)) {
32 TRACE("(%p)->(IID_IUnknown %p)\n", This
, ppv
);
33 *ppv
= &This
->IOleInPlaceFrame_iface
;
34 }else if(IsEqualGUID(&IID_IOleWindow
, riid
)) {
35 TRACE("(%p)->(IID_IOleWindow %p)\n", This
, ppv
);
36 *ppv
= &This
->IOleInPlaceFrame_iface
;
37 }else if(IsEqualGUID(&IID_IOleInPlaceUIWindow
, riid
)) {
38 TRACE("(%p)->(IID_IOleInPlaceUIWindow %p)\n", This
, ppv
);
39 *ppv
= &This
->IOleInPlaceFrame_iface
;
40 }else if(IsEqualGUID(&IID_IOleInPlaceFrame
, riid
)) {
41 TRACE("(%p)->(IID_IOleInPlaceFrame %p)\n", This
, ppv
);
42 *ppv
= &This
->IOleInPlaceFrame_iface
;
45 WARN("Unsopported interface %s\n", debugstr_guid(riid
));
50 IUnknown_AddRef((IUnknown
*)*ppv
);
54 static ULONG WINAPI
InPlaceFrame_AddRef(IOleInPlaceFrame
*iface
)
56 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
57 return IOleClientSite_AddRef(&This
->IOleClientSite_iface
);
60 static ULONG WINAPI
InPlaceFrame_Release(IOleInPlaceFrame
*iface
)
62 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
63 return IOleClientSite_Release(&This
->IOleClientSite_iface
);
66 static HRESULT WINAPI
InPlaceFrame_GetWindow(IOleInPlaceFrame
*iface
, HWND
*phwnd
)
68 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
69 FIXME("(%p)->(%p)\n", This
, phwnd
);
73 static HRESULT WINAPI
InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame
*iface
,
76 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
77 FIXME("(%p)->(%x)\n", This
, fEnterMode
);
81 static HRESULT WINAPI
InPlaceFrame_GetBorder(IOleInPlaceFrame
*iface
, LPRECT lprectBorder
)
83 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
84 FIXME("(%p)->(%p)\n", This
, lprectBorder
);
88 static HRESULT WINAPI
InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame
*iface
,
89 LPCBORDERWIDTHS pborderwidths
)
91 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
92 FIXME("(%p)->(%p)\n", This
, pborderwidths
);
96 static HRESULT WINAPI
InPlaceFrame_SetBorderSpace(IOleInPlaceFrame
*iface
,
97 LPCBORDERWIDTHS pborderwidths
)
99 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
100 FIXME("(%p)->(%p)\n", This
, pborderwidths
);
104 static HRESULT WINAPI
InPlaceFrame_SetActiveObject(IOleInPlaceFrame
*iface
,
105 IOleInPlaceActiveObject
*pActiveObject
, LPCOLESTR pszObjName
)
107 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
108 FIXME("(%p)->(%p %s)\n", This
, pActiveObject
, debugstr_w(pszObjName
));
112 static HRESULT WINAPI
InPlaceFrame_InsertMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
113 LPOLEMENUGROUPWIDTHS lpMenuWidths
)
115 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
116 FIXME("(%p)->(%p %p)\n", This
, hmenuShared
, lpMenuWidths
);
120 static HRESULT WINAPI
InPlaceFrame_SetMenu(IOleInPlaceFrame
*iface
, HMENU hmenuShared
,
121 HOLEMENU holemenu
, HWND hwndActiveObject
)
123 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
124 FIXME("(%p)->(%p %p %p)\n", This
, hmenuShared
, holemenu
, hwndActiveObject
);
128 static HRESULT WINAPI
InPlaceFrame_RemoveMenus(IOleInPlaceFrame
*iface
, HMENU hmenuShared
)
130 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
131 FIXME("(%p)->(%p)\n", This
, hmenuShared
);
135 static HRESULT WINAPI
InPlaceFrame_SetStatusText(IOleInPlaceFrame
*iface
,
136 LPCOLESTR pszStatusText
)
138 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
139 TRACE("(%p)->(%s)\n", This
, debugstr_w(pszStatusText
));
140 return This
->container_vtbl
->SetStatusText(This
, pszStatusText
);
143 static HRESULT WINAPI
InPlaceFrame_EnableModeless(IOleInPlaceFrame
*iface
, BOOL fEnable
)
145 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
146 FIXME("(%p)->(%x)\n", This
, fEnable
);
150 static HRESULT WINAPI
InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame
*iface
, LPMSG lpmsg
,
153 DocHost
*This
= impl_from_IOleInPlaceFrame(iface
);
154 FIXME("(%p)->(%p %d)\n", This
, lpmsg
, wID
);
158 #undef impl_from_IOleInPlaceFrame
160 static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl
= {
161 InPlaceFrame_QueryInterface
,
163 InPlaceFrame_Release
,
164 InPlaceFrame_GetWindow
,
165 InPlaceFrame_ContextSensitiveHelp
,
166 InPlaceFrame_GetBorder
,
167 InPlaceFrame_RequestBorderSpace
,
168 InPlaceFrame_SetBorderSpace
,
169 InPlaceFrame_SetActiveObject
,
170 InPlaceFrame_InsertMenus
,
171 InPlaceFrame_SetMenu
,
172 InPlaceFrame_RemoveMenus
,
173 InPlaceFrame_SetStatusText
,
174 InPlaceFrame_EnableModeless
,
175 InPlaceFrame_TranslateAccelerator
178 void DocHost_Frame_Init(DocHost
*This
)
180 This
->IOleInPlaceFrame_iface
.lpVtbl
= &OleInPlaceFrameVtbl
;