[INTL]
[reactos.git] / reactos / dll / cpl / intl / intl.h
1 #ifndef _INTL_H
2 #define _INTL_H
3
4 #include <stdarg.h>
5 #include <stdlib.h>
6
7 #define WIN32_NO_STATUS
8 #include <windef.h>
9 #include <winbase.h>
10 #include <winnls.h>
11 #include <winreg.h>
12 #include <winuser.h>
13 #include <cpl.h>
14 #include <setupapi.h>
15 #include <ndk/exfuncs.h>
16
17 #include "resource.h"
18
19 #define DECIMAL_RADIX 10
20
21 /* Limits */
22 #define MAX_FMT_SIZE 30
23 #define MAX_STR_SIZE 128
24 #define MAX_SAMPLES_STR_SIZE 70
25
26 #define MAX_NUMDECIMALSEP 4
27 #define MAX_NUMTHOUSANDSEP 4
28 #define MAX_NUMNEGATIVESIGN 5
29 #define MAX_NUMPOSITIVESIGN 5
30 #define MAX_NUMLISTSEP 4
31 #define MAX_NUMNATIVEDIGITS 11
32
33 #define MAX_CURRSYMBOL 13
34 #define MAX_CURRDECIMALSEP 4
35 #define MAX_CURRTHOUSANDSEP 4
36 #define MAX_CURRGROUPING 10
37
38 #define MAX_TIMEFORMAT 80
39 #define MAX_TIMESEPARATOR 4
40 #define MAX_TIMEAMSYMBOL 15
41 #define MAX_TIMEPMSYMBOL 15
42
43 #define MAX_SHORTDATEFORMAT 80
44 #define MAX_LONGDATEFORMAT 80
45 #define MAX_DATESEPARATOR 4
46 #define MAX_YEAR_EDIT 4
47
48 #define MAX_MISCCOUNTRY 80
49 #define MAX_MISCLANGUAGE 80
50
51 #define MAX_GROUPINGFORMATS 3
52
53
54 typedef struct _APPLET
55 {
56 UINT idIcon;
57 UINT idName;
58 UINT idDescription;
59 APPLET_PROC AppletProc;
60 } APPLET, *PAPPLET;
61
62 typedef struct _GLOBALDATA
63 {
64 /* Number */
65 WCHAR szNumDecimalSep[MAX_NUMDECIMALSEP];
66 WCHAR szNumThousandSep[MAX_NUMTHOUSANDSEP];
67 WCHAR szNumNegativeSign[MAX_NUMNEGATIVESIGN];
68 WCHAR szNumPositiveSign[MAX_NUMPOSITIVESIGN];
69 WCHAR szNumListSep[MAX_NUMLISTSEP];
70 WCHAR szNumNativeDigits[MAX_NUMNATIVEDIGITS];
71 INT nNumNegFormat;
72 INT nNumDigits;
73 INT nNumLeadingZero;
74 INT nNumGrouping;
75 INT nNumMeasure;
76 INT nNumShape;
77
78 /* Currency */
79 WCHAR szCurrSymbol[MAX_CURRSYMBOL];
80 WCHAR szCurrDecimalSep[MAX_CURRDECIMALSEP];
81 WCHAR szCurrThousandSep[MAX_CURRTHOUSANDSEP];
82 INT nCurrPosFormat;
83 INT nCurrNegFormat;
84 INT nCurrDigits;
85 INT nCurrGrouping;
86
87 /* Time */
88 WCHAR szTimeFormat[MAX_TIMEFORMAT];
89 WCHAR szTimeSep[MAX_TIMESEPARATOR];
90 WCHAR szTimeAM[MAX_TIMEAMSYMBOL];
91 WCHAR szTimePM[MAX_TIMEPMSYMBOL];
92 INT nTime;
93 INT nTimePrefix;
94 INT nTimeLeadingZero;
95
96 /* Date */
97 WCHAR szLongDateFormat[MAX_LONGDATEFORMAT];
98 WCHAR szShortDateFormat[MAX_SHORTDATEFORMAT];
99 WCHAR szDateSep[MAX_DATESEPARATOR];
100 INT nFirstDayOfWeek;
101 INT nFirstWeekOfYear;
102 INT nDate;
103 INT nCalendarType;
104
105 /* Other */
106 WCHAR szMiscCountry[MAX_MISCCOUNTRY];
107 WCHAR szMiscLanguage[MAX_MISCLANGUAGE];
108 INT nMiscCountry;
109
110 LCID UserLCID;
111 LCID SystemLCID;
112 BOOL bUserLocaleChanged;
113 BOOL bApplyToDefaultUser;
114
115 GEOID geoid;
116 BOOL bGeoIdChanged;
117
118 /* Misc */
119 BOOL bIsUserAdmin;
120 } GLOBALDATA, *PGLOBALDATA;
121
122 typedef struct
123 {
124 UINT nInteger;
125 PWSTR pszString;
126 } GROUPINGDATA;
127
128 extern HINSTANCE hApplet;
129 extern DWORD IsUnattendedSetupEnabled;
130 extern DWORD UnattendLCID;
131 extern GROUPINGDATA GroupingFormats[MAX_GROUPINGFORMATS];
132
133 /* intl.c */
134 VOID PrintErrorMsgBox(UINT msg);
135
136 INT
137 ResourceMessageBox(
138 HWND hwnd,
139 UINT uType,
140 UINT uCaptionId,
141 UINT uMessageId);
142
143 /* languages.c */
144 INT_PTR CALLBACK
145 LanguagesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
146
147 /* advanced.c */
148 INT_PTR CALLBACK
149 AdvancedPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
150
151 /* currency.c */
152 INT_PTR CALLBACK
153 CurrencyPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
154
155 /* date.c */
156 INT_PTR CALLBACK
157 DatePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
158
159 /* general.c */
160 INT_PTR CALLBACK
161 GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
162
163 PWSTR
164 GetLocaleString(
165 PWSTR *pLocaleArray,
166 LCTYPE lcType);
167
168 /* locale.c */
169 INT_PTR CALLBACK
170 InpLocalePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
171
172 /* numbers.h */
173 INT_PTR CALLBACK
174 NumbersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
175
176 /* time.c */
177 INT_PTR CALLBACK
178 TimePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
179
180 /* sort.c */
181 BOOL
182 IsSortPageNeeded(LCID lcid);
183
184 INT_PTR CALLBACK
185 SortPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
186
187 /* misc.c */
188 PWSTR
189 InsSpacesFmt(PCWSTR szSourceStr, PCWSTR szFmtStr);
190
191 PWSTR
192 ReplaceSubStr(PCWSTR szSourceStr, PCWSTR szStrToReplace, PCWSTR szTempl);
193
194 /* kblayouts.c */
195 VOID AddNewKbLayoutsByLcid(LCID Lcid);
196
197 #endif /* _INTL_H */