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