xref: /reactos/dll/cpl/intl/intl.h (revision c2c66aff)
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     /* General */
65     WCHAR szNumPositiveSign[MAX_NUMPOSITIVESIGN];
66     WCHAR szNumNativeDigits[MAX_NUMNATIVEDIGITS];
67 
68     /* Number */
69     WCHAR szNumDecimalSep[MAX_NUMDECIMALSEP];
70     WCHAR szNumThousandSep[MAX_NUMTHOUSANDSEP];
71     WCHAR szNumNegativeSign[MAX_NUMNEGATIVESIGN];
72     WCHAR szNumListSep[MAX_NUMLISTSEP];
73     INT nNumNegFormat;
74     INT nNumDigits;
75     INT nNumLeadingZero;
76     INT nNumGrouping;
77     INT nNumMeasure;
78     INT nNumShape;
79 
80     /* Currency */
81     WCHAR szCurrSymbol[MAX_CURRSYMBOL];
82     WCHAR szCurrDecimalSep[MAX_CURRDECIMALSEP];
83     WCHAR szCurrThousandSep[MAX_CURRTHOUSANDSEP];
84     INT nCurrPosFormat;
85     INT nCurrNegFormat;
86     INT nCurrDigits;
87     INT nCurrGrouping;
88 
89     /* Time */
90     WCHAR szTimeFormat[MAX_TIMEFORMAT];
91     WCHAR szTimeSep[MAX_TIMESEPARATOR];
92     WCHAR szTimeAM[MAX_TIMEAMSYMBOL];
93     WCHAR szTimePM[MAX_TIMEPMSYMBOL];
94     INT nTime;
95     INT nTimePrefix;
96     INT nTimeLeadingZero;
97 
98     /* Date */
99     WCHAR szLongDateFormat[MAX_LONGDATEFORMAT];
100     WCHAR szShortDateFormat[MAX_SHORTDATEFORMAT];
101     WCHAR szDateSep[MAX_DATESEPARATOR];
102     INT nFirstDayOfWeek;
103     INT nFirstWeekOfYear;
104     INT nDate;
105     INT nCalendarType;
106     BOOL bEnableYearNotification;
107 
108     /* Other */
109     WCHAR szMiscCountry[MAX_MISCCOUNTRY];
110     WCHAR szMiscLanguage[MAX_MISCLANGUAGE];
111     INT nMiscCountry;
112 
113     LCID UserLCID;
114     LCID SystemLCID;
115     BOOL bUserLocaleChanged;
116     BOOL bApplyToDefaultUser;
117 
118     GEOID geoid;
119     BOOL bGeoIdChanged;
120 
121     /* Misc */
122     BOOL bIsUserAdmin;
123 } GLOBALDATA, *PGLOBALDATA;
124 
125 typedef struct
126 {
127     UINT nInteger;
128     PWSTR pszString;
129 } GROUPINGDATA;
130 
131 extern HINSTANCE hApplet;
132 extern DWORD IsUnattendedSetupEnabled;
133 extern DWORD UnattendLCID;
134 extern GROUPINGDATA GroupingFormats[MAX_GROUPINGFORMATS];
135 
136 /* intl.c */
137 VOID PrintErrorMsgBox(UINT msg);
138 
139 INT
140 ResourceMessageBox(
141     HWND hwnd,
142     UINT uType,
143     UINT uCaptionId,
144     UINT uMessageId);
145 
146 /* languages.c */
147 INT_PTR CALLBACK
148 LanguagesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
149 
150 /* advanced.c */
151 INT_PTR CALLBACK
152 AdvancedPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
153 
154 /* currency.c */
155 INT_PTR CALLBACK
156 CurrencyPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
157 
158 /* date.c */
159 INT_PTR CALLBACK
160 DatePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
161 
162 /* general.c */
163 INT_PTR CALLBACK
164 GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
165 
166 PWSTR
167 GetLocaleString(
168     PWSTR *pLocaleArray,
169     LCTYPE lcType);
170 
171 /* locale.c */
172 INT_PTR CALLBACK
173 InpLocalePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
174 
175 /* numbers.h */
176 INT_PTR CALLBACK
177 NumbersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
178 
179 /* time.c */
180 INT_PTR CALLBACK
181 TimePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
182 
183 /* sort.c */
184 BOOL
185 IsSortPageNeeded(LCID lcid);
186 
187 INT_PTR CALLBACK
188 SortPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
189 
190 /* misc.c */
191 PWSTR
192 InsSpacesFmt(PCWSTR szSourceStr, PCWSTR szFmtStr);
193 
194 PWSTR
195 ReplaceSubStr(PCWSTR szSourceStr, PCWSTR szStrToReplace, PCWSTR szTempl);
196 
197 VOID
198 GetSelectedComboBoxText(
199     HWND hwndDlg,
200     INT nIdDlgItem,
201     PWSTR Buffer,
202     UINT uSize);
203 
204 VOID
205 GetSelectedComboBoxIndex(
206     HWND hwndDlg,
207     INT nIdDlgItem,
208     PINT pValue);
209 
210 /* kblayouts.c */
211 VOID AddNewKbLayoutsByLcid(LCID Lcid);
212 
213 #endif /* _INTL_H */
214