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.

100 lines
2.2 KiB

  1. //
  2. // mslbui.h
  3. //
  4. #ifndef MSLBUI_H
  5. #define MSLBUI_H
  6. #include "ctflbui.h"
  7. #include "nui.h"
  8. #include "computil.h"
  9. #include "gcomp.h"
  10. #include "cresstr.h"
  11. #include "cutil.h"
  12. #include "ids.h"
  13. #define STRSAFE_NO_DEPRECATE
  14. #include "strsafe.h"
  15. extern const GUID GUID_COMPARTMENT_CICPAD;
  16. extern const GUID GUID_COMPARTMENT_SPEECHUISHOWN;
  17. //////////////////////////////////////////////////////////////////////////////
  18. //
  19. // CUnCicAppLangBarAddIn
  20. //
  21. //////////////////////////////////////////////////////////////////////////////
  22. class CUnCicAppLangBarAddIn : public ITfLangBarAddIn, CDetectSRUtil
  23. {
  24. public:
  25. CUnCicAppLangBarAddIn();
  26. ~CUnCicAppLangBarAddIn();
  27. //
  28. // IUnknown methods
  29. //
  30. STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  31. STDMETHODIMP_(ULONG) AddRef(void);
  32. STDMETHODIMP_(ULONG) Release(void);
  33. //
  34. // ITfLangBarAddIn methods
  35. //
  36. STDMETHODIMP OnStart(CLSID *pclsid);
  37. STDMETHODIMP OnUpdate(DWORD dwFlags);
  38. STDMETHODIMP OnTerminate();
  39. DWORD GetUIStatus()
  40. {
  41. if (!_ptim)
  42. {
  43. if (!SUCCEEDED(TF_GetThreadMgr(&_ptim)) || !_ptim)
  44. {
  45. return 0;
  46. }
  47. }
  48. DWORD dw;
  49. GetCompartmentDWORD(_ptim, GUID_COMPARTMENT_SPEECHUISHOWN, &dw, FALSE);
  50. return dw;
  51. }
  52. private:
  53. static HRESULT _CompEventSinkCallback(void *pv, REFGUID rguid);
  54. void _DeleteSpeechUIItems();
  55. // utility
  56. void AddItemBalloon();
  57. void RemoveItemBalloon();
  58. void ToggleMicrophoneBtn( BOOL fOn);
  59. void SetBalloonText(WCHAR *pwszText);
  60. ITfLangBarItemMgr *_plbim;
  61. ITfCompartmentMgr *_pCompMgr;
  62. ITfThreadMgr *_ptim;
  63. CLBarCicPadItem *_pCicPadItem;
  64. CLBarItemMicrophone *_pMicrophoneItem;
  65. CLBarItemBalloon *_pBalloonItem;
  66. CLBarItemCfgMenuButton *_pCfgMenuItem;
  67. CGlobalCompartmentEventSink *_pces;
  68. #ifdef DEBUG
  69. CLBarTestItem *_pTestItem;
  70. #endif
  71. long _cRef;
  72. };
  73. BOOL GetBalloonStatus();
  74. void SetBalloonStatus(BOOL fShow, BOOL fForce);
  75. #define LANGIDFROMHKL(x) LANGID(LOWORD(HandleToLong(x)))
  76. #endif MSLBUI_H