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.

79 lines
2.2 KiB

  1. //
  2. // insert.h
  3. //
  4. #ifndef INSERT_H
  5. #define INSERT_H
  6. #include "private.h"
  7. #include "dbgid.h"
  8. class COvertypeStore;
  9. // max number of overtyped chars that IH will backup
  10. #define DEF_MAX_OVERTYPE_CCH 32
  11. // tips need to register this GUID with the category manager before using the library!
  12. extern const GUID GUID_PROP_OVERTYPE;
  13. class CCompositionInsertHelper
  14. {
  15. public:
  16. CCompositionInsertHelper();
  17. ULONG AddRef();
  18. ULONG Release();
  19. HRESULT Configure(ULONG cchMaxOvertype);
  20. HRESULT InsertAtSelection(TfEditCookie ecWrite, ITfContext *pic, const WCHAR *pchText, ULONG cchText, ITfRange **ppCompRange);
  21. HRESULT QueryPreInsert(TfEditCookie ecWrite, ITfRange *rangeToAdjust,
  22. ULONG cchCurrent /* must be zero for first insert! */, ULONG cchInsert,
  23. BOOL *pfInsertOk);
  24. HRESULT PreInsert(TfEditCookie ecWrite, ITfRange *rangeToAdjust,
  25. ULONG cchCurrent /* must be zero for first insert! */, ULONG cchInsert,
  26. BOOL *pfInsertOk);
  27. HRESULT PostInsert();
  28. HRESULT ReleaseBlobs(TfEditCookie ecWrite, ITfContext *pic, ITfRange *range);
  29. private:
  30. ~CCompositionInsertHelper() {} // clients should use Release
  31. HRESULT _PreInsert(TfEditCookie ecWrite, ITfRange *rangeToAdjust,
  32. ULONG cchCurrent /* must be zero for first insert! */, ULONG cchInsert,
  33. BOOL *pfInsertOk, BOOL fQuery);
  34. friend COvertypeStore;
  35. BOOL _AcceptTextUpdated()
  36. {
  37. return _fAcceptTextUpdated;
  38. }
  39. void _IncOvertypeStoreRef()
  40. {
  41. _cRefOvertypeStore++;
  42. }
  43. void _DecOvertypeStoreRef()
  44. {
  45. Assert(_cRefOvertypeStore > 0);
  46. _cRefOvertypeStore--;
  47. }
  48. HRESULT _PreInsertGrow(TfEditCookie ec, ITfRange *rangeToAdjust, ULONG cchCurrent, ULONG cchInsert, BOOL fQuery);
  49. HRESULT _PreInsertShrink(TfEditCookie ec, ITfRange *rangeToAdjust, ULONG cchCurrent, ULONG cchInsert, BOOL fQuery);
  50. BOOL _fAcceptTextUpdated;
  51. ULONG _cchMaxOvertype;
  52. LONG _cRefOvertypeStore;
  53. LONG _cRef;
  54. DBG_ID_DECLARE;
  55. };
  56. #endif // INSERT_H