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