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.

113 lines
2.4 KiB

  1. /*++
  2. Copyright (c) 2001, Microsoft Corporation
  3. Module Name:
  4. profile.h
  5. Abstract:
  6. This file defines the CicProfiles Class.
  7. Author:
  8. Revision History:
  9. Notes:
  10. --*/
  11. #ifndef _PROFILE_H
  12. #define _PROFILE_H
  13. #include "ats.h"
  14. #include "tls.h"
  15. #include "template.h"
  16. class CicProfile : public IUnknown
  17. {
  18. public:
  19. CicProfile();
  20. virtual ~CicProfile();
  21. public:
  22. //
  23. // IUnknown methods
  24. //
  25. STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  26. STDMETHODIMP_(ULONG) AddRef(void);
  27. STDMETHODIMP_(ULONG) Release(void);
  28. //
  29. //
  30. //
  31. HRESULT InitProfileInstance(TLS* ptls);
  32. HRESULT Activate(void);
  33. HRESULT Deactivate(void);
  34. HRESULT ChangeCurrentKeyboardLayout(HKL hKL);
  35. HRESULT GetLangId(LANGID *plid);
  36. HRESULT GetCodePageA(UINT* puCodePage);
  37. HRESULT GetKeyboardLayout(HKL* phkl);
  38. HRESULT IsIME(HKL hKL);
  39. HRESULT GetActiveLanguageProfile(IN HKL hKL,
  40. IN GUID catid,
  41. OUT TF_LANGUAGEPROFILE* pLanguageProfile);
  42. public:
  43. //
  44. // Callbacks
  45. //
  46. static HRESULT ActiveLanguageProfileNotifySinkCallback(REFGUID rguid, REFGUID rguidProfile, BOOL fActivated, void *pv);
  47. //
  48. // Enumrate callbacks
  49. //
  50. struct LANG_PROF_ENUM_ARG {
  51. IN GUID catid;
  52. OUT TF_LANGUAGEPROFILE LanguageProfile;
  53. };
  54. static ENUM_RET LanguageProfilesCallback(TF_LANGUAGEPROFILE LanguageProfile,
  55. LANG_PROF_ENUM_ARG* pLangProfEnumArg);
  56. private:
  57. LANGID LangIdFromKL(HKL hKL)
  58. {
  59. return LOWORD(hKL);
  60. }
  61. void ResetCache(void)
  62. {
  63. m_fInitCP = FALSE;
  64. m_fInitLangID = FALSE;
  65. m_fInitHKL = FALSE;
  66. }
  67. protected:
  68. ITfInputProcessorProfiles* m_profile;
  69. CActiveLanguageProfileNotifySink* m_pActiveLanguageProfileNotifySink;
  70. private:
  71. LANGID m_SavedLangId;
  72. BOOL m_fActivateThread : 1; // TRUE: Activate this thread.
  73. BOOL m_fInitCP : 1; // TRUE: initialized CodePage value.
  74. BOOL m_fInitLangID : 1; // TRUE: initialized LangID value.
  75. BOOL m_fInitHKL : 1; // TRUE: initialized hKL value.
  76. UINT m_cp;
  77. LANGID m_LangID;
  78. HKL m_hKL;
  79. long m_ref;
  80. };
  81. #endif // _PROFILE_H