Match class name used by Windows.
[wine] / dlls / shell32 / undocshell.h
1 /*
2  * Copyright 1999, 2000 Juergen Schmied
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19 #ifndef __WINE_UNDOCSHELL_H
20 #define __WINE_UNDOCSHELL_H
21
22 #include <stdarg.h>
23
24 #include "windef.h"
25 #include "winbase.h"
26 #include "winuser.h"
27 #include "commctrl.h"
28 #include "shlobj.h"
29
30 #ifdef __cplusplus
31 extern "C" {
32 #endif /* defined(__cplusplus) */
33
34 /****************************************************************************
35  *      IDList Functions
36  */
37 BOOL WINAPI ILGetDisplayName(
38         LPCITEMIDLIST pidl,
39         LPVOID path);
40
41 /* type parameter for ILGetDisplayNameEx() */
42 #define ILGDN_FORPARSING  0
43 #define ILGDN_NORMAL      1
44 #define ILGDN_INFOLDER    2
45
46 BOOL WINAPI ILGetDisplayNameEx(
47         LPSHELLFOLDER psf,
48         LPCITEMIDLIST pidl,
49         LPVOID path,
50         DWORD type);
51
52 LPITEMIDLIST WINAPI ILGlobalClone(LPCITEMIDLIST pidl);
53 void WINAPI ILGlobalFree(LPITEMIDLIST pidl);
54
55 LPITEMIDLIST WINAPI SHSimpleIDListFromPathA (LPCSTR lpszPath);
56 LPITEMIDLIST WINAPI SHSimpleIDListFromPathW (LPCWSTR lpszPath);
57
58 HRESULT WINAPI SHILCreateFromPathA (
59         LPCSTR path,
60         LPITEMIDLIST * ppidl,
61         DWORD *attributes);
62
63 HRESULT WINAPI SHILCreateFromPathW (
64         LPCWSTR path,
65         LPITEMIDLIST * ppidl,
66         DWORD *attributes);
67
68 LPITEMIDLIST WINAPI ILCreateFromPathA(LPCSTR path);
69 LPITEMIDLIST WINAPI ILCreateFromPathW(LPCWSTR path);
70
71 /*
72         string functions
73 */
74 BOOL WINAPI StrRetToStrNA(LPSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
75 BOOL WINAPI StrRetToStrNW(LPWSTR,DWORD,LPSTRRET,const ITEMIDLIST*);
76
77
78 /****************************************************************************
79 * SHChangeNotifyRegister API
80 */
81 #define SHCNRF_InterruptLevel           0x0001
82 #define SHCNRF_ShellLevel               0x0002
83 #define SHCNRF_RecursiveInterrupt       0x1000  /* Must be combined with SHCNRF_InterruptLevel */
84 #define SHCNRF_NewDelivery              0x8000  /* Messages use shared memory */
85
86 /****************************************************************************
87  * Shell Common Dialogs
88  */
89
90 BOOL WINAPI PickIconDlg(
91         HWND hwndOwner,
92         LPSTR lpstrFile,
93         DWORD nMaxFile,
94         LPDWORD lpdwIconIndex);
95
96 /* RunFileDlg flags */
97 #define RFF_NOBROWSE       0x01
98 #define RFF_NODEFAULT      0x02
99 #define RFF_CALCDIRECTORY  0x04
100 #define RFF_NOLABEL        0x08
101 #define RFF_NOSEPARATEMEM  0x20  /* NT only */
102
103 /* RunFileFlg notification structure */
104 typedef struct
105 {
106   NMHDR   hdr;
107   LPCSTR  lpFile;
108   LPCSTR  lpDirectory;
109   int     nShow;
110 } NM_RUNFILEDLG, * LPNM_RUNFILEDLG;
111
112 /* RunFileDlg notification return values */
113 #define RF_OK      0x00
114 #define RF_CANCEL  0x01
115 #define RF_RETRY   0x02
116
117 void WINAPI RunFileDlg(
118         HWND hwndOwner,
119         HICON hIcon,
120         LPCSTR lpstrDirectory,
121         LPCSTR lpstrTitle,
122         LPCSTR lpstrDescription,
123         UINT uFlags);
124
125 void WINAPI ExitWindowsDialog(HWND hwndOwner);
126
127 BOOL WINAPI GetFileNameFromBrowse(
128         HWND hwndOwner,
129         LPSTR lpstrFile,
130         DWORD nMaxFile,
131         LPCSTR lpstrInitialDir,
132         LPCSTR lpstrDefExt,
133         LPCSTR lpstrFilter,
134         LPCSTR lpstrTitle);
135
136 BOOL WINAPI SHFindComputer(
137         LPCITEMIDLIST pidlRoot,
138         LPCITEMIDLIST pidlSavedSearch);
139
140 void WINAPI SHHandleDiskFull(HWND hwndOwner,
141         UINT uDrive);
142
143 int  WINAPI SHOutOfMemoryMessageBox(
144         HWND hwndOwner,
145         LPCSTR lpCaption,
146         UINT uType);
147
148 DWORD WINAPI SHNetConnectionDialog(
149         HWND hwndOwner,
150         LPCSTR lpstrRemoteName,
151         DWORD dwType);
152
153 /****************************************************************************
154  * Memory Routines
155  */
156
157 /* The Platform SDK's shlobj.h header defines similar functions with a
158  * leading underscore. However those are unusable because of the leading
159  * underscore, because they have an incorrect calling convention, and
160  * because these functions are not exported by name anyway.
161  */
162 HANDLE WINAPI SHAllocShared(
163         LPVOID pv,
164         ULONG cb,
165         DWORD pid);
166
167 BOOL WINAPI SHFreeShared(
168         HANDLE hMem,
169         DWORD pid);
170
171 LPVOID WINAPI SHLockShared(
172         HANDLE hMem,
173         DWORD pid);
174
175 BOOL WINAPI SHUnlockShared(LPVOID pv);
176
177 /****************************************************************************
178  * Cabinet Window Messages
179  */
180
181 #define CWM_SETPATH           (WM_USER + 2)
182 #define CWM_WANTIDLE          (WM_USER + 3)
183 #define CWM_GETSETCURRENTINFO (WM_USER + 4)
184 #define CWM_SELECTITEM        (WM_USER + 5)
185 #define CWM_SELECTITEMSTR     (WM_USER + 6)
186 #define CWM_GETISHELLBROWSER  (WM_USER + 7)
187 #define CWM_TESTPATH          (WM_USER + 9)
188 #define CWM_STATECHANGE       (WM_USER + 10)
189 #define CWM_GETPATH           (WM_USER + 12)
190
191 /* CWM_TESTPATH types */
192 #define CWTP_ISEQUAL  0
193 #define CWTP_ISCHILD  1
194
195 /* CWM_TESTPATH structure */
196 typedef struct
197 {
198         DWORD dwType;
199         ITEMIDLIST idl;
200 } CWTESTPATHSTRUCT,* LPCWTESTPATHSTRUCT;
201
202 /****************************************************************************
203  * System Imagelist Routines
204  */
205
206 int WINAPI Shell_GetCachedImageIndex(
207         LPCSTR lpszFileName,
208         UINT nIconIndex,
209         BOOL bSimulateDoc);
210
211 BOOL WINAPI Shell_GetImageLists(
212         HIMAGELIST *lphimlLarge,
213         HIMAGELIST *lphimlSmall);
214
215 HICON WINAPI SHGetFileIcon(
216         DWORD dwReserved,
217         LPCSTR lpszPath,
218         DWORD dwFileAttributes,
219         UINT uFlags);
220
221 BOOL WINAPI FileIconInit(BOOL bFullInit);
222
223 /****************************************************************************
224  * File Menu Routines
225  */
226 /* FileMenu_Create nSelHeight constants */
227 #define FM_DEFAULT_SELHEIGHT  -1
228 #define FM_FULL_SELHEIGHT     0
229
230 /* FileMenu_Create flags */
231 #define FMF_SMALL_ICONS      0x00
232 #define FMF_LARGE_ICONS      0x08
233 #define FMF_NO_COLUMN_BREAK  0x10
234
235 HMENU WINAPI FileMenu_Create(
236         COLORREF crBorderColor,
237         int nBorderWidth,
238         HBITMAP hBorderBmp,
239         int nSelHeight,
240         UINT uFlags);
241
242 void WINAPI FileMenu_Destroy(HMENU hMenu);
243
244 /* FileMenu_AppendItem constants */
245 #define FM_SEPARATOR       (LPCSTR)1
246 #define FM_BLANK_ICON      -1
247 #define FM_DEFAULT_HEIGHT  0
248
249 BOOL WINAPI FileMenu_AppendItem(
250         HMENU hMenu,
251         LPCSTR lpszText,
252         UINT uID,
253         int iIcon,
254         HMENU hMenuPopup,
255         int nItemHeight);
256
257 /* FileMenu_InsertUsingPidl flags */
258 #define FMF_NO_EMPTY_ITEM      0x01
259 #define FMF_NO_PROGRAM_GROUPS  0x04
260
261 /* FileMenu_InsertUsingPidl callback function */
262 typedef void (CALLBACK *LPFNFMCALLBACK)(LPCITEMIDLIST pidlFolder, LPCITEMIDLIST pidlFile);
263
264 int WINAPI FileMenu_InsertUsingPidl(
265         HMENU hMenu,
266         UINT uID,
267         LPCITEMIDLIST pidl,
268         UINT uFlags,
269         UINT uEnumFlags,
270         LPFNFMCALLBACK lpfnCallback);
271
272 int WINAPI FileMenu_ReplaceUsingPidl(
273         HMENU hMenu,
274         UINT uID,
275         LPCITEMIDLIST pidl,
276         UINT uEnumFlags,
277         LPFNFMCALLBACK lpfnCallback);
278
279 void WINAPI FileMenu_Invalidate(HMENU hMenu);
280
281 HMENU WINAPI FileMenu_FindSubMenuByPidl(
282         HMENU hMenu,
283         LPCITEMIDLIST pidl);
284
285 BOOL WINAPI FileMenu_TrackPopupMenuEx(
286         HMENU hMenu,
287         UINT uFlags,
288         int x,
289         int y,
290         HWND hWnd,
291         LPTPMPARAMS lptpm);
292
293 BOOL WINAPI FileMenu_GetLastSelectedItemPidls(
294         UINT uReserved,
295         LPCITEMIDLIST *ppidlFolder,
296         LPCITEMIDLIST *ppidlItem);
297
298 LRESULT WINAPI FileMenu_MeasureItem(
299         HWND hWnd,
300         LPMEASUREITEMSTRUCT lpmis);
301
302 LRESULT WINAPI FileMenu_DrawItem(
303         HWND hWnd,
304         LPDRAWITEMSTRUCT lpdis);
305
306 BOOL WINAPI FileMenu_InitMenuPopup(HMENU hMenu);
307
308 void WINAPI FileMenu_AbortInitMenu(void);
309
310 LRESULT WINAPI FileMenu_HandleMenuChar(
311         HMENU hMenu,
312         WPARAM wParam);
313
314 BOOL WINAPI FileMenu_DeleteAllItems(HMENU hMenu);
315
316 BOOL WINAPI FileMenu_DeleteItemByCmd(
317         HMENU hMenu,
318         UINT uID);
319
320 BOOL WINAPI FileMenu_DeleteItemByIndex(
321         HMENU hMenu,
322         UINT uPos);
323
324 BOOL WINAPI FileMenu_DeleteMenuItemByFirstID(
325         HMENU hMenu,
326         UINT uID);
327
328 BOOL WINAPI FileMenu_DeleteSeparator(HMENU hMenu);
329
330 BOOL WINAPI FileMenu_EnableItemByCmd(
331         HMENU hMenu,
332         UINT uID,
333         BOOL bEnable);
334
335 DWORD WINAPI FileMenu_GetItemExtent(
336         HMENU hMenu,
337         UINT uPos);
338
339 int WINAPI FileMenu_AppendFilesForPidl(
340         HMENU hMenu,
341         LPCITEMIDLIST pidl,
342         BOOL bAddSeparator);
343
344 int WINAPI FileMenu_AddFilesForPidl(
345         HMENU hMenu,
346         UINT uReserved,
347         UINT uID,
348         LPCITEMIDLIST pidl,
349         UINT uFlags,
350         UINT uEnumFlags,
351         LPFNFMCALLBACK lpfnCallback);
352
353 /****************************************************************************
354  * Drag And Drop Routines
355  */
356
357 HRESULT WINAPI SHRegisterDragDrop(
358         HWND hWnd,
359         LPDROPTARGET lpDropTarget);
360
361 HRESULT WINAPI SHRevokeDragDrop(HWND hWnd);
362
363 BOOL WINAPI DAD_DragEnter(HWND hWnd);
364
365 BOOL WINAPI DAD_SetDragImageFromListView(
366         HWND hWnd,
367         POINT pt);
368
369 BOOL WINAPI DAD_ShowDragImage(BOOL bShow);
370
371 HRESULT WINAPI CIDLData_CreateFromIDArray(
372         LPCITEMIDLIST pidlFolder,
373         DWORD cpidlFiles,
374         LPCITEMIDLIST *lppidlFiles,
375         LPDATAOBJECT *ppdataObject);
376
377 /****************************************************************************
378  * Path Manipulation Routines
379  */
380
381 BOOL WINAPI PathAppendAW(LPVOID lpszPath1, LPCVOID lpszPath2);
382
383 LPVOID WINAPI PathCombineAW(LPVOID szDest, LPCVOID lpszDir, LPCVOID lpszFile);
384
385 LPVOID  WINAPI PathAddBackslashAW(LPVOID path);
386
387 LPVOID WINAPI PathBuildRootAW(LPVOID lpszPath, int drive);
388
389 LPVOID WINAPI PathFindExtensionAW(LPCVOID path);
390
391 LPVOID WINAPI PathFindFileNameAW(LPCVOID path);
392
393 LPVOID WINAPI PathGetExtensionAW(LPCVOID lpszPath,  DWORD void1, DWORD void2);
394
395 LPVOID WINAPI PathGetArgsAW(LPVOID lpszPath);
396
397 BOOL WINAPI PathRemoveFileSpecAW(LPVOID lpszPath);
398
399 void WINAPI PathRemoveBlanksAW(LPVOID lpszPath);
400
401 VOID  WINAPI PathQuoteSpacesAW(LPVOID path);
402
403 void WINAPI PathUnquoteSpacesAW(LPVOID lpszPath);
404
405 BOOL WINAPI PathIsUNCAW(LPCVOID lpszPath);
406
407 BOOL WINAPI PathIsRelativeAW(LPCVOID lpszPath);
408
409 BOOL WINAPI PathIsRootAW(LPCVOID x);
410
411 BOOL WINAPI PathIsExeAW(LPCVOID lpszPath);
412
413 BOOL WINAPI PathIsDirectoryAW(LPCVOID lpszPath);
414
415 BOOL WINAPI PathFileExistsAW(LPCVOID lpszPath);
416
417 BOOL WINAPI PathMatchSpecAW(LPVOID lpszPath, LPVOID lpszSpec);
418
419 BOOL WINAPI PathMakeUniqueNameAW(
420         LPVOID lpszBuffer,
421         DWORD dwBuffSize,
422         LPCVOID lpszShortName,
423         LPCVOID lpszLongName,
424         LPCVOID lpszPathName);
425
426 BOOL WINAPI PathYetAnotherMakeUniqueName(
427         LPWSTR lpszBuffer,
428         LPCWSTR lpszPathName,
429         LPCWSTR lpszShortName,
430         LPCWSTR lpszLongName);
431
432 /* PathCleanupSpec return values */
433 #define PCS_REPLACEDCHARS  0x00000001
434 #define PCS_REMOVEDCHARS   0x00000002
435 #define PCS_SHORTENED      0x00000004
436 #define PCS_PATHTOOLONG    0x80000008
437
438 DWORD WINAPI PathCleanupSpecAW(LPCVOID lpszPath, LPVOID lpszFile);
439
440 BOOL WINAPI PathQualifyA(LPCSTR path);
441 BOOL WINAPI PathQualifyW(LPCWSTR path);
442 #define PathQualify WINELIB_NAME_AW(PathQualify)
443 BOOL  WINAPI PathQualifyAW(LPCVOID path);
444
445
446 /* PathResolve flags */
447 #define PRF_CHECKEXISTANCE  0x01
448 #define PRF_EXECUTABLE      0x02
449 #define PRF_QUALIFYONPATH   0x04
450 #define PRF_WINDOWS31       0x08
451
452 BOOL WINAPI PathResolveAW(LPVOID lpszPath, LPCVOID *alpszPaths, DWORD dwFlags);
453
454 VOID WINAPI PathSetDlgItemPathAW(HWND hDlg, int nIDDlgItem, LPCVOID lpszPath);
455
456 /* PathProcessCommand flags */
457 #define PPCF_QUOTEPATH        0x01 /* implies PPCF_INCLUDEARGS */
458 #define PPCF_INCLUDEARGS      0x02
459 #define PPCF_NODIRECTORIES    0x10
460 #define PPCF_DONTRESOLVE      0x20
461 #define PPCF_PATHISRELATIVE   0x40
462
463 HRESULT WINAPI PathProcessCommandAW(LPCVOID lpszPath, LPVOID lpszBuff,
464                                 DWORD dwBuffSize, DWORD dwFlags);
465
466 void WINAPI PathStripPathAW(LPVOID lpszPath);
467
468 BOOL WINAPI PathStripToRootAW(LPVOID lpszPath);
469
470 void WINAPI PathRemoveArgsAW(LPVOID lpszPath);
471
472 void WINAPI PathRemoveExtensionAW(LPVOID lpszPath);
473
474 int WINAPI PathParseIconLocationAW(LPVOID lpszPath);
475
476 BOOL WINAPI PathIsSameRootAW(LPCVOID lpszPath1, LPCVOID lpszPath2);
477
478 BOOL WINAPI PathFindOnPathAW(LPVOID sFile, LPCVOID sOtherDirs);
479
480 /****************************************************************************
481  * Shell Namespace Routines
482  */
483
484 /* Generic structure used by several messages */
485 typedef struct
486 {
487   DWORD          dwReserved;
488   DWORD          dwReserved2;
489   LPCITEMIDLIST  pidl;
490   LPDWORD        lpdwUser;
491 } SFVCBINFO, * LPSFVCBINFO;
492 typedef const SFVCBINFO * LPCSFVCBINFO;
493
494 /* SFVCB_SELECTIONCHANGED structure */
495 typedef struct
496 {
497   UINT           uOldState;
498   UINT           uNewState;
499   LPCITEMIDLIST  pidl;
500   LPDWORD        lpdwUser;
501 } SFVSELECTSTATE, * LPSFVSELECTSTATE;
502 typedef const SFVSELECTSTATE * LPCSFVSELECTSTATE;
503
504 /* SFVCB_COPYHOOKCALLBACK structure */
505 typedef struct
506 {
507   HWND    hwnd;
508   UINT    wFunc;
509   UINT    wFlags;
510   LPCSTR  pszSrcFile;
511   DWORD   dwSrcAttribs;
512   LPCSTR  pszDestFile;
513   DWORD   dwDestAttribs;
514 } SFVCOPYHOOKINFO, * LPSFVCOPYHOOKINFO;
515 typedef const SFVCOPYHOOKINFO * LPCSFVCOPYHOOKINFO;
516
517 /* SFVCB_GETDETAILSOF structure */
518 typedef struct
519 {
520   LPCITEMIDLIST  pidl;
521   int            fmt;
522   int            cx;
523   STRRET         lpText;
524 } SFVCOLUMNINFO, * LPSFVCOLUMNINFO;
525
526 /****************************************************************************
527  * Misc Stuff
528  */
529
530 /* SHWaitForFileToOpen flags */
531 #define SHWFF_ADD     0x01
532 #define SHWFF_REMOVE  0x02
533 #define SHWFF_WAIT    0x04
534
535 BOOL WINAPI SHWaitForFileToOpen(
536         LPCITEMIDLIST pidl,
537         DWORD dwFlags,
538         DWORD dwTimeout);
539
540 WORD WINAPI ArrangeWindows(
541         HWND hwndParent,
542         DWORD dwReserved,
543         LPCRECT lpRect,
544         WORD cKids,
545         CONST HWND * lpKids);
546
547 /* RegisterShellHook types */
548 #define RSH_DEREGISTER        0
549 #define RSH_REGISTER          1
550 #define RSH_REGISTER_PROGMAN  2
551 #define RSH_REGISTER_TASKMAN  3
552
553 BOOL WINAPI RegisterShellHook(
554         HWND hWnd,
555         DWORD dwType);
556
557 /* SHCreateDefClassObject callback function */
558 typedef HRESULT (CALLBACK *LPFNCDCOCALLBACK)(
559         LPUNKNOWN pUnkOuter,
560         REFIID riidObject,
561         LPVOID *ppvObject);
562
563 HRESULT WINAPI SHCreateDefClassObject(
564         REFIID riidFactory,
565         LPVOID *ppvFactory,
566         LPFNCDCOCALLBACK lpfnCallback,
567         LPDWORD lpdwUsage,
568         REFIID riidObject);
569
570 void WINAPI SHFreeUnusedLibraries();
571
572 /* SHCreateLinks flags */
573 #define SHCLF_PREFIXNAME       0x01
574 #define SHCLF_CREATEONDESKTOP  0x02
575
576 HRESULT WINAPI SHCreateLinks(
577         HWND hWnd,
578         LPCSTR lpszDir,
579         LPDATAOBJECT lpDataObject,
580         UINT uFlags,
581         LPITEMIDLIST *lppidlLinks);
582
583 DWORD WINAPI CheckEscapesA(LPSTR string, DWORD len);
584 DWORD WINAPI CheckEscapesW(LPWSTR string, DWORD len);
585
586 /* policy functions */
587 BOOL WINAPI SHInitRestricted(LPCVOID unused, LPCVOID inpRegKey);
588
589 #ifdef __cplusplus
590 } /* extern "C" */
591 #endif /* defined(__cplusplus) */
592
593 #endif /* __WINE_UNDOCSHELL_H */