Prevent memory leak and superfluous status notifications.
[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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 import "objidl.idl";
23 import "oleidl.idl";
24 import "oaidl.idl";
25 import "shtypes.idl";
26 import "servprov.idl";
27 import "comcat.idl";
28 /*import "propidl.idl";*/
29 /*import "prsht.idl";*/
30 /*import "msxml.idl";*/
31
32
33 /*****************************************************************************
34  * IPersistFolder interface
35  */
36 [
37     object,
38     uuid(000214ea-0000-0000-c000-000000000046),
39     pointer_default(unique)
40 ]
41 interface IPersistFolder : IPersist
42 {
43     typedef IPersistFolder *LPPERSISTFOLDER;
44
45     HRESULT Initialize( [in] LPCITEMIDLIST pidl );
46 }
47
48
49 /*****************************************************************************
50  * IPersistFolder2 interface
51  */
52 [
53     object,
54     uuid(1ac3d9f0-175c-11d1-95be-00609797ea4f),
55     pointer_default(unique)
56 ]
57 interface IPersistFolder2 : IPersistFolder
58 {
59     typedef IPersistFolder2 *LPPERSISTFOLDER2;
60
61     HRESULT GetCurFolder( [out] LPITEMIDLIST *ppidl );
62 }
63
64
65 /*****************************************************************************
66  * IEnumIDList interface
67  */
68 [
69     object,
70     uuid(000214f2-0000-0000-c000-000000000046),
71     pointer_default(unique)
72 ]
73 interface IEnumIDList : IUnknown
74 {
75     typedef IEnumIDList *LPENUMIDLIST;
76
77     HRESULT Next(
78         [in] ULONG celt,
79         [out, size_is(celt), length_is(*pceltFetched)] LPITEMIDLIST *rgelt,
80         [out] ULONG *pceltFetched);
81
82     HRESULT Skip( [in] ULONG celt );
83     HRESULT Reset();
84     HRESULT Clone( [out] IEnumIDList **ppenum );
85 }
86
87
88 /*****************************************************************************
89  * IShellFolder interface
90  */
91 [
92     object,
93     uuid(000214e6-0000-0000-c000-000000000046),
94     pointer_default(unique)
95 ]
96 interface IShellFolder : IUnknown
97 {
98     typedef IShellFolder * LPSHELLFOLDER;
99
100     typedef enum tagSHGDN
101     {
102         SHGDN_NORMAL = 0,
103         SHGDN_INFOLDER = 1,
104         SHGDN_FOREDITING = 0x1000,
105         SHGDN_INCLUDE_NONFILESYS = 0x2000,
106         SHGDN_FORADDRESSBAR = 0x4000,
107         SHGDN_FORPARSING = 0x8000
108     } SHGNO;
109
110     typedef DWORD SHGDNF;
111
112     enum tagSHCONTF
113     {
114         SHCONTF_FOLDERS = 32,
115         SHCONTF_NONFOLDERS = 64,
116         SHCONTF_INCLUDEHIDDEN = 128,
117         SHCONTF_INIT_ON_FIRST_NEXT = 256,
118         SHCONTF_NETPRINTERSRCH = 512,
119         SHCONTF_SHAREABLE = 1024,
120         SHCONTF_STORAGE = 2048
121     };
122
123     typedef DWORD SHCONTF;
124
125     cpp_quote("#define SFGAO_CANCOPY           DROPEFFECT_COPY")
126     cpp_quote("#define SFGAO_CANMOVE           DROPEFFECT_MOVE")
127     cpp_quote("#define SFGAO_CANLINK           DROPEFFECT_LINK")
128     cpp_quote("#define SFGAO_CANRENAME         0x00000010L")
129     cpp_quote("#define SFGAO_CANDELETE         0x00000020L")
130     cpp_quote("#define SFGAO_HASPROPSHEET      0x00000040L")
131     cpp_quote("#define SFGAO_DROPTARGET        0x00000100L")
132     cpp_quote("#define SFGAO_CAPABILITYMASK    0x00000177L")
133     cpp_quote("#define SFGAO_LINK              0x00010000L")
134     cpp_quote("#define SFGAO_SHARE             0x00020000L")
135     cpp_quote("#define SFGAO_READONLY          0x00040000L")
136     cpp_quote("#define SFGAO_GHOSTED           0x00080000L")
137     cpp_quote("#define SFGAO_HIDDEN            0x00080000L")
138     cpp_quote("#define SFGAO_DISPLAYATTRMASK   0x000F0000L")
139     cpp_quote("#define SFGAO_FILESYSANCESTOR   0x10000000L")
140     cpp_quote("#define SFGAO_FOLDER            0x20000000L")
141     cpp_quote("#define SFGAO_FILESYSTEM        0x40000000L")
142     cpp_quote("#define SFGAO_HASSUBFOLDER      0x80000000L")
143     cpp_quote("#define SFGAO_CONTENTSMASK      0x80000000L")
144     cpp_quote("#define SFGAO_VALIDATE          0x01000000L")
145     cpp_quote("#define SFGAO_REMOVABLE         0x02000000L")
146     cpp_quote("#define SFGAO_COMPRESSED        0x04000000L")
147     cpp_quote("#define SFGAO_BROWSABLE         0x08000000L")
148     cpp_quote("#define SFGAO_NONENUMERATED     0x00100000L")
149     cpp_quote("#define SFGAO_NEWCONTENT        0x00200000L")
150
151     typedef ULONG SFGAOF;
152
153     HRESULT ParseDisplayName(
154         [in] HWND hwndOwner,
155         [in] LPBC pbcReserved,
156         [in, string] LPOLESTR lpszDisplayName,
157         [out] ULONG *pchEaten,
158         [out] LPITEMIDLIST *ppidl,
159         [in, out, unique] ULONG *pdwAttributes);
160
161     HRESULT EnumObjects(
162         [in] HWND hwndOwner,
163         [in] SHCONTF grfFlags,
164         [out] IEnumIDList **ppenumIDList);
165
166     HRESULT BindToObject(
167         [in] LPCITEMIDLIST pidl,
168         [in] LPBC pbcReserved,
169         [in] REFIID riid,
170         [out, iid_is(riid)] void **ppvOut);
171
172     HRESULT BindToStorage(
173         [in] LPCITEMIDLIST pidl,
174         [in] LPBC pbcReserved,
175         [in] REFIID riid,
176         [out, iid_is(riid)] void **ppvObj);
177
178     HRESULT CompareIDs(
179         [in] LPARAM lParam,
180         [in] LPCITEMIDLIST pidl1,
181         [in] LPCITEMIDLIST pidl2);
182
183     HRESULT CreateViewObject(
184         [in] HWND hwndOwner,
185         [in] REFIID riid,
186         [out, iid_is(riid)] void **ppvOut);
187
188     HRESULT GetAttributesOf(
189         [in] UINT cidl,
190         [in, size_is(cidl)] LPCITEMIDLIST *apidl,
191         [in, out] SFGAOF *rgfInOut);
192
193     HRESULT GetUIObjectOf(
194         [in] HWND hwndOwner,
195         [in] UINT cidl,
196         [in, size_is(cidl)] LPCITEMIDLIST *apidl,
197         [in] REFIID riid,
198         [in, out, unique] UINT *prgfInOut,
199         [out, iid_is(riid)] void **ppvOut);
200
201     HRESULT GetDisplayNameOf(
202         [in] LPCITEMIDLIST pidl,
203         [in] SHGDNF uFlags,
204         [out] STRRET *lpName);
205
206     HRESULT SetNameOf(
207         [in] HWND hwnd,
208         [in] LPCITEMIDLIST pidl,
209         [in, string] LPCOLESTR lpszName,
210         [in] SHGDNF uFlags,
211         [out] LPITEMIDLIST *ppidlOut);
212 }
213
214
215 /*****************************************************************************
216  * IEnumExtraSearch interface
217  */
218 [
219     object,
220     uuid(0e700be1-9db6-11d1-a1ce-00c04fd75d13),
221     pointer_default(unique)
222 ]
223 interface IEnumExtraSearch : IUnknown
224 {
225     typedef IEnumExtraSearch *LPENUMEXTRASEARCH;
226
227     typedef struct
228     {
229         GUID guidSearch;
230         WCHAR wszFriendlyName[80];
231         /*
232          *WCHAR wszMenuText[80];
233          *WCHAR wszHelpText[MAX_PATH];
234          */
235         WCHAR wszUrl[2084];
236         /*
237          *WCHAR wszIcon[MAX_PATH+10];
238          *WCHAR wszGreyIcon[MAX_PATH+10];
239          *WCHAR wszClrIcon[MAX_PATH+10];
240          */
241     } EXTRASEARCH, *LPEXTRASEARCH;
242
243     HRESULT Next(
244         [in] ULONG celt,
245         [out, size_is(celt), length_is(*pceltFetched)] EXTRASEARCH *rgelt,
246         [out] ULONG *pceltFetched);
247
248     HRESULT Skip( [in] ULONG celt );
249     HRESULT Reset();
250     HRESULT Clone( [out] IEnumExtraSearch **ppenum );
251 }
252
253
254 /*****************************************************************************
255  * IShellFolder2 interface
256  */
257 [
258     object,
259     uuid(93f2f68c-1d1b-11d3-a30e-00c04f79abd1),
260     pointer_default(unique)
261 ]
262 interface IShellFolder2 : IShellFolder
263 {
264     typedef enum
265     {
266         SHCOLSTATE_TYPE_STR = 0x00000001,
267         SHCOLSTATE_TYPE_INT = 0x00000002,
268         SHCOLSTATE_TYPE_DATE = 0x00000003,
269         SHCOLSTATE_TYPEMASK = 0x0000000f,
270         SHCOLSTATE_ONBYDEFAULT = 0x00000010,
271         SHCOLSTATE_SLOW = 0x00000020,
272         SHCOLSTATE_EXTENDED = 0x00000040,
273         SHCOLSTATE_SECONDARYUI = 0x00000080,
274         SHCOLSTATE_HIDDEN = 0x00000100,
275         SHCOLSTATE_PREFER_VARCMP = 0x00000200
276     } SHCOLSTATE;
277
278     typedef DWORD SHCOLSTATEF;
279
280     typedef struct
281     {
282         GUID    fmtid;
283         DWORD   pid;
284     } SHCOLUMNID, *LPSHCOLUMNID;
285     typedef const SHCOLUMNID *LPCSHCOLUMNID;
286
287     HRESULT GetDefaultSearchGUID( [out] GUID *lpguid );
288     HRESULT EnumSearches( [out] IEnumExtraSearch **ppenum );
289     HRESULT GetDefaultColumn( [in] DWORD dwReserved, [out] ULONG *pSort, [out] ULONG *pDisplay );
290     HRESULT GetDefaultColumnState( [in] UINT iColumn, [out] SHCOLSTATEF *pcsFlags );
291     HRESULT GetDetailsEx( [in] LPCITEMIDLIST pidl, [in] const SHCOLUMNID *pscid, [out] VARIANT *pv);
292     HRESULT GetDetailsOf( [in] LPCITEMIDLIST pidl, [in] UINT iColumn, [out] SHELLDETAILS *psd);
293     HRESULT MapColumnToSCID( [in] UINT iColumn, [in] SHCOLUMNID *pscid );
294 }
295
296
297
298 /*****************************************************************************
299  * FOLDERSETTINGS
300  */
301 typedef char *LPVIEWSETTINGS;
302
303 typedef enum
304 {
305     FWF_AUTOARRANGE         = 0x00000001,
306     FWF_ABBREVIATEDNAMES    = 0x00000002,
307     FWF_SNAPTOGRID          = 0x00000004,
308     FWF_OWNERDATA           = 0x00000008,
309     FWF_BESTFITWINDOW       = 0x00000010,
310     FWF_DESKTOP             = 0x00000020,
311     FWF_SINGLESEL           = 0x00000040,
312     FWF_NOSUBFOLDERS        = 0x00000080,
313     FWF_TRANSPARENT         = 0x00000100,
314     FWF_NOCLIENTEDGE        = 0x00000200,
315     FWF_NOSCROLL            = 0x00000400,
316     FWF_ALIGNLEFT           = 0x00000800,
317     FWF_NOICONS             = 0x00001000,
318     FWF_SHOWSELALWAYS       = 0x00002000,
319     FWF_NOVISIBLE           = 0x00004000,
320     FWF_SINGLECLICKACTIVATE = 0x00008000,
321     FWF_NOWEBVIEW           = 0x00010000,
322     FWF_HIDEFILENAMES       = 0x00020000,
323     FWF_CHECKSELECT         = 0x00040000
324 } FOLDERFLAGS;
325
326 typedef enum
327 {
328     FVM_ICON       = 1,
329     FVM_FIRST      = FVM_ICON,
330     FVM_SMALLICON  = 2,
331     FVM_LIST       = 3,
332     FVM_DETAILS    = 4,
333     FVM_THUMBNAIL  = 5,
334     FVM_TILE       = 6,
335     FVM_THUMBSTRIP = 7,
336     FVM_LAST       = FVM_THUMBSTRIP
337 } FOLDERVIEWMODE;
338
339 typedef struct
340 {
341     UINT ViewMode;
342     UINT fFlags;
343 } FOLDERSETTINGS, *PFOLDERSETTINGS, *LPFOLDERSETTINGS;
344 typedef const FOLDERSETTINGS *LPCFOLDERSETTINGS;
345
346
347 /*****************************************************************************
348  * IShellView interface
349  */
350 interface IShellBrowser;  /* forward declaration */
351 [
352     object,
353     uuid(000214e3-0000-0000-c000-000000000046),
354     pointer_default(unique)
355 ]
356 interface IShellView : IOleWindow
357 {
358     typedef IShellView *LPSHELLVIEW;
359
360     cpp_quote("#define SVSI_DESELECT       0x00000000")
361     cpp_quote("#define SVSI_SELECT         0x00000001")
362     cpp_quote("#define SVSI_EDIT           0x00000003")
363     cpp_quote("#define SVSI_DESELECTOTHERS 0x00000004")
364     cpp_quote("#define SVSI_ENSUREVISIBLE  0x00000008")
365     cpp_quote("#define SVSI_FOCUSED        0x00000010")
366     cpp_quote("#define SVSI_TRANSLATEPT    0x00000020")
367     cpp_quote("#define SVSI_SELECTIONMARK  0x00000040")
368     cpp_quote("#define SVSI_POSITIONITEM   0x00000080")
369     cpp_quote("#define SVSI_CHECK          0x00000100")
370     cpp_quote("#define SVSI_NOSTATECHANGE  0x80000000")
371
372     typedef UINT SVSIF;
373
374     typedef enum
375     {
376         SVGIO_BACKGROUND     = 0x00000000,
377         SVGIO_SELECTION      = 0x00000001,
378         SVGIO_ALLVIEW        = 0x00000002,
379         SVGIO_CHECKED        = 0x00000003,
380         SVGIO_TYPE_MASK      = 0x0000000f,
381         SVGIO_FLAG_VIEWORDER = 0x80000000,
382     } SVGIO;
383
384     typedef enum
385     {
386         SVUIA_DEACTIVATE       = 0,
387         SVUIA_ACTIVATE_NOFOCUS = 1,
388         SVUIA_ACTIVATE_FOCUS   = 2,
389         SVUIA_INPLACEACTIVATE  = 3
390     } SVUIA_STATUS;
391
392 cpp_quote("#if 0")
393     typedef LPARAM LPFNSVADDPROPSHEETPAGE;
394 cpp_quote("#else")
395 cpp_quote("#include <prsht.h>")
396 cpp_quote("typedef LPFNADDPROPSHEETPAGE LPFNSVADDPROPSHEETPAGE;")
397 cpp_quote("#endif")
398
399     HRESULT TranslateAccelerator( [in] MSG *pmsg );
400     HRESULT EnableModeless( [in] BOOL fEnable );
401     HRESULT UIActivate( [in] UINT uState );
402     HRESULT Refresh();
403     HRESULT CreateViewWindow(
404         [in] IShellView *psvPrevious,
405         [in] LPCFOLDERSETTINGS lpfs,
406         [in] IShellBrowser *psb,
407         [out] RECT *prcView,
408         [out] HWND *phWnd);
409
410     HRESULT DestroyViewWindow();
411     HRESULT GetCurrentInfo( [out] LPFOLDERSETTINGS lpfs );
412
413     [local] HRESULT AddPropertySheetPages(
414         [in] DWORD dwReserved,
415         [in] LPFNSVADDPROPSHEETPAGE pfn,
416         [in] LPARAM lparam);
417
418     HRESULT SaveViewState();
419     HRESULT SelectItem(
420         [in] LPCITEMIDLIST pidlItem,
421         [in] SVSIF uFlags);
422     HRESULT GetItemObject(
423         [in] UINT uItem,
424         [in] REFIID riid,
425         [out, iid_is(riid)] void **ppv);
426 }
427
428
429 /*****************************************************************************
430  * IShellBrowser interface
431  */
432 [
433     object,
434     uuid(000214e2-0000-0000-c000-000000000046),
435     pointer_default(unique)
436 ]
437 interface IShellBrowser : IOleWindow
438 {
439     typedef IShellBrowser *LPSHELLBROWSER;
440
441 cpp_quote("#define SBSP_DEFBROWSER            0x00000000")
442 cpp_quote("#define SBSP_SAMEBROWSER           0x00000001")
443 cpp_quote("#define SBSP_NEWBROWSER            0x00000002")
444 cpp_quote("#define SBSP_DEFMODE               0x00000000")
445 cpp_quote("#define SBSP_OPENMODE              0x00000010")
446 cpp_quote("#define SBSP_EXPLOREMODE           0x00000020")
447 cpp_quote("#define SBSP_HELPMODE              0x00000040")
448 cpp_quote("#define SBSP_NOTRANSFERHIST        0x00000080")
449 cpp_quote("#define SBSP_ABSOLUTE              0x00000000")
450 cpp_quote("#define SBSP_RELATIVE              0x00001000")
451 cpp_quote("#define SBSP_PARENT                0x00002000")
452 cpp_quote("#define SBSP_NAVIGATEBACK          0x00004000")
453 cpp_quote("#define SBSP_NAVIGATEFORWARD       0x00008000")
454 cpp_quote("#define SBSP_ALLOW_AUTONAVIGATE    0x00010000")
455 cpp_quote("#define SBSP_NOAUTOSELECT          0x04000000")
456 cpp_quote("#define SBSP_WRITENOHISTORY        0x08000000")
457 cpp_quote("#define SBSP_REDIRECT              0x40000000")
458 cpp_quote("#define SBSP_INITIATEDBYHLINKFRAME 0x80000000")
459
460 cpp_quote("#define FCW_STATUS      0x0001")
461 cpp_quote("#define FCW_TOOLBAR     0x0002")
462 cpp_quote("#define FCW_TREE        0x0003")
463 cpp_quote("#define FCW_INTERNETBAR 0x0006")
464 cpp_quote("#define FCW_PROGRESS    0x0008")
465
466 cpp_quote("#define FCT_MERGE       0x0001")
467 cpp_quote("#define FCT_CONFIGABLE  0x0002")
468 cpp_quote("#define FCT_ADDTOEND    0x0004")
469
470 cpp_quote("#if 0")
471     typedef LPARAM LPTBBUTTONSB;
472 cpp_quote("#else")
473 cpp_quote("#include <commctrl.h>")
474 cpp_quote("typedef LPTBBUTTON LPTBBUTTONSB;")
475 cpp_quote("#endif")
476
477     HRESULT InsertMenusSB(
478         [in] HMENU hmenuShared,
479         [in, out] LPOLEMENUGROUPWIDTHS lpMenuWidths);
480
481     HRESULT SetMenuSB(
482         [in] HMENU hmenuShared,
483         [in] HOLEMENU holemenuReserved,
484         [in] HWND hwndActiveObject);
485
486     HRESULT RemoveMenusSB( [in] HMENU hmenuShared );
487     HRESULT SetStatusTextSB( [in, unique] LPCOLESTR pszStatusText );
488     HRESULT EnableModelessSB( [in] BOOL fEnable );
489     HRESULT TranslateAcceleratorSB( [in] MSG *pmsg, [in] WORD wID );
490
491     HRESULT BrowseObject(
492         [in] LPCITEMIDLIST pidl,
493         [in] UINT wFlags);
494
495     HRESULT GetViewStateStream(
496         [in] DWORD grfMode,
497         [out] IStream **ppStrm);
498
499     HRESULT GetControlWindow(
500         [in] UINT id,
501         [out] HWND *phwnd);
502
503     [local] HRESULT SendControlMsg(
504         [in] UINT id,
505         [in] UINT uMsg,
506         [in] WPARAM wParam,
507         [in] LPARAM lParam,
508         [in] LRESULT *pret);
509
510     HRESULT QueryActiveShellView( [out] IShellView **ppshv );
511     HRESULT OnViewWindowActive( [in] IShellView *pshv );
512
513     [local]
514     HRESULT SetToolbarItems(
515         [in] LPTBBUTTONSB lpButtons,
516         [in] UINT nButtons,
517         [in] UINT uFlags);
518 }
519
520
521 /*****************************************************************************
522  * IShellLinkA interface
523  */
524 [
525     object,
526     uuid(000214ee-0000-0000-c000-000000000046),
527     pointer_default(unique)
528 ]
529 interface IShellLinkA : IUnknown
530 {
531     typedef enum
532     {
533         SLR_NO_UI               = 0x0001,
534         SLR_ANY_MATCH           = 0x0002,
535         SLR_UPDATE              = 0x0004,
536         SLR_NOUPDATE            = 0x0008,
537         SLR_NOSEARCH            = 0x0010,
538         SLR_NOTRACK             = 0x0020,
539         SLR_NOLINKINFO          = 0x0040,
540         SLR_INVOKE_MSI          = 0x0080,
541         SLR_NO_UI_WITH_MSG_PUMP = 0x0101,
542     } SLR_FLAGS;
543
544     typedef enum
545     {
546         SLGP_SHORTPATH   = 0x0001,
547         SLGP_UNCPRIORITY = 0x0002,
548         SLGP_RAWPATH     = 0x0004,
549     } SLGP_FLAGS;
550
551     HRESULT GetPath(
552         [out, size_is(cch)] LPSTR pszFile,
553         [in] int cch,
554         [in, out] WIN32_FIND_DATAA *pfd,
555         [in] DWORD fFlags);
556
557     HRESULT GetIDList( [out] LPITEMIDLIST * ppidl );
558
559     HRESULT SetIDList( [in] LPCITEMIDLIST pidl );
560
561     HRESULT GetDescription(
562         [out, size_is(cch)] LPSTR pszName,
563         [in] int cch);
564
565     HRESULT SetDescription( [in] LPCSTR pszName );
566
567     HRESULT GetWorkingDirectory(
568         [out, size_is(cch)] LPSTR pszDir,
569         [in] int cch);
570
571     HRESULT SetWorkingDirectory( [in] LPCSTR pszDir );
572
573     HRESULT GetArguments(
574         [out, size_is(cch)] LPSTR pszArgs,
575         [in] int cch);
576
577     HRESULT SetArguments( [in] LPCSTR pszArgs );
578
579     HRESULT GetHotkey( [out] WORD *pwHotkey );
580
581     HRESULT SetHotkey( [in] WORD wHotkey );
582
583     HRESULT GetShowCmd( [out] int *piShowCmd );
584
585     HRESULT SetShowCmd( [in] int iShowCmd );
586
587     HRESULT GetIconLocation(
588         [out, size_is(cch)] LPSTR pszIconPath,
589         [in] int cch,
590         [out] int *piIcon);
591
592     HRESULT SetIconLocation(
593         [in] LPCSTR pszIconPath,
594         [in] int iIcon);
595
596     HRESULT SetRelativePath(
597         [in] LPCSTR pszPathRel,
598         [in] DWORD dwReserved);
599
600     HRESULT Resolve(
601         [in] HWND hwnd,
602         [in] DWORD fFlags);
603
604     HRESULT SetPath( [in] LPCSTR pszFile );
605 }
606
607
608 /*****************************************************************************
609  * IShellLinkW interface
610  */
611 [
612     object,
613     uuid(000214f9-0000-0000-c000-000000000046),
614     pointer_default(unique)
615 ]
616 interface IShellLinkW : IUnknown
617 {
618     HRESULT GetPath(
619         [out, size_is(cch)] LPWSTR pszFile,
620         [in] int cch,
621         [in, out] WIN32_FIND_DATAW *pfd,
622         [in] DWORD fFlags);
623
624     HRESULT GetIDList( [out] LPITEMIDLIST * ppidl );
625
626     HRESULT SetIDList( [in] LPCITEMIDLIST pidl );
627
628     HRESULT GetDescription(
629         [out, size_is(cch)] LPWSTR pszName,
630         [in] int cch);
631
632     HRESULT SetDescription( [in] LPCWSTR pszName );
633
634     HRESULT GetWorkingDirectory(
635         [out, size_is(cch)] LPWSTR pszDir,
636         [in] int cch);
637
638     HRESULT SetWorkingDirectory( [in] LPCWSTR pszDir );
639
640     HRESULT GetArguments(
641         [out, size_is(cch)] LPWSTR pszArgs,
642         [in] int cch);
643
644     HRESULT SetArguments( [in] LPCWSTR pszArgs );
645
646     HRESULT GetHotkey( [out] WORD *pwHotkey );
647
648     HRESULT SetHotkey( [in] WORD wHotkey );
649
650     HRESULT GetShowCmd( [out] int *piShowCmd );
651
652     HRESULT SetShowCmd( [in] int iShowCmd );
653
654     HRESULT GetIconLocation(
655         [out, size_is(cch)] LPWSTR pszIconPath,
656         [in] int cch,
657         [out] int *piIcon);
658
659     HRESULT SetIconLocation(
660         [in] LPCWSTR pszIconPath,
661         [in] int iIcon);
662
663     HRESULT SetRelativePath(
664         [in] LPCWSTR pszPathRel,
665         [in] DWORD dwReserved);
666
667     HRESULT Resolve(
668         [in] HWND hwnd,
669         [in] DWORD fFlags);
670
671     HRESULT SetPath( [in] LPCWSTR pszFile );
672 }
673
674 cpp_quote("#define IShellLink WINELIB_NAME_AW(IShellLink)")
675
676
677 /*****************************************************************************
678  * IShellExtInit interface
679  */
680 [
681     object,
682     uuid(000214e8-0000-0000-c000-000000000046),
683     pointer_default(unique)
684 ]
685 interface IShellExtInit : IUnknown
686 {
687     typedef IShellExtInit *LPSHELLEXTINIT;
688
689     HRESULT Initialize(
690         [in] LPCITEMIDLIST pidlFolder,
691         [in] IDataObject *pdtobj,
692         [in] HKEY hkeyProgID);
693 }
694
695
696 /*******************************************************************************/
697 /* Note: the following interfaces are not in shobjidl.idl under Windows, they  */
698 /* are declared directly in shlobj.h. It hopefully won't break anything to put */
699 /* them here anyway.                                                           */
700 /*******************************************************************************/
701
702 #ifndef MAX_PATH
703 #define MAX_PATH 260
704 #endif
705
706
707 /*****************************************************************************
708  * IPersistFolder3 interface
709  */
710 [
711     object,
712     uuid(cef04fdf-fe72-11d2-87a5-00c04f6837cf),
713     pointer_default(unique)
714 ]
715 interface IPersistFolder3 : IPersistFolder2
716 {
717     typedef struct
718     {
719         LPITEMIDLIST    pidlTargetFolder;
720         WCHAR           szTargetParsingName[MAX_PATH];
721         WCHAR           szNetworkProvider[MAX_PATH];
722         DWORD           dwAttributes;
723         int             csidl;
724     } PERSIST_FOLDER_TARGET_INFO;
725
726     HRESULT InitializeEx(
727         [in] IBindCtx *pbc,
728         [in] LPCITEMIDLIST pidlRoot,
729         [in] const PERSIST_FOLDER_TARGET_INFO *ppfti);
730
731     HRESULT GetFolderTargetInfo( [out] PERSIST_FOLDER_TARGET_INFO *ppfti );
732 }
733
734
735 /*****************************************************************************
736  * IExtractIconA interface
737  */
738 [
739     object,
740     uuid(000214eb-0000-0000-c000-000000000046),
741     pointer_default(unique)
742 ]
743 interface IExtractIconA : IUnknown
744 {
745 cpp_quote("#define GIL_OPENICON     0x0001")
746 cpp_quote("#define GIL_FORSHELL     0x0002")
747 cpp_quote("#define GIL_ASYNC        0x0020")
748 cpp_quote("#define GIL_DEFAULTICON  0x0040")
749 cpp_quote("#define GIL_FORSHORTCUT  0x0080")
750
751 cpp_quote("#define GIL_SIMULATEDOC  0x0001")
752 cpp_quote("#define GIL_PERINSTANCE  0x0002")
753 cpp_quote("#define GIL_PERCLASS     0x0004")
754 cpp_quote("#define GIL_NOTFILENAME  0x0008")
755 cpp_quote("#define GIL_DONTCACHE    0x0010")
756
757     typedef IExtractIconA *LPEXTRACTICONA;
758
759     HRESULT GetIconLocation(
760         [in] UINT uFlags,
761         [out, size_is(cchMax)] LPSTR szIconFile,
762         [in] UINT cchMax,
763         [out] INT *piIndex,
764         [out] UINT *pwFlags);
765
766     HRESULT Extract(
767         [in] LPCSTR pszFile,
768         [in] UINT nIconIndex,
769         [out] HICON *phiconLarge,
770         [out] HICON *phiconSmall,
771         [in] UINT nIconSize );
772 }
773
774
775 /*****************************************************************************
776  * IExtractIconW interface
777  */
778 [
779     object,
780     uuid(000214fa-0000-0000-c000-000000000046),
781     pointer_default(unique)
782 ]
783 interface IExtractIconW : IUnknown
784 {
785     typedef IExtractIconW *LPEXTRACTICONW;
786
787     HRESULT GetIconLocation(
788         [in] UINT uFlags,
789         [out, size_is(cchMax)] LPWSTR szIconFile,
790         [in] UINT cchMax,
791         [out] INT *piIndex,
792         [out] UINT *pwFlags);
793
794     HRESULT Extract(
795         [in] LPCWSTR pszFile,
796         [in] UINT nIconIndex,
797         [out] HICON *phiconLarge,
798         [out] HICON *phiconSmall,
799         [in] UINT nIconSize );
800 }
801
802 cpp_quote("#define LPEXTRACTICON WINELIB_NAME_AW(LPEXTRACTICON)")
803 cpp_quote("#define IExtractIcon WINELIB_NAME_AW(IExtractIcon)")
804
805
806 /*****************************************************************************
807  * ICommDlgBrowser interface
808  */
809 [
810     object,
811     uuid(000214f1-0000-0000-c000-000000000046),
812     pointer_default(unique)
813 ]
814 interface ICommDlgBrowser : IUnknown
815 {
816 cpp_quote("#define CDBOSC_SETFOCUS     0x00000000")
817 cpp_quote("#define CDBOSC_KILLFOCUS    0x00000001")
818 cpp_quote("#define CDBOSC_SELCHANGE    0x00000002")
819 cpp_quote("#define CDBOSC_RENAME       0x00000003")
820 cpp_quote("#define CDBOSC_STATECHANGE  0x00000004")
821
822     typedef ICommDlgBrowser *LPCOMMDLGBROWSER;
823
824     HRESULT OnDefaultCommand( [in] IShellView *shv );
825     HRESULT OnStateChange( [in] IShellView *shv, [in] ULONG uChange );
826     HRESULT IncludeObject( [in] IShellView *shv, [in] LPCITEMIDLIST pidl );
827 }
828
829
830 /*****************************************************************************
831  * IDockingWindowFrame interface
832  */
833 [
834     object,
835     uuid(47d2657a-7b27-11d0-8ca9-00a0c92dbfe8),
836     pointer_default(unique)
837 ]
838 interface IDockingWindowFrame : IOleWindow
839 {
840 cpp_quote("#define DWFRF_NORMAL           0x0000")
841 cpp_quote("#define DWFRF_DELETECONFIGDATA 0x0001")
842 cpp_quote("#define DWFAF_HIDDEN           0x0001")
843
844     HRESULT AddToolbar(
845         [in] IUnknown *punkSrc,
846         [in] LPCWSTR pwszItem,
847         [in] DWORD dwAddFlags);
848
849     HRESULT RemoveToolbar(
850         [in] IUnknown *punkSrc,
851         [in] DWORD dwRemoveFlags);
852
853     HRESULT FindToolbar(
854         [in] LPCWSTR pwszItem,
855         [in] REFIID riid,
856         [out] LPVOID *ppvObj);
857 }
858
859
860 /*****************************************************************************
861  * IDragSourceHelper interface
862  */
863 [
864     object,
865     uuid(de5bf786-477a-11d2-839d-00c04fd918d0),
866     pointer_default(unique)
867 ]
868 interface IDragSourceHelper : IUnknown
869 {
870     typedef struct
871     {
872         SIZE     sizeDragImage;
873         POINT    ptOffset;
874         HBITMAP  hbmpDragImage;
875         COLORREF crColorKey;
876     } SHDRAGIMAGE, *LPSHDRAGIMAGE;
877
878   HRESULT InitializeFromBitmap(
879       [in] LPSHDRAGIMAGE pshdi,
880       [in] IDataObject *pDataObject);
881
882   HRESULT InitializeFromWindow(
883       [in] HWND hwnd,
884       [in] POINT *ppt,
885       [in] IDataObject *pDataObject);
886 }
887
888
889 /*****************************************************************************
890  * IDropTargetHelper interface
891  */
892 [
893     object,
894     uuid(4657278b-411b-11d2-839a-00c04fd918d0),
895     pointer_default(unique)
896 ]
897 interface IDropTargetHelper : IUnknown
898 {
899     HRESULT DragEnter(
900         [in] HWND hwndTarget,
901         [in] IDataObject *pDataObject,
902         [in] POINT *ppt,
903         [in] DWORD dwEffect);
904
905     HRESULT DragLeave();
906
907     HRESULT DragOver(
908         [in] POINT *ppt,
909         [in] DWORD dwEffect);
910
911     HRESULT Drop(
912         [in] IDataObject *pDataObject,
913         [in] POINT *ppt,
914         [in] DWORD dwEffect);
915
916     HRESULT Show( [in] BOOL fShow );
917 }
918
919
920 /*****************************************************************************
921  * IContextMenu interface
922  */
923 [
924     object,
925     uuid(000214e4-0000-0000-c000-000000000046),
926     pointer_default(unique)
927 ]
928 interface IContextMenu : IUnknown
929 {
930 cpp_quote("#define CMF_NORMAL        0x00000000")
931 cpp_quote("#define CMF_DEFAULTONLY   0x00000001")
932 cpp_quote("#define CMF_VERBSONLY     0x00000002")
933 cpp_quote("#define CMF_EXPLORE       0x00000004")
934 cpp_quote("#define CMF_NOVERBS       0x00000008")
935 cpp_quote("#define CMF_CANRENAME     0x00000010")
936 cpp_quote("#define CMF_NODEFAULT     0x00000020")
937 cpp_quote("#define CMF_INCLUDESTATIC 0x00000040")
938 cpp_quote("#define CMF_EXTENDEDVERBS 0x00000100")
939 cpp_quote("#define CMF_RESERVED      0xffff0000")
940
941 cpp_quote("#define GCS_VERBA         0x00000000")
942 cpp_quote("#define GCS_HELPTEXTA     0x00000001")
943 cpp_quote("#define GCS_VALIDATEA     0x00000002")
944 cpp_quote("#define GCS_VERBW         0x00000004")
945 cpp_quote("#define GCS_HELPTEXTW     0x00000005")
946 cpp_quote("#define GCS_VALIDATEW     0x00000006")
947 cpp_quote("#define GCS_UNICODE       0x00000004")
948 cpp_quote("#define GCS_VERB          WINELIB_NAME_AW(GCS_VERB)")
949 cpp_quote("#define GCS_HELPTEXT      WINELIB_NAME_AW(GCS_HELPTEXT)")
950 cpp_quote("#define GCS_VALIDATE      WINELIB_NAME_AW(GCS_VALIDATE)")
951
952 cpp_quote("#define CMDSTR_NEWFOLDERA   \"NewFolder\"")
953 cpp_quote("#define CMDSTR_VIEWLISTA    \"ViewList\"")
954 cpp_quote("#define CMDSTR_VIEWDETAILSA \"ViewDetails\"")
955 cpp_quote("#if defined(__GNUC__)")
956 cpp_quote("# define CMDSTR_NEWFOLDERW (const WCHAR []){ 'N','e','w','F','o','l','d','e','r',0 }")
957 cpp_quote("# define CMDSTR_VIEWLISTW (const WCHAR []){ 'V','i','e','w','L','i','s','t',0 }")
958 cpp_quote("# define CMDSTR_VIEWDETAILSW (const WCHAR []){ 'V','i','e','w','D','e','t','a','i','l','s',0 }")
959 cpp_quote("#elif defined(_MSC_VER)")
960 cpp_quote("# define CMDSTR_NEWFOLDERW   L\"NewFolder\"")
961 cpp_quote("# define CMDSTR_VIEWLISTW    L\"ViewList\"")
962 cpp_quote("# define CMDSTR_VIEWDETAILSW L\"ViewDetails\"")
963 cpp_quote("#else")
964 cpp_quote("static const WCHAR CMDSTR_NEWFOLDERW[] = {'N','e','w','F','o','l','d','e','r',0};")
965 cpp_quote("static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0};")
966 cpp_quote("static const WCHAR CMDSTR_VIEWDETAILSW[] = {'V','i','e','w','D','e','t','a','i','l','s',0};")
967 cpp_quote("#endif")
968 cpp_quote("#define CMDSTR_NEWFOLDER    WINELIB_NAME_AW(CMDSTR_NEWFOLDER)")
969 cpp_quote("#define CMDSTR_VIEWLIST     WINELIB_NAME_AW(CMDSTR_VIEWLIST)")
970 cpp_quote("#define CMDSTR_VIEWDETAILS  WINELIB_NAME_AW(CMDSTR_VIEWDETAILS)")
971
972 cpp_quote("#define CMIC_MASK_HOTKEY         SEE_MASK_HOTKEY")
973 cpp_quote("#define CMIC_MASK_ICON           SEE_MASK_ICON")
974 cpp_quote("#define CMIC_MASK_FLAG_NO_UI     SEE_MASK_FLAG_NO_UI")
975 cpp_quote("#define CMIC_MASK_UNICODE        SEE_MASK_UNICODE")
976 cpp_quote("#define CMIC_MASK_NO_CONSOLE     SEE_MASK_NO_CONSOLE")
977 cpp_quote("#define CMIC_MASK_HASLINKNAME    SEE_MASK_HASLINKNAME")
978 cpp_quote("#define CMIC_MASK_FLAG_SEP_VDM   SEE_MASK_FLAG_SEPVDM")
979 cpp_quote("#define CMIC_MASK_HASTITLE       SEE_MASK_HASTITLE")
980 cpp_quote("#define CMIC_MASK_ASYNCOK        SEE_MASK_ASYNCOK")
981 cpp_quote("#define CMIC_MASK_SHIFT_DOWN     0x10000000")
982 cpp_quote("#define CMIC_MASK_PTINVOKE       0x20000000")
983 cpp_quote("#define CMIC_MASK_CONTROL_DOWN   0x40000000")
984 cpp_quote("#define CMIC_MASK_FLAG_LOG_USAGE SEE_MASK_FLAG_LOG_USAGE")
985 cpp_quote("#define CMIC_MASK_NOZONECHECKS   SEE_MASK_NOZONECHECKS")
986
987     typedef IContextMenu *LPCONTEXTMENU;
988
989     typedef struct tagCMINVOKECOMMANDINFO
990     {
991         DWORD cbSize;
992         DWORD fMask;
993         HWND hwnd;
994         LPCSTR lpVerb;
995         LPCSTR lpParameters;
996         LPCSTR lpDirectory;
997         INT nShow;
998         DWORD dwHotKey;
999         HANDLE hIcon;
1000     } CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO;
1001
1002     typedef struct tagCMInvokeCommandInfoEx
1003     {
1004         DWORD cbSize;
1005         DWORD fMask;
1006         HWND hwnd;
1007         LPCSTR lpVerb;
1008         LPCSTR lpParameters;
1009         LPCSTR lpDirectory;
1010         INT nShow;
1011         DWORD dwHotKey;
1012         HANDLE hIcon;
1013         LPCSTR lpTitle;
1014         LPCWSTR lpVerbW;
1015         LPCWSTR lpParametersW;
1016         LPCWSTR lpDirectoryW;
1017         LPCWSTR lpTitleW;
1018         POINT ptInvoke;
1019     } CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX;
1020
1021     HRESULT QueryContextMenu(
1022         [in] HMENU hmenu,
1023         [in] UINT indexMenu,
1024         [in] UINT idCmdFirst,
1025         [in] UINT idCmdLast,
1026         [in] UINT uFlags);
1027
1028     HRESULT InvokeCommand( [in] LPCMINVOKECOMMANDINFO lpici );
1029
1030     HRESULT GetCommandString(
1031         [in] UINT idCmd,
1032         [in] UINT uType,
1033         [out] UINT *pwReserved,
1034         [out, size_is(cchMax)] LPSTR pszName,
1035         [in] UINT cchMax);
1036 }
1037
1038
1039 /*****************************************************************************
1040  * IContextMenu2 interface
1041  */
1042 [
1043     object,
1044     uuid(000214f4-0000-0000-c000-000000000046),
1045     pointer_default(unique)
1046 ]
1047 interface IContextMenu2 : IContextMenu
1048 {
1049     typedef IContextMenu2 *LPCONTEXTMENU2;
1050
1051     HRESULT HandleMenuMsg(
1052         [in] UINT uMsg,
1053         [in] WPARAM wParam,
1054         [in] LPARAM lParam);
1055 }
1056
1057
1058 /*****************************************************************************
1059  * IContextMenu3 interface
1060  */
1061 [
1062     object,
1063     uuid(bcfce0a0-ec17-11d0-8d10-00a0c90f2719),
1064     pointer_default(unique)
1065 ]
1066 interface IContextMenu3 : IContextMenu2
1067 {
1068     typedef IContextMenu3 *LPCONTEXTMENU3;
1069
1070     HRESULT HandleMenuMsg2(
1071         [in] UINT uMsg,
1072         [in] WPARAM wParam,
1073         [in] LPARAM lParam,
1074         [out] LRESULT *plResult);
1075 }
1076
1077
1078 /*****************************************************************************
1079  * IShellExecuteHookA interface
1080  */
1081 [
1082     object,
1083     uuid(000214f5-0000-0000-c000-000000000046),
1084     pointer_default(unique)
1085 ]
1086 interface IShellExecuteHookA : IUnknown
1087 {
1088     cpp_quote("struct _SHELLEXECUTEINFOA;");
1089     HRESULT Execute(
1090         [in, out] struct _SHELLEXECUTEINFOA* pei);
1091 }
1092
1093
1094 /*****************************************************************************
1095  * IShellExecuteHookW interface
1096  */
1097 [
1098     object,
1099     uuid(000214fb-0000-0000-c000-000000000046),
1100     pointer_default(unique)
1101 ]
1102 interface IShellExecuteHookW : IUnknown
1103 {
1104     cpp_quote("struct _SHELLEXECUTEINFOW;");
1105     HRESULT Execute(
1106                 [in, out] struct _SHELLEXECUTEINFOW* pei);
1107 }