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