[INTRIN]
[reactos.git] / reactos / dll / win32 / ieframe / frame.c
1 /*
2 * Copyright 2005 Jacek Caban for CodeWeavers
3 *
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.
8 *
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.
13 *
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
17 */
18
19 #include "ieframe.h"
20
21 static inline DocHost *impl_from_IOleInPlaceFrame(IOleInPlaceFrame *iface)
22 {
23 return CONTAINING_RECORD(iface, DocHost, IOleInPlaceFrame_iface);
24 }
25
26 static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface,
27 REFIID riid, void **ppv)
28 {
29 DocHost *This = impl_from_IOleInPlaceFrame(iface);
30
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;
43 }else {
44 *ppv = NULL;
45 WARN("Unsopported interface %s\n", debugstr_guid(riid));
46 return E_NOINTERFACE;
47 }
48
49
50 IUnknown_AddRef((IUnknown*)*ppv);
51 return S_OK;
52 }
53
54 static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface)
55 {
56 DocHost *This = impl_from_IOleInPlaceFrame(iface);
57 return IOleClientSite_AddRef(&This->IOleClientSite_iface);
58 }
59
60 static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface)
61 {
62 DocHost *This = impl_from_IOleInPlaceFrame(iface);
63 return IOleClientSite_Release(&This->IOleClientSite_iface);
64 }
65
66 static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
67 {
68 DocHost *This = impl_from_IOleInPlaceFrame(iface);
69 FIXME("(%p)->(%p)\n", This, phwnd);
70 return E_NOTIMPL;
71 }
72
73 static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface,
74 BOOL fEnterMode)
75 {
76 DocHost *This = impl_from_IOleInPlaceFrame(iface);
77 FIXME("(%p)->(%x)\n", This, fEnterMode);
78 return E_NOTIMPL;
79 }
80
81 static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder)
82 {
83 DocHost *This = impl_from_IOleInPlaceFrame(iface);
84 FIXME("(%p)->(%p)\n", This, lprectBorder);
85 return E_NOTIMPL;
86 }
87
88 static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface,
89 LPCBORDERWIDTHS pborderwidths)
90 {
91 DocHost *This = impl_from_IOleInPlaceFrame(iface);
92 FIXME("(%p)->(%p)\n", This, pborderwidths);
93 return E_NOTIMPL;
94 }
95
96 static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface,
97 LPCBORDERWIDTHS pborderwidths)
98 {
99 DocHost *This = impl_from_IOleInPlaceFrame(iface);
100 FIXME("(%p)->(%p)\n", This, pborderwidths);
101 return E_NOTIMPL;
102 }
103
104 static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
105 IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
106 {
107 DocHost *This = impl_from_IOleInPlaceFrame(iface);
108 FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName));
109 return E_NOTIMPL;
110 }
111
112 static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared,
113 LPOLEMENUGROUPWIDTHS lpMenuWidths)
114 {
115 DocHost *This = impl_from_IOleInPlaceFrame(iface);
116 FIXME("(%p)->(%p %p)\n", This, hmenuShared, lpMenuWidths);
117 return E_NOTIMPL;
118 }
119
120 static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared,
121 HOLEMENU holemenu, HWND hwndActiveObject)
122 {
123 DocHost *This = impl_from_IOleInPlaceFrame(iface);
124 FIXME("(%p)->(%p %p %p)\n", This, hmenuShared, holemenu, hwndActiveObject);
125 return E_NOTIMPL;
126 }
127
128 static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared)
129 {
130 DocHost *This = impl_from_IOleInPlaceFrame(iface);
131 FIXME("(%p)->(%p)\n", This, hmenuShared);
132 return E_NOTIMPL;
133 }
134
135 static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface,
136 LPCOLESTR pszStatusText)
137 {
138 DocHost *This = impl_from_IOleInPlaceFrame(iface);
139 TRACE("(%p)->(%s)\n", This, debugstr_w(pszStatusText));
140 return This->container_vtbl->SetStatusText(This, pszStatusText);
141 }
142
143 static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
144 {
145 DocHost *This = impl_from_IOleInPlaceFrame(iface);
146 FIXME("(%p)->(%x)\n", This, fEnable);
147 return E_NOTIMPL;
148 }
149
150 static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg,
151 WORD wID)
152 {
153 DocHost *This = impl_from_IOleInPlaceFrame(iface);
154 FIXME("(%p)->(%p %d)\n", This, lpmsg, wID);
155 return E_NOTIMPL;
156 }
157
158 #undef impl_from_IOleInPlaceFrame
159
160 static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = {
161 InPlaceFrame_QueryInterface,
162 InPlaceFrame_AddRef,
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
176 };
177
178 void DocHost_Frame_Init(DocHost *This)
179 {
180 This->IOleInPlaceFrame_iface.lpVtbl = &OleInPlaceFrameVtbl;
181 }