TextStor.idl
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:21k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //+-------------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright (C) Microsoft Corporation, 1992-2001.
  5. //
  6. //  File: textstor.idl
  7. //
  8. //  Contents: ITextStore
  9. //
  10. //--------------------------------------------------------------------------
  11. import "oaidl.idl";
  12. interface IAnchor;
  13. // IDataObject embedded obj service
  14. cpp_quote("DEFINE_GUID (GUID_TS_SERVICE_DATAOBJECT, 0x6086fbb5, 0xe225, 0x46ce, 0xa7, 0x70, 0xc1, 0xbb, 0xd3, 0xe0, 0x5d, 0x7b);")
  15. cpp_quote("DEFINE_GUID (GUID_TS_SERVICE_ACCESSIBLE, 0xf9786200, 0xa5bf, 0x4a0f, 0x8c, 0x24, 0xfb, 0x16, 0xf5, 0xd1, 0xaa, 0xbb);")
  16. cpp_quote("DEFINE_GUID (GUID_TS_SERVICE_ACTIVEX,    0xea937a50, 0xc9a6, 0x4b7d, 0x89, 0x4a, 0x49, 0xd9, 0x9b, 0x78, 0x48, 0x34);")
  17. // custom error HRESULTs
  18. cpp_quote("#define TS_E_INVALIDPOS      MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0200)")
  19. cpp_quote("#define TS_E_NOLOCK          MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0201)")
  20. cpp_quote("#define TS_E_NOOBJECT        MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0202)")
  21. cpp_quote("#define TS_E_NOSERVICE       MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0203)")
  22. cpp_quote("#define TS_E_NOINTERFACE     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0204)")
  23. cpp_quote("#define TS_E_NOSELECTION     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0205)")
  24. cpp_quote("#define TS_E_NOLAYOUT        MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0206)")
  25. cpp_quote("#define TS_E_INVALIDPOINT    MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0207)")
  26. cpp_quote("#define TS_E_SYNCHRONOUS     MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0208)")
  27. cpp_quote("#define TS_E_READONLY        MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0209)")
  28. cpp_quote("#define TS_E_FORMAT          MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x020a)")
  29. // TS_S_ASYNC is only used as an [out] param for RequestLock
  30. cpp_quote("#define TS_S_ASYNC           MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_ITF, 0x0300)")
  31. // flags for AdviseSink
  32. const DWORD TS_AS_TEXT_CHANGE      = 0x01;  // use the sink's OnTextChange method
  33. const DWORD TS_AS_SEL_CHANGE       = 0x02;  // use the sink's OnSelectionChange method
  34. const DWORD TS_AS_LAYOUT_CHANGE    = 0x04;  // use the sink's OnLayoutChange method
  35. const DWORD TS_AS_ATTR_CHANGE      = 0x08;  // use the sink's OnAttrChange method
  36. const DWORD TS_AS_STATUS_CHANGE    = 0x10;  // use the sink's OnStatusChange method
  37. const DWORD TS_AS_ALL_SINKS = (TS_AS_TEXT_CHANGE | TS_AS_SEL_CHANGE | TS_AS_LAYOUT_CHANGE | TS_AS_ATTR_CHANGE | TS_AS_STATUS_CHANGE);
  38. // RequestLock flags
  39. const DWORD TS_LF_SYNC            = 0x1;
  40. const DWORD TS_LF_READ            = 0x2;
  41. const DWORD TS_LF_READWRITE       = 0x6;
  42. // bit values for TS_STATUS's dwDynamicFlags field
  43. const DWORD TS_SD_READONLY        = 0x001;   // if set, document is read only; writes will fail
  44. const DWORD TS_SD_LOADING         = 0x002;   // if set, document is loading, expect additional inserts
  45. // bit values for TS_STATUS's dwStaticFlags field
  46. const DWORD TS_SS_DISJOINTSEL     = 0x001;   // if set, the document supports multiple selections
  47. const DWORD TS_SS_REGIONS         = 0x002;   // if clear, the document will never contain multiple regions
  48. const DWORD TS_SS_TRANSITORY      = 0x004;   // if set, the document is expected to have a short lifespan
  49. const DWORD TS_SS_NOHIDDENTEXT    = 0x008;   // if set, the document will never contain hidden text (for perf)
  50. const DWORD TS_SD_MASKALL = (TS_SD_READONLY | TS_SD_LOADING);
  51. // SetText flags
  52. const DWORD TS_ST_CORRECTION      = 0x1; // the replacement is a transform of existing content (correction), not new content
  53. // InsertEmbedded flags
  54. const DWORD TS_IE_CORRECTION      = 0x1;
  55. const DWORD TS_IE_COMPOSITION     = 0x2;
  56. // OnTextChange flags
  57. const DWORD TS_TC_CORRECTION      = 0x1;
  58. // InsertTextAtSelection flags
  59. const DWORD TS_IAS_NOQUERY        = 0x1;
  60. const DWORD TS_IAS_QUERYONLY      = 0x2;
  61. typedef [uuid(fec4f516-c503-45b1-a5fd-7a3d8ab07049)]  struct TS_STATUS
  62. {
  63.     DWORD dwDynamicFlags; // OnStatusChange reports these bitfields
  64.     DWORD dwStaticFlags;  // these bitfields never change
  65. } TS_STATUS;
  66. typedef [uuid(f3181bd6-bcf0-41d3-a81c-474b17ec38fb)]  struct TS_TEXTCHANGE
  67. {
  68.     LONG acpStart;
  69.     LONG acpOldEnd;
  70.     LONG acpNewEnd;
  71. } TS_TEXTCHANGE;
  72. typedef [uuid(05fcf85b-5e9c-4c3e-ab71-29471d4f38e7)]  enum { TS_AE_NONE = 0, TS_AE_START = 1, TS_AE_END = 2 } TsActiveSelEnd;
  73. typedef [uuid(7ecc3ffa-8f73-4d91-98ed-76f8ac5b1600)]  struct TS_SELECTIONSTYLE
  74. {
  75.     TsActiveSelEnd ase;
  76.     BOOL fInterimChar; // implies selection has length 1 and TS_AE_NONE
  77. } TS_SELECTIONSTYLE;
  78. typedef [uuid(c4b9c33b-8a0d-4426-bebe-d444a4701fe9)]  struct TS_SELECTION_ACP
  79. {
  80.     LONG acpStart;
  81.     LONG acpEnd;
  82.     TS_SELECTIONSTYLE style;
  83. } TS_SELECTION_ACP;
  84. typedef [uuid(b03413d2-0723-4c4e-9e08-2e9c1ff3772b)]  struct TS_SELECTION_ANCHOR
  85. {
  86.     IAnchor *paStart;
  87.     IAnchor *paEnd;
  88.     TS_SELECTIONSTYLE style;
  89. } TS_SELECTION_ANCHOR;
  90. const ULONG TS_DEFAULT_SELECTION = ((ULONG)-1);
  91. // flags for GetACPFromPoint, GetAnchorFromPoint
  92. const DWORD GXFPF_ROUND_NEAREST = 0x1;  // if set, round x to nearest char (default: always round x down)
  93. const DWORD GXFPF_NEAREST       = 0x2;  // if set, if the point does not hit any char, return the nearest char
  94. const WCHAR TS_CHAR_EMBEDDED     = 0xfffc; // unicode 2.1 object replacement character
  95. const WCHAR TS_CHAR_REGION       = 0x0000; // region boundary
  96. const WCHAR TS_CHAR_REPLACEMENT  = 0xfffd; // hidden text placeholder char, Unicode replacement character
  97. typedef [uuid(ef3457d9-8446-49a7-a9e6-b50d9d5f3fd9)]  GUID TS_ATTRID;
  98. typedef [uuid(2cc2b33f-1174-4507-b8d9-5bc0eb37c197)]  struct TS_ATTRVAL
  99. {
  100.     TS_ATTRID   idAttr;
  101.     DWORD      dwOverlapId; // zero for non-overlapping properties!
  102.     VARIANT    varValue;
  103. } TS_ATTRVAL;
  104. const DWORD TS_ATTR_FIND_BACKWARDS      =   0x0001;
  105. const DWORD TS_ATTR_FIND_WANT_OFFSET    =   0x0002;
  106. const DWORD TS_ATTR_FIND_UPDATESTART    =   0x0004;
  107. const DWORD TS_ATTR_FIND_WANT_VALUE     =   0x0008;
  108. const DWORD TS_ATTR_FIND_WANT_END       =   0x0010;
  109. const DWORD TS_ATTR_FIND_HIDDEN         =   0x0020;
  110. typedef [uuid(1faf509e-44c1-458e-950a-38a96705a62b)]  DWORD TsViewCookie;
  111. const TsViewCookie TS_VCOOKIE_NUL = 0xffffffff;
  112. typedef [uuid(7899d7c4-5f07-493c-a89a-fac8e777f476)]  enum { TS_LC_CREATE = 0, TS_LC_CHANGE = 1, TS_LC_DESTROY = 2 } TsLayoutCode;
  113. typedef [uuid(033b0df0-f193-4170-b47b-141afc247878)]  enum { TS_RT_PLAIN, TS_RT_HIDDEN, TS_RT_OPAQUE } TsRunType;
  114. typedef [uuid(a6231949-37c5-4b74-a24e-2a26c327201d)]  struct TS_RUNINFO
  115. {
  116.     ULONG uCount;
  117.     TsRunType type;
  118. } TS_RUNINFO;
  119. //
  120. // ITextStoreACP
  121. //
  122. [
  123.   object,
  124.   uuid(28888fe3-c2a0-483a-a3ea-8cb1ce51ff3d),
  125.   pointer_default(unique)
  126. ]
  127. interface ITextStoreACP : IUnknown
  128. {
  129.     HRESULT AdviseSink([in] REFIID riid,
  130.                        [in, iid_is(riid)] IUnknown *punk,
  131.                        [in] DWORD dwMask);
  132.     HRESULT UnadviseSink([in] IUnknown *punk);
  133.     HRESULT RequestLock([in] DWORD dwLockFlags,
  134.                         [out] HRESULT *phrSession);
  135.     HRESULT GetStatus([out] TS_STATUS *pdcs);
  136.     HRESULT QueryInsert([in] LONG acpTestStart,
  137.                         [in] LONG acpTestEnd,
  138.                         [in] ULONG cch,
  139.                         [out] LONG *pacpResultStart,
  140.                         [out] LONG *pacpResultEnd);
  141.     HRESULT GetSelection([in] ULONG ulIndex,
  142.                          [in] ULONG ulCount,
  143.                          [out, size_is(ulCount), length_is(*pcFetched)] TS_SELECTION_ACP *pSelection,
  144.                          [out] ULONG *pcFetched);
  145.     HRESULT SetSelection([in] ULONG ulCount,
  146.                          [in, size_is(ulCount)] const TS_SELECTION_ACP *pSelection);
  147.     HRESULT GetText([in] LONG acpStart,
  148.                     [in] LONG acpEnd,
  149.                     [out, size_is(cchPlainReq), length_is(*pcchPlainRet)] WCHAR *pchPlain,
  150.                     [in] ULONG cchPlainReq,
  151.                     [out] ULONG *pcchPlainRet,
  152.                     [out, size_is(cRunInfoReq), length_is(*pcRunInfoRet)] TS_RUNINFO *prgRunInfo,
  153.                     [in] ULONG cRunInfoReq,
  154.                     [out] ULONG *pcRunInfoRet,
  155.                     [out] LONG *pacpNext);
  156.     HRESULT SetText([in] DWORD dwFlags,
  157.                     [in] LONG acpStart,
  158.                     [in] LONG acpEnd,
  159.                     [in, size_is(cch)] const WCHAR *pchText,
  160.                     [in] ULONG cch,
  161.                     [out] TS_TEXTCHANGE *pChange);
  162.     HRESULT GetFormattedText([in] LONG acpStart,
  163.                              [in] LONG acpEnd,
  164.                              [out] IDataObject **ppDataObject);
  165.     HRESULT GetEmbedded([in] LONG acpPos,
  166.                         [in] REFGUID rguidService,
  167.                         [in] REFIID riid,
  168.                         [out, iid_is(riid)] IUnknown **ppunk);
  169.     HRESULT QueryInsertEmbedded([in] const GUID *pguidService,
  170.                                 [in] const FORMATETC *pFormatEtc,
  171.                                 [out] BOOL *pfInsertable);
  172.     HRESULT InsertEmbedded([in] DWORD dwFlags,
  173.                            [in] LONG acpStart,
  174.                            [in] LONG acpEnd,
  175.                            [in] IDataObject *pDataObject,
  176.                            [out] TS_TEXTCHANGE *pChange);
  177.     HRESULT InsertTextAtSelection([in] DWORD dwFlags,
  178.                                   [in, size_is(cch)] const WCHAR *pchText,
  179.                                   [in] ULONG cch,
  180.                                   [out] LONG *pacpStart,
  181.                                   [out] LONG *pacpEnd,
  182.                                   [out] TS_TEXTCHANGE *pChange);
  183.     HRESULT InsertEmbeddedAtSelection([in] DWORD dwFlags,
  184.                                       [in] IDataObject *pDataObject,
  185.                                       [out] LONG *pacpStart,
  186.                                       [out] LONG *pacpEnd,
  187.                                       [out] TS_TEXTCHANGE *pChange);
  188.     HRESULT RequestSupportedAttrs([in] DWORD dwFlags,
  189.                                   [in] ULONG cFilterAttrs,
  190.                                   [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs);
  191.     HRESULT RequestAttrsAtPosition([in] LONG acpPos,
  192.                                    [in] ULONG cFilterAttrs,
  193.                                    [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs,
  194.                                    [in] DWORD dwFlags);
  195.     HRESULT RequestAttrsTransitioningAtPosition([in] LONG acpPos,
  196.                                                 [in] ULONG cFilterAttrs,
  197.                                                 [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs,
  198.                                                 [in] DWORD dwFlags);
  199.     HRESULT FindNextAttrTransition([in] LONG acpStart,
  200.                                    [in] LONG acpHalt,
  201.                                    [in] ULONG cFilterAttrs,
  202.                                    [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs,
  203.                                    [in] DWORD dwFlags,
  204.                                    [out] LONG *pacpNext,
  205.                                    [out] BOOL *pfFound,
  206.                                    [out] LONG *plFoundOffset);
  207.     HRESULT RetrieveRequestedAttrs([in] ULONG ulCount,
  208.                                    [out, size_is(ulCount), length_is(*pcFetched)] TS_ATTRVAL *paAttrVals,
  209.                                    [out] ULONG *pcFetched);
  210.     HRESULT GetEndACP([out] LONG *pacp);
  211.     HRESULT GetActiveView([out] TsViewCookie *pvcView);
  212.     HRESULT GetACPFromPoint([in] TsViewCookie vcView,
  213.                             [in] const POINT *ptScreen,
  214.                             [in] DWORD dwFlags, [out] LONG *pacp);
  215.     HRESULT GetTextExt([in] TsViewCookie vcView,
  216.                        [in] LONG acpStart,
  217.                        [in] LONG acpEnd,
  218.                        [out] RECT *prc,
  219.                        [out] BOOL *pfClipped);
  220.     HRESULT GetScreenExt([in] TsViewCookie vcView,
  221.                          [out] RECT *prc);
  222.     HRESULT GetWnd([in] TsViewCookie vcView,
  223.                    [out] HWND *phwnd);
  224. };
  225. //
  226. // ITextStoreACPSink
  227. //
  228. [
  229.   object,
  230.   uuid(22d44c94-a419-4542-a272-ae26093ececf),
  231.   pointer_default(unique)
  232. ]
  233. interface ITextStoreACPSink : IUnknown
  234. {
  235.     HRESULT OnTextChange([in] DWORD dwFlags,
  236.                          [in] const TS_TEXTCHANGE *pChange);
  237.     HRESULT OnSelectionChange();
  238.     HRESULT OnLayoutChange([in] TsLayoutCode lcode, [in] TsViewCookie vcView);
  239.     HRESULT OnStatusChange([in] DWORD dwFlags);
  240.     HRESULT OnAttrsChange([in] LONG acpStart,
  241.                           [in] LONG acpEnd,
  242.                           [in] ULONG cAttrs,
  243.                           [in, size_is(cAttrs)] const TS_ATTRID *paAttrs);
  244.     HRESULT OnLockGranted([in] DWORD dwLockFlags);
  245.     HRESULT OnStartEditTransaction();
  246.     HRESULT OnEndEditTransaction();
  247. };
  248. //
  249. // IAnchor
  250. //
  251. [
  252.   object,
  253.   uuid(0feb7e34-5a60-4356-8ef7-abdec2ff7cf8),
  254.   pointer_default(unique)
  255. ]
  256. interface IAnchor : IUnknown
  257. {
  258.     typedef [uuid(daa8601e-7695-426f-9bb7-498a6aa64b68)]  enum { TS_GR_BACKWARD = 0, TS_GR_FORWARD = 1 } TsGravity;
  259.     typedef [uuid(898e19df-4fb4-4af3-8daf-9b3c1145c79d)]  enum { TS_SD_BACKWARD = 0, TS_SD_FORWARD = 1 } TsShiftDir;
  260.     const DWORD TS_CH_PRECEDING_DEL = 1;
  261.     const DWORD TS_CH_FOLLOWING_DEL = 2;
  262.     const DWORD TS_SHIFT_COUNT_HIDDEN = 0x1;
  263.     const DWORD TS_SHIFT_HALT_HIDDEN  = 0x2;
  264.     const DWORD TS_SHIFT_HALT_VISIBLE = 0x4;
  265.     const DWORD TS_SHIFT_COUNT_ONLY   = 0x8;
  266.     HRESULT SetGravity([in] TsGravity gravity);
  267.     HRESULT GetGravity([out] TsGravity *pgravity);
  268.     HRESULT IsEqual([in] IAnchor *paWith,
  269.                     [out] BOOL *pfEqual);
  270.     HRESULT Compare([in] IAnchor *paWith,
  271.                     [out] LONG *plResult);
  272.     HRESULT Shift([in] DWORD dwFlags,
  273.                   [in] LONG cchReq,                  
  274.                   [out] LONG *pcch,
  275.                   [in] IAnchor *paHaltAnchor);
  276.     HRESULT ShiftTo([in] IAnchor *paSite);
  277.     HRESULT ShiftRegion([in] DWORD dwFlags,
  278.                         [in] TsShiftDir dir,
  279.                         [out] BOOL *pfNoRegion);
  280.     HRESULT SetChangeHistoryMask([in] DWORD dwMask);
  281.     HRESULT GetChangeHistory([out] DWORD *pdwHistory);
  282.     HRESULT ClearChangeHistory();
  283.     HRESULT Clone([out] IAnchor **ppaClone);
  284. };
  285. [
  286.   object,
  287.   uuid(9b2077b0-5f18-4dec-bee9-3cc722f5dfe0),
  288.   pointer_default(unique)
  289. ]
  290. interface ITextStoreAnchor : IUnknown
  291. {
  292.     HRESULT AdviseSink([in] REFIID riid,
  293.                        [in, iid_is(riid)] IUnknown *punk,
  294.                        [in] DWORD dwMask);
  295.     HRESULT UnadviseSink([in] IUnknown *punk);
  296.         
  297.     HRESULT RequestLock([in] DWORD dwLockFlags,
  298.                         [out] HRESULT *phrSession);
  299.     HRESULT GetStatus([out] TS_STATUS *pdcs);
  300.     HRESULT QueryInsert([in] IAnchor *paTestStart,
  301.                         [in] IAnchor *paTestEnd,
  302.                         [in] ULONG cch,
  303.                         [out] IAnchor **ppaResultStart,
  304.                         [out] IAnchor **ppaResultEnd);
  305.     HRESULT GetSelection([in] ULONG ulIndex,
  306.                          [in] ULONG ulCount,
  307.                          [out, size_is(ulCount), length_is(*pcFetched)] TS_SELECTION_ANCHOR *pSelection,
  308.                          [out] ULONG *pcFetched);
  309.     HRESULT SetSelection([in] ULONG ulCount,
  310.                          [in, size_is(ulCount)] const TS_SELECTION_ANCHOR *pSelection);
  311.     const DWORD TS_GTA_HIDDEN = 0x1; // if set, GetText will return hidden text
  312.     HRESULT GetText([in] DWORD dwFlags,
  313.                     [in] IAnchor *paStart,
  314.                     [in] IAnchor *paEnd,
  315.                     [out, size_is(cchReq), length_is(*pcch)] WCHAR *pchText,
  316.                     [in] ULONG cchReq,
  317.                     [out] ULONG *pcch,
  318.                     [in] BOOL fUpdateAnchor);
  319.     HRESULT SetText([in] DWORD dwFlags,
  320.                     [in] IAnchor *paStart,
  321.                     [in] IAnchor *paEnd,
  322.                     [in, size_is(cch)] const WCHAR *pchText,
  323.                     [in] ULONG cch);
  324.     HRESULT GetFormattedText([in] IAnchor *paStart,
  325.                              [in] IAnchor *paEnd,
  326.                              [out] IDataObject **ppDataObject);
  327.     const DWORD TS_GEA_HIDDEN = 0x1; // if set, GetEmbedded will return hidden text
  328.     HRESULT GetEmbedded([in] DWORD dwFlags,
  329.                         [in] IAnchor *paPos,
  330.                         [in] REFGUID rguidService,
  331.                         [in] REFIID riid,
  332.                         [out, iid_is(riid)] IUnknown **ppunk);
  333.     HRESULT InsertEmbedded([in] DWORD dwFlags,
  334.                            [in] IAnchor *paStart,
  335.                            [in] IAnchor *paEnd,
  336.                            [in] IDataObject *pDataObject);
  337.     HRESULT RequestSupportedAttrs([in] DWORD dwFlags,
  338.                                   [in] ULONG cFilterAttrs,
  339.                                   [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs);
  340.     HRESULT RequestAttrsAtPosition([in] IAnchor *paPos,
  341.                                    [in] ULONG cFilterAttrs,
  342.                                    [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs,
  343.                                    [in] DWORD dwFlags);
  344.     HRESULT RequestAttrsTransitioningAtPosition([in] IAnchor *paPos,
  345.                                                 [in] ULONG cFilterAttrs,
  346.                                                 [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs,
  347.                                                 [in] DWORD dwFlags);
  348.     HRESULT FindNextAttrTransition([in] IAnchor *paStart,
  349.                                    [in] IAnchor *paHalt,
  350.                                    [in] ULONG cFilterAttrs,
  351.                                    [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs,
  352.                                    [in] DWORD dwFlags,
  353.                                    [out] BOOL *pfFound,
  354.                                    [out] LONG *plFoundOffset);
  355.     HRESULT RetrieveRequestedAttrs([in] ULONG ulCount,
  356.                                    [out, size_is(ulCount), length_is(*pcFetched)] TS_ATTRVAL *paAttrVals,
  357.                                    [out] ULONG *pcFetched);
  358.     HRESULT GetStart([out] IAnchor **ppaStart);
  359.     HRESULT GetEnd([out] IAnchor **ppaEnd);
  360.     HRESULT GetActiveView([out] TsViewCookie *pvcView);
  361.     HRESULT GetAnchorFromPoint([in] TsViewCookie vcView,
  362.                                [in] const POINT *ptScreen,
  363.                                [in] DWORD dwFlags, [out] IAnchor **ppaSite);
  364.     HRESULT GetTextExt([in] TsViewCookie vcView,
  365.                        [in] IAnchor *paStart,
  366.                        [in] IAnchor *paEnd,
  367.                        [out] RECT *prc,
  368.                        [out] BOOL *pfClipped);
  369.     HRESULT GetScreenExt([in] TsViewCookie vcView,
  370.                          [out] RECT *prc);
  371.     HRESULT GetWnd([in] TsViewCookie vcView,
  372.                    [out] HWND *phwnd);
  373.     HRESULT QueryInsertEmbedded([in] const GUID *pguidService,
  374.                                 [in] const FORMATETC *pFormatEtc,
  375.                                 [out] BOOL *pfInsertable);
  376.     HRESULT InsertTextAtSelection([in] DWORD dwFlags,
  377.                                   [in, size_is(cch)] const WCHAR *pchText,
  378.                                   [in] ULONG cch,
  379.                                   [out] IAnchor **ppaStart,
  380.                                   [out] IAnchor **ppaEnd);
  381.     HRESULT InsertEmbeddedAtSelection([in] DWORD dwFlags,
  382.                                       [in] IDataObject *pDataObject,
  383.                                       [out] IAnchor **ppaStart,
  384.                                       [out] IAnchor **ppaEnd);
  385. };
  386. //
  387. // ITextStoreAnchorSink
  388. //
  389. [
  390.   object,
  391.   uuid(aa80e905-2021-11d2-93e0-0060b067b86e),
  392.   pointer_default(unique)
  393. ]
  394. interface ITextStoreAnchorSink : IUnknown
  395. {
  396.     HRESULT OnTextChange([in] DWORD dwFlags,
  397.                          [in] IAnchor *paStart,
  398.                          [in] IAnchor *paEnd);
  399.     HRESULT OnSelectionChange();
  400.     HRESULT OnLayoutChange([in] TsLayoutCode lcode, [in] TsViewCookie vcView);
  401.     HRESULT OnStatusChange([in] DWORD dwFlags);
  402.     HRESULT OnAttrsChange([in] IAnchor *paStart,
  403.                           [in] IAnchor *paEnd,
  404.                           [in] ULONG cAttrs,
  405.                           [in, size_is(cAttrs)] const TS_ATTRID *paAttrs);
  406.     HRESULT OnLockGranted([in] DWORD dwLockFlags);
  407.     HRESULT OnStartEditTransaction();
  408.     HRESULT OnEndEditTransaction();
  409. };