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