[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 <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 } GLOBALDATA, *PGLOBALDATA;
120
121 typedef struct
122 {
123 UINT nInteger;
124 PWSTR pszString;
125 } GROUPINGDATA;
126
127 extern HINSTANCE hApplet;
128 extern DWORD IsUnattendedSetupEnabled;
129 extern DWORD UnattendLCID;
130 extern GROUPINGDATA GroupingFormats[MAX_GROUPINGFORMATS];
131
132 /* intl.c */
133 VOID PrintErrorMsgBox(UINT msg);
134
135 VOID
136 ResourceMessageBox(
137 HWND hwnd,
138 UINT uType,
139 UINT uCaptionId,
140 UINT uMessageId);
141
142 /* languages.c */
143 INT_PTR CALLBACK
144 LanguagesPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
145
146 /* advanced.c */
147 INT_PTR CALLBACK
148 AdvancedPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
149
150 /* currency.c */
151 INT_PTR CALLBACK
152 CurrencyPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
153
154 /* date.c */
155 INT_PTR CALLBACK
156 DatePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
157
158 /* general.c */
159 INT_PTR CALLBACK
160 GeneralPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
161
162 PWSTR
163 GetLocaleString(
164 PWSTR *pLocaleArray,
165 LCTYPE lcType);
166
167 /* locale.c */
168 INT_PTR CALLBACK
169 InpLocalePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
170
171 /* numbers.h */
172 INT_PTR CALLBACK
173 NumbersPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
174
175 /* time.c */
176 INT_PTR CALLBACK
177 TimePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
178
179 /* sort.c */
180 BOOL
181 IsSortPageNeeded(LCID lcid);
182
183 INT_PTR CALLBACK
184 SortPageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
185
186 /* misc.c */
187 PWSTR
188 InsSpacesFmt(PCWSTR szSourceStr, PCWSTR szFmtStr);
189
190 PWSTR
191 ReplaceSubStr(PCWSTR szSourceStr, PCWSTR szStrToReplace, PCWSTR szTempl);
192
193 /* kblayouts.c */
194 VOID AddNewKbLayoutsByLcid(LCID Lcid);
195
196 #endif /* _INTL_H */