Added missing goto in switch statement.
[wine.git] / include / wine / obj_shellfolder.h
blob31a093534a9d3804073102b59430c8dccbffa563
1 /*
2 * Defines the COM interfaces and APIs related to IShellFolder
4 * Depends on 'obj_base.h'.
5 */
7 #ifndef __WINE_WINE_OBJ_SHELLFOLDER_H
8 #define __WINE_WINE_OBJ_SHELLFOLDER_H
10 #include "wine/obj_base.h"
11 #include "wine/obj_moniker.h" /* for LPBC */
12 #include "wine/obj_enumidlist.h"
13 #include "wine/obj_oleaut.h"
14 #include "winbase.h"
15 #include "shell.h"
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* defined(__cplusplus) */
21 /****************************************************************************
22 * STRRET (temporary, move it away)
24 #define STRRET_WSTR 0x0000
25 #define STRRET_OFFSETA 0x0001
26 #define STRRET_CSTRA 0x0002
27 #define STRRET_ASTR 0X0003
28 #define STRRET_OFFSETW 0X0004
29 #define STRRET_CSTRW 0X0005
32 typedef struct _STRRET
33 { UINT uType; /* STRRET_xxx */
34 union
35 { LPWSTR pOleStr; /* OLESTR that will be freed */
36 LPSTR pStr;
37 UINT uOffset; /* OffsetINT32o SHITEMID (ANSI) */
38 char cStr[MAX_PATH]; /* Buffer to fill in */
39 WCHAR cStrW[MAX_PATH];
40 }u;
41 } STRRET,*LPSTRRET;
43 /*****************************************************************************
44 * Predeclare the interfaces
46 DEFINE_SHLGUID(IID_IShellFolder, 0x000214E6L, 0, 0);
47 typedef struct IShellFolder IShellFolder, *LPSHELLFOLDER;
49 DEFINE_SHLGUID(IID_IPersistFolder, 0x000214EAL, 0, 0);
50 typedef struct IPersistFolder IPersistFolder, *LPPERSISTFOLDER;
52 DEFINE_GUID(IID_IPersistFolder2, 0x1ac3d9f0L, 0x175C, 0x11D1, 0x95, 0xBE, 0x00, 0x60, 0x97, 0x97, 0xEA, 0x4F);
53 typedef struct IPersistFolder2 IPersistFolder2, *LPPERSISTFOLDER2;
55 DEFINE_GUID(IID_IShellFolder2, 0xB82C5AA8, 0xA41B, 0x11D2, 0xBE, 0x32, 0x0, 0xc0, 0x4F, 0xB9, 0x36, 0x61);
56 typedef struct IShellFolder2 IShellFolder2, *LPSHELLFOLDER2;
58 DEFINE_GUID(IID_IEnumExtraSearch, 0xE700BE1, 0x9DB6, 0x11D1, 0xA1, 0xCE, 0x0, 0xc0, 0x4F, 0xD7, 0x5D, 0x13);
59 typedef struct IEnumExtraSearch IEnumExtraSearch, *LPENUMEXTRASEARCH;
61 /*****************************************************************************
62 * IEnumExtraSearch interface
65 typedef struct
67 GUID guidSearch;
68 WCHAR wszFriendlyName[80];
69 WCHAR wszMenuText[80];
70 WCHAR wszHelpText[MAX_PATH];
71 WCHAR wszUrl[2084];
72 WCHAR wszIcon[MAX_PATH+10];
73 WCHAR wszGreyIcon[MAX_PATH+10];
74 WCHAR wszClrIcon[MAX_PATH+10];
75 } EXTRASEARCH,* LPEXTRASEARCH;
77 #define ICOM_INTERFACE IEnumExtraSearch
78 #define IEnumExtraSearch_METHODS \
79 ICOM_METHOD3(HRESULT, Next, ULONG, celt, LPEXTRASEARCH*, rgelt, ULONG*, pceltFetched) \
80 ICOM_METHOD1(HRESULT, Skip, ULONG, celt) \
81 ICOM_METHOD (HRESULT, Reset) \
82 ICOM_METHOD1(HRESULT, Clone, IEnumExtraSearch**, ppenum)
83 #define IEnumExtraSearch_IMETHODS \
84 IUnknown_IMETHODS \
85 IEnumExtraSearch_METHODS
86 ICOM_DEFINE(IEnumExtraSearch,IUnknown)
87 #undef ICOM_INTERFACE
89 /*** IUnknown methods ***/
90 #define IEnumIDList_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
91 #define IEnumIDList_AddRef(p) ICOM_CALL (AddRef,p)
92 #define IEnumIDList_Release(p) ICOM_CALL (Release,p)
93 /*** IEnumIDList methods ***/
94 #define IEnumIDList_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
95 #define IEnumIDList_Skip(p,a) ICOM_CALL1(Skip,p,a)
96 #define IEnumIDList_Reset(p) ICOM_CALL(Reset,p)
97 #define IEnumIDList_Clone(p,a) ICOM_CALL1(Clone,p,a)
99 /*****************************************************************************
100 * IShellFolder::GetDisplayNameOf/SetNameOf uFlags
102 typedef enum
103 { SHGDN_NORMAL = 0, /* default (display purpose) */
104 SHGDN_INFOLDER = 1, /* displayed under a folder (relative)*/
105 SHGDN_FORPARSING = 0x8000 /* for ParseDisplayName or path */
106 } SHGNO;
108 /*****************************************************************************
109 * IShellFolder::EnumObjects
111 typedef enum tagSHCONTF
112 { SHCONTF_FOLDERS = 32, /* for shell browser */
113 SHCONTF_NONFOLDERS = 64, /* for default view */
114 SHCONTF_INCLUDEHIDDEN = 128 /* for hidden/system objects */
115 } SHCONTF;
117 /*****************************************************************************
118 * IShellFolder::GetAttributesOf flags
120 #define SFGAO_CANCOPY DROPEFFECT_COPY /* Objects can be copied */
121 #define SFGAO_CANMOVE DROPEFFECT_MOVE /* Objects can be moved */
122 #define SFGAO_CANLINK DROPEFFECT_LINK /* Objects can be linked */
123 #define SFGAO_CANRENAME 0x00000010L /* Objects can be renamed */
124 #define SFGAO_CANDELETE 0x00000020L /* Objects can be deleted */
125 #define SFGAO_HASPROPSHEET 0x00000040L /* Objects have property sheets */
126 #define SFGAO_DROPTARGET 0x00000100L /* Objects are drop target */
127 #define SFGAO_CAPABILITYMASK 0x00000177L
128 #define SFGAO_LINK 0x00010000L /* Shortcut (link) */
129 #define SFGAO_SHARE 0x00020000L /* shared */
130 #define SFGAO_READONLY 0x00040000L /* read-only */
131 #define SFGAO_GHOSTED 0x00080000L /* ghosted icon */
132 #define SFGAO_HIDDEN 0x00080000L /* hidden object */
133 #define SFGAO_DISPLAYATTRMASK 0x000F0000L
134 #define SFGAO_FILESYSANCESTOR 0x10000000L /* It contains file system folder */
135 #define SFGAO_FOLDER 0x20000000L /* It's a folder. */
136 #define SFGAO_FILESYSTEM 0x40000000L /* is a file system thing (file/folder/root) */
137 #define SFGAO_HASSUBFOLDER 0x80000000L /* Expandable in the map pane */
138 #define SFGAO_CONTENTSMASK 0x80000000L
139 #define SFGAO_VALIDATE 0x01000000L /* invalidate cached information */
140 #define SFGAO_REMOVABLE 0x02000000L /* is this removeable media? */
141 #define SFGAO_BROWSABLE 0x08000000L /* is in-place browsable */
142 #define SFGAO_NONENUMERATED 0x00100000L /* is a non-enumerated object */
143 #define SFGAO_NEWCONTENT 0x00200000L /* should show bold in explorer tree */
145 /************************************************************************
147 * FOLDERSETTINGS
150 typedef LPBYTE LPVIEWSETTINGS;
152 /* NB Bitfields. */
153 /* FWF_DESKTOP implies FWF_TRANSPARENT/NOCLIENTEDGE/NOSCROLL */
154 typedef enum
155 { FWF_AUTOARRANGE = 0x0001,
156 FWF_ABBREVIATEDNAMES = 0x0002,
157 FWF_SNAPTOGRID = 0x0004,
158 FWF_OWNERDATA = 0x0008,
159 FWF_BESTFITWINDOW = 0x0010,
160 FWF_DESKTOP = 0x0020,
161 FWF_SINGLESEL = 0x0040,
162 FWF_NOSUBFOLDERS = 0x0080,
163 FWF_TRANSPARENT = 0x0100,
164 FWF_NOCLIENTEDGE = 0x0200,
165 FWF_NOSCROLL = 0x0400,
166 FWF_ALIGNLEFT = 0x0800,
167 FWF_SINGLECLICKACTIVATE=0x8000 /* TEMPORARY -- NO UI FOR THIS */
168 } FOLDERFLAGS;
170 typedef enum
171 { FVM_ICON = 1,
172 FVM_SMALLICON = 2,
173 FVM_LIST = 3,
174 FVM_DETAILS = 4
175 } FOLDERVIEWMODE;
177 typedef struct
178 { UINT ViewMode; /* View mode (FOLDERVIEWMODE values) */
179 UINT fFlags; /* View options (FOLDERFLAGS bits) */
180 } FOLDERSETTINGS, *LPFOLDERSETTINGS;
182 typedef const FOLDERSETTINGS * LPCFOLDERSETTINGS;
184 /************************************************************************
185 * Desktopfolder
188 extern IShellFolder * pdesktopfolder;
190 DWORD WINAPI SHGetDesktopFolder(IShellFolder * *);
192 /*****************************************************************************
193 * IShellFolder interface
195 #define ICOM_INTERFACE IShellFolder
196 #define IShellFolder_METHODS \
197 ICOM_METHOD6( HRESULT, ParseDisplayName, HWND, hwndOwner,LPBC, pbcReserved, LPOLESTR, lpszDisplayName, ULONG *, pchEaten, LPITEMIDLIST *, ppidl, ULONG *, pdwAttributes) \
198 ICOM_METHOD3( HRESULT, EnumObjects, HWND, hwndOwner, DWORD, grfFlags, LPENUMIDLIST *, ppenumIDList)\
199 ICOM_METHOD4( HRESULT, BindToObject, LPCITEMIDLIST, pidl, LPBC, pbcReserved, REFIID, riid, LPVOID *, ppvOut)\
200 ICOM_METHOD4( HRESULT, BindToStorage, LPCITEMIDLIST, pidl, LPBC, pbcReserved, REFIID, riid, LPVOID *, ppvObj)\
201 ICOM_METHOD3( HRESULT, CompareIDs, LPARAM, lParam, LPCITEMIDLIST, pidl1, LPCITEMIDLIST, pidl2)\
202 ICOM_METHOD3( HRESULT, CreateViewObject, HWND, hwndOwner, REFIID, riid, LPVOID *, ppvOut)\
203 ICOM_METHOD3( HRESULT, GetAttributesOf, UINT, cidl, LPCITEMIDLIST *, apidl, ULONG *, rgfInOut)\
204 ICOM_METHOD6( HRESULT, GetUIObjectOf, HWND, hwndOwner, UINT, cidl, LPCITEMIDLIST *, apidl, REFIID, riid, UINT *, prgfInOut, LPVOID *, ppvOut)\
205 ICOM_METHOD3( HRESULT, GetDisplayNameOf, LPCITEMIDLIST, pidl, DWORD, uFlags, LPSTRRET, lpName)\
206 ICOM_METHOD5( HRESULT, SetNameOf, HWND, hwndOwner, LPCITEMIDLIST, pidl,LPCOLESTR, lpszName, DWORD, uFlags,LPITEMIDLIST *, ppidlOut)
207 #define IShellFolder_IMETHODS \
208 IUnknown_IMETHODS \
209 IShellFolder_METHODS
210 ICOM_DEFINE(IShellFolder,IUnknown)
211 #undef ICOM_INTERFACE
213 /*** IUnknown methods ***/
214 #define IShellFolder_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
215 #define IShellFolder_AddRef(p) ICOM_CALL (AddRef,p)
216 #define IShellFolder_Release(p) ICOM_CALL (Release,p)
217 /*** IShellFolder methods ***/
218 #define IShellFolder_ParseDisplayName(p,a,b,c,d,e,f) ICOM_CALL6(ParseDisplayName,p,a,b,c,d,e,f)
219 #define IShellFolder_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
220 #define IShellFolder_BindToObject(p,a,b,c,d) ICOM_CALL4(BindToObject,p,a,b,c,d)
221 #define IShellFolder_BindToStorage(p,a,b,c,d) ICOM_CALL4(BindToStorage,p,a,b,c,d)
222 #define IShellFolder_CompareIDs(p,a,b,c) ICOM_CALL3(CompareIDs,p,a,b,c)
223 #define IShellFolder_CreateViewObject(p,a,b,c) ICOM_CALL3(CreateViewObject,p,a,b,c)
224 #define IShellFolder_GetAttributesOf(p,a,b,c) ICOM_CALL3(GetAttributesOf,p,a,b,c)
225 #define IShellFolder_GetUIObjectOf(p,a,b,c,d,e,f) ICOM_CALL6(GetUIObjectOf,p,a,b,c,d,e,f)
226 #define IShellFolder_GetDisplayNameOf(p,a,b,c) ICOM_CALL3(GetDisplayNameOf,p,a,b,c)
227 #define IShellFolder_SetNameOf(p,a,b,c,d,e) ICOM_CALL5(SetNameOf,p,a,b,c,d,e)
229 /*****************************************************************************
230 * IShellFolder2 interface
232 /* IShellFolder2 */
234 /* GetDefaultColumnState */
235 typedef enum
237 SHCOLSTATE_TYPE_STR = 0x00000001,
238 SHCOLSTATE_TYPE_INT = 0x00000002,
239 SHCOLSTATE_TYPE_DATE = 0x00000003,
240 SHCOLSTATE_TYPEMASK = 0x0000000F,
241 SHCOLSTATE_ONBYDEFAULT = 0x00000010,
242 SHCOLSTATE_SLOW = 0x00000020,
243 SHCOLSTATE_EXTENDED = 0x00000040,
244 SHCOLSTATE_SECONDARYUI = 0x00000080,
245 SHCOLSTATE_HIDDEN = 0x00000100,
246 } SHCOLSTATE;
248 typedef struct
250 GUID fmtid;
251 DWORD pid;
252 } SHCOLUMNID, *LPSHCOLUMNID;
253 typedef const SHCOLUMNID* LPCSHCOLUMNID;
255 /* GetDetailsEx */
256 #define PID_FINDDATA 0
257 #define PID_NETRESOURCE 1
258 #define PID_DESCRIPTIONID 2
260 typedef struct
262 int fmt;
263 int cxChar;
264 STRRET str;
265 } SHELLDETAILS, *LPSHELLDETAILS;
267 #define ICOM_INTERFACE IShellFolder2
268 #define IShellFolder2_METHODS \
269 ICOM_METHOD1( HRESULT, GetDefaultSearchGUID, LPGUID, lpguid)\
270 ICOM_METHOD1( HRESULT, EnumSearches, LPENUMEXTRASEARCH *, ppEnum) \
271 ICOM_METHOD3( HRESULT, GetDefaultColumn, DWORD, dwReserved, ULONG *, pSort, ULONG *, pDisplay)\
272 ICOM_METHOD2( HRESULT, GetDefaultColumnState, UINT, iColumn, DWORD *, pcsFlags)\
273 ICOM_METHOD3( HRESULT, GetDetailsEx, LPCITEMIDLIST, pidl, const SHCOLUMNID *, pscid, VARIANT *, pv)\
274 ICOM_METHOD3( HRESULT, GetDetailsOf, LPCITEMIDLIST, pidl, UINT, iColumn, LPSHELLDETAILS, pDetails)\
275 ICOM_METHOD2( HRESULT, MapNameToSCID, LPCWSTR, pwszName, SHCOLUMNID *, pscid)
276 #define IShellFolder2_IMETHODS \
277 IShellFolder_METHODS \
278 IShellFolder2_METHODS
279 ICOM_DEFINE(IShellFolder2, IShellFolder)
280 #undef ICOM_INTERFACE
282 /*** IUnknown methods ***/
283 #define IShellFolder2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
284 #define IShellFolder2_AddRef(p) ICOM_CALL (AddRef,p)
285 #define IShellFolder2_Release(p) ICOM_CALL (Release,p)
286 /*** IShellFolder methods ***/
287 #define IShellFolder2_ParseDisplayName(p,a,b,c,d,e,f) ICOM_CALL6(ParseDisplayName,p,a,b,c,d,e,f)
288 #define IShellFolder2_EnumObjects(p,a,b,c) ICOM_CALL3(EnumObjects,p,a,b,c)
289 #define IShellFolder2_BindToObject(p,a,b,c,d) ICOM_CALL4(BindToObject,p,a,b,c,d)
290 #define IShellFolder2_BindToStorage(p,a,b,c,d) ICOM_CALL4(BindToStorage,p,a,b,c,d)
291 #define IShellFolder2_CompareIDs(p,a,b,c) ICOM_CALL3(CompareIDs,p,a,b,c)
292 #define IShellFolder2_CreateViewObject(p,a,b,c) ICOM_CALL3(CreateViewObject,p,a,b,c)
293 #define IShellFolder2_GetAttributesOf(p,a,b,c) ICOM_CALL3(GetAttributesOf,p,a,b,c)
294 #define IShellFolder2_GetUIObjectOf(p,a,b,c,d,e,f) ICOM_CALL6(GetUIObjectOf,p,a,b,c,d,e,f)
295 #define IShellFolder2_GetDisplayNameOf(p,a,b,c) ICOM_CALL3(GetDisplayNameOf,p,a,b,c)
296 #define IShellFolder2_SetNameOf(p,a,b,c,d,e) ICOM_CALL5(SetNameOf,p,a,b,c,d,e)
297 /*** IShellFolder2 methods ***/
298 #define IShellFolder2_GetDefaultSearchGUID(p,a) ICOM_CALL1(GetDefaultSearchGUID,p,a)
299 #define IShellFolder2_EnumSearches(p,a) ICOM_CALL1(EnumSearches,p,a)
300 #define IShellFolder2_GetDefaultColumn(p,a,b,c) ICOM_CALL3(GetDefaultColumn,p,a,b,c)
301 #define IShellFolder2_GetDefaultColumnState(p,a,b) ICOM_CALL2(GetDefaultColumnState,p,a,b)
302 #define IShellFolder2_GetDetailsEx(p,a,b,c) ICOM_CALL3(GetDetailsEx,p,a,b,c)
303 #define IShellFolder2_GetDetailsOf(p,a,b,c) ICOM_CALL3(GetDetailsOf,p,a,b,c)
304 #define IShellFolder2_MapNameToSCID(p,a,b) ICOM_CALL2(MapNameToSCID,p,a,b)
306 /*****************************************************************************
307 * IPersistFolder interface
310 /* ClassID's */
311 DEFINE_GUID (CLSID_SFMyComp,0x20D04FE0,0x3AEA,0x1069,0xA2,0xD8,0x08,0x00,0x2B,0x30,0x30,0x9D);
312 DEFINE_GUID (CLSID_SFINet, 0x871C5380,0x42A0,0x1069,0xA2,0xEA,0x08,0x00,0x2B,0x30,0x30,0x9D);
313 DEFINE_GUID (CLSID_SFFile, 0xF3364BA0,0x65B9,0x11CE,0xA9,0xBA,0x00,0xAA,0x00,0x4A,0xE8,0x37);
315 #define ICOM_INTERFACE IPersistFolder
316 #define IPersistFolder_METHODS \
317 ICOM_METHOD1( HRESULT, Initialize, LPCITEMIDLIST, pidl)
318 #define IPersistFolder_IMETHODS \
319 IPersist_IMETHODS \
320 IPersistFolder_METHODS
321 ICOM_DEFINE(IPersistFolder, IPersist)
322 #undef ICOM_INTERFACE
324 /*** IUnknown methods ***/
325 #define IPersistFolder_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
326 #define IPersistFolder_AddRef(p) ICOM_CALL (AddRef,p)
327 #define IPersistFolder_Release(p) ICOM_CALL (Release,p)
328 /*** IPersist methods ***/
329 #define IPersistFolder_GetClassID(p,a) ICOM_CALL1(GetClassID,p,a)
330 /*** IPersistFolder methods ***/
331 #define IPersistFolder_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
333 /*****************************************************************************
334 * IPersistFolder2 interface
337 #define ICOM_INTERFACE IPersistFolder2
338 #define IPersistFolder2_METHODS \
339 ICOM_METHOD1( HRESULT, GetCurFolder, LPITEMIDLIST*, pidl)
340 #define IPersistFolder2_IMETHODS \
341 IPersist_IMETHODS \
342 IPersistFolder_METHODS \
343 IPersistFolder2_METHODS
344 ICOM_DEFINE(IPersistFolder2, IPersistFolder)
345 #undef ICOM_INTERFACE
347 /*** IUnknown methods ***/
348 #define IPersistFolder2_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
349 #define IPersistFolder2_AddRef(p) ICOM_CALL (AddRef,p)
350 #define IPersistFolder2_Release(p) ICOM_CALL (Release,p)
351 /*** IPersist methods ***/
352 #define IPersistFolder2_GetClassID(p,a) ICOM_CALL1(GetClassID,p,a)
353 /*** IPersistFolder methods ***/
354 #define IPersistFolder2_Initialize(p,a) ICOM_CALL1(Initialize,p,a)
355 /*** IPersistFolder2 methods ***/
356 #define IPersistFolder2_GetCurFolder(p,a) ICOM_CALL1(GetCurFolder,p,a)
358 #ifdef __cplusplus
359 } /* extern "C" */
360 #endif /* defined(__cplusplus) */
362 #endif /* __WINE_WINE_OBJ_SHELLFOLDER_H */