We must include windef.h before wtypes.h (directly or indirectly).
[wine] / dlls / commdlg / cdlg.h
1 /*
2  *  Common Dialog Boxes interface (32 bit)
3  *
4  * Copyright 1998 Bertho A. Stultiens
5  */
6
7 #ifndef _WINE_DLL_CDLG_H
8 #define _WINE_DLL_CDLG_H
9
10 #include "dlgs.h"
11 #include "wine/windef16.h"
12
13 /*---------------- 16-bit ----------------*/
14 extern HINSTANCE16      COMMDLG_hInstance;
15 extern HINSTANCE        COMMDLG_hInstance32;
16
17 /*---------------- 32-bit ----------------*/
18
19 /* Common dialogs implementation globals */
20 #define COMDLG32_Atom   ((ATOM)0xa000)  /* MS uses this one to identify props */
21
22 extern HINSTANCE        COMDLG32_hInstance;
23
24 void    COMDLG32_SetCommDlgExtendedError(DWORD err);
25 LPVOID  COMDLG32_AllocMem(int size);
26
27
28
29 /* Find/Replace local definitions */
30
31 #define FR_WINE_UNICODE         0x80000000
32 #define FR_WINE_REPLACE         0x40000000
33
34 typedef struct {
35         FINDREPLACEA    fr;     /* Internally used structure */
36         union {
37                 FINDREPLACEA    *fra;   /* Reference to the user supplied structure */
38                 FINDREPLACEW    *frw;
39         } user_fr;
40 } COMDLG32_FR_Data;
41
42 #define PD32_PRINT_TITLE        7000
43
44 #define PD32_VALUE_UREADABLE                  1104
45 #define PD32_INVALID_PAGE_RANGE               1105
46 #define PD32_FROM_NOT_ABOVE_TO                1106
47 #define PD32_MARGINS_OVERLAP                  1107
48 #define PD32_NR_OF_COPIES_EMPTY               1108
49 #define PD32_TOO_LARGE_COPIES                 1109
50 #define PD32_PRINT_ERROR                      1110
51 #define PD32_NO_DEFAULT_PRINTER               1111
52 #define PD32_CANT_FIND_PRINTER                1112
53 #define PD32_OUT_OF_MEMORY                    1113
54 #define PD32_GENERIC_ERROR                    1114
55 #define PD32_DRIVER_UNKNOWN                   1115
56
57 #define PD32_PRINTER_STATUS_READY             1536
58 #define PD32_PRINTER_STATUS_PAUSED            1537
59 #define PD32_PRINTER_STATUS_ERROR             1538 
60 #define PD32_PRINTER_STATUS_PENDING_DELETION  1539
61 #define PD32_PRINTER_STATUS_PAPER_JAM         1540
62 #define PD32_PRINTER_STATUS_PAPER_OUT         1541
63 #define PD32_PRINTER_STATUS_MANUAL_FEED       1542
64 #define PD32_PRINTER_STATUS_PAPER_PROBLEM     1543
65 #define PD32_PRINTER_STATUS_OFFLINE           1544
66 #define PD32_PRINTER_STATUS_IO_ACTIVE         1545
67 #define PD32_PRINTER_STATUS_BUSY              1546
68 #define PD32_PRINTER_STATUS_PRINTING          1547
69 #define PD32_PRINTER_STATUS_OUTPUT_BIN_FULL   1548
70 #define PD32_PRINTER_STATUS_NOT_AVAILABLE     1549
71 #define PD32_PRINTER_STATUS_WAITING           1550
72 #define PD32_PRINTER_STATUS_PROCESSING        1551
73 #define PD32_PRINTER_STATUS_INITIALIZING      1552
74 #define PD32_PRINTER_STATUS_WARMING_UP        1553
75 #define PD32_PRINTER_STATUS_TONER_LOW         1554
76 #define PD32_PRINTER_STATUS_NO_TONER          1555
77 #define PD32_PRINTER_STATUS_PAGE_PUNT         1556
78 #define PD32_PRINTER_STATUS_USER_INTERVENTION 1557
79 #define PD32_PRINTER_STATUS_OUT_OF_MEMORY     1558
80 #define PD32_PRINTER_STATUS_DOOR_OPEN         1559
81 #define PD32_PRINTER_STATUS_SERVER_UNKNOWN    1560
82 #define PD32_PRINTER_STATUS_POWER_SAVE        1561
83
84 #define PD32_DEFAULT_PRINTER                  1582
85 #define PD32_NR_OF_DOCUMENTS_IN_QUEUE         1583
86 #define PD32_PRINT_ALL_X_PAGES                1584
87 #define PD32_MARGINS_IN_INCHES                1585
88 #define PD32_MARGINS_IN_MILIMETERS            1586
89 #define PD32_MILIMETERS                       1587
90
91 #include "commctrl.h"
92 #include "shlobj.h"
93 #include "shellapi.h"
94
95 /* IMAGELIST */
96 extern BOOL     (WINAPI* COMDLG32_ImageList_Draw) (HIMAGELIST himl, int i, HDC hdcDest, int x, int y, UINT fStyle);
97
98 /* ITEMIDLIST */
99
100 extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILClone) (LPCITEMIDLIST);
101 extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILCombine)(LPCITEMIDLIST,LPCITEMIDLIST);
102 extern LPITEMIDLIST (WINAPI *COMDLG32_PIDL_ILGetNext)(LPITEMIDLIST);
103 extern BOOL (WINAPI *COMDLG32_PIDL_ILRemoveLastID)(LPCITEMIDLIST);
104 extern BOOL (WINAPI *COMDLG32_PIDL_ILIsEqual)(LPCITEMIDLIST, LPCITEMIDLIST);
105
106 /* SHELL */
107 extern BOOL (WINAPI *COMDLG32_SHGetPathFromIDListA) (LPCITEMIDLIST,LPSTR);
108 extern HRESULT (WINAPI *COMDLG32_SHGetSpecialFolderLocation)(HWND,INT,LPITEMIDLIST *);
109 extern DWORD (WINAPI *COMDLG32_SHGetDesktopFolder)(IShellFolder **);
110 extern DWORD (WINAPI *COMDLG32_SHGetFileInfoA)(LPCSTR,DWORD,SHFILEINFOA*,UINT,UINT);
111 extern LPVOID (WINAPI *COMDLG32_SHAlloc)(DWORD);
112 extern DWORD (WINAPI *COMDLG32_SHFree)(LPVOID);
113 extern HRESULT (WINAPI *COMDLG32_SHGetDataFromIDListA)(LPSHELLFOLDER psf, LPCITEMIDLIST pidl, int nFormat, LPVOID dest, int len);
114 extern BOOL (WINAPI *COMDLG32_SHGetFolderPathA)(HWND,int,HANDLE,DWORD,LPSTR);
115
116
117 /* PATH */
118 extern BOOL (WINAPI *COMDLG32_PathIsRootA)(LPCSTR x);
119 extern LPSTR (WINAPI *COMDLG32_PathFindFileNameA)(LPCSTR path);
120 extern DWORD (WINAPI *COMDLG32_PathRemoveFileSpecA)(LPSTR fn);
121 extern BOOL (WINAPI *COMDLG32_PathMatchSpecW)(LPCWSTR x, LPCWSTR y);
122 extern LPSTR (WINAPI *COMDLG32_PathAddBackslashA)(LPSTR path);
123 extern BOOL (WINAPI *COMDLG32_PathCanonicalizeA)(LPSTR pszBuf, LPCSTR pszPath);
124 extern int (WINAPI *COMDLG32_PathGetDriveNumberA)(LPCSTR lpszPath);
125 extern BOOL (WINAPI *COMDLG32_PathIsRelativeA) (LPCSTR lpszPath);
126 extern LPSTR (WINAPI *COMDLG32_PathFindNextComponentA)(LPCSTR pszPath);
127 extern LPWSTR (WINAPI *COMDLG32_PathAddBackslashW)(LPWSTR lpszPath);
128 extern LPSTR (WINAPI *COMDLG32_PathFindExtensionA)(LPCVOID lpszPath);
129 extern BOOL (WINAPI *COMDLG32_PathAddExtensionA)(LPSTR  pszPath,LPCSTR pszExtension);
130
131
132 extern BOOL  WINAPI GetFileDialog95A(LPOPENFILENAMEA ofn,UINT iDlgType);
133 extern BOOL  WINAPI GetFileDialog95W(LPOPENFILENAMEW ofn,UINT iDlgType);
134
135 /* 16 bit api */
136
137 #include "pshpack1.h"
138
139 typedef UINT16 (CALLBACK *LPOFNHOOKPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
140
141 typedef struct {
142         DWORD           lStructSize;
143         HWND16          hwndOwner;
144         HINSTANCE16     hInstance;
145         SEGPTR          lpstrFilter;
146         SEGPTR          lpstrCustomFilter;
147         DWORD           nMaxCustFilter;
148         DWORD           nFilterIndex;
149         SEGPTR          lpstrFile;
150         DWORD           nMaxFile;
151         SEGPTR          lpstrFileTitle;
152         DWORD           nMaxFileTitle;
153         SEGPTR          lpstrInitialDir;
154         SEGPTR          lpstrTitle;
155         DWORD           Flags;
156         UINT16          nFileOffset;
157         UINT16          nFileExtension;
158         SEGPTR          lpstrDefExt;
159         LPARAM          lCustData;
160         LPOFNHOOKPROC16 lpfnHook;
161         SEGPTR          lpTemplateName;
162 }   OPENFILENAME16,*LPOPENFILENAME16;
163
164 typedef UINT16 (CALLBACK *LPCCHOOKPROC16) (HWND16, UINT16, WPARAM16, LPARAM);
165
166 typedef struct {
167         DWORD           lStructSize;
168         HWND16          hwndOwner;
169         HWND16          hInstance;
170         COLORREF        rgbResult;
171         COLORREF       *lpCustColors;
172         DWORD           Flags;
173         LPARAM          lCustData;
174         LPCCHOOKPROC16  lpfnHook;
175         SEGPTR          lpTemplateName;
176 } CHOOSECOLOR16;
177 typedef CHOOSECOLOR16 *LPCHOOSECOLOR16;
178
179 typedef UINT16 (CALLBACK *LPFRHOOKPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
180 typedef struct {
181         DWORD           lStructSize;                    /* size of this struct 0x20 */
182         HWND16          hwndOwner;                              /* handle to owner's window */
183         HINSTANCE16     hInstance;                              /* instance handle of.EXE that  */
184                                                                                 /*      contains cust. dlg. template */
185         DWORD           Flags;                  /* one or more of the FR_?? */
186         SEGPTR          lpstrFindWhat;          /* ptr. to search string    */
187         SEGPTR          lpstrReplaceWith;       /* ptr. to replace string   */
188         UINT16          wFindWhatLen;           /* size of find buffer      */
189         UINT16          wReplaceWithLen;        /* size of replace buffer   */
190         LPARAM          lCustData;              /* data passed to hook fn.  */
191         LPFRHOOKPROC16  lpfnHook;
192         SEGPTR          lpTemplateName;         /* custom template name     */
193 } FINDREPLACE16, *LPFINDREPLACE16;
194
195 typedef UINT16 (CALLBACK *LPCFHOOKPROC16)(HWND16,UINT16,WPARAM16,LPARAM);
196 typedef struct 
197 {
198         DWORD                   lStructSize;
199         HWND16                  hwndOwner;          /* caller's window handle   */
200         HDC16                   hDC;                /* printer DC/IC or NULL    */
201         SEGPTR                  lpLogFont;          /* ptr. to a LOGFONT struct */
202         short                   iPointSize;         /* 10 * size in points of selected font */
203         DWORD                   Flags;  /* enum. type flags         */
204         COLORREF                rgbColors;          /* returned text color      */
205         LPARAM                  lCustData;          /* data passed to hook fn.  */
206         LPCFHOOKPROC16          lpfnHook;
207         SEGPTR                  lpTemplateName;     /* custom template name     */
208         HINSTANCE16             hInstance;          /* instance handle of.EXE that   */
209                                                         /* contains cust. dlg. template  */
210         SEGPTR                  lpszStyle;  /* return the style field here   */
211                                                         /* must be LF_FACESIZE or bigger */
212         UINT16                  nFontType;              /* same value reported to the    */
213                                                         /* EnumFonts callback with the   */
214                                                         /* extra FONTTYPE_ bits added    */
215         short                   nSizeMin;   /* minimum pt size allowed & */
216         short                   nSizeMax;   /* max pt size allowed if    */
217                                                         /* CF_LIMITSIZE is used      */
218 } CHOOSEFONT16, *LPCHOOSEFONT16;
219
220
221 typedef UINT16 (CALLBACK *LPPRINTHOOKPROC16) (HWND16, UINT16, WPARAM16, LPARAM);
222 typedef UINT16 (CALLBACK *LPSETUPHOOKPROC16) (HWND16, UINT16, WPARAM16, LPARAM);
223 typedef struct
224 {
225     DWORD            lStructSize;
226     HWND16           hwndOwner;
227     HGLOBAL16        hDevMode;
228     HGLOBAL16        hDevNames;
229     HDC16            hDC;
230     DWORD            Flags;
231     WORD             nFromPage;
232     WORD             nToPage;
233     WORD             nMinPage;
234     WORD             nMaxPage;
235     WORD             nCopies;
236     HINSTANCE16      hInstance;
237     LPARAM           lCustData;
238     LPPRINTHOOKPROC16 lpfnPrintHook;
239     LPSETUPHOOKPROC16 lpfnSetupHook;
240     SEGPTR           lpPrintTemplateName;
241     SEGPTR           lpSetupTemplateName;
242     HGLOBAL16        hPrintTemplate;
243     HGLOBAL16        hSetupTemplate;
244 } PRINTDLG16, *LPPRINTDLG16;
245
246 BOOL16  WINAPI ChooseColor16(LPCHOOSECOLOR16 lpChCol);
247 HWND16  WINAPI FindText16( SEGPTR find);
248 INT16   WINAPI GetFileTitle16(LPCSTR lpFile, LPSTR lpTitle, UINT16 cbBuf);
249 BOOL16  WINAPI GetOpenFileName16(SEGPTR ofn);
250 BOOL16  WINAPI GetSaveFileName16(SEGPTR ofn);
251 BOOL16  WINAPI PrintDlg16( LPPRINTDLG16 print);
252 HWND16  WINAPI ReplaceText16( SEGPTR find);
253 BOOL16  WINAPI ChooseFont16(LPCHOOSEFONT16);
254
255 #include "poppack.h"
256
257 #endif /* _WINE_DLL_CDLG_H */
258