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.

59 lines
2.1 KiB

  1. #ifndef _CORRECTION_H
  2. #define _CORRECTION_H
  3. #include "sapilayr.h"
  4. class CSapiIMX;
  5. class CSpTask;
  6. class __declspec(novtable) CCorrectionHandler
  7. {
  8. public:
  9. CCorrectionHandler(CSapiIMX *psi);
  10. virtual ~CCorrectionHandler( );
  11. HRESULT InjectAlternateText(const WCHAR *pwszResult, LANGID langid, ITfContext *pic, BOOL bHandleLeadingSpace=FALSE);
  12. HRESULT _ProcessAlternateText(TfEditCookie ec, WCHAR *pwszText,LANGID langid, ITfContext *pic, BOOL bHandleLeadingSpace=FALSE);
  13. HRESULT CorrectThat();
  14. HRESULT _CorrectThat(TfEditCookie ec, ITfContext *pic);
  15. HRESULT _ReconvertOnRange(ITfRange *pRange, BOOL *pfConvertable = NULL);
  16. HRESULT _DoReconvertOnRange( );
  17. HRESULT SetReplaceSelection(ITfRange *pRange, ULONG cchReplaceStart, ULONG cchReplaceChars, ITfContext *pic);
  18. HRESULT _SetReplaceSelection(TfEditCookie ec, ITfContext *pic, ITfRange *pRange, ULONG cchReplaceStart, ULONG cchReplaceChars);
  19. HRESULT _SaveCorrectOrgIP(TfEditCookie ec, ITfContext *pic);
  20. HRESULT _RestoreCorrectOrgIP(TfEditCookie ec, ITfContext *pic);
  21. void _ReleaseCorrectOrgIP( );
  22. HRESULT RestoreCorrectOrgIP(ITfContext *pic);
  23. void _SetRestoreIPFlag( BOOL fRestore ) { fRestoreIP = fRestore; };
  24. HRESULT _SetSystemReconvFunc( );
  25. void _ReleaseSystemReconvFunc( );
  26. private:
  27. CSapiIMX *m_psi;
  28. CComPtr<ITfRange> m_cpOrgIP;
  29. BOOL fRestoreIP;
  30. // indicates if need to restore IP
  31. // after an alternate text is injected
  32. // to the doc.
  33. // If no alternate text is injected and the
  34. // candidate UI window is cancelled, it is always
  35. // to restore IP.
  36. CComPtr<ITfRange> m_cpCorrectRange; // the range to be corrected.
  37. CComPtr<ITfFnReconversion> m_cpsysReconv; //The system Reconverston function object.
  38. };
  39. #endif // _CORRECTION_H