Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

507 lines
15 KiB

  1. /*++
  2. Copyright (c) 1994-2000, Microsoft Corporation All rights reserved.
  3. Module Name:
  4. intl.h
  5. Abstract:
  6. This module contains the header information for the Regional Options
  7. applet.
  8. Revision History:
  9. --*/
  10. #ifndef _INTL_H_
  11. #define _INTL_H_
  12. //
  13. // Include Files.
  14. //
  15. #include <windows.h>
  16. #include <prsht.h>
  17. #include <prshtp.h>
  18. #include <shellapi.h>
  19. #include <setupapi.h>
  20. #include <winnls.h>
  21. #include "intlid.h"
  22. #include "util.h"
  23. #include <shlwapi.h>
  24. //
  25. // Enumeration
  26. //
  27. enum LANGCOLLECTION{
  28. BASIC_COLLECTION,
  29. COMPLEX_COLLECTION,
  30. CJK_COLLECTION,
  31. };
  32. //
  33. // Constant Declarations.
  34. //
  35. #define RMI_PRIMARY (0x1) // this should win in event of conflict
  36. #define ARRAYSIZE(a) (sizeof(a) / sizeof(a[0]))
  37. #define US_LOCALE (MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US))
  38. #define LANG_SPANISH_TRADITIONAL (MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH))
  39. #define LANG_SPANISH_INTL (MAKELANGID(LANG_SPANISH, SUBLANG_SPANISH_MODERN))
  40. #define LCID_SPANISH_TRADITIONAL (MAKELCID(LANG_SPANISH_TRADITIONAL, SORT_DEFAULT))
  41. #define LCID_SPANISH_INTL (MAKELCID(LANG_SPANISH_INTL, SORT_DEFAULT))
  42. #define ML_ORIG_INSTALLED 0x0001
  43. #define ML_PERMANENT 0x0002
  44. #define ML_INSTALL 0x0004
  45. #define ML_REMOVE 0x0008
  46. #define ML_DEFAULT 0x0010
  47. #define ML_DISABLE 0x0020
  48. #define ML_STATIC (ML_PERMANENT | ML_DEFAULT | ML_DISABLE)
  49. //
  50. // Used in string and other array declarations.
  51. //
  52. #define cInt_Str 10 // length of the array of int strings
  53. #define SIZE_64 64 // frequently used buffer size
  54. #define SIZE_128 128 // frequently used buffer size
  55. #define SIZE_300 300 // frequently used buffer size
  56. #define MAX_SAMPLE_SIZE 100 // limit on Sample text for display
  57. //
  58. // For the indicator on the tray.
  59. //
  60. #define IDM_NEWSHELL 249
  61. //
  62. // Character constants.
  63. //
  64. #define CHAR_SML_D TEXT('d')
  65. #define CHAR_CAP_M TEXT('M')
  66. #define CHAR_SML_Y TEXT('y')
  67. #define CHAR_SML_G TEXT('g')
  68. #define CHAR_SML_H TEXT('h')
  69. #define CHAR_CAP_H TEXT('H')
  70. #define CHAR_SML_M TEXT('m')
  71. #define CHAR_SML_S TEXT('s')
  72. #define CHAR_SML_T TEXT('t')
  73. #define CHAR_NULL TEXT('\0')
  74. #define CHAR_QUOTE TEXT('\'')
  75. #define CHAR_SPACE TEXT(' ')
  76. #define CHAR_COMMA TEXT(',')
  77. #define CHAR_SEMICOLON TEXT(';')
  78. #define CHAR_COLON TEXT(':')
  79. #define CHAR_STAR TEXT('*')
  80. #define CHAR_HYPHEN TEXT('-')
  81. #define CHAR_DECIMAL TEXT('.')
  82. #define CHAR_INTL_CURRENCY TEXT('�')
  83. #define CHAR_GRAVE TEXT('`')
  84. #define CHAR_ZERO TEXT('0')
  85. #define CHAR_NINE TEXT('9')
  86. //
  87. // Setup command line switch values.
  88. //
  89. #define SETUP_SWITCH_NONE 0x0000
  90. #define SETUP_SWITCH_R 0x0001
  91. #define SETUP_SWITCH_I 0x0002
  92. #define SETUP_SWITCH_S 0x0004
  93. //
  94. // Flags to assist in updating property sheet pages once the regional locale
  95. // setting has changed. As pages are updated, their process flag value is
  96. // deleted from the Verified_Regional_Chg variable.
  97. //
  98. #define INTL_ALL_CHG 0x00ff // change affects all pages
  99. #define INTL_CHG 0x001f // change affects customize pages
  100. #define Process_Num 0x0001 // number page not yet updated
  101. #define Process_Curr 0x0002 // currency page not yet updated
  102. #define Process_Time 0x0004 // time page not yet updated
  103. #define Process_Date 0x0008 // date page not yet updated
  104. #define Process_Sorting 0x0010 // sorting page not yet updated
  105. #define Process_Regional 0x0020 // regional options page not yet updated
  106. #define Process_Advanced 0x0040 // advanced page not yet updated
  107. #define Process_Languages 0x0080 // languages page not yet updated
  108. //
  109. // Each of these change flags will be used to update the appropriate property
  110. // sheet pages change word when their associated combobox notifies the
  111. // property sheet of a change. The change values are used to determine which
  112. // locale settings must be updated.
  113. //
  114. //
  115. // Region Change.
  116. //
  117. #define RC_EverChg 0x0001
  118. #define RC_UserRegion 0x0002
  119. #define RC_UserLocale 0x0004
  120. //
  121. // Advanced Change
  122. //
  123. #define AD_EverChg 0x0001
  124. #define AD_SystemLocale 0x0002
  125. #define AD_CodePages 0x0004
  126. #define AD_DefaultUser 0x0008
  127. //
  128. // Number Change.
  129. //
  130. #define NC_EverChg 0x0001
  131. #define NC_DSymbol 0x0002
  132. #define NC_NSign 0x0004
  133. #define NC_SList 0x0008
  134. #define NC_SThousand 0x0010
  135. #define NC_IDigits 0x0020
  136. #define NC_DGroup 0x0040
  137. #define NC_LZero 0x0080
  138. #define NC_NegFmt 0x0100
  139. #define NC_Measure 0x0200
  140. #define NC_NativeDigits 0x0400
  141. #define NC_DigitSubst 0x0800
  142. //
  143. // Currency Change.
  144. //
  145. #define CC_EverChg 0x0001
  146. #define CC_SCurrency 0x0002
  147. #define CC_CurrSymPos 0x0004
  148. #define CC_NegCurrFmt 0x0008
  149. #define CC_SMonDec 0x0010
  150. #define CC_ICurrDigits 0x0020
  151. #define CC_SMonThousand 0x0040
  152. #define CC_DMonGroup 0x0080
  153. //
  154. // Time Change.
  155. //
  156. #define TC_EverChg 0x0001
  157. #define TC_1159 0x0002
  158. #define TC_2359 0x0004
  159. #define TC_STime 0x0008
  160. #define TC_TimeFmt 0x0010
  161. #define TC_AllChg 0x001F
  162. #define TC_FullTime 0x0031
  163. //
  164. // Date Change.
  165. //
  166. #define DC_EverChg 0x0001
  167. #define DC_ShortFmt 0x0002
  168. #define DC_LongFmt 0x0004
  169. #define DC_SDate 0x0008
  170. #define DC_Calendar 0x0010
  171. #define DC_Arabic_Calendar 0x0020
  172. #define DC_TwoDigitYearMax 0x0040
  173. //
  174. // Sorting Change.
  175. //
  176. #define SC_EverChg 0x0001
  177. #define SC_Sorting 0x0002
  178. //
  179. // Language Change
  180. //
  181. #define LG_EverChg 0x0001
  182. #define LG_UILanguage 0x0002
  183. #define LG_Change 0x0004
  184. #define LG_Complex 0x0008
  185. #define LG_CJK 0x0010
  186. //
  187. // Global Variables.
  188. // Data that is shared betweeen the property sheets.
  189. //
  190. extern BOOL g_bCDROM; // if setup from a CD-ROM
  191. extern HANDLE g_hMutex; // mutex handle
  192. extern TCHAR szMutexName[]; // name of the mutex
  193. extern HANDLE g_hEvent; // event handle
  194. extern TCHAR szEventName[]; // name of the event
  195. extern BOOL g_bAdmin_Privileges; // Admin privileges
  196. extern DWORD g_dwLastSorting; // index of last sorting setting in combo box
  197. extern DWORD g_dwCurSorting; // index of current sorting setting in combo box
  198. extern BOOL g_bCustomize; // in customize mode or second level tabs
  199. extern DWORD g_dwCustChange; // change made at the second level
  200. extern BOOL g_bDefaultUser; // in default user settings
  201. extern BOOL g_bShowSortingTab; // show the sorting tab or not
  202. extern BOOL g_bInstallComplex; // Complex scripts language groups installation requested
  203. extern BOOL g_bInstallCJK; // CJK language groups installation requested
  204. extern TCHAR aInt_Str[cInt_Str][3]; // cInt_Str # of elements of int strings
  205. extern TCHAR szSample_Number[]; // used for currency and number samples
  206. extern TCHAR szNegSample_Number[]; // used for currency and number samples
  207. extern TCHAR szTimeChars[]; // valid time characters
  208. extern TCHAR szTCaseSwap[]; // invalid time chars to change case => valid
  209. extern TCHAR szTLetters[]; // time NLS chars
  210. extern TCHAR szSDateChars[]; // valid short date characters
  211. extern TCHAR szSDCaseSwap[]; // invalid SDate chars to change case => valid
  212. extern TCHAR szSDLetters[]; // short date NLS chars
  213. extern TCHAR szLDateChars[]; // valid long date characters
  214. extern TCHAR szLDCaseSwap[]; // invalid LDate chars to change case => valid
  215. extern TCHAR szLDLetters[]; // long date NLS chars
  216. extern TCHAR szStyleH[]; // date and time style H equivalent
  217. extern TCHAR szStyleh[]; // date and time style h equivalent
  218. extern TCHAR szStyleM[]; // date and time style M equivalent
  219. extern TCHAR szStylem[]; // date and time style m equivalent
  220. extern TCHAR szStyles[]; // date and time style s equivalent
  221. extern TCHAR szStylet[]; // date and time style t equivalent
  222. extern TCHAR szStyled[]; // date and time style d equivalent
  223. extern TCHAR szStyley[]; // date and time style y equivalent
  224. extern TCHAR szLocaleGetError[]; // shared locale info get error
  225. extern TCHAR szIntl[]; // intl string
  226. extern TCHAR szInvalidSDate[]; // invalid chars for date separator
  227. extern TCHAR szInvalidSTime[]; // invalid chars for time separator
  228. extern HINSTANCE hInstance; // library instance
  229. extern int Verified_Regional_Chg; // used to determine when to verify
  230. // regional changes in all prop sheet pgs
  231. extern int RegionalChgState; // used to determine when a page have changed
  232. extern BOOL Styles_Localized; // indicate whether or not style must be
  233. // translated between NLS and local formats
  234. extern LCID UserLocaleID; // user locale
  235. extern LCID SysLocaleID; // system locale
  236. extern LCID RegUserLocaleID; // user locale stored in the registry
  237. extern LCID RegSysLocaleID; // system locale stored in the registry
  238. extern BOOL bShowRtL; // indicate if RTL date samples should be shown
  239. extern BOOL bShowArabic; // indicate if the other Arabic specific stuff should be shown
  240. extern BOOL bHebrewUI; // indicate if the UI language is Hebrew
  241. extern BOOL bLPKInstalled; // if LPK is installed
  242. extern TCHAR szSetupSourcePath[]; // buffer to hold setup source string
  243. extern LPTSTR pSetupSourcePath; // pointer to setup source string buffer
  244. extern TCHAR szSetupSourcePathWithArchitecture[]; // buffer to hold setup source string with architecture-specific extension.
  245. extern LPTSTR pSetupSourcePathWithArchitecture; // pointer to setup source string buffer with architecture-specific extension.
  246. //
  247. // Global Variables.
  248. //
  249. static TCHAR szLayoutPath[] = TEXT("SYSTEM\\CurrentControlSet\\Control\\Keyboard Layouts");
  250. static TCHAR szKbdPreloadKey[] = TEXT("Keyboard Layout\\Preload");
  251. static TCHAR szKbdSubstKey[] = TEXT("Keyboard Layout\\Substitutes");
  252. static TCHAR szKbdToggleKey[] = TEXT("Keyboard Layout\\Toggle");
  253. static TCHAR szKbdPreloadKey_DefUser[] = TEXT(".DEFAULT\\Keyboard Layout\\Preload");
  254. static TCHAR szKbdSubstKey_DefUser[] = TEXT(".DEFAULT\\Keyboard Layout\\Substitutes");
  255. static TCHAR szKbdToggleKey_DefUser[] = TEXT(".DEFAULT\\Keyboard Layout\\Toggle");
  256. static TCHAR szInternat[] = TEXT("internat.exe");
  257. static char szInternatA[] = "internat.exe";
  258. extern BOOL g_bSetupCase;
  259. extern BOOL g_bLog;
  260. extern BOOL g_bProgressBarDisplay;
  261. extern BOOL g_bSettingsChanged;
  262. extern BOOL g_bUnttendMode;
  263. extern BOOL g_bMatchUIFont;
  264. extern const TCHAR c_szInstalledLocales[];
  265. extern const TCHAR c_szLanguageGroups[];
  266. extern const TCHAR c_szLIPInstalled[];
  267. extern const TCHAR c_szMUILanguages[];
  268. extern const TCHAR c_szFontSubstitute[];
  269. extern const TCHAR c_szSetupKey[];
  270. extern const TCHAR c_szCPanelIntl[];
  271. extern const TCHAR c_szCPanelIntl_DefUser[];
  272. extern const TCHAR c_szCtfmon[];
  273. extern const TCHAR c_szCtfmon_DefUser[];
  274. extern const TCHAR c_szCPanelDesktop[];
  275. extern const TCHAR c_szCPanelDesktop_DefUser[];
  276. extern const TCHAR c_szKbdLayouts[];
  277. extern const TCHAR c_szKbdLayouts_DefUser[];
  278. extern const TCHAR c_szInputMethod[];
  279. extern const TCHAR c_szInputMethod_DefUser[];
  280. extern const TCHAR c_szInputTips[];
  281. extern const TCHAR c_szInputTips_DefUser[];
  282. extern const TCHAR c_szMUIPolicyKeyPath[];
  283. extern const TCHAR c_szMUIValue[];
  284. extern const TCHAR c_szIntlRun[];
  285. extern const TCHAR c_szSysocmgr[];
  286. extern TCHAR szIntlInf[];
  287. extern TCHAR szHelpFile[];
  288. extern TCHAR szFontSubstitute[];
  289. extern TCHAR szLocaleListPrefix[];
  290. extern TCHAR szLGBasicInstall[];
  291. extern TCHAR szLGComplexInstall[];
  292. extern TCHAR szLGComplexRemove[];
  293. extern TCHAR szLGExtInstall[];
  294. extern TCHAR szLGExtRemove[];
  295. extern TCHAR szCPInstallPrefix[];
  296. extern TCHAR szCPRemovePrefix[];
  297. extern TCHAR szKbdLayoutIds[];
  298. extern TCHAR szInputLibrary[]; // Name of the library that contain the text input dlg
  299. extern TCHAR szUIFontSubstitute[];
  300. extern TCHAR szSetupInProgress[];
  301. extern TCHAR szSetupUpgrade[];
  302. extern TCHAR szMultiUILanguageId[];
  303. extern TCHAR szMUILangPending[];
  304. extern TCHAR szCtfmonValue[];
  305. extern TCHAR szRegionalSettings[];
  306. extern TCHAR szLanguageGroup[];
  307. extern TCHAR szLanguage[];
  308. extern TCHAR szSystemLocale[];
  309. extern TCHAR szUserLocale[];
  310. extern TCHAR szInputLocale[];
  311. extern TCHAR szMUILanguage[];
  312. extern TCHAR szUserLocale_DefUser[];
  313. extern TCHAR szInputLocale_DefUser[];
  314. extern TCHAR szMUILanguage_DefUSer[];
  315. extern HINF g_hIntlInf;
  316. extern LPLANGUAGEGROUP pLanguageGroups;
  317. extern LPCODEPAGE pCodePages;
  318. extern int g_NumAltSorts;
  319. extern HANDLE hAltSorts;
  320. extern LPDWORD pAltSorts;
  321. extern HINSTANCE hInputDLL;
  322. extern BOOL (*pfnInstallInputLayout)(LCID, DWORD, BOOL, HKL, BOOL, BOOL);
  323. extern BOOL (*pfnUninstallInputLayout)(LCID, DWORD, BOOL);
  324. //
  325. // Language group of UI languages.
  326. //
  327. extern UILANGUAGEGROUP UILangGroup;
  328. //
  329. // Function Prototypes.
  330. //
  331. //
  332. // Callback functions for each of the propety sheet pages.
  333. //
  334. INT_PTR CALLBACK
  335. GeneralDlgProc(
  336. HWND hDlg,
  337. UINT message,
  338. WPARAM wParam,
  339. LPARAM lParam);
  340. INT_PTR CALLBACK
  341. InputLocaleDlgProc(
  342. HWND hDlg,
  343. UINT message,
  344. WPARAM wParam,
  345. LPARAM lParam);
  346. INT_PTR CALLBACK
  347. LanguageDlgProc(
  348. HWND hDlg,
  349. UINT message,
  350. WPARAM wParam,
  351. LPARAM lParam);
  352. INT_PTR CALLBACK
  353. AdvancedDlgProc(
  354. HWND hDlg,
  355. UINT message,
  356. WPARAM wParam,
  357. LPARAM lParam);
  358. INT_PTR CALLBACK
  359. NumberDlgProc(
  360. HWND hDlg,
  361. UINT message,
  362. WPARAM wParam,
  363. LPARAM lParam);
  364. INT_PTR CALLBACK
  365. CurrencyDlgProc(
  366. HWND hDlg,
  367. UINT message,
  368. WPARAM wParam,
  369. LPARAM lParam);
  370. INT_PTR CALLBACK
  371. TimeDlgProc(
  372. HWND hDlg,
  373. UINT message,
  374. WPARAM wParam,
  375. LPARAM lParam);
  376. INT_PTR CALLBACK
  377. DateDlgProc(
  378. HWND hDlg,
  379. UINT message,
  380. WPARAM wParam,
  381. LPARAM lParam);
  382. INT_PTR CALLBACK
  383. SortingDlgProc(
  384. HWND hDlg,
  385. UINT message,
  386. WPARAM wParam,
  387. LPARAM lParam);
  388. //
  389. // In regdlg.c.
  390. //
  391. void
  392. Region_UpdateShortDate(VOID);
  393. void
  394. Region_DoUnattendModeSetup(
  395. LPCTSTR pUnattendFile);
  396. //
  397. // In intl.c.
  398. //
  399. BOOL
  400. IsRtLLocale(
  401. LCID iLCID);
  402. //
  403. // Restore functions.
  404. //
  405. void
  406. Date_RestoreValues();
  407. void
  408. Currency_RestoreValues();
  409. void
  410. Time_RestoreValues();
  411. void
  412. Number_RestoreValues();
  413. void
  414. Sorting_RestoreValues();
  415. #endif //_INTL_H_