winemaker: Output UTF-8 Makefiles.
[wine] / dlls / 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 #include "wine/debug.h"
22
23 WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
24
25 static inline DocHost *impl_from_IOleInPlaceFrame(IOleInPlaceFrame *iface)
26 {
27     return CONTAINING_RECORD(iface, DocHost, IOleInPlaceFrame_iface);
28 }
29
30 static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface,
31                                                   REFIID riid, void **ppv)
32 {
33     DocHost *This = impl_from_IOleInPlaceFrame(iface);
34
35     if(IsEqualGUID(&IID_IUnknown, riid)) {
36         TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
37         *ppv = &This->IOleInPlaceFrame_iface;
38     }else if(IsEqualGUID(&IID_IOleWindow, riid)) {
39         TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
40         *ppv = &This->IOleInPlaceFrame_iface;
41     }else if(IsEqualGUID(&IID_IOleInPlaceUIWindow, riid)) {
42         TRACE("(%p)->(IID_IOleInPlaceUIWindow %p)\n", This, ppv);
43         *ppv = &This->IOleInPlaceFrame_iface;
44     }else if(IsEqualGUID(&IID_IOleInPlaceFrame, riid)) {
45         TRACE("(%p)->(IID_IOleInPlaceFrame %p)\n", This, ppv);
46         *ppv = &This->IOleInPlaceFrame_iface;
47     }else {
48         *ppv = NULL;
49         WARN("Unsopported interface %s\n", debugstr_guid(riid));
50         return E_NOINTERFACE;
51     }
52
53
54     IUnknown_AddRef((IUnknown*)*ppv);
55     return S_OK;
56 }
57
58 static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface)
59 {
60     DocHost *This = impl_from_IOleInPlaceFrame(iface);
61     return IOleClientSite_AddRef(&This->IOleClientSite_iface);
62 }
63
64 static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface)
65 {
66     DocHost *This = impl_from_IOleInPlaceFrame(iface);
67     return IOleClientSite_Release(&This->IOleClientSite_iface);
68 }
69
70 static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
71 {
72     DocHost *This = impl_from_IOleInPlaceFrame(iface);
73     FIXME("(%p)->(%p)\n", This, phwnd);
74     return E_NOTIMPL;
75 }
76
77 static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface,
78                                                         BOOL fEnterMode)
79 {
80     DocHost *This = impl_from_IOleInPlaceFrame(iface);
81     FIXME("(%p)->(%x)\n", This, fEnterMode);
82     return E_NOTIMPL;
83 }
84
85 static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder)
86 {
87     DocHost *This = impl_from_IOleInPlaceFrame(iface);
88     FIXME("(%p)->(%p)\n", This, lprectBorder);
89     return E_NOTIMPL;
90 }
91
92 static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface,
93                                                       LPCBORDERWIDTHS pborderwidths)
94 {
95     DocHost *This = impl_from_IOleInPlaceFrame(iface);
96     FIXME("(%p)->(%p)\n", This, pborderwidths);
97     return E_NOTIMPL;
98 }
99
100 static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface,
101                                                   LPCBORDERWIDTHS pborderwidths)
102 {
103     DocHost *This = impl_from_IOleInPlaceFrame(iface);
104     FIXME("(%p)->(%p)\n", This, pborderwidths);
105     return E_NOTIMPL;
106 }
107
108 static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
109         IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
110 {
111     DocHost *This = impl_from_IOleInPlaceFrame(iface);
112     FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName));
113     return E_NOTIMPL;
114 }
115
116 static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared,
117         LPOLEMENUGROUPWIDTHS lpMenuWidths)
118 {
119     DocHost *This = impl_from_IOleInPlaceFrame(iface);
120     FIXME("(%p)->(%p %p)\n", This, hmenuShared, lpMenuWidths);
121     return E_NOTIMPL;
122 }
123
124 static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared,
125         HOLEMENU holemenu, HWND hwndActiveObject)
126 {
127     DocHost *This = impl_from_IOleInPlaceFrame(iface);
128     FIXME("(%p)->(%p %p %p)\n", This, hmenuShared, holemenu, hwndActiveObject);
129     return E_NOTIMPL;
130 }
131
132 static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared)
133 {
134     DocHost *This = impl_from_IOleInPlaceFrame(iface);
135     FIXME("(%p)->(%p)\n", This, hmenuShared);
136     return E_NOTIMPL;
137 }
138
139 static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface,
140                                                  LPCOLESTR pszStatusText)
141 {
142     DocHost *This = impl_from_IOleInPlaceFrame(iface);
143     TRACE("(%p)->(%s)\n", This, debugstr_w(pszStatusText));
144     return This->container_vtbl->SetStatusText(This, pszStatusText);
145 }
146
147 static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
148 {
149     DocHost *This = impl_from_IOleInPlaceFrame(iface);
150     FIXME("(%p)->(%x)\n", This, fEnable);
151     return E_NOTIMPL;
152 }
153
154 static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg,
155                                                         WORD wID)
156 {
157     DocHost *This = impl_from_IOleInPlaceFrame(iface);
158     FIXME("(%p)->(%p %d)\n", This, lpmsg, wID);
159     return E_NOTIMPL;
160 }
161
162 #undef impl_from_IOleInPlaceFrame
163
164 static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = {
165     InPlaceFrame_QueryInterface,
166     InPlaceFrame_AddRef,
167     InPlaceFrame_Release,
168     InPlaceFrame_GetWindow,
169     InPlaceFrame_ContextSensitiveHelp,
170     InPlaceFrame_GetBorder,
171     InPlaceFrame_RequestBorderSpace,
172     InPlaceFrame_SetBorderSpace,
173     InPlaceFrame_SetActiveObject,
174     InPlaceFrame_InsertMenus,
175     InPlaceFrame_SetMenu,
176     InPlaceFrame_RemoveMenus,
177     InPlaceFrame_SetStatusText,
178     InPlaceFrame_EnableModeless,
179     InPlaceFrame_TranslateAccelerator
180 };
181
182 void DocHost_Frame_Init(DocHost *This)
183 {
184     This->IOleInPlaceFrame_iface.lpVtbl = &OleInPlaceFrameVtbl;
185 }