- start moving a few file related functions from files/file.c to
[wine] / include / prsht.h
1 /*
2  * Copyright (C) the Wine project
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_PRSHT_H
20 #define __WINE_PRSHT_H
21
22 #include "windef.h"
23 #include "wingdi.h"
24 #include "winuser.h"
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30
31 /*
32  * Property sheet support (callback procs)
33  */
34
35
36 #define WC_PROPSHEETA      "SysPropertySheet"
37 #if defined(__GNUC__)
38 # define WC_PROPSHEETW (const WCHAR []){ 'S','y','s', \
39   'P','r','o','p','e','r','t','y','S','h','e','e','t',0 }
40 #elif defined(_MSC_VER)
41 # define WC_PROPSHEETW     L"SysPropertySheet"
42 #else
43 static const WCHAR WC_PROPSHEETW[] = { 'S','y','s',
44   'P','r','o','p','e','r','t','y','S','h','e','e','t',0 };
45 #endif
46 #define WC_PROPSHEET         WINELIB_NAME_AW(WC_PROPSHEET)
47
48 struct _PROPSHEETPAGEA;  /** need to forward declare those structs **/
49 struct _PROPSHEETPAGEW;
50 struct _PSP;
51 typedef struct _PSP *HPROPSHEETPAGE;
52
53
54 typedef UINT (CALLBACK *LPFNPSPCALLBACKA)(HWND, UINT, struct _PROPSHEETPAGEA*);
55 typedef UINT (CALLBACK *LPFNPSPCALLBACKW)(HWND, UINT, struct _PROPSHEETPAGEW*);
56 typedef INT  (CALLBACK *PFNPROPSHEETCALLBACK)(HWND, UINT, LPARAM);
57 typedef BOOL (CALLBACK *LPFNADDPROPSHEETPAGE)(HPROPSHEETPAGE, LPARAM);
58 typedef BOOL (CALLBACK *LPFNADDPROPSHEETPAGES)(LPVOID, LPFNADDPROPSHEETPAGE, LPARAM);
59
60 /*
61  * Property sheet support (structures)
62  */
63 typedef struct _PROPSHEETPAGEA
64 {
65     DWORD              dwSize;
66     DWORD              dwFlags;
67     HINSTANCE        hInstance;
68     union
69     {
70         LPCSTR           pszTemplate;
71         LPCDLGTEMPLATEA  pResource;
72     }DUMMYUNIONNAME;
73     union
74     {
75         HICON          hIcon;
76         LPCSTR           pszIcon;
77     }DUMMYUNIONNAME2;
78     LPCSTR             pszTitle;
79     DLGPROC          pfnDlgProc;
80     LPARAM             lParam;
81     LPFNPSPCALLBACKA pfnCallback;
82     UINT*            pcRefParent;
83     LPCSTR             pszHeaderTitle;
84     LPCSTR             pszHeaderSubTitle;
85 } PROPSHEETPAGEA, *LPPROPSHEETPAGEA;
86
87 typedef const PROPSHEETPAGEA *LPCPROPSHEETPAGEA;
88
89 typedef struct _PROPSHEETPAGEW
90 {
91     DWORD               dwSize;
92     DWORD               dwFlags;
93     HINSTANCE         hInstance;
94     union
95     {
96         LPCWSTR          pszTemplate;
97         LPCDLGTEMPLATEW  pResource;
98     }DUMMYUNIONNAME;
99     union
100     {
101         HICON          hIcon;
102         LPCWSTR          pszIcon;
103     }DUMMYUNIONNAME2;
104     LPCWSTR            pszTitle;
105     DLGPROC          pfnDlgProc;
106     LPARAM             lParam;
107     LPFNPSPCALLBACKW pfnCallback;
108     UINT*            pcRefParent;
109     LPCWSTR            pszHeaderTitle;
110     LPCWSTR            pszHeaderSubTitle;
111 } PROPSHEETPAGEW, *LPPROPSHEETPAGEW;
112
113 typedef const PROPSHEETPAGEW *LPCPROPSHEETPAGEW;
114
115
116 typedef struct _PROPSHEETHEADERA
117 {
118     DWORD                    dwSize;
119     DWORD                    dwFlags;
120     HWND                   hwndParent;
121     HINSTANCE              hInstance;
122     union
123     {
124       HICON                  hIcon;
125       LPCSTR                   pszIcon;
126     }DUMMYUNIONNAME;
127     LPCSTR                   pszCaption;
128     UINT                   nPages;
129     union
130     {
131         UINT                 nStartPage;
132         LPCSTR                 pStartPage;
133     }DUMMYUNIONNAME2;
134     union
135     {
136         LPCPROPSHEETPAGEA    ppsp;
137         HPROPSHEETPAGE*        phpage;
138     }DUMMYUNIONNAME3;
139     PFNPROPSHEETCALLBACK   pfnCallback;
140     union
141     {
142         HBITMAP              hbmWatermark;
143         LPCSTR                 pszbmWatermark;
144     }DUMMYUNIONNAME4;
145     HPALETTE               hplWatermark;
146     union
147     {
148         HBITMAP              hbmHeader;
149         LPCSTR                 pszbmHeader;
150     }DUMMYUNIONNAME5;
151 } PROPSHEETHEADERA, *LPPROPSHEETHEADERA;
152
153 typedef const PROPSHEETHEADERA *LPCPROPSHEETHEADERA;
154
155 typedef struct _PROPSHEETHEADERW
156 {
157     DWORD                    dwSize;
158     DWORD                    dwFlags;
159     HWND                   hwndParent;
160     HINSTANCE              hInstance;
161     union
162     {
163       HICON                  hIcon;
164       LPCWSTR                   pszIcon;
165     }DUMMYUNIONNAME;
166     LPCWSTR                  pszCaption;
167     UINT                   nPages;
168     union
169     {
170         UINT                 nStartPage;
171         LPCWSTR                pStartPage;
172     }DUMMYUNIONNAME2;
173     union
174     {
175         LPCPROPSHEETPAGEW    ppsp;
176         HPROPSHEETPAGE*        phpage;
177     }DUMMYUNIONNAME3;
178     PFNPROPSHEETCALLBACK   pfnCallback;
179     union
180     {
181         HBITMAP              hbmWatermark;
182         LPCWSTR                pszbmWatermark;
183     }DUMMYUNIONNAME4;
184     HPALETTE               hplWatermark;
185     union
186     {
187         HBITMAP              hbmHeader;
188         LPCWSTR                pszbmHeader;
189     }DUMMYUNIONNAME5;
190 } PROPSHEETHEADERW, *LPPROPSHEETHEADERW;
191
192 typedef const PROPSHEETHEADERW *LPCPROPSHEETHEADERW;
193
194
195 /*
196  * Property sheet support (methods)
197  */
198 INT WINAPI PropertySheetA(LPCPROPSHEETHEADERA);
199 INT WINAPI PropertySheetW(LPCPROPSHEETHEADERW);
200 #define PropertySheet WINELIB_NAME_AW(PropertySheet)
201 HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(LPCPROPSHEETPAGEA);
202 HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW);
203 #define CreatePropertySheetPage WINELIB_NAME_AW(CreatePropertySheetPage)
204 BOOL WINAPI DestroyPropertySheetPage(HPROPSHEETPAGE hPropPage);
205
206 /*
207  * Property sheet support (UNICODE-Winelib)
208  */
209
210 DECL_WINELIB_TYPE_AW(PROPSHEETPAGE)
211 DECL_WINELIB_TYPE_AW(LPPROPSHEETPAGE)
212 DECL_WINELIB_TYPE_AW(LPCPROPSHEETPAGE)
213 DECL_WINELIB_TYPE_AW(PROPSHEETHEADER)
214 DECL_WINELIB_TYPE_AW(LPPROPSHEETHEADER)
215 DECL_WINELIB_TYPE_AW(LPCPROPSHEETHEADER)
216 DECL_WINELIB_TYPE_AW(LPFNPSPCALLBACK)
217
218
219 /*
220  * Property sheet support (defines)
221  */
222 #define PSP_DEFAULT             0x0000
223 #define PSP_DLGINDIRECT         0x0001
224 #define PSP_USEHICON            0x0002
225 #define PSP_USEICONID           0x0004
226 #define PSP_USETITLE            0x0008
227 #define PSP_RTLREADING          0x0010
228
229 #define PSP_HASHELP             0x0020
230 #define PSP_USEREFPARENT        0x0040
231 #define PSP_USECALLBACK         0x0080
232 #define PSP_PREMATURE           0x0400
233
234 #define PSP_HIDEHEADER          0x00000800
235 #define PSP_USEHEADERTITLE      0x00001000
236 #define PSP_USEHEADERSUBTITLE   0x00002000
237
238 #define PSPCB_RELEASE           1
239 #define PSPCB_CREATE            2
240
241 #define PSH_DEFAULT             0x0000
242 #define PSH_PROPTITLE           0x0001
243 #define PSH_USEHICON            0x0002
244 #define PSH_USEICONID           0x0004
245 #define PSH_PROPSHEETPAGE       0x0008
246 #define PSH_WIZARDHASFINISH     0x0010
247 #define PSH_WIZARD              0x0020
248 #define PSH_USEPSTARTPAGE       0x0040
249 #define PSH_NOAPPLYNOW          0x0080
250 #define PSH_USECALLBACK         0x0100
251 #define PSH_HASHELP             0x0200
252 #define PSH_MODELESS            0x0400
253 #define PSH_RTLREADING          0x0800
254 #define PSH_WIZARDCONTEXTHELP   0x00001000
255
256 #define PSH_WIZARD97_OLD        0x00002000 /* for IE < 5 */
257 #define PSH_WATERMARK           0x00008000
258 #define PSH_USEHBMWATERMARK     0x00010000
259 #define PSH_USEHPLWATERMARK     0x00020000
260 #define PSH_STRETCHWATERMARK    0x00040000
261 #define PSH_HEADER              0x00080000
262 #define PSH_USEHBMHEADER        0x00100000
263 #define PSH_USEPAGELANG         0x00200000
264 #define PSH_WIZARD_LITE         0x00400000
265 #define PSH_WIZARD97_NEW        0x01000000 /* for IE >= 5 */
266 #define PSH_NOCONTEXTHELP       0x02000000
267 #ifndef __WINESRC__
268 # if _WIN32_IE < 0x0500
269 #  define PSH_WIZARD97          PSH_WIZARD97_OLD
270 # else
271 #  define PSH_WIZARD97          PSH_WIZARD97_NEW
272 # endif
273 #endif
274
275 #define PSCB_INITIALIZED  1
276 #define PSCB_PRECREATE    2
277
278 typedef struct _PSHNOTIFY
279 {
280    NMHDR hdr;
281    LPARAM lParam;
282 } PSHNOTIFY, *LPPSHNOTIFY;
283
284 #define PSN_FIRST               (0U-200U)
285 #define PSN_LAST                (0U-299U)
286
287
288 #define PSN_SETACTIVE           (PSN_FIRST-0)
289 #define PSN_KILLACTIVE          (PSN_FIRST-1)
290 /* #define PSN_VALIDATE            (PSN_FIRST-1) */
291 #define PSN_APPLY               (PSN_FIRST-2)
292 #define PSN_RESET               (PSN_FIRST-3)
293 /* #define PSN_CANCEL              (PSN_FIRST-3) */
294 #define PSN_HELP                (PSN_FIRST-5)
295 #define PSN_WIZBACK             (PSN_FIRST-6)
296 #define PSN_WIZNEXT             (PSN_FIRST-7)
297 #define PSN_WIZFINISH           (PSN_FIRST-8)
298 #define PSN_QUERYCANCEL         (PSN_FIRST-9)
299 #define PSN_GETOBJECT           (PSN_FIRST-10)
300
301 #define PSNRET_NOERROR              0
302 #define PSNRET_INVALID              1
303 #define PSNRET_INVALID_NOCHANGEPAGE 2
304
305
306 #define PSM_SETCURSEL           (WM_USER + 101)
307 #define PSM_REMOVEPAGE          (WM_USER + 102)
308 #define PSM_ADDPAGE             (WM_USER + 103)
309 #define PSM_CHANGED             (WM_USER + 104)
310 #define PSM_RESTARTWINDOWS      (WM_USER + 105)
311 #define PSM_REBOOTSYSTEM        (WM_USER + 106)
312 #define PSM_CANCELTOCLOSE       (WM_USER + 107)
313 #define PSM_QUERYSIBLINGS       (WM_USER + 108)
314 #define PSM_UNCHANGED           (WM_USER + 109)
315 #define PSM_APPLY               (WM_USER + 110)
316 #define PSM_SETTITLEA         (WM_USER + 111)
317 #define PSM_SETTITLEW         (WM_USER + 120)
318 #define PSM_SETTITLE WINELIB_NAME_AW(PSM_SETTITLE)
319 #define PSM_SETWIZBUTTONS       (WM_USER + 112)
320 #define PSM_PRESSBUTTON         (WM_USER + 113)
321 #define PSM_SETCURSELID         (WM_USER + 114)
322 #define PSM_SETFINISHTEXTA    (WM_USER + 115)
323 #define PSM_SETFINISHTEXTW    (WM_USER + 121)
324 #define PSM_SETFINISHTEXT WINELIB_NAME_AW(PSM_SETFINISHTEXT)
325 #define PSM_GETTABCONTROL       (WM_USER + 116)
326 #define PSM_ISDIALOGMESSAGE     (WM_USER + 117)
327 #define PSM_GETCURRENTPAGEHWND  (WM_USER + 118)
328
329 #define PSWIZB_BACK             0x00000001
330 #define PSWIZB_NEXT             0x00000002
331 #define PSWIZB_FINISH           0x00000004
332 #define PSWIZB_DISABLEDFINISH   0x00000008
333
334 #define PSBTN_BACK              0
335 #define PSBTN_NEXT              1
336 #define PSBTN_FINISH            2
337 #define PSBTN_OK                3
338 #define PSBTN_APPLYNOW          4
339 #define PSBTN_CANCEL            5
340 #define PSBTN_HELP              6
341 #define PSBTN_MAX               6
342
343 #define ID_PSRESTARTWINDOWS     0x2
344 #define ID_PSREBOOTSYSTEM       (ID_PSRESTARTWINDOWS | 0x1)
345
346
347 #define WIZ_CXDLG               276
348 #define WIZ_CYDLG               140
349
350 #define WIZ_CXBMP               80
351
352 #define WIZ_BODYX               92
353 #define WIZ_BODYCX              184
354
355 #define PROP_SM_CXDLG           212
356 #define PROP_SM_CYDLG           188
357
358 #define PROP_MED_CXDLG          227
359 #define PROP_MED_CYDLG          215
360
361 #define PROP_LG_CXDLG           252
362 #define PROP_LG_CYDLG           218
363
364 /*
365  * Property sheet support (macros)
366  */
367
368 #define PropSheet_SetCurSel(hDlg, hpage, index) \
369         SendMessageA(hDlg, PSM_SETCURSEL, (WPARAM)index, (LPARAM)hpage)
370
371 #define PropSheet_RemovePage(hDlg, index, hpage) \
372         SNDMSG(hDlg, PSM_REMOVEPAGE, index, (LPARAM)hpage)
373
374 #define PropSheet_AddPage(hDlg, hpage) \
375         SNDMSG(hDlg, PSM_ADDPAGE, 0, (LPARAM)hpage)
376
377 #define PropSheet_Changed(hDlg, hwnd) \
378         SNDMSG(hDlg, PSM_CHANGED, (WPARAM)hwnd, 0L)
379
380 #define PropSheet_RestartWindows(hDlg) \
381         SNDMSG(hDlg, PSM_RESTARTWINDOWS, 0, 0L)
382
383 #define PropSheet_RebootSystem(hDlg) \
384         SNDMSG(hDlg, PSM_REBOOTSYSTEM, 0, 0L)
385
386 #define PropSheet_CancelToClose(hDlg) \
387         PostMessage(hDlg, PSM_CANCELTOCLOSE, 0, 0L)
388
389 #define PropSheet_QuerySiblings(hDlg, wParam, lParam) \
390         SNDMSG(hDlg, PSM_QUERYSIBLINGS, wParam, lParam)
391
392 #define PropSheet_UnChanged(hDlg, hwnd) \
393         SNDMSG(hDlg, PSM_UNCHANGED, (WPARAM)hwnd, 0L)
394
395 #define PropSheet_Apply(hDlg) \
396         SNDMSG(hDlg, PSM_APPLY, 0, 0L)
397
398 #define PropSheet_SetTitle(hDlg, wStyle, lpszText)\
399         SNDMSG(hDlg, PSM_SETTITLE, wStyle, (LPARAM)(LPCTSTR)lpszText)
400
401 #define PropSheet_SetWizButtons(hDlg, dwFlags) \
402         PostMessage(hDlg, PSM_SETWIZBUTTONS, 0, (LPARAM)dwFlags)
403
404 #define PropSheet_PressButton(hDlg, iButton) \
405         PostMessage(hDlg, PSM_PRESSBUTTON, (WPARAM)iButton, 0)
406
407 #define PropSheet_SetCurSelByID(hDlg, id) \
408         SNDMSG(hDlg, PSM_SETCURSELID, 0, (LPARAM)id)
409
410 #define PropSheet_SetFinishText(hDlg, lpszText) \
411         SNDMSG(hDlg, PSM_SETFINISHTEXT, 0, (LPARAM)lpszText)
412
413 #define PropSheet_GetTabControl(hDlg) \
414         (HWND)SNDMSG(hDlg, PSM_GETTABCONTROL, 0, 0)
415
416 #define PropSheet_IsDialogMessage(hDlg, pMsg) \
417         (BOOL)SNDMSG(hDlg, PSM_ISDIALOGMESSAGE, 0, (LPARAM)pMsg)
418
419 #define PropSheet_GetCurrentPageHwnd(hDlg) \
420         (HWND)SNDMSG(hDlg, PSM_GETCURRENTPAGEHWND, 0, 0L)
421
422
423 #ifdef __cplusplus
424 }
425 #endif
426
427 #endif /* __WINE_PRSHT_H */