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.1 KiB

  1. /*++
  2. Copyright (c) 2001, Microsoft Corporation
  3. Module Name:
  4. mouse.h
  5. Abstract:
  6. This file defines the CMouseSink Class.
  7. Author:
  8. Revision History:
  9. Notes:
  10. --*/
  11. #ifndef _MOUSE_H_
  12. #define _MOUSE_H_
  13. #include "imc.h"
  14. #include "template.h"
  15. class CMouseSink
  16. {
  17. public:
  18. CMouseSink(TfClientId tid,
  19. Interface_Attach<ITfContext> pic,
  20. LIBTHREAD* pLibTLS)
  21. : m_tid(tid), m_ic(pic), m_pLibTLS(pLibTLS)
  22. {
  23. m_ref = 1;
  24. m_prgMouseSinks = NULL;
  25. }
  26. virtual ~CMouseSink()
  27. {
  28. if (m_prgMouseSinks)
  29. {
  30. delete m_prgMouseSinks;
  31. m_prgMouseSinks = NULL;
  32. }
  33. }
  34. BOOL Init()
  35. {
  36. Assert(!m_prgMouseSinks);
  37. m_prgMouseSinks = new CStructArray<GENERICSINK>;
  38. if (!m_prgMouseSinks)
  39. return FALSE;
  40. return TRUE;
  41. }
  42. public:
  43. ULONG InternalAddRef(void);
  44. ULONG InternalRelease(void);
  45. public:
  46. //
  47. // Mouse sink
  48. //
  49. public:
  50. HRESULT AdviseMouseSink(HIMC hImc, ITfRangeACP* range, ITfMouseSink* pSink, DWORD* pdwCookie);
  51. HRESULT UnadviseMouseSink(DWORD dwCookie);
  52. LRESULT MsImeMouseHandler(ULONG uEdge, ULONG uQuadrant, ULONG dwBtnStatus, IMCLock& imc);
  53. public:
  54. CStructArray<GENERICSINK> *m_prgMouseSinks;
  55. protected:
  56. long m_ref;
  57. //
  58. // Edit session helper
  59. //
  60. protected:
  61. HRESULT EscbReadOnlyPropMargin(IMCLock& imc, Interface<ITfRangeACP>* range_acp, LONG* pcch)
  62. {
  63. return ::EscbReadOnlyPropMargin(imc, m_tid, m_ic, m_pLibTLS, range_acp, pcch);
  64. }
  65. //
  66. // Edit session friend
  67. //
  68. private:
  69. friend HRESULT EscbReadOnlyPropMargin(IMCLock& imc, TfClientId tid, Interface_Attach<ITfContext> pic, LIBTHREAD* pLibTLS,
  70. Interface<ITfRangeACP>* range_acp,
  71. LONG* pcch);
  72. private:
  73. Interface_Attach<ITfContext> m_ic;
  74. TfClientId m_tid;
  75. LIBTHREAD* m_pLibTLS;
  76. };
  77. #endif // _MOUSE_H_