Leaked source code of windows server 2003
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.

96 lines
1.9 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. ESPNLS.H
  5. History:
  6. --*/
  7. #ifndef ESPUTIL_ESPNLS_H
  8. #define ESPUTIL_ESPNLS_H
  9. typedef int CodePage;
  10. const CodePage cpInvalidCodePage = 0xDEADBEEF;
  11. const CodePage US_ACP = 1252;
  12. typedef WORD LangId;
  13. const int BAD_LOCALE = 0xFFFF;
  14. enum CodePageType
  15. {
  16. cpUnknown,
  17. cpAnsi,
  18. cpDos,
  19. cpMac,
  20. cpUnicode
  21. };
  22. struct LanguageInfo
  23. {
  24. LangId lid;
  25. CodePage cpAnsi;
  26. CodePage cpDos;
  27. CodePage cpMac;
  28. const TCHAR *szName;
  29. const TCHAR *szShortName;
  30. WORD fLangFlags;
  31. };
  32. const WORD lfNoFlags = 0;
  33. const WORD lfDBCSHotKey = 0x0001;
  34. typedef void (*pfnLangHandler)(const LanguageInfo &, void *);
  35. class LTAPIENTRY CLocLangId
  36. {
  37. public:
  38. CLocLangId(void);
  39. LTASSERTONLY(void AssertValid(void) const);
  40. NOTHROW LangId GetLanguageId(void) const;
  41. NOTHROW CodePage GetCodePage(CodePageType) const;
  42. NOTHROW void GetLangName(CLString &) const;
  43. NOTHROW void GetLangShortName(CLString &) const;
  44. NOTHROW BOOL SetLanguageId(LangId);
  45. NOTHROW const CLocLangId & operator=(const CLocLangId &);
  46. NOTHROW int operator==(const CLocLangId &) const;
  47. NOTHROW int operator!=(const CLocLangId &) const;
  48. NOTHROW static UINT GetNumLangInfo(void);
  49. static void EnumerateLanguages(pfnLangHandler, void *);
  50. static void Enumerate(CEnumCallback &);
  51. NOTHROW static BOOL IsDBCSHotKey(LangId);
  52. NOTHROW BOOL IsDBCSHotKey(void) const;
  53. NOTHROW static BOOL IsValidLangId(LangId lid);
  54. LTASSERTONLY(~CLocLangId());
  55. private:
  56. //
  57. // Private implementation.
  58. //
  59. NOTHROW static const LanguageInfo & LocateLangInfo(LangId);
  60. NOTHROW static const LanguageInfo & GetLangInfo(UINT);
  61. //
  62. // Private data.
  63. //
  64. LangId m_lid;
  65. const LanguageInfo *m_pLangInfo;
  66. };
  67. #if !defined(_DEBUG) || defined(IMPLEMENT)
  68. #include "espnls.inl"
  69. #endif
  70. #endif // ESPUTIL_ESPNLS_H