shell32: Add IExplorerBrowser interface stub.
[wine.git] / dlls / shell32 / ebrowser.c
blob1a71e02db4d726af1fea50190f7a197e395fdad5
1 /*
2 * ExplorerBrowser Control implementation.
4 * Copyright 2010 David Hedberg
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
23 #define COBJMACROS
24 #define NONAMELESSUNION
25 #define NONAMELESSSTRUCT
27 #include "winerror.h"
28 #include "windef.h"
29 #include "winbase.h"
31 #include "wine/debug.h"
32 #include "debughlp.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(shell);
36 typedef struct _ExplorerBrowserImpl {
37 const IExplorerBrowserVtbl *lpVtbl;
38 LONG ref;
39 BOOL destroyed;
40 } ExplorerBrowserImpl;
42 /**************************************************************************
43 * IExplorerBrowser Implementation
45 static HRESULT WINAPI IExplorerBrowser_fnQueryInterface(IExplorerBrowser *iface,
46 REFIID riid, void **ppvObject)
48 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
49 TRACE("%p (%s, %p)\n", This, shdebugstr_guid(riid), ppvObject);
51 *ppvObject = NULL;
52 if(IsEqualIID(riid, &IID_IExplorerBrowser) ||
53 IsEqualIID(riid, &IID_IUnknown))
55 *ppvObject = This;
58 if(*ppvObject)
60 IUnknown_AddRef((IUnknown*)*ppvObject);
61 return S_OK;
64 return E_NOINTERFACE;
67 static ULONG WINAPI IExplorerBrowser_fnAddRef(IExplorerBrowser *iface)
69 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
70 LONG ref = InterlockedIncrement(&This->ref);
71 TRACE("%p - ref %d\n", This, ref);
73 return ref;
76 static ULONG WINAPI IExplorerBrowser_fnRelease(IExplorerBrowser *iface)
78 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
79 LONG ref = InterlockedDecrement(&This->ref);
80 TRACE("%p - ref %d\n", This, ref);
82 if(!ref)
84 TRACE("Freeing.\n");
86 if(!This->destroyed)
87 IExplorerBrowser_Destroy(iface);
89 HeapFree(GetProcessHeap(), 0, This);
90 return 0;
93 return ref;
96 static HRESULT WINAPI IExplorerBrowser_fnInitialize(IExplorerBrowser *iface,
97 HWND hwndParent, const RECT *prc,
98 const FOLDERSETTINGS *pfs)
100 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
101 TRACE("%p (%p, %p, %p)\n", This, hwndParent, prc, pfs);
103 return S_OK;
106 static HRESULT WINAPI IExplorerBrowser_fnDestroy(IExplorerBrowser *iface)
108 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
109 TRACE("%p\n", This);
111 This->destroyed = TRUE;
113 return S_OK;
116 static HRESULT WINAPI IExplorerBrowser_fnSetRect(IExplorerBrowser *iface,
117 HDWP *phdwp, RECT rcBrowser)
119 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
120 FIXME("stub, %p (%p, %s)\n", This, phdwp, wine_dbgstr_rect(&rcBrowser));
122 return E_NOTIMPL;
125 static HRESULT WINAPI IExplorerBrowser_fnSetPropertyBag(IExplorerBrowser *iface,
126 LPCWSTR pszPropertyBag)
128 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
129 FIXME("stub, %p (%s)\n", This, debugstr_w(pszPropertyBag));
131 return E_NOTIMPL;
134 static HRESULT WINAPI IExplorerBrowser_fnSetEmptyText(IExplorerBrowser *iface,
135 LPCWSTR pszEmptyText)
137 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
138 FIXME("stub, %p (%s)\n", This, debugstr_w(pszEmptyText));
140 return E_NOTIMPL;
143 static HRESULT WINAPI IExplorerBrowser_fnSetFolderSettings(IExplorerBrowser *iface,
144 const FOLDERSETTINGS *pfs)
146 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
147 FIXME("stub, %p (%p)\n", This, pfs);
149 return E_NOTIMPL;
152 static HRESULT WINAPI IExplorerBrowser_fnAdvise(IExplorerBrowser *iface,
153 IExplorerBrowserEvents *psbe,
154 DWORD *pdwCookie)
156 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
157 FIXME("stub, %p (%p, %p)\n", This, psbe, pdwCookie);
159 return E_NOTIMPL;
162 static HRESULT WINAPI IExplorerBrowser_fnUnadvise(IExplorerBrowser *iface,
163 DWORD dwCookie)
165 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
166 FIXME("stub, %p (0x%x)\n", This, dwCookie);
168 return E_NOTIMPL;
171 static HRESULT WINAPI IExplorerBrowser_fnSetOptions(IExplorerBrowser *iface,
172 EXPLORER_BROWSER_OPTIONS dwFlag)
174 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
175 FIXME("stub, %p (0x%x)\n", This, dwFlag);
177 return E_NOTIMPL;
180 static HRESULT WINAPI IExplorerBrowser_fnGetOptions(IExplorerBrowser *iface,
181 EXPLORER_BROWSER_OPTIONS *pdwFlag)
183 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
184 FIXME("stub, %p (%p)\n", This, pdwFlag);
186 return E_NOTIMPL;
189 static HRESULT WINAPI IExplorerBrowser_fnBrowseToIDList(IExplorerBrowser *iface,
190 PCUIDLIST_RELATIVE pidl,
191 UINT uFlags)
193 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
194 FIXME("stub, %p (%p, 0x%x)\n", This, pidl, uFlags);
196 return E_NOTIMPL;
199 static HRESULT WINAPI IExplorerBrowser_fnBrowseToObject(IExplorerBrowser *iface,
200 IUnknown *punk, UINT uFlags)
202 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
203 FIXME("stub, %p (%p, 0x%x)\n", This, punk, uFlags);
205 return E_NOTIMPL;
208 static HRESULT WINAPI IExplorerBrowser_fnFillFromObject(IExplorerBrowser *iface,
209 IUnknown *punk,
210 EXPLORER_BROWSER_FILL_FLAGS dwFlags)
212 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
213 FIXME("stub, %p (%p, 0x%x)\n", This, punk, dwFlags);
215 return E_NOTIMPL;
218 static HRESULT WINAPI IExplorerBrowser_fnRemoveAll(IExplorerBrowser *iface)
220 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
221 FIXME("stub, %p\n", This);
223 return E_NOTIMPL;
226 static HRESULT WINAPI IExplorerBrowser_fnGetCurrentView(IExplorerBrowser *iface,
227 REFIID riid, void **ppv)
229 ExplorerBrowserImpl *This = (ExplorerBrowserImpl*)iface;
230 FIXME("stub, %p (%s, %p)\n", This, shdebugstr_guid(riid), ppv);
232 *ppv = NULL;
233 return E_FAIL;
236 static const IExplorerBrowserVtbl vt_IExplorerBrowser =
238 IExplorerBrowser_fnQueryInterface,
239 IExplorerBrowser_fnAddRef,
240 IExplorerBrowser_fnRelease,
241 IExplorerBrowser_fnInitialize,
242 IExplorerBrowser_fnDestroy,
243 IExplorerBrowser_fnSetRect,
244 IExplorerBrowser_fnSetPropertyBag,
245 IExplorerBrowser_fnSetEmptyText,
246 IExplorerBrowser_fnSetFolderSettings,
247 IExplorerBrowser_fnAdvise,
248 IExplorerBrowser_fnUnadvise,
249 IExplorerBrowser_fnSetOptions,
250 IExplorerBrowser_fnGetOptions,
251 IExplorerBrowser_fnBrowseToIDList,
252 IExplorerBrowser_fnBrowseToObject,
253 IExplorerBrowser_fnFillFromObject,
254 IExplorerBrowser_fnRemoveAll,
255 IExplorerBrowser_fnGetCurrentView
258 HRESULT WINAPI ExplorerBrowser_Constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv)
260 ExplorerBrowserImpl *eb;
261 HRESULT ret;
263 TRACE("%p %s %p\n", pUnkOuter, shdebugstr_guid (riid), ppv);
265 if(!ppv)
266 return E_POINTER;
267 if(pUnkOuter)
268 return CLASS_E_NOAGGREGATION;
270 eb = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ExplorerBrowserImpl));
271 eb->ref = 1;
272 eb->lpVtbl = &vt_IExplorerBrowser;
274 ret = IExplorerBrowser_QueryInterface((IExplorerBrowser*)eb, riid, ppv);
275 IExplorerBrowser_Release((IExplorerBrowser*)eb);
277 TRACE("--(%p)\n", ppv);
278 return ret;