version/tests: Make sure return values are used (LLVM/Clang).
[wine] / include / shobjidl.idl
1 /*
2  * COM interfaces for shell objects
3  *
4  * Copyright (C) 1999 Juergen Schmied
5  * Copyright (C) 2003 Alexandre Julliard
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20  */
21
22 import "objidl.idl";
23 import "oleidl.idl";
24 import "oaidl.idl";
25 import "docobj.idl";
26 import "shtypes.idl";
27 import "servprov.idl";
28 import "comcat.idl";
29 import "propidl.idl";
30 /* FIXME: import "prsht.idl";*/
31 import "msxml.idl";
32 import "wtypes.idl";
33 import "propsys.idl";
34 /* FIXME: import "structuredquery.idl"; */
35
36 cpp_quote("/* FIXME: #include <sherrors.h> */")
37
38
39 /*****************************************************************************
40  * IPersistFolder interface
41  */
42 [
43     object,
44     uuid(000214ea-0000-0000-c000-000000000046),
45     pointer_default(unique)
46 ]
47 interface IPersistFolder : IPersist
48 {
49     typedef IPersistFolder *LPPERSISTFOLDER;
50
51     HRESULT Initialize( [in] LPCITEMIDLIST pidl );
52 }
53
54
55 /*****************************************************************************
56  * IPersistFolder2 interface
57  */
58 [
59     object,
60     uuid(1ac3d9f0-175c-11d1-95be-00609797ea4f),
61     pointer_default(unique)
62 ]
63 interface IPersistFolder2 : IPersistFolder
64 {
65     typedef IPersistFolder2 *LPPERSISTFOLDER2;
66
67     HRESULT GetCurFolder( [out] LPITEMIDLIST *ppidl );
68 }
69
70
71 /*****************************************************************************
72  * IPersistIDList interface
73  */
74 [
75     object,
76     uuid(1079acfc-29bd-11d3-8e0d-00c04f6837d5),
77     pointer_default(unique)
78 ]
79 interface IPersistIDList : IPersist
80 {
81     HRESULT SetIDList( [in] LPCITEMIDLIST pidl );
82     HRESULT GetIDList( [out] LPITEMIDLIST *ppidl );
83 }
84
85
86 /*****************************************************************************
87  * IEnumIDList interface
88  */
89 [
90     object,
91     uuid(000214f2-0000-0000-c000-000000000046),
92     pointer_default(unique)
93 ]
94 interface IEnumIDList : IUnknown
95 {
96     typedef IEnumIDList *LPENUMIDLIST;
97
98     HRESULT Next(
99         [in] ULONG celt,
100         [out, size_is(celt), length_is(*pceltFetched)] LPITEMIDLIST *rgelt,
101         [out] ULONG *pceltFetched);
102
103     HRESULT Skip( [in] ULONG celt );
104     HRESULT Reset();
105     HRESULT Clone( [out] IEnumIDList **ppenum );
106 }
107
108 /*****************************************************************************
109  * IShellPropSheetExt interface
110  */
111 cpp_quote("#if 0")
112     typedef LPARAM LPFNSVADDPROPSHEETPAGE;
113 cpp_quote("#else")
114 cpp_quote("#include <prsht.h>")
115 cpp_quote("typedef LPFNADDPROPSHEETPAGE LPFNSVADDPROPSHEETPAGE;")
116 cpp_quote("#endif")
117
118 [
119     object,
120     uuid(000214E9-0000-0000-C000-000000000046),
121     pointer_default(unique),
122     local
123 ]
124 interface IShellPropSheetExt : IUnknown
125 {
126     enum tagSHELLPROPSHEETEXTPAGEID {
127         EXPPS_FILETYPES = 0x1
128     };
129
130     typedef UINT EXPPS;
131
132     HRESULT AddPages(
133         [in] LPFNSVADDPROPSHEETPAGE pfnAddPage,
134         [in] LPARAM lParam);
135     HRESULT ReplacePage(
136         [in] EXPPS uPageID,
137         [in] LPFNSVADDPROPSHEETPAGE pfnReplaceWith,
138         [in] LPARAM lParam);
139 }
140 typedef IShellPropSheetExt *LPSHELLPROPSHEETEXT;
141
142 /*****************************************************************************
143  * IShellFolder interface
144  */
145 [
146     object,
147     uuid(000214e6-0000-0000-c000-000000000046),
148     pointer_default(unique)
149 ]
150 interface IShellFolder : IUnknown
151 {
152     typedef IShellFolder * LPSHELLFOLDER;
153
154     typedef enum tagSHGDN
155     {
156         SHGDN_NORMAL = 0,
157         SHGDN_INFOLDER = 1,
158         SHGDN_FOREDITING = 0x1000,
159         SHGDN_INCLUDE_NONFILESYS = 0x2000,
160         SHGDN_FORADDRESSBAR = 0x4000,
161         SHGDN_FORPARSING = 0x8000
162     } SHGNO;
163
164     typedef DWORD SHGDNF;
165
166     enum tagSHCONTF
167     {
168         SHCONTF_FOLDERS = 32,
169         SHCONTF_NONFOLDERS = 64,
170         SHCONTF_INCLUDEHIDDEN = 128,
171         SHCONTF_INIT_ON_FIRST_NEXT = 256,
172         SHCONTF_NETPRINTERSRCH = 512,
173         SHCONTF_SHAREABLE = 1024,
174         SHCONTF_STORAGE = 2048
175     };
176
177     typedef DWORD SHCONTF;
178
179     cpp_quote("#define SFGAO_CANCOPY           DROPEFFECT_COPY")
180     cpp_quote("#define SFGAO_CANMOVE           DROPEFFECT_MOVE")
181     cpp_quote("#define SFGAO_CANLINK           DROPEFFECT_LINK")
182     cpp_quote("#define SFGAO_STORAGE           0x00000008L")
183     cpp_quote("#define SFGAO_CANRENAME         0x00000010L")
184     cpp_quote("#define SFGAO_CANDELETE         0x00000020L")
185     cpp_quote("#define SFGAO_HASPROPSHEET      0x00000040L")
186     cpp_quote("#define SFGAO_DROPTARGET        0x00000100L")
187     cpp_quote("#define SFGAO_CAPABILITYMASK    0x00000177L")
188     cpp_quote("#define SFGAO_ENCRYPTED         0x00002000L")
189     cpp_quote("#define SFGAO_ISSLOW            0x00004000L")
190     cpp_quote("#define SFGAO_GHOSTED           0x00008000L")
191     cpp_quote("#define SFGAO_LINK              0x00010000L")
192     cpp_quote("#define SFGAO_SHARE             0x00020000L")
193     cpp_quote("#define SFGAO_READONLY          0x00040000L")
194     cpp_quote("#define SFGAO_HIDDEN            0x00080000L")
195     cpp_quote("#define SFGAO_DISPLAYATTRMASK   0x000FC000L")
196     cpp_quote("#define SFGAO_FILESYSANCESTOR   0x10000000L")
197     cpp_quote("#define SFGAO_FOLDER            0x20000000L")
198     cpp_quote("#define SFGAO_FILESYSTEM        0x40000000L")
199     cpp_quote("#define SFGAO_HASSUBFOLDER      0x80000000L")
200     cpp_quote("#define SFGAO_CONTENTSMASK      0x80000000L")
201     cpp_quote("#define SFGAO_VALIDATE          0x01000000L")
202     cpp_quote("#define SFGAO_REMOVABLE         0x02000000L")
203     cpp_quote("#define SFGAO_COMPRESSED        0x04000000L")
204     cpp_quote("#define SFGAO_BROWSABLE         0x08000000L")
205     cpp_quote("#define SFGAO_NONENUMERATED     0x00100000L")
206     cpp_quote("#define SFGAO_NEWCONTENT        0x00200000L")
207     cpp_quote("#define SFGAO_STREAM            0x00400000L")
208     cpp_quote("#define SFGAO_STORAGEANCESTOR   0x00800000L")
209
210     typedef ULONG SFGAOF;
211
212     HRESULT ParseDisplayName(
213         [in] HWND hwndOwner,
214         [in] LPBC pbcReserved,
215         [in, string] LPOLESTR lpszDisplayName,
216         [out] ULONG *pchEaten,
217         [out] LPITEMIDLIST *ppidl,
218         [in, out, unique] ULONG *pdwAttributes);
219
220     HRESULT EnumObjects(
221         [in] HWND hwndOwner,
222         [in] SHCONTF grfFlags,
223         [out] IEnumIDList **ppenumIDList);
224
225     HRESULT BindToObject(
226         [in] LPCITEMIDLIST pidl,
227         [in] LPBC pbcReserved,
228         [in] REFIID riid,
229         [out, iid_is(riid)] void **ppvOut);
230
231     HRESULT BindToStorage(
232         [in] LPCITEMIDLIST pidl,
233         [in] LPBC pbcReserved,
234         [in] REFIID riid,
235         [out, iid_is(riid)] void **ppvObj);
236
237     HRESULT CompareIDs(
238         [in] LPARAM lParam,
239         [in] LPCITEMIDLIST pidl1,
240         [in] LPCITEMIDLIST pidl2);
241
242     HRESULT CreateViewObject(
243         [in] HWND hwndOwner,
244         [in] REFIID riid,
245         [out, iid_is(riid)] void **ppvOut);
246
247     HRESULT GetAttributesOf(
248         [in] UINT cidl,
249         [in, size_is(cidl)] LPCITEMIDLIST *apidl,
250         [in, out] SFGAOF *rgfInOut);
251
252     HRESULT GetUIObjectOf(
253         [in] HWND hwndOwner,
254         [in] UINT cidl,
255         [in, size_is(cidl)] LPCITEMIDLIST *apidl,
256         [in] REFIID riid,
257         [in, out, unique] UINT *prgfInOut,
258         [out, iid_is(riid)] void **ppvOut);
259
260     HRESULT GetDisplayNameOf(
261         [in] LPCITEMIDLIST pidl,
262         [in] SHGDNF uFlags,
263         [out] STRRET *lpName);
264
265     HRESULT SetNameOf(
266         [in] HWND hwnd,
267         [in] LPCITEMIDLIST pidl,
268         [in, string] LPCOLESTR lpszName,
269         [in] SHGDNF uFlags,
270         [out] LPITEMIDLIST *ppidlOut);
271 }
272
273
274 /*****************************************************************************
275  * IEnumExtraSearch interface
276  */
277 [
278     object,
279     uuid(0e700be1-9db6-11d1-a1ce-00c04fd75d13),
280     pointer_default(unique)
281 ]
282 interface IEnumExtraSearch : IUnknown
283 {
284     typedef IEnumExtraSearch *LPENUMEXTRASEARCH;
285
286     typedef struct
287     {
288         GUID guidSearch;
289         WCHAR wszFriendlyName[80];
290         /*
291          *WCHAR wszMenuText[80];
292          *WCHAR wszHelpText[MAX_PATH];
293          */
294         WCHAR wszUrl[2084];
295         /*
296          *WCHAR wszIcon[MAX_PATH+10];
297          *WCHAR wszGreyIcon[MAX_PATH+10];
298          *WCHAR wszClrIcon[MAX_PATH+10];
299          */
300     } EXTRASEARCH, *LPEXTRASEARCH;
301
302     HRESULT Next(
303         [in] ULONG celt,
304         [out, size_is(celt), length_is(*pceltFetched)] EXTRASEARCH *rgelt,
305         [out] ULONG *pceltFetched);
306
307     HRESULT Skip( [in] ULONG celt );
308     HRESULT Reset();
309     HRESULT Clone( [out] IEnumExtraSearch **ppenum );
310 }
311
312
313 /*****************************************************************************
314  * IShellFolder2 interface
315  */
316 [
317     object,
318     uuid(93f2f68c-1d1b-11d3-a30e-00c04f79abd1),
319     pointer_default(unique)
320 ]
321 interface IShellFolder2 : IShellFolder
322 {
323     typedef struct
324     {
325         GUID    fmtid;
326         DWORD   pid;
327     } SHCOLUMNID, *LPSHCOLUMNID;
328     typedef const SHCOLUMNID *LPCSHCOLUMNID;
329
330     HRESULT GetDefaultSearchGUID( [out] GUID *lpguid );
331     HRESULT EnumSearches( [out] IEnumExtraSearch **ppenum );
332     HRESULT GetDefaultColumn( [in] DWORD dwReserved, [out] ULONG *pSort, [out] ULONG *pDisplay );
333     HRESULT GetDefaultColumnState( [in] UINT iColumn, [out] SHCOLSTATEF *pcsFlags );
334     HRESULT GetDetailsEx( [in] LPCITEMIDLIST pidl, [in] const SHCOLUMNID *pscid, [out] VARIANT *pv);
335     HRESULT GetDetailsOf( [in] LPCITEMIDLIST pidl, [in] UINT iColumn, [out] SHELLDETAILS *psd);
336     HRESULT MapColumnToSCID( [in] UINT iColumn, [in] SHCOLUMNID *pscid );
337 }
338
339 /*****************************************************************************
340  * IShellItem interface
341  */
342 [
343     object,
344     uuid(43826d1e-e718-42ee-bc55-a1e261c37bfe),
345     pointer_default(unique)
346 ]
347 interface IShellItem : IUnknown
348 {
349     typedef [v1_enum] enum {
350         SIGDN_NORMALDISPLAY                = 0,
351         SIGDN_PARENTRELATIVEPARSING        = 0x80018001,
352         SIGDN_DESKTOPABSOLUTEPARSING       = 0x80028000,
353         SIGDN_PARENTRELATIVEEDITING        = 0x80031001,
354         SIGDN_DESKTOPABSOLUTEEDITING       = 0x8004c000,
355         SIGDN_FILESYSPATH                  = 0x80058000,
356         SIGDN_URL                          = 0x80068000,
357         SIGDN_PARENTRELATIVEFORADDRESSBAR  = 0x8007c001,
358         SIGDN_PARENTRELATIVE               = 0x80080001
359     } SIGDN; /* & 0xFFFF => SHGDN */
360
361     [v1_enum] enum _SICHINTF
362     {
363         SICHINT_DISPLAY                       = 0x00000000,
364         SICHINT_CANONICAL                     = 0x10000000,
365         SICHINT_TEST_FILESYSPATH_IF_NOT_EQUAL = 0x20000000,
366         SICHINT_ALLFIELDS                     = 0x80000000
367     };
368     typedef DWORD SICHINTF;
369
370     HRESULT BindToHandler(
371         [in] IBindCtx *pbc,
372         [in] REFGUID rbhid,
373         [in] REFIID riid,
374         [out, iid_is(riid)] void **ppvOut);
375
376     HRESULT GetParent( [out] IShellItem **ppsi );
377
378     HRESULT GetDisplayName(
379         [in] SIGDN sigdnName,
380         [out] LPWSTR *ppszName);
381
382     HRESULT GetAttributes(
383         [in] SFGAOF sfgaoMask,
384         [out] SFGAOF *psfgaoAttribs);
385
386     HRESULT Compare(
387         [in] IShellItem *psi,
388         [in] SICHINTF hint,
389         [out] int *piOrder);
390 }
391
392 /*****************************************************************************
393  * IShellItem2 interface
394  */
395 [
396     object,
397     uuid(7E9FB0D3-919F-4307-AB2E-9B1860310C93),
398     pointer_default(unique)
399 ]
400 interface IShellItem2 : IShellItem
401 {
402     HRESULT GetPropertyStore(
403         [in] GETPROPERTYSTOREFLAGS flags,
404         [in] REFIID riid,
405         [out, iid_is(riid)] void **ppv);
406
407     HRESULT GetPropertyStoreWithCreateObject(
408         [in] GETPROPERTYSTOREFLAGS flags,
409         [in] IUnknown *punkCreateObject,
410         [in] REFIID riid,
411         [out, iid_is(riid)] void **ppv);
412
413     HRESULT GetPropertyStoreForKeys(
414         [in, size_is(cKeys)] const PROPERTYKEY *rgKeys,
415         [in] UINT cKeys,
416         [in] GETPROPERTYSTOREFLAGS flags,
417         [in] REFIID riid,
418         [out, iid_is(riid)] void **ppv);
419
420     HRESULT GetPropertyDescriptionList(
421         [in] REFPROPERTYKEY keyType,
422         [in] REFIID riid,
423         [out, iid_is(riid)] void **ppv);
424
425     HRESULT Update(
426         [in, unique] IBindCtx *pbc);
427
428     HRESULT GetProperty(
429         [in] REFPROPERTYKEY key,
430         [out] PROPVARIANT *ppropvar);
431
432     HRESULT GetCLSID(
433         [in] REFPROPERTYKEY key,
434         [out] CLSID *pclsid);
435
436     HRESULT GetFileTime (
437         [in] REFPROPERTYKEY key,
438         [out] FILETIME *pft);
439
440     HRESULT GetInt32(
441         [in] REFPROPERTYKEY key,
442         [out] int *pi);
443
444     HRESULT GetString(
445         [in] REFPROPERTYKEY key,
446         [out, string] LPWSTR *ppsz);
447
448     HRESULT GetUInt32(
449         [in] REFPROPERTYKEY key,
450         [out] ULONG *pui);
451
452     HRESULT GetUInt64(
453         [in] REFPROPERTYKEY key,
454         [out] ULONGLONG *pull);
455
456     HRESULT GetBool(
457         [in] REFPROPERTYKEY key,
458         [out] BOOL *pf);
459 }
460
461 typedef enum tagNWMF {
462     NWMF_UNLOADING        = 0x0001,
463     NWMF_USERINITED       = 0x0002,
464     NWMF_FIRST            = 0x0004,
465     NWMF_OVERRIDEKEY      = 0x0008,
466     NWMF_SHOWHELP         = 0x0010,
467     NWMF_HTMLDIALOG       = 0x0020,
468     NWMF_FROMDIALOGCHILD  = 0x0040,
469     NWMF_USERREQUESTED    = 0x0080,
470     NWMF_USERALLOWED      = 0x0100
471 } NWMF;
472
473 [
474     uuid(d2bc4c84-3f72-4a52-a604-7bcbf3982cbb),
475     object,
476     pointer_default(unique)
477 ]
478 interface INewWindowManager : IUnknown
479 {
480     HRESULT EvaluateNewWindow(
481         [in, string] LPCWSTR pszUrl,
482         [in, string] LPCWSTR pszName,
483         [in, string] LPCWSTR pszUrlContext,
484         [in, string] LPCWSTR pszFeatures,
485         [in]         BOOL fReplace,
486         [in]         DWORD dwFlags,
487         [in]         DWORD dwUserActionTime);
488 }
489
490 cpp_quote("#define SID_SNewWindowManager IID_INewWindowManager")
491
492 /*****************************************************************************
493  * IEnumShellItems interface
494  */
495 [
496  object,
497  uuid(70629033-E363-4A28-A567-0DB78006E6D7),
498  pointer_default(unique)
499 ]
500 interface IEnumShellItems : IUnknown
501 {
502     [local] HRESULT Next(
503         [in] ULONG celt,
504         [out, size_is(celt), length_is(*pceltFetched)] IShellItem **rgelt,
505         [out] ULONG *pceltFetched);
506
507     [call_as(Next)] HRESULT RemoteNext(
508         [in] ULONG celt,
509         [out, size_is(celt), length_is(*pceltFetched)] IShellItem **rgelt,
510         [out] ULONG *pceltFetched);
511
512     HRESULT Skip(
513         [in] ULONG celt);
514
515     HRESULT Reset();
516
517     HRESULT Clone(
518         [out] IEnumShellItems **ppenum);
519 }
520
521 /*****************************************************************************
522  * IShellItemArray interface
523  */
524 [
525  object,
526  uuid(B63EA76D-1F85-456F-A19C-48159EFA858B),
527  pointer_default(unique)
528 ]
529 interface IShellItemArray : IUnknown
530 {
531     typedef [v1_enum] enum SIATTRIBFLAGS {
532         SIATTRIBFLAGS_AND            = 0x0001,
533         SIATTRIBFLAGS_OR             = 0x0002,
534         SIATTRIBFLAGS_APPCOMPAT      = 0x0003,
535         SIATTRIBFLAGS_MASK           = 0x0003,
536         SIATTRIBFLAGS_ALLITEMS       = 0x4000
537     } SIATTRIBFLAGS;
538     cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(SIATTRIBFLAGS)")
539
540     HRESULT BindToHandler(
541         [in, unique] IBindCtx *pbc,
542         [in] REFGUID bhid,
543         [in] REFIID riid,
544         [out, iid_is(riid)] void **ppvOut);
545
546     HRESULT GetPropertyStore(
547         [in] GETPROPERTYSTOREFLAGS flags,
548         [in] REFIID riid,
549         [out, iid_is(riid)] void **ppv);
550
551     HRESULT GetPropertyDescriptionList(
552         [in] REFPROPERTYKEY keyType,
553         [in] REFIID riid,
554         [out, iid_is(riid)] void **ppv);
555
556     HRESULT GetAttributes(
557         [in] SIATTRIBFLAGS AttribFlags,
558         [in] SFGAOF sfgaoMask,
559         [out] SFGAOF *psfgaoAttribs);
560
561     HRESULT GetCount(
562         [out] DWORD *pdwNumItems);
563
564     HRESULT GetItemAt(
565         [in] DWORD dwIndex,
566         [out] IShellItem **ppsi);
567
568     HRESULT EnumItems(
569         [out] IEnumShellItems **ppenumShellItems);
570
571 }
572
573 typedef [v1_enum] enum DATAOBJ_GET_ITEM_FLAGS
574 {
575     DOGIF_DEFAULT       = 0x0,
576     DOGIF_TRAVERSE_LINK = 0x1,
577     DOGIF_NO_HDROP      = 0x2,
578     DOGIF_NO_URL        = 0x4,
579     DOGIF_ONLY_IF_ONE   = 0x8
580 } DATAOBJ_GET_ITEM_FLAGS;
581 cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(DATAOBJ_GET_ITEM_FLAGS)")
582
583 cpp_quote("HRESULT WINAPI SHGetNameFromIDList(PCIDLIST_ABSOLUTE pidl, SIGDN sigdnName, PWSTR *ppszName);")
584 cpp_quote("HRESULT WINAPI SHCreateItemFromParsingName(PCWSTR pszPath, IBindCtx *pbc, REFIID riid, void **ppv);")
585 cpp_quote("HRESULT WINAPI SHCreateItemFromIDList(PCIDLIST_ABSOLUTE pidl, REFIID riid, void **ppv);")
586 cpp_quote("HRESULT WINAPI SHGetItemFromDataObject(IDataObject *pdtobj, DATAOBJ_GET_ITEM_FLAGS dwFlags, REFIID riid, void **ppv);")
587 cpp_quote("HRESULT WINAPI SHGetIDListFromObject(IUnknown *punk, PIDLIST_ABSOLUTE *ppidl);")
588 cpp_quote("HRESULT WINAPI SHGetItemFromObject(IUnknown *punk, REFIID riid, void **ppv);")
589 cpp_quote("HRESULT WINAPI SHCreateShellItemArray(PCIDLIST_ABSOLUTE pidlParent, IShellFolder* psf, UINT cidl, PCUITEMID_CHILD_ARRAY ppidl, IShellItemArray **ppsiItemArray);")
590 cpp_quote("HRESULT WINAPI SHCreateShellItemArrayFromShellItem(IShellItem *psi, REFIID riid, void **ppv);")
591 cpp_quote("HRESULT WINAPI SHCreateShellItemArrayFromDataObject(IDataObject *pdo, REFIID riid, void **ppv);")
592
593 /*****************************************************************************
594  * IShellItemFilter interface
595  */
596 [
597  object,
598  uuid(2659B475-EEB8-48B7-8F07-B378810F48CF),
599  pointer_default(unique)
600 ]
601 interface IShellItemFilter : IUnknown
602 {
603     HRESULT IncludeItem(
604         [in] IShellItem *psi);
605
606     HRESULT GetEnumFlagsForItem(
607         [in] IShellItem *psi,
608         [out] SHCONTF *pgrfFlags);
609 }
610
611 /*****************************************************************************
612  * FOLDERSETTINGS
613  */
614 typedef char *LPVIEWSETTINGS;
615
616 typedef enum
617 {
618     FWF_AUTOARRANGE         = 0x00000001,
619     FWF_ABBREVIATEDNAMES    = 0x00000002,
620     FWF_SNAPTOGRID          = 0x00000004,
621     FWF_OWNERDATA           = 0x00000008,
622     FWF_BESTFITWINDOW       = 0x00000010,
623     FWF_DESKTOP             = 0x00000020,
624     FWF_SINGLESEL           = 0x00000040,
625     FWF_NOSUBFOLDERS        = 0x00000080,
626     FWF_TRANSPARENT         = 0x00000100,
627     FWF_NOCLIENTEDGE        = 0x00000200,
628     FWF_NOSCROLL            = 0x00000400,
629     FWF_ALIGNLEFT           = 0x00000800,
630     FWF_NOICONS             = 0x00001000,
631     FWF_SHOWSELALWAYS       = 0x00002000,
632     FWF_NOVISIBLE           = 0x00004000,
633     FWF_SINGLECLICKACTIVATE = 0x00008000,
634     FWF_NOWEBVIEW           = 0x00010000,
635     FWF_HIDEFILENAMES       = 0x00020000,
636     FWF_CHECKSELECT         = 0x00040000,
637     FWF_NOENUMREFRESH       = 0x00080000,
638     FWF_NOGROUPING          = 0x00100000,
639     FWF_FULLROWSELECT       = 0x00200000,
640     FWF_NOFILTERS           = 0x00400000,
641     FWF_NOCOLUMNHEADER      = 0x00800000,
642     FWF_NOHEADERINALLVIEWS  = 0x01000000,
643     FWF_EXTENDEDTILES       = 0x02000000,
644     FWF_TRICHECKSELECT      = 0x04000000,
645     FWF_AUTOCHECKSELECT     = 0x08000000,
646     FWF_NOBROWSERVIEWSTATE  = 0x10000000,
647     FWF_SUBSETGROUPS        = 0x20000000,
648     FWF_USESEARCHFOLDER     = 0x40000000,
649     FWF_ALLOWRTLREADING     = 0x80000000
650 } FOLDERFLAGS;
651
652 typedef enum
653 {
654     FVM_AUTO       =-1,
655     FVM_ICON       = 1,
656     FVM_FIRST      = FVM_ICON,
657     FVM_SMALLICON  = 2,
658     FVM_LIST       = 3,
659     FVM_DETAILS    = 4,
660     FVM_THUMBNAIL  = 5,
661     FVM_TILE       = 6,
662     FVM_THUMBSTRIP = 7,
663     FVM_CONTENT    = 8,
664     FVM_LAST       = FVM_CONTENT
665 } FOLDERVIEWMODE;
666
667 typedef struct
668 {
669     UINT ViewMode;
670     UINT fFlags;
671 } FOLDERSETTINGS, *PFOLDERSETTINGS, *LPFOLDERSETTINGS;
672 typedef const FOLDERSETTINGS *LPCFOLDERSETTINGS;
673
674 /*****************************************************************************
675  * IShellIcon interface
676  */
677 [
678     uuid(000214e5-0000-0000-c000-000000000046),
679     object,
680     pointer_default(unique)
681 ]
682 interface IShellIcon : IUnknown
683 {
684     HRESULT GetIconOf(
685         [in] PCUITEMID_CHILD pidl,
686         [in] UINT flags,
687         [out] int *pIconIndex);
688 }
689
690 /*****************************************************************************
691  * IShellView interface
692  */
693 interface IShellBrowser;  /* forward declaration */
694 [
695     object,
696     uuid(000214e3-0000-0000-c000-000000000046),
697     pointer_default(unique)
698 ]
699 interface IShellView : IOleWindow
700 {
701     typedef IShellView *LPSHELLVIEW;
702
703     cpp_quote("#define SVSI_DESELECT       0x00000000")
704     cpp_quote("#define SVSI_SELECT         0x00000001")
705     cpp_quote("#define SVSI_EDIT           0x00000003")
706     cpp_quote("#define SVSI_DESELECTOTHERS 0x00000004")
707     cpp_quote("#define SVSI_ENSUREVISIBLE  0x00000008")
708     cpp_quote("#define SVSI_FOCUSED        0x00000010")
709     cpp_quote("#define SVSI_TRANSLATEPT    0x00000020")
710     cpp_quote("#define SVSI_SELECTIONMARK  0x00000040")
711     cpp_quote("#define SVSI_POSITIONITEM   0x00000080")
712     cpp_quote("#define SVSI_CHECK          0x00000100")
713     cpp_quote("#define SVSI_NOSTATECHANGE  0x80000000")
714
715     typedef UINT SVSIF;
716
717     typedef enum
718     {
719         SVGIO_BACKGROUND     = 0x00000000,
720         SVGIO_SELECTION      = 0x00000001,
721         SVGIO_ALLVIEW        = 0x00000002,
722         SVGIO_CHECKED        = 0x00000003,
723         SVGIO_TYPE_MASK      = 0x0000000f,
724         SVGIO_FLAG_VIEWORDER = 0x80000000,
725     } SVGIO;
726
727     typedef enum
728     {
729         SVUIA_DEACTIVATE       = 0,
730         SVUIA_ACTIVATE_NOFOCUS = 1,
731         SVUIA_ACTIVATE_FOCUS   = 2,
732         SVUIA_INPLACEACTIVATE  = 3
733     } SVUIA_STATUS;
734
735     HRESULT TranslateAccelerator( [in] MSG *pmsg );
736     HRESULT EnableModeless( [in] BOOL fEnable );
737     HRESULT UIActivate( [in] UINT uState );
738     HRESULT Refresh();
739     HRESULT CreateViewWindow(
740         [in] IShellView *psvPrevious,
741         [in] LPCFOLDERSETTINGS lpfs,
742         [in] IShellBrowser *psb,
743         [out] RECT *prcView,
744         [out] HWND *phWnd);
745
746     HRESULT DestroyViewWindow();
747     HRESULT GetCurrentInfo( [out] LPFOLDERSETTINGS lpfs );
748
749     [local] HRESULT AddPropertySheetPages(
750         [in] DWORD dwReserved,
751         [in] LPFNSVADDPROPSHEETPAGE pfn,
752         [in] LPARAM lparam);
753
754     HRESULT SaveViewState();
755     HRESULT SelectItem(
756         [in] LPCITEMIDLIST pidlItem,
757         [in] SVSIF uFlags);
758     HRESULT GetItemObject(
759         [in] UINT uItem,
760         [in] REFIID riid,
761         [out, iid_is(riid)] void **ppv);
762 }
763
764 [
765     object,
766     uuid(88e39e80-3578-11cf-ae69-08002b2e1262),
767     pointer_default(unique)
768 ]
769 interface IShellView2 : IShellView
770 {
771     typedef GUID SHELLVIEWID;
772 cpp_quote("#include <pshpack8.h>")
773     typedef struct _SV2CVW2_PARAMS
774     {
775         DWORD cbSize;
776         IShellView *psvPrev;
777         LPCFOLDERSETTINGS pfs;
778         IShellBrowser *psbOwner;
779         RECT *prcView;
780         SHELLVIEWID const *pvid;
781         HWND hwndView;
782     } SV2CVW2_PARAMS, *LPSV2CVW2_PARAMS;
783 cpp_quote("#include <poppack.h>")
784
785     HRESULT GetView(
786         [in, out] SHELLVIEWID *view_guid,
787         [in] ULONG view_type
788     );
789     HRESULT CreateViewWindow2(
790         [in] LPSV2CVW2_PARAMS view_params
791     );
792     HRESULT HandleRename(
793         [in] LPCITEMIDLIST new_pidl
794     );
795     HRESULT SelectAndPositionItem(
796         [in] LPCITEMIDLIST item,
797         [in] UINT flags,
798         [in] POINT *point
799     );
800 }
801
802 /*****************************************************************************
803  * IFolderView interface
804  */
805 [
806     uuid(cde725b0-ccc9-4519-917e-325d72fab4ce),
807     object,
808     pointer_default(unique)
809 ]
810 interface IFolderView : IUnknown
811 {
812     HRESULT GetCurrentViewMode( [out] UINT *mode );
813     HRESULT SetCurrentViewMode( [in] UINT mode );
814     HRESULT GetFolder( [in] REFIID riid, [out, iid_is(riid)] void **ppv );
815     HRESULT Item(
816         [in] int index,
817         [out] PITEMID_CHILD *ppidl
818     );
819     HRESULT ItemCount(
820         [in] UINT flags,
821         [out] int *items
822     );
823     HRESULT Items(
824         [in] UINT flags,
825         [in] REFIID riid,
826         [out, iid_is(riid)] void **ppv
827     );
828     HRESULT GetSelectionMarkedItem( [out] int *item );
829     HRESULT GetFocusedItem( [out] int *item );
830     HRESULT GetItemPosition(
831         [in] PCUITEMID_CHILD pidl,
832         [out] POINT* ppt
833     );
834     HRESULT GetSpacing( [in, out, unique] POINT* pt );
835     HRESULT GetDefaultSpacing( [out] POINT* pt );
836     HRESULT GetAutoArrange();
837     HRESULT SelectItem(
838         [in] int item,
839         [in] DWORD flags
840     );
841     HRESULT SelectAndPositionItems(
842         [in] UINT cidl,
843         [in, size_is(cidl)] PCUITEMID_CHILD_ARRAY apidl,
844         [in, unique, size_is(cidl)] POINT* apt,
845         [in] DWORD flags
846     );
847 }
848
849 /*****************************************************************************
850  * IShellBrowser interface
851  */
852 [
853     object,
854     uuid(000214e2-0000-0000-c000-000000000046),
855     pointer_default(unique)
856 ]
857 interface IShellBrowser : IOleWindow
858 {
859     typedef IShellBrowser *LPSHELLBROWSER;
860
861 cpp_quote("#define SBSP_DEFBROWSER            0x00000000")
862 cpp_quote("#define SBSP_SAMEBROWSER           0x00000001")
863 cpp_quote("#define SBSP_NEWBROWSER            0x00000002")
864 cpp_quote("#define SBSP_DEFMODE               0x00000000")
865 cpp_quote("#define SBSP_OPENMODE              0x00000010")
866 cpp_quote("#define SBSP_EXPLOREMODE           0x00000020")
867 cpp_quote("#define SBSP_HELPMODE              0x00000040")
868 cpp_quote("#define SBSP_NOTRANSFERHIST        0x00000080")
869 cpp_quote("#define SBSP_ABSOLUTE              0x00000000")
870 cpp_quote("#define SBSP_RELATIVE              0x00001000")
871 cpp_quote("#define SBSP_PARENT                0x00002000")
872 cpp_quote("#define SBSP_NAVIGATEBACK          0x00004000")
873 cpp_quote("#define SBSP_NAVIGATEFORWARD       0x00008000")
874 cpp_quote("#define SBSP_ALLOW_AUTONAVIGATE    0x00010000")
875 cpp_quote("#define SBSP_KEEPSAMETEMPLATE      0x00020000")
876 cpp_quote("#define SBSP_KEEPWORDWHEELTEXT     0x00040000")
877 cpp_quote("#define SBSP_ACTIVATE_NOFOCUS      0x00080000")
878 cpp_quote("#define SBSP_CREATENOHISTORY       0x00100000")
879 cpp_quote("#define SBSP_PLAYNOSOUND           0x00200000")
880 cpp_quote("#define SBSP_CALLERUNTURUSTED      0x00800000")
881 cpp_quote("#define SBSP_TRUSTFIRSTDOWNLOAD    0x01000000")
882 cpp_quote("#define SBSP_UNTRUSTEDFORDOWNLOAD  0x02000000")
883 cpp_quote("#define SBSP_NOAUTOSELECT          0x04000000")
884 cpp_quote("#define SBSP_WRITENOHISTORY        0x08000000")
885 cpp_quote("#define SBSP_TRUSTEDFORACTIVEX     0x10000000")
886 cpp_quote("#define SBSP_FEEDNAVIGATION        0x20000000")
887 cpp_quote("#define SBSP_REDIRECT              0x40000000")
888 cpp_quote("#define SBSP_INITIATEDBYHLINKFRAME 0x80000000")
889
890 cpp_quote("#define FCW_STATUS      0x0001")
891 cpp_quote("#define FCW_TOOLBAR     0x0002")
892 cpp_quote("#define FCW_TREE        0x0003")
893 cpp_quote("#define FCW_INTERNETBAR 0x0006")
894 cpp_quote("#define FCW_PROGRESS    0x0008")
895
896 cpp_quote("#define FCT_MERGE       0x0001")
897 cpp_quote("#define FCT_CONFIGABLE  0x0002")
898 cpp_quote("#define FCT_ADDTOEND    0x0004")
899
900 cpp_quote("#if 0")
901     typedef LPARAM LPTBBUTTONSB;
902 cpp_quote("#else")
903 cpp_quote("#include <commctrl.h>")
904 cpp_quote("typedef LPTBBUTTON LPTBBUTTONSB;")
905 cpp_quote("#endif")
906
907     HRESULT InsertMenusSB(
908         [in] HMENU hmenuShared,
909         [in, out] LPOLEMENUGROUPWIDTHS lpMenuWidths);
910
911     HRESULT SetMenuSB(
912         [in] HMENU hmenuShared,
913         [in] HOLEMENU holemenuReserved,
914         [in] HWND hwndActiveObject);
915
916     HRESULT RemoveMenusSB( [in] HMENU hmenuShared );
917     HRESULT SetStatusTextSB( [in, unique] LPCOLESTR pszStatusText );
918     HRESULT EnableModelessSB( [in] BOOL fEnable );
919     HRESULT TranslateAcceleratorSB( [in] MSG *pmsg, [in] WORD wID );
920
921     HRESULT BrowseObject(
922         [in] LPCITEMIDLIST pidl,
923         [in] UINT wFlags);
924
925     HRESULT GetViewStateStream(
926         [in] DWORD grfMode,
927         [out] IStream **ppStrm);
928
929     HRESULT GetControlWindow(
930         [in] UINT id,
931         [out] HWND *phwnd);
932
933     [local] HRESULT SendControlMsg(
934         [in] UINT id,
935         [in] UINT uMsg,
936         [in] WPARAM wParam,
937         [in] LPARAM lParam,
938         [in] LRESULT *pret);
939
940     HRESULT QueryActiveShellView( [out] IShellView **ppshv );
941     HRESULT OnViewWindowActive( [in] IShellView *pshv );
942
943     [local]
944     HRESULT SetToolbarItems(
945         [in] LPTBBUTTONSB lpButtons,
946         [in] UINT nButtons,
947         [in] UINT uFlags);
948 }
949
950
951 /*****************************************************************************
952  * IShellLinkA interface
953  */
954 [
955     object,
956     uuid(000214ee-0000-0000-c000-000000000046),
957     pointer_default(unique)
958 ]
959 interface IShellLinkA : IUnknown
960 {
961     typedef enum
962     {
963         SLR_NO_UI               = 0x0001,
964         SLR_ANY_MATCH           = 0x0002,
965         SLR_UPDATE              = 0x0004,
966         SLR_NOUPDATE            = 0x0008,
967         SLR_NOSEARCH            = 0x0010,
968         SLR_NOTRACK             = 0x0020,
969         SLR_NOLINKINFO          = 0x0040,
970         SLR_INVOKE_MSI          = 0x0080,
971         SLR_NO_UI_WITH_MSG_PUMP = 0x0101,
972     } SLR_FLAGS;
973
974     typedef enum
975     {
976         SLGP_SHORTPATH   = 0x0001,
977         SLGP_UNCPRIORITY = 0x0002,
978         SLGP_RAWPATH     = 0x0004,
979     } SLGP_FLAGS;
980
981     HRESULT GetPath(
982         [out, size_is(cch)] LPSTR pszFile,
983         [in] int cch,
984         [in, out, unique] WIN32_FIND_DATAA *pfd,
985         [in] DWORD fFlags);
986
987     HRESULT GetIDList( [out] LPITEMIDLIST * ppidl );
988
989     HRESULT SetIDList( [in] LPCITEMIDLIST pidl );
990
991     HRESULT GetDescription(
992         [out, size_is(cch)] LPSTR pszName,
993         [in] int cch);
994
995     HRESULT SetDescription( [in] LPCSTR pszName );
996
997     HRESULT GetWorkingDirectory(
998         [out, size_is(cch)] LPSTR pszDir,
999         [in] int cch);
1000
1001     HRESULT SetWorkingDirectory( [in] LPCSTR pszDir );
1002
1003     HRESULT GetArguments(
1004         [out, size_is(cch)] LPSTR pszArgs,
1005         [in] int cch);
1006
1007     HRESULT SetArguments( [in] LPCSTR pszArgs );
1008
1009     HRESULT GetHotkey( [out] WORD *pwHotkey );
1010
1011     HRESULT SetHotkey( [in] WORD wHotkey );
1012
1013     HRESULT GetShowCmd( [out] int *piShowCmd );
1014
1015     HRESULT SetShowCmd( [in] int iShowCmd );
1016
1017     HRESULT GetIconLocation(
1018         [out, size_is(cch)] LPSTR pszIconPath,
1019         [in] int cch,
1020         [out] int *piIcon);
1021
1022     HRESULT SetIconLocation(
1023         [in] LPCSTR pszIconPath,
1024         [in] int iIcon);
1025
1026     HRESULT SetRelativePath(
1027         [in] LPCSTR pszPathRel,
1028         [in] DWORD dwReserved);
1029
1030     HRESULT Resolve(
1031         [in] HWND hwnd,
1032         [in] DWORD fFlags);
1033
1034     HRESULT SetPath( [in] LPCSTR pszFile );
1035 }
1036
1037
1038 /*****************************************************************************
1039  * IShellLinkW interface
1040  */
1041 [
1042     object,
1043     uuid(000214f9-0000-0000-c000-000000000046),
1044     pointer_default(unique)
1045 ]
1046 interface IShellLinkW : IUnknown
1047 {
1048     HRESULT GetPath(
1049         [out, size_is(cch)] LPWSTR pszFile,
1050         [in] int cch,
1051         [in, out] WIN32_FIND_DATAW *pfd,
1052         [in] DWORD fFlags);
1053
1054     HRESULT GetIDList( [out] LPITEMIDLIST * ppidl );
1055
1056     HRESULT SetIDList( [in] LPCITEMIDLIST pidl );
1057
1058     HRESULT GetDescription(
1059         [out, size_is(cch)] LPWSTR pszName,
1060         [in] int cch);
1061
1062     HRESULT SetDescription( [in] LPCWSTR pszName );
1063
1064     HRESULT GetWorkingDirectory(
1065         [out, size_is(cch)] LPWSTR pszDir,
1066         [in] int cch);
1067
1068     HRESULT SetWorkingDirectory( [in] LPCWSTR pszDir );
1069
1070     HRESULT GetArguments(
1071         [out, size_is(cch)] LPWSTR pszArgs,
1072         [in] int cch);
1073
1074     HRESULT SetArguments( [in] LPCWSTR pszArgs );
1075
1076     HRESULT GetHotkey( [out] WORD *pwHotkey );
1077
1078     HRESULT SetHotkey( [in] WORD wHotkey );
1079
1080     HRESULT GetShowCmd( [out] int *piShowCmd );
1081
1082     HRESULT SetShowCmd( [in] int iShowCmd );
1083
1084     HRESULT GetIconLocation(
1085         [out, size_is(cch)] LPWSTR pszIconPath,
1086         [in] int cch,
1087         [out] int *piIcon);
1088
1089     HRESULT SetIconLocation(
1090         [in] LPCWSTR pszIconPath,
1091         [in] int iIcon);
1092
1093     HRESULT SetRelativePath(
1094         [in] LPCWSTR pszPathRel,
1095         [in] DWORD dwReserved);
1096
1097     HRESULT Resolve(
1098         [in] HWND hwnd,
1099         [in] DWORD fFlags);
1100
1101     HRESULT SetPath( [in] LPCWSTR pszFile );
1102 }
1103
1104 cpp_quote("#define IShellLink WINELIB_NAME_AW(IShellLink)")
1105
1106
1107 /*****************************************************************************
1108  * IShellExtInit interface
1109  */
1110 [
1111     object,
1112     uuid(000214e8-0000-0000-c000-000000000046),
1113     pointer_default(unique),
1114     local
1115 ]
1116 interface IShellExtInit : IUnknown
1117 {
1118     typedef IShellExtInit *LPSHELLEXTINIT;
1119
1120     HRESULT Initialize(
1121         [in] LPCITEMIDLIST pidlFolder,
1122         [in] IDataObject *pdtobj,
1123         [in] HKEY hkeyProgID);
1124 }
1125
1126
1127 /*******************************************************************************/
1128 /* Note: the following interfaces are not in shobjidl.idl under Windows, they  */
1129 /* are declared directly in shlobj.h. It hopefully won't break anything to put */
1130 /* them here anyway.                                                           */
1131 /*******************************************************************************/
1132
1133 #ifndef MAX_PATH
1134 #define MAX_PATH 260
1135 #endif
1136
1137
1138 /*****************************************************************************
1139  * IPersistFolder3 interface
1140  */
1141 [
1142     object,
1143     uuid(cef04fdf-fe72-11d2-87a5-00c04f6837cf),
1144     pointer_default(unique)
1145 ]
1146 interface IPersistFolder3 : IPersistFolder2
1147 {
1148     typedef struct
1149     {
1150         LPITEMIDLIST    pidlTargetFolder;
1151         WCHAR           szTargetParsingName[MAX_PATH];
1152         WCHAR           szNetworkProvider[MAX_PATH];
1153         DWORD           dwAttributes;
1154         int             csidl;
1155     } PERSIST_FOLDER_TARGET_INFO;
1156
1157     HRESULT InitializeEx(
1158         [in] IBindCtx *pbc,
1159         [in] LPCITEMIDLIST pidlRoot,
1160         [in] const PERSIST_FOLDER_TARGET_INFO *ppfti);
1161
1162     HRESULT GetFolderTargetInfo( [out] PERSIST_FOLDER_TARGET_INFO *ppfti );
1163 }
1164
1165
1166 /*****************************************************************************
1167  * IExtractIconA interface
1168  */
1169 [
1170     object,
1171     uuid(000214eb-0000-0000-c000-000000000046),
1172     pointer_default(unique),
1173     local
1174 ]
1175 interface IExtractIconA : IUnknown
1176 {
1177 cpp_quote("#define GIL_OPENICON     0x0001")
1178 cpp_quote("#define GIL_FORSHELL     0x0002")
1179 cpp_quote("#define GIL_ASYNC        0x0020")
1180 cpp_quote("#define GIL_DEFAULTICON  0x0040")
1181 cpp_quote("#define GIL_FORSHORTCUT  0x0080")
1182
1183 cpp_quote("#define GIL_SIMULATEDOC  0x0001")
1184 cpp_quote("#define GIL_PERINSTANCE  0x0002")
1185 cpp_quote("#define GIL_PERCLASS     0x0004")
1186 cpp_quote("#define GIL_NOTFILENAME  0x0008")
1187 cpp_quote("#define GIL_DONTCACHE    0x0010")
1188
1189     typedef IExtractIconA *LPEXTRACTICONA;
1190
1191     HRESULT GetIconLocation(
1192         [in] UINT uFlags,
1193         [out, size_is(cchMax)] LPSTR szIconFile,
1194         [in] UINT cchMax,
1195         [out] INT *piIndex,
1196         [out] UINT *pwFlags);
1197
1198     HRESULT Extract(
1199         [in] LPCSTR pszFile,
1200         [in] UINT nIconIndex,
1201         [out] HICON *phiconLarge,
1202         [out] HICON *phiconSmall,
1203         [in] UINT nIconSize );
1204 }
1205
1206
1207 /*****************************************************************************
1208  * IExtractIconW interface
1209  */
1210 [
1211     object,
1212     uuid(000214fa-0000-0000-c000-000000000046),
1213     pointer_default(unique),
1214     local
1215 ]
1216 interface IExtractIconW : IUnknown
1217 {
1218     typedef IExtractIconW *LPEXTRACTICONW;
1219
1220     HRESULT GetIconLocation(
1221         [in] UINT uFlags,
1222         [out, size_is(cchMax)] LPWSTR szIconFile,
1223         [in] UINT cchMax,
1224         [out] INT *piIndex,
1225         [out] UINT *pwFlags);
1226
1227     HRESULT Extract(
1228         [in] LPCWSTR pszFile,
1229         [in] UINT nIconIndex,
1230         [out] HICON *phiconLarge,
1231         [out] HICON *phiconSmall,
1232         [in] UINT nIconSize );
1233 }
1234
1235 cpp_quote("#define LPEXTRACTICON WINELIB_NAME_AW(LPEXTRACTICON)")
1236 cpp_quote("#define IExtractIcon WINELIB_NAME_AW(IExtractIcon)")
1237
1238
1239 /*****************************************************************************
1240  * ICommDlgBrowser interface
1241  */
1242 [
1243     object,
1244     uuid(000214f1-0000-0000-c000-000000000046),
1245     pointer_default(unique)
1246 ]
1247 interface ICommDlgBrowser : IUnknown
1248 {
1249 cpp_quote("#define CDBOSC_SETFOCUS     0x00000000")
1250 cpp_quote("#define CDBOSC_KILLFOCUS    0x00000001")
1251 cpp_quote("#define CDBOSC_SELCHANGE    0x00000002")
1252 cpp_quote("#define CDBOSC_RENAME       0x00000003")
1253 cpp_quote("#define CDBOSC_STATECHANGE  0x00000004")
1254
1255     typedef ICommDlgBrowser *LPCOMMDLGBROWSER;
1256
1257     HRESULT OnDefaultCommand( [in] IShellView *shv );
1258     HRESULT OnStateChange( [in] IShellView *shv, [in] ULONG uChange );
1259     HRESULT IncludeObject( [in] IShellView *shv, [in] LPCITEMIDLIST pidl );
1260 }
1261
1262
1263 /*****************************************************************************
1264  * ICommDlgBrowser2 interface
1265  */
1266 [
1267  object,
1268  uuid(10339516-2894-11D2-9039-00C04F8EEB3E),
1269  pointer_default(unique)
1270 ]
1271 interface ICommDlgBrowser2 : ICommDlgBrowser
1272 {
1273
1274     HRESULT Notify(
1275         [in] IShellView *ppshv,
1276         [in] DWORD dwNotifyType);
1277
1278     HRESULT GetDefaultMenuText(
1279         [in] IShellView *ppshv,
1280         [out, string, size_is(cchMax)] LPWSTR pszText,
1281         [in] int cchMax);
1282
1283     HRESULT GetViewFlags(
1284         [out] DWORD *pdwFlags);
1285 }
1286
1287
1288 /*****************************************************************************
1289  * ICommDlgBrowser3 interface
1290  */
1291 [
1292  object,
1293  uuid(C8AD25A1-3294-41EE-8165-71174BD01C57),
1294  pointer_default(unique)
1295 ]
1296 interface ICommDlgBrowser3 : ICommDlgBrowser2
1297 {
1298
1299     HRESULT OnColumnClicked(
1300         [in] IShellView *ppshv,
1301         [in] int iColumn);
1302
1303     HRESULT GetCurrentFilter(
1304         [out, string, size_is(cchFileSpec)] LPWSTR pszFileSpec,
1305         [in] int cchFileSpec);
1306
1307     HRESULT OnPreviewCreated(
1308         [in] IShellView *ppshv);
1309 }
1310
1311
1312 /*****************************************************************************
1313  * IDockingWindowFrame interface
1314  */
1315 [
1316     object,
1317     uuid(47d2657a-7b27-11d0-8ca9-00a0c92dbfe8),
1318     pointer_default(unique),
1319     local
1320 ]
1321 interface IDockingWindowFrame : IOleWindow
1322 {
1323 cpp_quote("#define DWFRF_NORMAL           0x0000")
1324 cpp_quote("#define DWFRF_DELETECONFIGDATA 0x0001")
1325 cpp_quote("#define DWFAF_HIDDEN           0x0001")
1326
1327     HRESULT AddToolbar(
1328         [in] IUnknown *punkSrc,
1329         [in] LPCWSTR pwszItem,
1330         [in] DWORD dwAddFlags);
1331
1332     HRESULT RemoveToolbar(
1333         [in] IUnknown *punkSrc,
1334         [in] DWORD dwRemoveFlags);
1335
1336     HRESULT FindToolbar(
1337         [in] LPCWSTR pwszItem,
1338         [in] REFIID riid,
1339         [out] LPVOID *ppvObj);
1340 }
1341
1342
1343 /*****************************************************************************
1344  * IDragSourceHelper interface
1345  */
1346 [
1347     object,
1348     uuid(de5bf786-477a-11d2-839d-00c04fd918d0),
1349     pointer_default(unique),
1350     local
1351 ]
1352 interface IDragSourceHelper : IUnknown
1353 {
1354     typedef struct
1355     {
1356         SIZE     sizeDragImage;
1357         POINT    ptOffset;
1358         HBITMAP  hbmpDragImage;
1359         COLORREF crColorKey;
1360     } SHDRAGIMAGE, *LPSHDRAGIMAGE;
1361
1362   HRESULT InitializeFromBitmap(
1363       [in] LPSHDRAGIMAGE pshdi,
1364       [in] IDataObject *pDataObject);
1365
1366   HRESULT InitializeFromWindow(
1367       [in] HWND hwnd,
1368       [in] POINT *ppt,
1369       [in] IDataObject *pDataObject);
1370 }
1371
1372
1373 /*****************************************************************************
1374  * IDropTargetHelper interface
1375  */
1376 [
1377     object,
1378     uuid(4657278b-411b-11d2-839a-00c04fd918d0),
1379     pointer_default(unique),
1380     local
1381 ]
1382 interface IDropTargetHelper : IUnknown
1383 {
1384     HRESULT DragEnter(
1385         [in] HWND hwndTarget,
1386         [in] IDataObject *pDataObject,
1387         [in] POINT *ppt,
1388         [in] DWORD dwEffect);
1389
1390     HRESULT DragLeave();
1391
1392     HRESULT DragOver(
1393         [in] POINT *ppt,
1394         [in] DWORD dwEffect);
1395
1396     HRESULT Drop(
1397         [in] IDataObject *pDataObject,
1398         [in] POINT *ppt,
1399         [in] DWORD dwEffect);
1400
1401     HRESULT Show( [in] BOOL fShow );
1402 }
1403
1404
1405 /*****************************************************************************
1406  * IContextMenu interface
1407  */
1408 [
1409     object,
1410     uuid(000214e4-0000-0000-c000-000000000046),
1411     pointer_default(unique),
1412     local
1413 ]
1414 interface IContextMenu : IUnknown
1415 {
1416 cpp_quote("#define CMF_NORMAL        0x00000000")
1417 cpp_quote("#define CMF_DEFAULTONLY   0x00000001")
1418 cpp_quote("#define CMF_VERBSONLY     0x00000002")
1419 cpp_quote("#define CMF_EXPLORE       0x00000004")
1420 cpp_quote("#define CMF_NOVERBS       0x00000008")
1421 cpp_quote("#define CMF_CANRENAME     0x00000010")
1422 cpp_quote("#define CMF_NODEFAULT     0x00000020")
1423 cpp_quote("#define CMF_INCLUDESTATIC 0x00000040")
1424 cpp_quote("#define CMF_EXTENDEDVERBS 0x00000100")
1425 cpp_quote("#define CMF_RESERVED      0xffff0000")
1426
1427 cpp_quote("#define GCS_VERBA         0x00000000")
1428 cpp_quote("#define GCS_HELPTEXTA     0x00000001")
1429 cpp_quote("#define GCS_VALIDATEA     0x00000002")
1430 cpp_quote("#define GCS_VERBW         0x00000004")
1431 cpp_quote("#define GCS_HELPTEXTW     0x00000005")
1432 cpp_quote("#define GCS_VALIDATEW     0x00000006")
1433 cpp_quote("#define GCS_UNICODE       0x00000004")
1434 cpp_quote("#define GCS_VERB          WINELIB_NAME_AW(GCS_VERB)")
1435 cpp_quote("#define GCS_HELPTEXT      WINELIB_NAME_AW(GCS_HELPTEXT)")
1436 cpp_quote("#define GCS_VALIDATE      WINELIB_NAME_AW(GCS_VALIDATE)")
1437
1438 cpp_quote("#define CMDSTR_NEWFOLDERA   \"NewFolder\"")
1439 cpp_quote("#define CMDSTR_VIEWLISTA    \"ViewList\"")
1440 cpp_quote("#define CMDSTR_VIEWDETAILSA \"ViewDetails\"")
1441 cpp_quote("#if defined(__GNUC__)")
1442 cpp_quote("# define CMDSTR_NEWFOLDERW (const WCHAR []){ 'N','e','w','F','o','l','d','e','r',0 }")
1443 cpp_quote("# define CMDSTR_VIEWLISTW (const WCHAR []){ 'V','i','e','w','L','i','s','t',0 }")
1444 cpp_quote("# define CMDSTR_VIEWDETAILSW (const WCHAR []){ 'V','i','e','w','D','e','t','a','i','l','s',0 }")
1445 cpp_quote("#elif defined(_MSC_VER)")
1446 cpp_quote("# define CMDSTR_NEWFOLDERW   L\"NewFolder\"")
1447 cpp_quote("# define CMDSTR_VIEWLISTW    L\"ViewList\"")
1448 cpp_quote("# define CMDSTR_VIEWDETAILSW L\"ViewDetails\"")
1449 cpp_quote("#else")
1450 cpp_quote("static const WCHAR CMDSTR_NEWFOLDERW[] = {'N','e','w','F','o','l','d','e','r',0};")
1451 cpp_quote("static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0};")
1452 cpp_quote("static const WCHAR CMDSTR_VIEWDETAILSW[] = {'V','i','e','w','D','e','t','a','i','l','s',0};")
1453 cpp_quote("#endif")
1454 cpp_quote("#define CMDSTR_NEWFOLDER    WINELIB_NAME_AW(CMDSTR_NEWFOLDER)")
1455 cpp_quote("#define CMDSTR_VIEWLIST     WINELIB_NAME_AW(CMDSTR_VIEWLIST)")
1456 cpp_quote("#define CMDSTR_VIEWDETAILS  WINELIB_NAME_AW(CMDSTR_VIEWDETAILS)")
1457
1458 cpp_quote("#define CMIC_MASK_HOTKEY         SEE_MASK_HOTKEY")
1459 cpp_quote("#define CMIC_MASK_ICON           SEE_MASK_ICON")
1460 cpp_quote("#define CMIC_MASK_FLAG_NO_UI     SEE_MASK_FLAG_NO_UI")
1461 cpp_quote("#define CMIC_MASK_UNICODE        SEE_MASK_UNICODE")
1462 cpp_quote("#define CMIC_MASK_NO_CONSOLE     SEE_MASK_NO_CONSOLE")
1463 cpp_quote("#define CMIC_MASK_HASLINKNAME    SEE_MASK_HASLINKNAME")
1464 cpp_quote("#define CMIC_MASK_FLAG_SEP_VDM   SEE_MASK_FLAG_SEPVDM")
1465 cpp_quote("#define CMIC_MASK_HASTITLE       SEE_MASK_HASTITLE")
1466 cpp_quote("#define CMIC_MASK_ASYNCOK        SEE_MASK_ASYNCOK")
1467 cpp_quote("#define CMIC_MASK_NOASYNC        SEE_MASK_NOASYNC")
1468 cpp_quote("#define CMIC_MASK_SHIFT_DOWN     0x10000000")
1469 cpp_quote("#define CMIC_MASK_PTINVOKE       0x20000000")
1470 cpp_quote("#define CMIC_MASK_CONTROL_DOWN   0x40000000")
1471 cpp_quote("#define CMIC_MASK_FLAG_LOG_USAGE SEE_MASK_FLAG_LOG_USAGE")
1472 cpp_quote("#define CMIC_MASK_NOZONECHECKS   SEE_MASK_NOZONECHECKS")
1473
1474     typedef IContextMenu *LPCONTEXTMENU;
1475
1476     typedef struct tagCMINVOKECOMMANDINFO
1477     {
1478         DWORD cbSize;
1479         DWORD fMask;
1480         HWND hwnd;
1481         LPCSTR lpVerb;
1482         LPCSTR lpParameters;
1483         LPCSTR lpDirectory;
1484         INT nShow;
1485         DWORD dwHotKey;
1486         HANDLE hIcon;
1487     } CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO;
1488
1489     typedef struct tagCMInvokeCommandInfoEx
1490     {
1491         DWORD cbSize;
1492         DWORD fMask;
1493         HWND hwnd;
1494         LPCSTR lpVerb;
1495         LPCSTR lpParameters;
1496         LPCSTR lpDirectory;
1497         INT nShow;
1498         DWORD dwHotKey;
1499         HANDLE hIcon;
1500         LPCSTR lpTitle;
1501         LPCWSTR lpVerbW;
1502         LPCWSTR lpParametersW;
1503         LPCWSTR lpDirectoryW;
1504         LPCWSTR lpTitleW;
1505         POINT ptInvoke;
1506     } CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX;
1507
1508     HRESULT QueryContextMenu(
1509         [in] HMENU hmenu,
1510         [in] UINT indexMenu,
1511         [in] UINT idCmdFirst,
1512         [in] UINT idCmdLast,
1513         [in] UINT uFlags);
1514
1515     HRESULT InvokeCommand( [in] LPCMINVOKECOMMANDINFO lpici );
1516
1517     HRESULT GetCommandString(
1518         [in] UINT_PTR idCmd,
1519         [in] UINT uType,
1520         [out] UINT *pwReserved,
1521         [out, size_is(cchMax)] LPSTR pszName,
1522         [in] UINT cchMax);
1523 }
1524
1525
1526 /*****************************************************************************
1527  * IContextMenu2 interface
1528  */
1529 [
1530     object,
1531     uuid(000214f4-0000-0000-c000-000000000046),
1532     pointer_default(unique),
1533     local
1534 ]
1535 interface IContextMenu2 : IContextMenu
1536 {
1537     typedef IContextMenu2 *LPCONTEXTMENU2;
1538
1539     HRESULT HandleMenuMsg(
1540         [in] UINT uMsg,
1541         [in] WPARAM wParam,
1542         [in] LPARAM lParam);
1543 }
1544
1545
1546 /*****************************************************************************
1547  * IContextMenu3 interface
1548  */
1549 [
1550     object,
1551     uuid(bcfce0a0-ec17-11d0-8d10-00a0c90f2719),
1552     pointer_default(unique),
1553     local
1554 ]
1555 interface IContextMenu3 : IContextMenu2
1556 {
1557     typedef IContextMenu3 *LPCONTEXTMENU3;
1558
1559     HRESULT HandleMenuMsg2(
1560         [in] UINT uMsg,
1561         [in] WPARAM wParam,
1562         [in] LPARAM lParam,
1563         [out] LRESULT *plResult);
1564 }
1565
1566
1567 /*****************************************************************************
1568  * IShellExecuteHookA interface
1569  */
1570 [
1571     object,
1572     uuid(000214f5-0000-0000-c000-000000000046),
1573     pointer_default(unique),
1574     local
1575 ]
1576 interface IShellExecuteHookA : IUnknown
1577 {
1578     cpp_quote("struct _SHELLEXECUTEINFOA;")
1579     HRESULT Execute(
1580         [in, out] struct _SHELLEXECUTEINFOA* pei);
1581 }
1582
1583
1584 /*****************************************************************************
1585  * IShellExecuteHookW interface
1586  */
1587 [
1588     object,
1589     uuid(000214fb-0000-0000-c000-000000000046),
1590     pointer_default(unique),
1591     local
1592 ]
1593 interface IShellExecuteHookW : IUnknown
1594 {
1595     cpp_quote("struct _SHELLEXECUTEINFOW;")
1596     HRESULT Execute(
1597                 [in, out] struct _SHELLEXECUTEINFOW* pei);
1598 }
1599
1600 /*****************************************************************************
1601  * IShellLinkDataList interface
1602  */
1603 [
1604     object,
1605     uuid(45e2b4ae-b1c3-11d0-b92f-00a0c90312e1),
1606     pointer_default(unique)
1607 ]
1608 interface IShellLinkDataList : IUnknown
1609 {
1610     [local] HRESULT AddDataBlock(
1611                 [in] void *pDataBlock);
1612     [local] HRESULT CopyDataBlock(
1613                 [in] DWORD dwSig,
1614                 [out] void **ppDataBlock);
1615     HRESULT RemoveDataBlock(
1616                 [in] DWORD dwSig);
1617     HRESULT GetFlags(
1618                 [out] DWORD *pdwFlags);
1619     HRESULT SetFlags(
1620                 [in] DWORD dwFlags);
1621 }
1622
1623
1624 /*****************************************************************************
1625  * IResolveShellLink interface
1626  */
1627 [
1628     object,
1629     uuid(5cd52983-9449-11d2-963a-00c04f79adf0),
1630     pointer_default(unique)
1631 ]
1632 interface IResolveShellLink : IUnknown
1633 {
1634     HRESULT ResolveShellLink(
1635                 [in] IUnknown *punk,
1636                 [in] HWND hwnd,
1637                 [in] DWORD fFlags);
1638 }
1639
1640
1641 /*****************************************************************************
1642  * IURLSearchHook interface
1643  */
1644 [
1645     object,
1646     uuid(ac60f6a0-0fd9-11d0-99cb-00c04fd64497),
1647     pointer_default(unique),
1648     local
1649 ]
1650 interface IURLSearchHook : IUnknown
1651 {
1652     HRESULT Translate(
1653                 [in, out] LPWSTR lpwszSearchURL,
1654                 [in] DWORD cchBufferSize);
1655 }
1656
1657
1658 /*****************************************************************************
1659  * ISearchContext interface
1660  */
1661 [
1662     object,
1663     uuid(09f656a2-41af-480c-88f7-16cc0d164615),
1664     pointer_default(unique),
1665     local
1666 ]
1667 interface ISearchContext : IUnknown
1668 {
1669     HRESULT GetSearchUrl(
1670                 [in] BSTR *pbstrSearchUrl);
1671     HRESULT GetSearchText(
1672                 [in] BSTR *pbstrSearchText);
1673     HRESULT GetSearchStyle(
1674                 [in] BSTR *pdwSearchStyle);
1675 }
1676
1677
1678 /*****************************************************************************
1679  * IURLSearchHook2 interface
1680  */
1681 [
1682     object,
1683     uuid(5ee44da4-6d32-46e3-86bc-07540dedd0e0),
1684     pointer_default(unique),
1685     local
1686 ]
1687 interface IURLSearchHook2 : IURLSearchHook
1688 {
1689     HRESULT TranslateWithSearchContext(
1690                 [in, out] LPWSTR lpwszSearchURL,
1691                 [in] DWORD cchBufferSize,
1692                 [in] ISearchContext *pSearchContext);
1693 }
1694
1695
1696 cpp_quote("#define INewShortcutHook WINELIB_NAME_AW(INewShortcutHook)")
1697
1698 /*****************************************************************************
1699  * INewShortcutHookA interface
1700  */
1701 [
1702     object,
1703     uuid(000214e1-0000-0000-c000-000000000046),
1704     pointer_default(unique),
1705     local
1706 ]
1707 interface INewShortcutHookA : IUnknown
1708 {
1709     HRESULT SetReferent(
1710                 [in] LPCSTR pcszReferent,
1711                 [in] HWND hwnd);
1712     HRESULT GetReferent(
1713                 [out] LPSTR pcszReferent,
1714                 [in] int cchReferent);
1715     HRESULT SetFolder(
1716                 [in] LPCSTR pcszReferent);
1717     HRESULT GetFolder(
1718                 [out] LPSTR pcszReferent,
1719                 [in] int cchFolder);
1720     HRESULT GetName(
1721                 [out] LPSTR pszName,
1722                 [in] int cchName);
1723     HRESULT GetExtension(
1724                 [out] LPSTR pszExtension,
1725                 [in] int cchExtension);
1726
1727
1728
1729 /*****************************************************************************
1730  * INewShortcutHookW interface
1731  */
1732 [
1733     object,
1734     uuid(000214f7-0000-0000-c000-000000000046),
1735     pointer_default(unique),
1736     local
1737 ]
1738 interface INewShortcutHookW : IUnknown
1739 {
1740     HRESULT SetReferent(
1741                 [in] LPCWSTR pcszReferent,
1742                 [in] HWND hwnd);
1743     HRESULT GetReferent(
1744                 [out] LPWSTR pcszReferent,
1745                 [in] int cchReferent);
1746     HRESULT SetFolder(
1747                 [in] LPCWSTR pcszReferent);
1748     HRESULT GetFolder(
1749                 [out] LPWSTR pcszReferent,
1750                 [in] int cchFolder);
1751     HRESULT GetName(
1752                 [out] LPWSTR pszName,
1753                 [in] int cchName);
1754     HRESULT GetExtension(
1755                 [out] LPWSTR pszExtension,
1756                 [in] int cchExtension);
1757
1758
1759 /*****************************************************************************
1760  * IRunnableTask interface
1761  */
1762 [
1763     object,
1764     uuid(85788d00-6807-11d0-b810-00c04fd706ec),
1765     pointer_default(unique),
1766     local
1767 ]
1768 interface IRunnableTask : IUnknown
1769 {
1770     HRESULT Run();
1771     HRESULT Kill([in] BOOL fWait);
1772     HRESULT Suspend();
1773     HRESULT Resume();
1774     ULONG IsRunning();
1775 }
1776
1777 /*****************************************************************************
1778  * IShellChangeNotify interface
1779  */
1780 [
1781     object,
1782     uuid(d82be2b1-5764-11d0-a96e-00c04fd705a2),
1783     pointer_default(unique),
1784     local
1785 ]
1786 interface IShellChangeNotify : IUnknown
1787 {
1788     HRESULT OnChange(
1789                 [in] LONG lEvent,
1790                 [in] LPCITEMIDLIST pidl1,
1791                 [in] LPCITEMIDLIST pidl2);
1792 }
1793
1794 /*****************************************************************************
1795  * IFileSystemBindData interface
1796  */
1797 [
1798     object,
1799     uuid(01e18d10-4d8b-11d2-855d-006008059367),
1800     pointer_default(unique),
1801     local
1802 ]
1803 interface IFileSystemBindData : IUnknown
1804 {
1805     HRESULT SetFindData(
1806                 [in] const WIN32_FIND_DATAW *pfd);
1807     HRESULT GetFindData(
1808                 [out] WIN32_FIND_DATAW *pfd);
1809 }
1810
1811 /*****************************************************************************
1812  *    ITaskbarList interface
1813  */
1814 [
1815     object,
1816     uuid(56FDF342-FD6D-11d0-958A-006097C9A090),
1817     pointer_default(unique)
1818 ]
1819 interface ITaskbarList : IUnknown
1820 {
1821     HRESULT HrInit();
1822
1823     HRESULT AddTab(
1824         [in] HWND hwnd);
1825
1826     HRESULT DeleteTab(
1827         [in] HWND hwnd);
1828
1829     HRESULT ActivateTab(
1830         [in] HWND hwnd);
1831
1832     HRESULT SetActiveAlt(
1833         [in] HWND hwnd);
1834 }
1835
1836 cpp_quote("EXTERN_C const CLSID CLSID_TaskbarList;")
1837
1838 /*****************************************************************************
1839  *    IAutoCompleteDropDown interface
1840  */
1841 [
1842     object,
1843     uuid(3CD141F4-3C6A-11d2-BCAA-00C04FD929DB),
1844     pointer_default(unique)
1845 ]
1846 interface IAutoCompleteDropDown : IUnknown
1847 {
1848 cpp_quote("#define ACDD_VISIBLE   0x0001")
1849
1850     HRESULT GetDropDownStatus(
1851         [out] DWORD *pdwFlags,
1852         [out, string] LPWSTR *ppwszString);
1853
1854     HRESULT ResetEnumerator();
1855 }
1856
1857 [
1858     object,
1859     uuid(cb728b20-f786-11ce-92ad-00aa00a74cd0),
1860     pointer_default(unique)
1861 ]
1862 interface IProfferService : IUnknown
1863 {
1864     HRESULT ProfferService(
1865         [in] REFGUID service,
1866         [in] IServiceProvider *pService,
1867         [out] DWORD *pCookie);
1868
1869     HRESULT RevokeService([in] DWORD cookie);
1870 }
1871
1872 /*****************************************************************************
1873  * IExplorerBrowserEvents interface
1874  */
1875 [
1876  object,
1877  uuid(361BBDC7-E6EE-4E13-BE58-58E2240C810F)
1878 ]
1879 interface IExplorerBrowserEvents : IUnknown
1880 {
1881     HRESULT OnNavigationPending(
1882         [in] PCIDLIST_ABSOLUTE pidlFolder);
1883
1884     HRESULT OnViewCreated(
1885         [in] IShellView *psv);
1886
1887     HRESULT OnNavigationComplete(
1888         [in] PCIDLIST_ABSOLUTE pidlFolder);
1889
1890     HRESULT OnNavigationFailed(
1891         [in] PCIDLIST_ABSOLUTE pidlFolder);
1892 }
1893
1894 typedef GUID EXPLORERPANE;
1895 typedef EXPLORERPANE *REFEXPLORERPANE;
1896
1897 cpp_quote("#define SID_ExplorerPaneVisibility IID_IExplorerPaneVisibility")
1898
1899 /*****************************************************************************
1900  * IExplorerPaneVisibility interface
1901  */
1902 [
1903  object,
1904  uuid(E07010EC-BC17-44C0-97B0-46C7C95B9EDC)
1905 ]
1906 interface IExplorerPaneVisibility : IUnknown
1907 {
1908     typedef enum tagEXPLORERPANESTATE {
1909         EPS_DONTCARE     = 0x0,
1910         EPS_DEFAULT_ON   = 0x1,
1911         EPS_DEFAULT_OFF  = 0x2,
1912         EPS_STATE_MASK   = 0xffff,
1913         EPS_INITIALSTATE = 0x10000,
1914         EPS_FORCE        = 0x20000
1915     } EXPLORERPANESTATE;
1916
1917     HRESULT GetPaneState(
1918         [in] REFEXPLORERPANE ep,
1919         [out] EXPLORERPANESTATE *peps);
1920 }
1921
1922 typedef [v1_enum] enum tagEXPLORER_BROWSER_FILL_FLAGS {
1923     EBF_NONE                     = 0,
1924     EBF_SELECTFROMDATAOBJECT     = 0x100,
1925     EBF_NODROPTARGET             = 0x200
1926 } EXPLORER_BROWSER_FILL_FLAGS;
1927
1928 typedef [v1_enum] enum tagEXPLORER_BROWSER_OPTIONS {
1929     EBO_NONE               = 0x00,
1930     EBO_NAVIGATEONCE       = 0x01,
1931     EBO_SHOWFRAMES         = 0x02,
1932     EBO_ALWAYSNAVIGATE     = 0x04,
1933     EBO_NOTRAVELLOG        = 0x08,
1934     EBO_NOWRAPPERWINDOW    = 0x10,
1935     EBO_HTMLSHAREPOINTVIEW = 0x20
1936 } EXPLORER_BROWSER_OPTIONS;
1937
1938 cpp_quote("#define SID_SExplorerBrowserFrame IID_ICommDlgBrowser")
1939
1940 /*****************************************************************************
1941  * IExplorerBrowser interface
1942  */
1943 [
1944  object,
1945  uuid(DFD3B6B5-C10C-4BE9-85F6-A66969F402F6),
1946  pointer_default(unique)
1947 ]
1948 interface IExplorerBrowser : IUnknown
1949 {
1950
1951     [local] HRESULT Initialize(
1952         [in] HWND hwndParent,
1953         [in] const RECT *prc,
1954         [in, unique] const FOLDERSETTINGS *pfs);
1955
1956     HRESULT Destroy();
1957
1958     [local] HRESULT SetRect(
1959         [in,out,unique] HDWP *phdwp,
1960         [in] RECT rcBrowser);
1961
1962     HRESULT SetPropertyBag(
1963         [in, string] LPCWSTR pszPropertyBag);
1964
1965     HRESULT SetEmptyText(
1966         [in, string] LPCWSTR pszEmptyText);
1967
1968     HRESULT SetFolderSettings(
1969         [in] const FOLDERSETTINGS *pfs);
1970
1971     HRESULT Advise(
1972         [in] IExplorerBrowserEvents *psbe,
1973         [out] DWORD *pdwCookie);
1974
1975     HRESULT Unadvise(
1976         [in] DWORD dwCookie);
1977
1978     HRESULT SetOptions(
1979         [in] EXPLORER_BROWSER_OPTIONS dwFlag);
1980
1981     HRESULT GetOptions(
1982         [out] EXPLORER_BROWSER_OPTIONS *pdwFlag);
1983
1984     HRESULT BrowseToIDList(
1985         [in] PCUIDLIST_RELATIVE pidl,
1986         [in] UINT uFlags);
1987
1988     HRESULT BrowseToObject(
1989         [in] IUnknown *punk,
1990         [in] UINT uFlags);
1991
1992     HRESULT FillFromObject(
1993         [in] IUnknown *punk,
1994         [in] EXPLORER_BROWSER_FILL_FLAGS dwFlags);
1995
1996     HRESULT RemoveAll();
1997
1998     HRESULT GetCurrentView(
1999         [in] REFIID riid,
2000         [out, iid_is(riid)] void **ppv);
2001 }
2002
2003 /*****************************************************************************
2004  * INameSpaceTreeControl interface
2005  */
2006 [
2007  object,
2008  uuid(028212A3-B627-47E9-8856-C14265554E4F)
2009 ]
2010 interface INameSpaceTreeControl : IUnknown
2011 {
2012     [v1_enum] enum _NSTCSTYLE {
2013         NSTCS_HASEXPANDOS                 = 0x00000001,
2014         NSTCS_HASLINES                    = 0x00000002,
2015         NSTCS_SINGLECLICKEXPAND           = 0x00000004,
2016         NSTCS_FULLROWSELECT               = 0x00000008,
2017         NSTCS_SPRINGEXPAND                = 0x00000010,
2018         NSTCS_HORIZONTALSCROLL            = 0x00000020,
2019         NSTCS_ROOTHASEXPANDO              = 0x00000040,
2020         NSTCS_SHOWSELECTIONALWAYS         = 0x00000080,
2021         NSTCS_NOINFOTIP                   = 0x00000200,
2022         NSTCS_EVENHEIGHT                  = 0x00000400,
2023         NSTCS_NOREPLACEOPEN               = 0x00000800,
2024         NSTCS_DISABLEDRAGDROP             = 0x00001000,
2025         NSTCS_NOORDERSTREAM               = 0x00002000,
2026         NSTCS_RICHTOOLTIP                 = 0x00004000,
2027         NSTCS_BORDER                      = 0x00008000,
2028         NSTCS_NOEDITLABELS                = 0x00010000,
2029         NSTCS_TABSTOP                     = 0x00020000,
2030         NSTCS_FAVORITESMODE               = 0x00080000,
2031         NSTCS_AUTOHSCROLL                 = 0x00100000,
2032         NSTCS_FADEINOUTEXPANDOS           = 0x00200000,
2033         NSTCS_EMPTYTEXT                   = 0x00400000,
2034         NSTCS_CHECKBOXES                  = 0x00800000,
2035         NSTCS_PARTIALCHECKBOXES           = 0x01000000,
2036         NSTCS_EXCLUSIONCHECKBOXES         = 0x02000000,
2037         NSTCS_DIMMEDCHECKBOXES            = 0x04000000,
2038         NSTCS_NOINDENTCHECKS              = 0x08000000,
2039         NSTCS_ALLOWJUNCTIONS              = 0x10000000,
2040         NSTCS_SHOWTABSBUTTON              = 0x20000000,
2041         NSTCS_SHOWDELETEBUTTON            = 0x40000000,
2042         NSTCS_SHOWREFRESHBUTTON      = (int)0x80000000
2043     };
2044     typedef DWORD NSTCSTYLE;
2045
2046     [v1_enum] enum _NSTCROOTSTYLE {
2047         NSTCRS_VISIBLE                    = 0x0000,
2048         NSTCRS_HIDDEN                     = 0x0001,
2049         NSTCRS_EXPANDED                   = 0x0002
2050     };
2051     typedef DWORD NSTCROOTSTYLE;
2052
2053     [v1_enum] enum _NSTCITEMSTATE {
2054         NSTCIS_NONE                       = 0x0000,
2055         NSTCIS_SELECTED                   = 0x0001,
2056         NSTCIS_EXPANDED                   = 0x0002,
2057         NSTCIS_BOLD                       = 0x0004,
2058         NSTCIS_DISABLED                   = 0x0008,
2059         NSTCIS_SELECTEDNOEXPAND           = 0x0010
2060     };
2061     typedef DWORD NSTCITEMSTATE;
2062
2063     typedef [v1_enum] enum NSTCGNI {
2064         NSTCGNI_NEXT                      = 0,
2065         NSTCGNI_NEXTVISIBLE               = 1,
2066         NSTCGNI_PREV                      = 2,
2067         NSTCGNI_PREVVISIBLE               = 3,
2068         NSTCGNI_PARENT                    = 4,
2069         NSTCGNI_CHILD                     = 5,
2070         NSTCGNI_FIRSTVISIBLE              = 6,
2071         NSTCGNI_LASTVISIBLE               = 7
2072     } NSTCGNI;
2073
2074     HRESULT Initialize(
2075         [in] HWND hwndParent,
2076         [in, unique] RECT *prc,
2077         [in] NSTCSTYLE nstcsFlags);
2078
2079     HRESULT TreeAdvise(
2080         [in] IUnknown *punk,
2081         [out] DWORD *pdwCookie);
2082
2083     HRESULT TreeUnadvise(
2084         [in] DWORD dwCookie);
2085
2086     HRESULT AppendRoot(
2087         [in] IShellItem *psiRoot,
2088         [in] SHCONTF grfEnumFlags,
2089         [in] NSTCROOTSTYLE grfRootStyle,
2090         [in, unique] IShellItemFilter *pif);
2091
2092     HRESULT InsertRoot(
2093         [in] int iIndex,
2094         [in] IShellItem *psiRoot,
2095         [in] SHCONTF grfEnumFlags,
2096         [in] NSTCROOTSTYLE grfRootStyle,
2097         [in, unique] IShellItemFilter *pif);
2098
2099     HRESULT RemoveRoot(
2100         [in] IShellItem *psiRoot);
2101
2102     HRESULT RemoveAllRoots();
2103
2104     HRESULT GetRootItems(
2105         [out] IShellItemArray **ppsiaRootItems);
2106
2107     HRESULT SetItemState(
2108         [in] IShellItem *psi,
2109         [in] NSTCITEMSTATE nstcisMask,
2110         [in] NSTCITEMSTATE nstcisFlags);
2111
2112     HRESULT GetItemState(
2113         [in] IShellItem *psi,
2114         [in] NSTCITEMSTATE nstcismask,
2115         [out] NSTCITEMSTATE *pnstcisFlags);
2116
2117     HRESULT GetSelectedItems(
2118         [out] IShellItemArray **psiaItems);
2119
2120     HRESULT GetItemCustomState(
2121         [in] IShellItem *psi,
2122         [out] int *piStateNumber);
2123
2124     HRESULT SetItemCustomState(
2125         [in] IShellItem *psi,
2126         [in] int iStateNumber);
2127
2128     HRESULT EnsureItemVisible(
2129         [in] IShellItem *psi);
2130
2131     HRESULT SetTheme(
2132         [in, string] LPCWSTR pszTheme);
2133
2134     HRESULT GetNextItem(
2135         [in, unique] IShellItem *psi,
2136         [in] NSTCGNI nstcgi,
2137         [out] IShellItem **ppsiNext);
2138
2139     HRESULT HitTest(
2140         [in] POINT *ppt,
2141         [out] IShellItem **ppsiOut);
2142
2143     HRESULT GetItemRect(
2144         [in] IShellItem *psi,
2145         [out] RECT *prect);
2146
2147     HRESULT CollapseAll();
2148 }
2149
2150 /*****************************************************************************
2151  * INameSpaceTreeControl2 interface
2152  */
2153 [
2154  object,
2155  uuid(7CC7AED8-290E-49BC-8945-C1401CC9306C)
2156 ]
2157 interface INameSpaceTreeControl2 : INameSpaceTreeControl
2158 {
2159     typedef [v1_enum] enum NSTCSTYLE2 {
2160         NSTCS2_DEFAULT                     = 0x00,
2161         NSTCS2_INTERRUPTNOTIFICATIONS      = 0x01,
2162         NSTCS2_SHOWNULLSPACEMENU           = 0x02,
2163         NSTCS2_DISPLAYPADDING              = 0x04,
2164         NSTCS2_DISPLAYPINNEDONLY           = 0x08,
2165         NTSCS2_NOSINGLETONAUTOEXPAND       = 0x10,  /* The apparent typo here is   */
2166         NTSCS2_NEVERINSERTNONENUMERATED    = 0x20   /* present also in the Win SDK */
2167     } NSTCSTYLE2;
2168     cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(NSTCSTYLE2)")
2169
2170     HRESULT SetControlStyle(
2171         [in] NSTCSTYLE nstcsMask,
2172         [in] NSTCSTYLE nstcsStyle);
2173
2174     HRESULT GetControlStyle(
2175         [in] NSTCSTYLE nstcsMask,
2176         [out] NSTCSTYLE *pnstcsStyle);
2177
2178     HRESULT SetControlStyle2(
2179         [in] NSTCSTYLE2 nstcsMask,
2180         [in] NSTCSTYLE2 nstcsStyle);
2181
2182     HRESULT GetControlStyle2(
2183         [in] NSTCSTYLE2 nstcsMask,
2184         [out] NSTCSTYLE2 *pnstcsStyle);
2185 }
2186
2187 /*****************************************************************************
2188  * INameSpaceTreeControlEvents interface
2189  */
2190
2191 [
2192  object,
2193  uuid(93D77985-B3D8-4484-8318-672CDDA002CE),
2194  local
2195 ]
2196 interface INameSpaceTreeControlEvents : IUnknown
2197 {
2198     [v1_enum] enum _NSTCEHITTEST {
2199         NSTCEHT_NOWHERE                    = 0x0001,
2200         NSTCEHT_ONITEMICON                 = 0x0002,
2201         NSTCEHT_ONITEMLABEL                = 0x0004,
2202         NSTCEHT_ONITEMIDENT                = 0x0008,
2203         NSTCEHT_ONITEMBUTTON               = 0x0010,
2204         NSTCEHT_ONITEMRIGHT                = 0x0020,
2205         NSTCEHT_ONITEMSTATEICON            = 0x0040,
2206         NSTCEHT_ONITEM                     = 0x0046,
2207         NSTCEHT_ONITEMTABBUTTON            = 0x1000
2208     };
2209     typedef DWORD NSTCEHITTEST;
2210
2211     [v1_enum] enum _NSTCECLICKTYPE {
2212         NSTCECT_LBUTTON                    = 0x1,
2213         NSTCECT_MBUTTON                    = 0x2,
2214         NSTCECT_RBUTTON                    = 0x3,
2215         NSTCECT_BUTTON                     = 0x3,
2216         NSTCECT_DBLCLICK                   = 0x4
2217     };
2218     typedef DWORD NSTCECLICKTYPE;
2219
2220     HRESULT OnItemClick(
2221         [in] IShellItem *psi,
2222         [in] NSTCEHITTEST nstceHitTest,
2223         [in] NSTCECLICKTYPE nstceClickType);
2224
2225     HRESULT OnPropertyItemCommit(
2226         [in] IShellItem *psi);
2227
2228     HRESULT OnItemStateChanging(
2229         [in] IShellItem *psi,
2230         [in] NSTCITEMSTATE nstcisMask,
2231         [in] NSTCITEMSTATE nstcisState);
2232
2233     HRESULT OnItemStateChanged(
2234         [in] IShellItem *psi,
2235         [in] NSTCITEMSTATE nstcisMask,
2236         [in] NSTCITEMSTATE nstcisState);
2237
2238     HRESULT OnSelectionChanged(
2239         [in] IShellItemArray *psiaSelection);
2240
2241     HRESULT OnKeyboardInput(
2242         [in] UINT uMsg,
2243         [in] WPARAM wParam,
2244         [in] LPARAM lParam);
2245
2246     HRESULT OnBeforeExpand(
2247         [in] IShellItem *psi);
2248
2249     HRESULT OnAfterExpand(
2250         [in] IShellItem *psi);
2251
2252     HRESULT OnBeginLabelEdit(
2253         [in] IShellItem *psi);
2254
2255     HRESULT OnEndLabelEdit(
2256         [in] IShellItem *psi);
2257
2258     HRESULT OnGetToolTip(
2259         [in] IShellItem *psi,
2260         [out, string, size_is(cchTip)] LPWSTR pszTip,
2261         [in] int cchTip);
2262
2263     HRESULT OnBeforeItemDelete(
2264         [in] IShellItem *psi);
2265
2266     HRESULT OnItemAdded(
2267         [in] IShellItem *psi,
2268         [in] BOOL fIsRoot);
2269
2270     HRESULT OnItemDeleted(
2271         [in] IShellItem *psi,
2272         [in] BOOL fIsRoot);
2273
2274     HRESULT OnBeforeContextMenu(
2275         [in, unique] IShellItem *psi,
2276         [in] REFIID riid,
2277         [out, iid_is(riid)] void **ppv);
2278
2279     HRESULT OnAfterContextMenu(
2280         [in] IShellItem *psi,
2281         [in] IContextMenu *pcmIn,
2282         [in] REFIID riid,
2283         [out, iid_is(riid)] void **ppv);
2284
2285     HRESULT OnBeforeStateImageChange(
2286         [in] IShellItem *psi);
2287
2288     HRESULT OnGetDefaultIconIndex(
2289         [in] IShellItem *psi,
2290         [out] int *piDefaultIcon,
2291         [out] int *piOpenIcon);
2292 }
2293
2294 cpp_quote("#ifdef MIDL_PASS")
2295 typedef IUnknown *HIMAGELIST;
2296 cpp_quote("#endif")
2297
2298 /*****************************************************************************
2299  * INameSpaceTreeControlCustomDraw interface
2300  */
2301 [
2302  object,
2303  uuid(2D3BA758-33EE-42D5-BB7B-5F3431D86C78),
2304  local
2305 ]
2306
2307 interface INameSpaceTreeControlCustomDraw : IUnknown
2308 {
2309     typedef struct NSTCCUSTOMDRAW
2310     {
2311         IShellItem *psi;
2312         UINT uItemState;
2313         NSTCITEMSTATE nstcis;
2314         LPCWSTR pszText;
2315         int iImage;
2316         HIMAGELIST himl;
2317         int iLevel;
2318         int iIndent;
2319     } NSTCCUSTOMDRAW;
2320
2321     HRESULT PrePaint(
2322         [in] HDC hdc,
2323         [in] RECT *prc,
2324         [out] LRESULT *plres);
2325
2326     HRESULT PostPaint(
2327         [in] HDC hdc,
2328         [in] RECT *prc);
2329
2330     HRESULT ItemPrePaint(
2331         [in] HDC hdc,
2332         [in] RECT *prc,
2333         [in, out] COLORREF *pclrText,
2334         [in, out] COLORREF *pclrTextBk,
2335         [out] LRESULT *plres);
2336
2337     HRESULT ItemPostPaint(
2338         [in] HDC hdc,
2339         [in] RECT *prc,
2340         [in] NSTCCUSTOMDRAW *pnstccdItem);
2341 }
2342
2343 /*****************************************************************************
2344  * INameSpaceTreeControlDropHandler interface
2345  */
2346 [
2347  object,
2348  uuid(F9C665D6-C2F2-4C19-BF33-8322D7352F51),
2349  local
2350 ]
2351 interface INameSpaceTreeControlDropHandler : IUnknown
2352 {
2353     HRESULT OnDragEnter(
2354         [in, unique] IShellItem *psiOver,
2355         [in] IShellItemArray *psiaData,
2356         [in] BOOL fOutsideSource,
2357         [in] DWORD grfKeyState,
2358         [in, out] DWORD *pdwEffect);
2359
2360     HRESULT OnDragOver(
2361         [in, unique] IShellItem *psiOver,
2362         [in] IShellItemArray *psiaData,
2363         [in] DWORD grfKeyState,
2364         [in, out] DWORD *pdwEffect);
2365
2366     HRESULT OnDragPosition(
2367         [in, unique] IShellItem *psiOver,
2368         [in] IShellItemArray *psiaData,
2369         [in] int iNewPosition,
2370         [in] int iOldPosition);
2371
2372     HRESULT OnDrop(
2373         [in, unique] IShellItem *psiOver,
2374         [in] IShellItemArray *psiaData,
2375         [in] int iPosition,
2376         [in] DWORD grfKeyState,
2377         [in, out] DWORD *pdwEffect);
2378
2379     HRESULT OnDropPosition(
2380         [in, unique] IShellItem *psiOver,
2381         [in] IShellItemArray *psiaData,
2382         [in] int iNewPosition,
2383         [in] int iOldPosition);
2384
2385     HRESULT OnDragLeave(
2386         [in, unique] IShellItem *psiOver);
2387 }
2388 cpp_quote("#define NSTCDHPOS_ONTOP -1")
2389
2390 interface IFileDialog;
2391
2392 typedef [v1_enum] enum FDE_OVERWRITE_RESPONSE
2393 {
2394     FDEOR_DEFAULT  = 0,
2395     FDEOR_ACCCEP   = 1,
2396     FDEOR_REFUSE   = 2
2397 } FDE_OVERWRITE_RESPONSE;
2398
2399 typedef [v1_enum] enum FDE_SHAREVIOLATION_RESPONSE
2400 {
2401     FDESVR_DEFAULT = 0,
2402     FDESVR_ACCEPT  = 1,
2403     FDESVR_REFUSE  = 2
2404 } FDE_SHAREVIOLATION_RESPONSE;
2405
2406 /*****************************************************************************
2407  * IFileDialogEvents interface
2408  */
2409 [
2410  object,
2411  uuid(973510DB-7D7F-452B-8975-74A85828D354),
2412  pointer_default(unique)
2413 ]
2414 interface IFileDialogEvents : IUnknown
2415 {
2416     HRESULT OnFileOk(
2417         [in] IFileDialog *pfd);
2418
2419     HRESULT OnFolderChanging(
2420         [in] IFileDialog *pfd,
2421         [in] IShellItem *psiFolder);
2422
2423     HRESULT OnFolderChange(
2424         [in] IFileDialog *pfd);
2425
2426     HRESULT OnSelectionChange(
2427         [in] IFileDialog *pfd);
2428
2429     HRESULT OnShareViolation(
2430         [in] IFileDialog *pfd,
2431         [in] IShellItem *psi,
2432         [out] FDE_SHAREVIOLATION_RESPONSE *pResponse);
2433
2434     HRESULT OnTypeChange(
2435         [in] IFileDialog *pfd);
2436
2437     HRESULT OnOverwrite(
2438         [in] IFileDialog *pfd,
2439         [in] IShellItem *psi,
2440         [out] FDE_OVERWRITE_RESPONSE *pResponse);
2441 }
2442
2443 /*****************************************************************************
2444  * IModalWindow interface
2445  */
2446 [
2447  object,
2448  uuid(B4DB1657-70D7-485E-8E3E-6FCB5A5C1802),
2449  pointer_default(unique)
2450 ]
2451 interface IModalWindow : IUnknown
2452 {
2453     [local]
2454     HRESULT Show(
2455         [in, unique, annotation("__in_opt")] HWND hwndOwner);
2456
2457     [call_as(Show)]
2458     HRESULT RemoteShow(
2459         [in, unique] HWND hwndOwner);
2460 }
2461
2462 typedef [v1_enum] enum FDAP
2463 {
2464     FDAP_BOTTOM    = 0,
2465     FDAP_TOP       = 1
2466 } FDAP;
2467
2468 /*****************************************************************************
2469  * IFileDialog interface
2470  */
2471 [
2472  object,
2473  uuid(42F85136-DB7E-439C-85F1-E4075D135FC8),
2474  pointer_default(unique)
2475 ]
2476 interface IFileDialog : IModalWindow
2477 {
2478     [v1_enum] enum _FILEOPENDIALOGOPTIONS
2479     {
2480         FOS_OVERWRITEPROMPT     = 0x00000002,
2481         FOS_STRICTFILETYPES     = 0x00000004,
2482         FOS_NOCHANGEDIR         = 0x00000008,
2483         FOS_PICKFOLDERS         = 0x00000020,
2484         FOS_FORCEFILESYSTEM     = 0x00000040,
2485         FOS_ALLNONSTORAGEITEMS  = 0x00000080,
2486         FOS_NOVALIDATE          = 0x00000100,
2487         FOS_ALLOWMULTISELECT    = 0x00000200,
2488         FOS_PATHMUSTEXIST       = 0x00000800,
2489         FOS_FILEMUSTEXIST       = 0x00001000,
2490         FOS_CREATEPROMPT        = 0x00002000,
2491         FOS_SHAREAWARE          = 0x00004000,
2492         FOS_NOREADONLYRETURN    = 0x00008000,
2493         FOS_NOTESTFILECREATE    = 0x00010000,
2494         FOS_HIDEMRUPLACES       = 0x00020000,
2495         FOS_HIDEPINNEDPLACES    = 0x00040000,
2496         FOS_NODEREFERENCELINKS  = 0x00100000,
2497         FOS_DONTADDTORECENT     = 0x02000000,
2498         FOS_FORCESHOWHIDDEN     = 0x10000000,
2499         FOS_DEFAULTNOMINIMODE   = 0x20000000,
2500         FOS_FORCEPREVIEWPANEON  = 0x40000000
2501     };
2502     typedef DWORD FILEOPENDIALOGOPTIONS;
2503
2504     HRESULT SetFileTypes(
2505         [in] UINT cFileTypes,
2506         [in, size_is(cFileTypes)] const COMDLG_FILTERSPEC *rgFilterSpec);
2507
2508     HRESULT SetFileTypeIndex(
2509         [in] UINT iFileType);
2510
2511     HRESULT GetFileTypeIndex(
2512         [out] UINT *piFileType);
2513
2514     HRESULT Advise(
2515         [in] IFileDialogEvents *pfde,
2516         [out] DWORD *pdwCookie);
2517
2518     HRESULT Unadvise(
2519         [in] DWORD dwCookie);
2520
2521     HRESULT SetOptions(
2522         [in] FILEOPENDIALOGOPTIONS fos);
2523
2524     HRESULT GetOptions(
2525         [in] FILEOPENDIALOGOPTIONS *pfos);
2526
2527     HRESULT SetDefaultFolder(
2528         [in] IShellItem *psi);
2529
2530     HRESULT SetFolder(
2531         [in] IShellItem *psi);
2532
2533     HRESULT GetFolder(
2534         [out] IShellItem **ppsi);
2535
2536     HRESULT GetCurrentSelection(
2537         [out] IShellItem **ppsi);
2538
2539     HRESULT SetFileName(
2540         [in, string] LPCWSTR pszName);
2541
2542     HRESULT GetFileName(
2543         [out, string] LPWSTR *pszName);
2544
2545     HRESULT SetTitle(
2546         [in, string] LPCWSTR pszTitle);
2547
2548     HRESULT SetOkButtonLabel(
2549         [in, string] LPCWSTR pszText);
2550
2551     HRESULT SetFileNameLabel(
2552         [in, string] LPCWSTR pszLabel);
2553
2554     HRESULT GetResult(
2555         [out] IShellItem **ppsi);
2556
2557     HRESULT AddPlace(
2558         [in] IShellItem *psi,
2559         [in] FDAP fdap);
2560
2561     HRESULT SetDefaultExtension(
2562         [in, string] LPCWSTR pszDefaultExtension);
2563
2564     HRESULT Close(
2565         [in] HRESULT hr);
2566
2567     HRESULT SetClientGuid(
2568         [in] REFGUID guid);
2569
2570     HRESULT ClearClientData();
2571
2572     HRESULT SetFilter(
2573         [in] IShellItemFilter *pFilter);
2574 }
2575
2576 /*****************************************************************************
2577  * IFileDialog2 interface
2578  */
2579 [
2580  object,
2581  uuid(61744FC7-85B5-4791-A9B0-272276309B13),
2582  pointer_default(unique)
2583 ]
2584 interface IFileDialog2 : IFileDialog
2585 {
2586     HRESULT SetCancelButtonLabel(
2587         [in] LPCWSTR pszLabel);
2588
2589     HRESULT SetNavigationRoot(
2590         [in] IShellItem *psi);
2591 }
2592
2593 /*****************************************************************************
2594  * IFileOperationProgressSink interface
2595  */
2596 [
2597  object,
2598  uuid(04B0F1A7-9490-44BC-96E1-4296A31252E2),
2599  pointer_default(unique)
2600 ]
2601 interface IFileOperationProgressSink : IUnknown
2602 {
2603     HRESULT StartOperations();
2604
2605     HRESULT FinishOperations(
2606         [in] HRESULT hrResult);
2607
2608     HRESULT PreRenameItem(
2609         [in] DWORD dwFlags,
2610         [in] IShellItem *psiItem,
2611         [in, unique, string] LPCWSTR pszNewName);
2612
2613     HRESULT PostRenameItem(
2614         [in] DWORD dwFlags,
2615         [in] IShellItem *psiItem,
2616         [in, string] LPCWSTR pszNewName,
2617         [in] HRESULT hrRename,
2618         [in] IShellItem *psiNewlyCreated);
2619
2620     HRESULT PreMoveItem(
2621         [in] DWORD dwFlags,
2622         [in] IShellItem *psiItem,
2623         [in] IShellItem *psiDestinationFolder,
2624         [in, unique, string] LPCWSTR pszNewName);
2625
2626     HRESULT PostMoveItem(
2627         [in] DWORD dwFlags,
2628         [in] IShellItem *psiItem,
2629         [in] IShellItem *psiDestinationFolder,
2630         [in, unique, string] LPCWSTR pszNewName,
2631         [in] HRESULT hrMove,
2632         [in] IShellItem *psiNewlyCreated);
2633
2634     HRESULT PreCopyItem(
2635         [in] DWORD dwFlags,
2636         [in] IShellItem *psiItem,
2637         [in] IShellItem *psiDestinationFolder,
2638         [in, unique, string] LPCWSTR pszNewName);
2639
2640     HRESULT PostCopyItem(
2641         [in] DWORD dwFlags,
2642         [in] IShellItem *psiItem,
2643         [in] IShellItem *psiDestinationFolder,
2644         [in, unique, string] LPCWSTR pszNewName,
2645         [in] HRESULT hrCopy,
2646         [in] IShellItem *psiNewlyCreated);
2647
2648     HRESULT PreDeleteItem(
2649         [in] DWORD dwFlags,
2650         [in] IShellItem *psiItem);
2651
2652     HRESULT PostDeleteItem(
2653         [in] DWORD dwFlags,
2654         [in] IShellItem *psiItem,
2655         [in] HRESULT hrDelete,
2656         [in] IShellItem *psiNewlyCreated);
2657
2658     HRESULT PreNewItem(
2659         [in] DWORD dwFlags,
2660         [in] IShellItem *psiDestinationFolder,
2661         [in, unique, string] LPCWSTR pszNewName);
2662
2663     HRESULT PostNewItem(
2664         [in] DWORD dwFlags,
2665         [in] IShellItem *psiDestinationFolder,
2666         [in, unique, string] LPCWSTR pszNewName,
2667         [in, unique, string] LPCWSTR pszTemplateName,
2668         [in] DWORD dwFileAttributes,
2669         [in] HRESULT hrNew,
2670         [in] IShellItem *psiNewItem);
2671
2672     HRESULT UpdateProgress(
2673         [in] UINT iWorkTotal,
2674         [in] UINT iWorkSoFar);
2675
2676     HRESULT ResetTimer();
2677
2678     HRESULT PauseTimer();
2679
2680     HRESULT ResumeTimer();
2681 }
2682
2683 /*****************************************************************************
2684  * IFileSaveDialog interface
2685  */
2686 [
2687  object,
2688  uuid(84BCCD23-5FDE-4CDB-AEA4-AF64B83D78AB),
2689  pointer_default(unique)
2690 ]
2691 interface IFileSaveDialog : IFileDialog
2692 {
2693     HRESULT SetSaveAsItem(
2694         [in] IShellItem *psi);
2695
2696     HRESULT SetProperties(
2697         [in] IPropertyStore *pStore);
2698
2699     HRESULT SetCollectedProperties(
2700         [in] IPropertyDescriptionList *pList,
2701         [in] BOOL fAppendDefault);
2702
2703     HRESULT GetProperties(
2704         [in] IPropertyStore **ppStore);
2705
2706     HRESULT ApplyProperties(
2707         [in] IShellItem *psi,
2708         [in] IPropertyStore *pStore,
2709         [in, unique] HWND hwnd,
2710         [in, unique] IFileOperationProgressSink *pSink);
2711 }
2712
2713
2714 /*****************************************************************************
2715  * IFileOpenDialog interface
2716  */
2717 [
2718  object,
2719  uuid(D57C7288-D4AD-4768-BE02-9D969532D960),
2720  pointer_default(unique)
2721 ]
2722 interface IFileOpenDialog : IFileDialog
2723 {
2724     HRESULT GetResults(
2725         [out] IShellItemArray **ppenum);
2726
2727     HRESULT GetSelectedItems(
2728         [out] IShellItemArray **ppsai);
2729 }
2730
2731 typedef [v1_enum] enum CDCONTROLSTATEF
2732 {
2733     CDCS_INACTIVE       = 0x0,
2734     CDCS_ENABLED        = 0x1,
2735     CDCS_VISIBLE        = 0x2,
2736     CDCS_ENABLEDVISIBLE = 0x3
2737 } CDCONTROLSTATEF;
2738 cpp_quote("DEFINE_ENUM_FLAG_OPERATORS(CDCONTROLSTATEF)")
2739 /*****************************************************************************
2740  * IFileDialogCustomize interface
2741  */
2742 [
2743  object,
2744  uuid(E6FDD21A-163F-4975-9C8C-A69F1BA37034),
2745  pointer_default(unique)
2746 ]
2747 interface IFileDialogCustomize : IUnknown
2748 {
2749     HRESULT EnableOpenDropDown(
2750         [in] DWORD dwIDCtl);
2751
2752     HRESULT AddMenu(
2753         [in] DWORD dwIDCtl,
2754         [in, string] LPCWSTR pszLabel);
2755
2756     HRESULT AddPushButton(
2757         [in] DWORD dwIDCtl,
2758         [in, string] LPCWSTR pszLabel);
2759
2760     HRESULT AddComboBox(
2761         [in] DWORD dwIDCtl);
2762
2763     HRESULT AddRadioButtonList(
2764         [in] DWORD dwIDCtl);
2765
2766     HRESULT AddCheckButton(
2767         [in] DWORD dwIDCtl,
2768         [in, string] LPCWSTR pszLabel,
2769         [in] BOOL bChecked);
2770
2771     HRESULT AddEditBox(
2772         [in] DWORD dwIDCtl,
2773         [in, string] LPCWSTR pszText);
2774
2775     HRESULT AddSeparator(
2776         [in] DWORD dwIDCtl);
2777
2778     HRESULT AddText(
2779         [in] DWORD dwIDCtl,
2780         [in, string] LPCWSTR pszText);
2781
2782     HRESULT SetControlLabel(
2783         [in] DWORD dwIDCtl,
2784         [in, string] LPCWSTR pszLabel);
2785
2786     HRESULT GetControlState(
2787         [in] DWORD dwIDCtl,
2788         [out] CDCONTROLSTATEF *pdwState);
2789
2790     HRESULT SetControlState(
2791         [in] DWORD dwIDCtl,
2792         [in] CDCONTROLSTATEF dwState);
2793
2794     HRESULT GetEditBoxText(
2795         [in] DWORD dwIDCtl,
2796         [out, string] WCHAR **ppszText);
2797
2798     HRESULT SetEditBoxText(
2799         [in] DWORD dwIDCtl,
2800         [in, string] LPCWSTR pszText);
2801
2802     HRESULT GetCheckButtonState(
2803         [in] DWORD dwIDCtl,
2804         [out] BOOL *pbChecked);
2805
2806     HRESULT SetCheckButtonState(
2807         [in] DWORD dwIDCtl,
2808         [in] BOOL bChecked);
2809
2810     HRESULT AddControlItem(
2811         [in] DWORD dwIDCtl,
2812         [in] DWORD dwIDItem,
2813         [in] LPCWSTR pszLabel);
2814
2815     HRESULT RemoveControlItem(
2816         [in] DWORD dwIDCtl,
2817         [in] DWORD dwIDItem);
2818
2819     HRESULT RemoveAllControlItems(
2820         [in] DWORD dwIDCtl);
2821
2822     HRESULT GetControlItemState(
2823         [in] DWORD dwIDCtl,
2824         [in] DWORD dwIDItem,
2825         [out] CDCONTROLSTATEF *pdwState);
2826
2827     HRESULT SetControlItemState(
2828         [in] DWORD dwIDCtl,
2829         [in] DWORD dwIDItem,
2830         [in] CDCONTROLSTATEF dwState);
2831
2832     HRESULT GetSelectedControlItem(
2833         [in] DWORD dwIDCtl,
2834         [out] DWORD *pdwIDItem);
2835
2836     HRESULT SetSelectedControlItem(
2837         [in] DWORD dwIDCtl,
2838         [in] DWORD dwIDItem);
2839
2840     HRESULT StartVisualGroup(
2841         [in] DWORD dwIDCtl,
2842         [in, string] LPCWSTR pszLabel);
2843
2844     HRESULT EndVisualGroup();
2845
2846     HRESULT MakeProminent(
2847         [in] DWORD dwIDCtl);
2848
2849     HRESULT SetControlItemText(
2850         [in] DWORD dwIDCtl,
2851         [in] DWORD dwIDItem,
2852         [in, string] LPCWSTR pszLabel);
2853 }
2854
2855 /*****************************************************************************
2856  * IFileDialogControlEvents interface
2857  */
2858 [
2859  object,
2860  uuid(36116642-D713-4B97-9B83-7484A9D00433),
2861  pointer_default(unique)
2862 ]
2863 interface IFileDialogControlEvents : IUnknown
2864 {
2865     HRESULT OnItemSelected(
2866         [in] IFileDialogCustomize *pfdc,
2867         [in] DWORD dwIDCtl,
2868         [in] DWORD dwIDItem);
2869
2870     HRESULT OnButtonClicked(
2871         [in] IFileDialogCustomize *pfdc,
2872         [in] DWORD dwIDCtl);
2873
2874     HRESULT OnCheckButtonToggled(
2875         [in] IFileDialogCustomize *pfdc,
2876         [in] BOOL dwIDCtl,
2877         [in] BOOL bChecked);
2878
2879     HRESULT OnControlActivating(
2880         [in] IFileDialogCustomize *pfdc,
2881         [in] DWORD dwIDCtl);
2882 }
2883
2884 typedef [v1_enum] enum tagKF_CATEGORY
2885 {
2886     KF_CATEGORY_VIRTUAL = 0x00000001,
2887     KF_CATEGORY_FIXED   = 0x00000002,
2888     KF_CATEGORY_COMMON  = 0x00000003,
2889     KF_CATEGORY_PERUSER = 0x00000004
2890 } KF_CATEGORY;
2891
2892 typedef [v1_enum] enum tagKF_REDIRECTION_CAPABILITIES
2893 {
2894     KF_REDIRECTION_CAPABILITIES_ALLOW_ALL               = 0x000000ff,
2895     KF_REDIRECTION_CAPABILITIES_REDIRECTABLE            = 0x00000001,
2896     KF_REDIRECTION_CAPABILITIES_DENY_ALL                = 0x000fff00,
2897     KF_REDIRECTION_CAPABILITIES_DENY_POLICY_REDIRECTED  = 0x00000100,
2898     KF_REDIRECTION_CAPABILITIES_DENY_POLICY             = 0x00000200,
2899     KF_REDIRECTION_CAPABILITIES_DENY_PERMISSIONS        = 0x00000400
2900 } KF_REDIRECTION_CAPABILITIES;
2901
2902 typedef [v1_enum] enum tagKF_DEFINITION_FLAGS
2903 {
2904     KFDF_LOCAL_REDIRECT_ONLY    = 0x00000002,
2905     KFDF_ROAMABLE               = 0x00000004,
2906     KFDF_PRECREATE              = 0x00000008
2907 } KF_DEFINITION_FLAGS;
2908
2909 typedef struct tagKNOWNFOLDER_DEFINITION
2910 {
2911     KF_CATEGORY         category;
2912     LPWSTR              pszName;
2913     LPWSTR              pszDescription;
2914     KNOWNFOLDERID       fidParent;
2915     LPWSTR              pszRelativePath;
2916     LPWSTR              pszParsingName;
2917     LPWSTR              pszTooltip;
2918     LPWSTR              pszLocalizedName;
2919     LPWSTR              pszIcon;
2920     LPWSTR              pszSecurity;
2921     DWORD               dwAttributes;
2922     KF_DEFINITION_FLAGS kfdFlags;
2923     FOLDERTYPEID        ftidType;
2924 } KNOWNFOLDER_DEFINITION;
2925
2926 [
2927  object,
2928  uuid(3aa7af7e-9b36-420C-a8e3-f77d4674a488),
2929  pointer_default(ref)
2930 ]
2931 interface IKnownFolder : IUnknown
2932 {
2933     HRESULT GetId(
2934         [out] KNOWNFOLDERID *pkfid);
2935
2936     HRESULT GetCategory(
2937         [out] KF_CATEGORY *pCategory);
2938
2939     HRESULT GetShellItem(
2940         [in] DWORD dwFlags,
2941         [in] REFIID riid,
2942         [out, iid_is(riid)] void **ppv);
2943
2944     HRESULT GetPath(
2945         [in] DWORD dwFlags,
2946         [out, string] LPWSTR *ppszPath);
2947
2948     HRESULT SetPath(
2949         [in] DWORD dwFlags,
2950         [in, string] LPCWSTR pszPath);
2951
2952     HRESULT GetIDList(
2953         [in] DWORD dwFlags,
2954         [out] PIDLIST_ABSOLUTE *ppidl);
2955
2956     HRESULT GetFolderType(
2957         [out] FOLDERTYPEID *pftid);
2958
2959     HRESULT GetRedirectionCapabilities(
2960         [out] KF_REDIRECTION_CAPABILITIES *pCapabilities);
2961
2962     HRESULT GetFolderDefinition(
2963         [out] KNOWNFOLDER_DEFINITION *pKFD);
2964 }
2965
2966 typedef [v1_enum] enum tagKF_REDIRECT_FLAGS
2967 {
2968     KF_REDIRECT_USER_EXCLUSIVE      = 0x00000001,
2969     KF_REDIRECT_COPY_SOURCE_DACL    = 0x00000002,
2970     KF_REDIRECT_OWNER_USER          = 0x00000004,
2971     KF_REDIRECT_SET_OWNER_EXPLICIT  = 0x00000008,
2972     KF_REDIRECT_CHECK_ONLY          = 0x00000010,
2973     KF_REDIRECT_WITH_UI             = 0x00000020,
2974     KF_REDIRECT_UNPIN               = 0x00000040,
2975     KF_REDIRECT_PIN                 = 0x00000080,
2976     KF_REDIRECT_COPY_CONTENTS       = 0x00000200,
2977     KF_REDIRECT_DEL_SOURCE_CONTENTS = 0x00000400,
2978     KF_REDIRECT_EXCLUDE_ALL_KNOWN_SUBFOLDERS = 0x00000800
2979 } KF_REDIRECT_FLAGS;
2980
2981 [
2982     object,
2983     uuid(8BE2D872-86AA-4d47-B776-32CCA40C7018),
2984     pointer_default(ref)
2985 ]
2986 interface IKnownFolderManager : IUnknown
2987 {
2988     typedef [v1_enum] enum tagFFFP_MODE
2989     {
2990         FFFP_EXACTMATCH,
2991         FFFP_NEARESTPARENTMATCH
2992     } FFFP_MODE;
2993
2994     HRESULT FolderIdFromCsidl(
2995         [in] int nCsidl,
2996         [out] KNOWNFOLDERID *pfid);
2997
2998     HRESULT FolderIdToCsidl(
2999         [in] REFKNOWNFOLDERID rfid,
3000         [out] int *pnCsidl);
3001
3002     HRESULT GetFolderIds(
3003         [out, size_is(, *pCount)] KNOWNFOLDERID **ppKFId,
3004         [in, out] UINT *pCount);
3005
3006     HRESULT GetFolder(
3007         [in] REFKNOWNFOLDERID rfid,
3008         [out] IKnownFolder **ppkf);
3009
3010     HRESULT GetFolderByName(
3011         [in, string] LPCWSTR pszCanonicalName,
3012         [out] IKnownFolder **ppkf);
3013
3014     HRESULT RegisterFolder(
3015         [in] REFKNOWNFOLDERID rfid,
3016         [in] KNOWNFOLDER_DEFINITION const *pKFD);
3017
3018     HRESULT UnregisterFolder(
3019         [in] REFKNOWNFOLDERID rfid);
3020
3021     HRESULT FindFolderFromPath(
3022         [in, string] LPCWSTR pszPath,
3023         [in] FFFP_MODE mode,
3024         [out] IKnownFolder **ppkf);
3025
3026     HRESULT FindFolderFromIDList(
3027         [in] PCIDLIST_ABSOLUTE pidl,
3028         [out] IKnownFolder **ppkf);
3029
3030     HRESULT Redirect(
3031         [in] REFKNOWNFOLDERID rfid,
3032         [in, unique] HWND hwnd,
3033         [in] KF_REDIRECT_FLAGS flags,
3034         [in, unique, string] LPCWSTR pszTargetPath,
3035         [in] UINT cFolders,
3036         [in, size_is(cFolders), unique] KNOWNFOLDERID const *pExclusion,
3037         [out, string] LPWSTR *ppszError);
3038 }
3039
3040 /*****************************************************************************
3041  * ShellObjects typelibrary
3042  */
3043 [
3044  uuid(50A7E9B1-70EF-11D1-B75A-00A0C90564FE),
3045  lcid(0x0000),
3046  version(1.0)
3047 ]
3048 library ShellObjects
3049 {
3050     [
3051         uuid(71F96385-DDD6-48D3-A0C1-AE06E8B055FB)
3052     ]
3053     coclass ExplorerBrowser
3054     {
3055         interface IExplorerBrowser;
3056     }
3057
3058     [
3059         uuid(DC1C5A9C-E88A-4DDE-A5A1-60F82A20AEF7)
3060     ]
3061     coclass FileOpenDialog
3062     {
3063         interface IFileOpenDialog;
3064     }
3065
3066     [
3067         uuid(C0B4E2F3-BA21-4773-8DBA-335EC946EB8B)
3068     ]
3069     coclass FileSaveDialog
3070     {
3071         interface IFileSaveDialog;
3072     }
3073
3074     [
3075         uuid(AE054212-3535-4430-83ED-D501AA6680E6)
3076     ]
3077     coclass NamespaceTreeControl
3078     {
3079         interface INameSpaceTreeControl2;
3080     }
3081
3082     [
3083         uuid(4df0c730-df9d-4ae3-9153-aa6b82e9795a)
3084     ]
3085     coclass KnownFolderManager
3086     {
3087         interface IKnownFolderManager;
3088     }
3089 }