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.

111 lines
3.0 KiB

  1. // Forward declarations
  2. class CIme;
  3. class CTextMsgFilter : public ITextMsgFilter
  4. {
  5. public :
  6. HRESULT STDMETHODCALLTYPE QueryInterface(
  7. REFIID riid,
  8. void **ppvObject);
  9. ULONG STDMETHODCALLTYPE AddRef( void);
  10. ULONG STDMETHODCALLTYPE Release( void);
  11. HRESULT STDMETHODCALLTYPE AttachDocument( HWND hwnd, ITextDocument2 *pTextDoc);
  12. HRESULT STDMETHODCALLTYPE HandleMessage(
  13. UINT *pmsg,
  14. WPARAM *pwparam,
  15. LPARAM *plparam,
  16. LRESULT *plres);
  17. HRESULT STDMETHODCALLTYPE AttachMsgFilter( ITextMsgFilter *pMsgFilter);
  18. ~CTextMsgFilter();
  19. BOOL IsIMEComposition() { return (_ime != NULL);};
  20. BOOL GetTxSelection();
  21. CIme *_ime; // non-NULL when IME composition active
  22. HWND _hwnd;
  23. UINT _uKeyBoardCodePage; // current keyboard codepage
  24. UINT _uSystemCodePage; // system codepage
  25. WORD _fIMECancelComplete :1; // If aborting IME, cancel comp string, else complete
  26. WORD _fUnicodeIME :1; // TRUE if Unicode IME
  27. WORD _fIMEAlwaysNotify :1; // Send Notification during IME undetermined string
  28. WORD _fHangulToHanja :1; // TRUE during Hangul to Hanja conversion
  29. WORD _fOvertypeMode :1; // TRUE if overtype mode is on.
  30. WORD _fMSIME :1; // TRUE if MSIME98 or later
  31. WORD _fUsingAIMM :1; // TRUE if AIMM is activated
  32. WORD _fUnicodeWindow :1; // TRUE if Unicode Window
  33. WORD _fForceEnable :1; // TRUE if Force Enable on Focus
  34. WORD _fForceActivate :1; // TRUE if Force Activate on Focus
  35. WORD _fForceRemember :1; // TRUE if Force Remember
  36. WORD _fIMEEnable :1; // TRUE if IME was enable before
  37. WORD _fRE10Mode :1; // TRUE if running in RE1.0 Mode
  38. // Support for SETIMEOPTIONS:
  39. DWORD _fIMEConversion; // for Force Remember use
  40. DWORD _fIMESentence; // for Force Remember use
  41. HKL _fIMEHKL; // for Force Remember use
  42. long _cpReconvertStart; // use during reconversion
  43. long _cpReconvertEnd; // use during reconversion
  44. long _lFEFlags; // For FE setting (ES_NOIME, ES_SELFIME)
  45. COMPCOLOR _crComp[4]; // Support 1.0 mode composition color
  46. ITextDocument2 *_pTextDoc;
  47. ITextSelection *_pTextSel;
  48. private:
  49. ULONG _crefs;
  50. ITextMsgFilter * _pFilter;
  51. HIMC _hIMCContext;
  52. // private methods
  53. HRESULT OnWMChar(
  54. UINT *pmsg,
  55. WPARAM *pwparam,
  56. LPARAM *plparam,
  57. LRESULT *plres);
  58. HRESULT OnWMIMEChar(
  59. UINT *pmsg,
  60. WPARAM *pwparam,
  61. LPARAM *plparam,
  62. LRESULT *plres);
  63. HRESULT OnIMEReconvert(
  64. UINT *pmsg,
  65. WPARAM *pwparam,
  66. LPARAM *plparam,
  67. LRESULT *plres,
  68. BOOL fUnicode);
  69. BOOL CheckIMEChange(
  70. LPRECONVERTSTRING lpRCS,
  71. long cpParaStart,
  72. long cpParaEnd,
  73. long cpMin,
  74. long cpMax,
  75. BOOL fUnicode);
  76. HRESULT OnIMEQueryPos(
  77. UINT *pmsg,
  78. WPARAM *pwparam,
  79. LPARAM *plparam,
  80. LRESULT *plres,
  81. BOOL fUnicode);
  82. void CheckIMEType( HKL hKL );
  83. HRESULT InputFEChar( WCHAR wchFEChar );
  84. void OnSetFocus();
  85. void OnKillFocus();
  86. LRESULT OnSetIMEOptions(WPARAM wparam, LPARAM lparam);
  87. LRESULT OnGetIMEOptions();
  88. void SetupIMEOptions();
  89. };