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.

87 lines
2.6 KiB

  1. //
  2. // fnrecon.h
  3. //
  4. #ifndef FNRECON_H
  5. #define FNRECON_H
  6. #include "private.h"
  7. #include "candlstx.h"
  8. class CFunctionProvider;
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // CFunction
  12. //
  13. //////////////////////////////////////////////////////////////////////////////
  14. class CFunction
  15. {
  16. public:
  17. CFunction(CFunctionProvider *pFuncPrv);
  18. ~CFunction();
  19. protected:
  20. HRESULT GetTarget(TfEditCookie ec, ITfContext *pic, ITfRange *pRange, BOOL bAdjust, ITfRange **ppRangeTmp, WCHAR **ppszText, ULONG *pcch);
  21. BOOL GetFocusedTarget(TfEditCookie ec, ITfContext *pic, ITfRange *pRange, BOOL bAdjust, ITfRange **ppRangeTmp);
  22. friend CKorIMX;
  23. CFunctionProvider *_pFuncPrv;
  24. };
  25. //////////////////////////////////////////////////////////////////////////////
  26. //
  27. // CFnRecovnersion
  28. //
  29. //////////////////////////////////////////////////////////////////////////////
  30. // !!! WARNING !!!
  31. // This is temp code should be removed in the future
  32. #define MAXREADING 256
  33. class CFnReconversion : public ITfFnReconversion,
  34. public CFunction
  35. {
  36. public:
  37. CFnReconversion(CKorIMX* pKorImx, CFunctionProvider *pFuncPrv);
  38. ~CFnReconversion();
  39. //
  40. // IUnknown methods
  41. //
  42. STDMETHODIMP QueryInterface(REFIID riid, void **ppvObj);
  43. STDMETHODIMP_(ULONG) AddRef(void);
  44. STDMETHODIMP_(ULONG) Release(void);
  45. //
  46. // ITfFunction
  47. //
  48. STDMETHODIMP GetDisplayName(BSTR *pbstrCand);
  49. STDMETHODIMP IsEnabled(BOOL *pfEnable);
  50. //
  51. // ITfFnReconversion
  52. //
  53. STDMETHODIMP QueryRange(ITfRange *pRange, ITfRange **ppNewRange, BOOL *pfConvertable);
  54. STDMETHODIMP GetReconversion(ITfRange *pRange, ITfCandidateList **ppCandList);
  55. STDMETHODIMP Reconvert(ITfRange *pRange);
  56. static HRESULT SetResult(ITfContext *pic, ITfRange *pRange, CCandidateListEx *pCandList, CCandidateStringEx *pCand, TfCandidateResult imcr);
  57. HRESULT _QueryRange(TfEditCookie ec, ITfContext *pic, ITfRange *pRange, ITfRange **ppNewRange);
  58. HRESULT _GetReconversion(TfEditCookie ec, ITfContext *pic, ITfRange *pRange, CCandidateListEx **ppCandList, BOOL fSelection);
  59. private:
  60. HRESULT GetReconversionProc( ITfContext *pic, ITfRange *pRange, CCandidateListEx **ppCandList, BOOL fSelection);
  61. HRESULT ShowCandidateList(ITfContext *pic, ITfRange *pRange, CCandidateListEx *pCandList);
  62. // static HRESULT _EditSessionCallback2(TfEditCookie ec, CEditSession2 *pes);
  63. WCHAR _szReading[MAXREADING];
  64. CKorIMX* m_pKorImx;
  65. long _cRef;
  66. };
  67. #endif // FNRECON_H