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.

94 lines
2.1 KiB

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