[SHELL32]
[reactos.git] / dll / win32 / comdlg32 / cdlg.h
1 /*
2 * Common Dialog Boxes interface (32 bit)
3 *
4 * Copyright 1998 Bertho A. Stultiens
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21 #ifndef _WINE_DLL_CDLG_H
22 #define _WINE_DLL_CDLG_H
23
24 #include <wine/config.h>
25
26 #include <stdio.h>
27
28 #define WIN32_NO_STATUS
29 #define _INC_WINDOWS
30 #define COM_NO_WINDOWS_H
31
32 #define COBJMACROS
33 #define NONAMELESSUNION
34 #define NONAMELESSSTRUCT
35
36 #include <windef.h>
37 #include <winbase.h>
38 #include <wingdi.h>
39 #include <winuser.h>
40 #include <wincon.h>
41 #include <winternl.h>
42 #include <objbase.h>
43 #include <commdlg.h>
44 #include <shlobj.h>
45 #include <dlgs.h>
46 #include <cderr.h>
47
48 /* RegGetValueW is supported by Win2k3 SP1 but headers need Win Vista */
49 #undef _WIN32_WINNT
50 #define _WIN32_WINNT 0x0600
51 #include <winreg.h>
52
53 #define NO_SHLWAPI_STREAM
54 #include <shlwapi.h>
55
56 #include <wine/unicode.h>
57
58 #include <wine/debug.h>
59 WINE_DEFAULT_DEBUG_CHANNEL(commdlg);
60
61 #include "filedlgbrowser.h"
62 #include "resource.h"
63
64 /* Common dialogs implementation globals */
65 #define COMDLG32_Atom ((ATOM)0xa000) /* MS uses this one to identify props */
66
67 extern HINSTANCE COMDLG32_hInstance DECLSPEC_HIDDEN;
68
69 void COMDLG32_SetCommDlgExtendedError(DWORD err) DECLSPEC_HIDDEN;
70 LPVOID COMDLG32_AllocMem(int size) __WINE_ALLOC_SIZE(1) DECLSPEC_HIDDEN;
71
72 /* Find/Replace local definitions */
73
74 #define FR_WINE_UNICODE 0x80000000
75 #define FR_WINE_REPLACE 0x40000000
76
77 typedef struct {
78 FINDREPLACEA fr; /* Internally used structure */
79 union {
80 FINDREPLACEA *fra; /* Reference to the user supplied structure */
81 FINDREPLACEW *frw;
82 } user_fr;
83 } COMDLG32_FR_Data;
84
85 /* Constructors */
86 HRESULT FileOpenDialog_Constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
87 HRESULT FileSaveDialog_Constructor(IUnknown *pUnkOuter, REFIID riid, void **ppv) DECLSPEC_HIDDEN;
88
89 /* Shared helper functions */
90 void COMDLG32_GetCanonicalPath(PCIDLIST_ABSOLUTE pidlAbsCurrent, LPWSTR lpstrFile, LPWSTR lpstrPathAndFile) DECLSPEC_HIDDEN;
91 int FILEDLG95_ValidatePathAction(LPWSTR lpstrPathAndFile, IShellFolder **ppsf,
92 HWND hwnd, DWORD flags, BOOL isSaveDlg, int defAction) DECLSPEC_HIDDEN;
93 int COMDLG32_SplitFileNames(LPWSTR lpstrEdit, UINT nStrLen, LPWSTR *lpstrFileList, UINT *sizeUsed) DECLSPEC_HIDDEN;
94 void FILEDLG95_OnOpenMessage(HWND hwnd, int idCaption, int idText) DECLSPEC_HIDDEN;
95
96 extern BOOL GetFileName31A( OPENFILENAMEA *lpofn, UINT dlgType ) DECLSPEC_HIDDEN;
97 extern BOOL GetFileName31W( OPENFILENAMEW *lpofn, UINT dlgType ) DECLSPEC_HIDDEN;
98
99 /* ITEMIDLIST */
100
101 extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILClone) (LPCITEMIDLIST);
102 extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILCombine)(LPCITEMIDLIST,LPCITEMIDLIST);
103 extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILGetNext)(LPITEMIDLIST);
104 extern BOOL (WINAPI *COMDLG32_PIDL_ILRemoveLastID)(LPCITEMIDLIST);
105 extern BOOL (WINAPI *COMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
106 extern UINT (WINAPI *COMDLG32_PIDL_ILGetSize)(LPCITEMIDLIST);
107
108 /* SHELL */
109 extern LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);
110 extern DWORD (WINAPI *COMDLG32_SHFree)(LPVOID);
111 extern BOOL (WINAPI *COMDLG32_SHGetFolderPathW)(HWND,int,HANDLE,DWORD,LPWSTR);
112 extern LPITEMIDLIST (WINAPI *COMDLG32_SHSimpleIDListFromPathAW)(LPCVOID);
113
114 #define ONOPEN_BROWSE 1
115 #define ONOPEN_OPEN 2
116 #define ONOPEN_SEARCH 3
117
118 #endif /* _WINE_DLL_CDLG_H */