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.

104 lines
3.1 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1999 **
  4. //*********************************************************************
  5. //
  6. // LANGUAGE.H - Header for the implementation of CLanguage
  7. //
  8. // HISTORY:
  9. //
  10. // 1/27/99 a-jaswed Created.
  11. //
  12. #ifndef _LANGUAGE_H_
  13. #define _LANGUAGE_H_
  14. #include <windows.h>
  15. #include <assert.h>
  16. #include <oleauto.h>
  17. #define LANGUAGE_REBOOT_NEVER 0
  18. #define LANGUAGE_REBOOT_NOW 1
  19. #define LANGUAGE_REBOOT_END 2
  20. // BUGBUG: SetupGetLocaleInfo will return sorted array so NAMELOOKUPELEMENT will not be needed.
  21. typedef struct tagNAMELOOKUPELEMENT {
  22. LPWSTR pszName;
  23. int nIndex;
  24. } NAMELOOKUPELEMENT, far *LPNAMELOOKUPELEMENT;
  25. class CLanguage : public IDispatch
  26. {
  27. private:
  28. ULONG m_cRef;
  29. DWORD m_lRebootState;
  30. long m_lRegionIndex;
  31. long m_lRegionDefault;
  32. long m_lRegionTotal;
  33. POOBE_LOCALE_INFO m_poliRegions;
  34. long m_lLangIndex;
  35. long m_lLangDefault;
  36. long m_lLangTotal;
  37. POOBE_LOCALE_INFO m_poliLangs;
  38. long m_lKeyboardLayoutIndex;
  39. long m_lKeyboardLayoutDefault;
  40. long m_lKeyboardLayoutTotal;
  41. POOBE_LOCALE_INFO m_poliKeyboards;
  42. long m_DefaultRegion;
  43. long m_DefaultLanguage;
  44. long m_DefaultKeyboard;
  45. //GET functions
  46. HRESULT get_NumOfRegions (long* plVal);
  47. HRESULT get_RegionIndex (long* plVal);
  48. HRESULT get_RegionName (long lIndex, BSTR* pbstrVal);
  49. HRESULT get_NumOfLangs (long* plVal);
  50. HRESULT get_LangIndex (long* plVal);
  51. HRESULT get_LangName (long lIndex, BSTR* pbstrVal);
  52. HRESULT get_NumOfKeyboardLayouts (long* plVal);
  53. HRESULT get_KeyboardLayoutIndex (long* plVal);
  54. HRESULT get_KeyboardLayoutName (long lIndex, BSTR* pbstrVal);
  55. //SET functions
  56. HRESULT set_RegionIndex (long lVal);
  57. HRESULT set_LangIndex (long lVal);
  58. HRESULT set_KeyboardLayoutIndex (long lVal);
  59. HRESULT SaveSettings ();
  60. VOID GetPhoneCountries ();
  61. public:
  62. CLanguage ();
  63. ~CLanguage ();
  64. // Public GET functions
  65. HRESULT get_RebootState (long* plVal);
  66. // IUnknown Interfaces
  67. STDMETHODIMP QueryInterface (REFIID riid, LPVOID* ppvObj);
  68. STDMETHODIMP_(ULONG) AddRef ();
  69. STDMETHODIMP_(ULONG) Release ();
  70. //IDispatch Interfaces
  71. STDMETHOD (GetTypeInfoCount) (UINT* pcInfo);
  72. STDMETHOD (GetTypeInfo) (UINT, LCID, ITypeInfo** );
  73. STDMETHOD (GetIDsOfNames) (REFIID, OLECHAR**, UINT, LCID, DISPID* );
  74. STDMETHOD (Invoke) (DISPID dispidMember, REFIID riid,
  75. LCID lcid, WORD wFlags,
  76. DISPPARAMS* pdispparams,
  77. VARIANT* pvarResult,
  78. EXCEPINFO* pexcepinfo, UINT* puArgErr);
  79. };
  80. #endif