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.

128 lines
1.9 KiB

  1. //
  2. // editssn.h
  3. //
  4. // CEditSession2
  5. //
  6. #ifndef EDITSES_H
  7. #define EDITSES_H
  8. class CKorIMX;
  9. class CEditSession2;
  10. //
  11. // structure
  12. //
  13. typedef struct _ESSTRUCT
  14. {
  15. DWORD id;
  16. ITfThreadMgr *ptim;
  17. ITfRange *pRange;
  18. IEnumTfRanges *pEnumRange;
  19. CCandidateListEx *pCandList;
  20. CCandidateStringEx *pCandStr;
  21. VOID *pv1;
  22. VOID *pv2;
  23. WPARAM wParam;
  24. LPARAM lParam;
  25. BOOL fBool;
  26. } ESSTRUCT;
  27. //
  28. // flags
  29. //
  30. /* read/readwrite flag */
  31. #define ES2_READONLY 0x00000000
  32. #define ES2_READWRITE 0x00000001
  33. /* sync/async flag */
  34. #define ES2_ASYNC 0x00000010
  35. #define ES2_SYNC 0x00000020
  36. #define ES2_SYNCASYNC 0x00000030
  37. /* mask bits */
  38. #define ES2_READWRITEMASK 0x0000000F
  39. #define ES2_SYNCMASK 0x000000F0
  40. //
  41. // callback function
  42. //
  43. typedef HRESULT (*PFNESCALLBACK)( TfEditCookie ec, CEditSession2 *pes );
  44. //
  45. // misc function
  46. //
  47. __inline void ESStructInit( ESSTRUCT *pess, DWORD id )
  48. {
  49. ZeroMemory(pess, sizeof(ESSTRUCT));
  50. pess->id = id;
  51. }
  52. //
  53. // CEditSession2
  54. //
  55. class CEditSession2 : public ITfEditSession
  56. {
  57. public:
  58. CEditSession2(ITfContext *pic, CKorIMX *ptip, ESSTRUCT *pess, PFNESCALLBACK pfnCallback);
  59. virtual ~CEditSession2();
  60. //
  61. // IUnknown methods
  62. //
  63. STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  64. STDMETHODIMP_(ULONG) AddRef();
  65. STDMETHODIMP_(ULONG) Release();
  66. //
  67. // ITfEditSession
  68. //
  69. STDMETHODIMP DoEditSession(TfEditCookie ec);
  70. //
  71. //
  72. //
  73. HRESULT Invoke(DWORD dwFlag, HRESULT *phrSession);
  74. __inline ITfContext *GetContext()
  75. {
  76. return m_pic;
  77. }
  78. __inline CKorIMX *GetTIP()
  79. {
  80. return m_ptip;
  81. }
  82. __inline ESSTRUCT *GetStruct()
  83. {
  84. return &m_ess;
  85. }
  86. __inline void Processed()
  87. {
  88. m_fProcessed = TRUE;
  89. }
  90. private:
  91. ULONG m_cRef;
  92. ITfContext *m_pic;
  93. CKorIMX *m_ptip;
  94. ESSTRUCT m_ess;
  95. PFNESCALLBACK m_pfnCallback;
  96. BOOL m_fProcessed;
  97. };
  98. #endif // EDITSES_H