2 * Copyright 2009 Aric Stewart, CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 const ULONG TS_DEFAULT_SELECTION
= ~
0u;
25 const DWORD TS_SD_READONLY
= 0x001;
26 const DWORD TS_SD_LOADING
= 0x002;
28 const DWORD TS_SS_DISJOINTSEL
= 0x001;
29 const DWORD TS_SS_REGIONS
= 0x002;
30 const DWORD TS_SS_TRANSITORY
= 0x004;
31 const DWORD TS_SS_NOHIDDENTEXT
= 0x008;
33 const DWORD TS_AS_TEXT_CHANGE
= 0x01;
34 const DWORD TS_AS_SEL_CHANGE
= 0x02;
35 const DWORD TS_AS_LAYOUT_CHANGE
= 0x04;
36 const DWORD TS_AS_ATTR_CHANGE
= 0x08;
37 const DWORD TS_AS_STATUS_CHANGE
= 0x10;
39 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
);
42 typedef [uuid(05fcf85b
-5e9c
-4c3e
-ab71
-29471d4f38e7
)] enum { TS_AE_NONE
, TS_AE_START
, TS_AE_END
} TsActiveSelEnd
;
43 typedef [uuid(033b0df0
-f193
-4170-b47b
-141afc247878
)] enum { TS_RT_PLAIN
, TS_RT_HIDDEN
, TS_RT_OPAQUE
} TsRunType
;
44 typedef [uuid(ef3457d9
-8446-49a7
-a9e6
-b50d9d5f3fd9
)] GUID TS_ATTRID
;
46 typedef [uuid(fec4f516
-c503
-45b1
-a5fd
-7a3d8ab07049
)] struct TS_STATUS
52 typedef [uuid(f3181bd6
-bcf0
-41d3
-a81c
-474b17ec38fb
)] struct TS_TEXTCHANGE
59 typedef [uuid(7ecc3ffa
-8f73
-4d91
-98ed
-76f8ac5b1600
)] struct TS_SELECTIONSTYLE
65 typedef [uuid(c4b9c33b
-8a0d
-4426-bebe
-d444a4701fe9
)] struct TS_SELECTION_ACP
69 TS_SELECTIONSTYLE style
;
72 typedef [uuid(a6231949
-37c5
-4b74
-a24e
-2a26c327201d
)] struct TS_RUNINFO
78 typedef [uuid(2cc2b33f
-1174-4507-b8d9
-5bc0eb37c197
)] struct TS_ATTRVAL
85 typedef [uuid(7899d7c4
-5f07
-493c
-a89a
-fac8e777f476
)] enum { TS_LC_CREATE
, TS_LC_CHANGE
, TS_LC_DESTROY
} TsLayoutCode
;
86 typedef [uuid(1faf509e
-44c1
-458e-950a
-38a96705a62b
)] DWORD TsViewCookie
;
90 uuid(22d44c94
-a419
-4542-a272
-ae26093ececf
),
91 pointer_default(unique)
93 interface ITextStoreACPSink
: IUnknown
97 [in] const TS_TEXTCHANGE
*pChange
);
99 HRESULT OnSelectionChange
();
101 HRESULT OnLayoutChange
(
102 [in] TsLayoutCode lcode
,
103 [in] TsViewCookie vcView
);
105 HRESULT OnStatusChange
(
108 HRESULT OnAttrsChange
(
112 [in, size_is(cAttrs
)] const TS_ATTRID
*paAttrs
);
114 HRESULT OnLockGranted
(
115 [in] DWORD dwLockFlags
);
117 HRESULT OnStartEditTransaction
();
119 HRESULT OnEndEditTransaction
();
124 uuid(28888fe3
-c2a0
-483a
-a3ea
-8cb1ce51ff3d
),
125 pointer_default(unique)
127 interface ITextStoreACP
: IUnknown
131 [in, iid_is(riid
)] IUnknown
*punk
,
134 HRESULT UnadviseSink
(
135 [in] IUnknown
*punk
);
138 [in] DWORD dwLockFlags
,
139 [out] HRESULT *phrSession
);
142 [out] TS_STATUS
*pdcs
);
145 [in] LONG acpTestStart
,
146 [in] LONG acpTestEnd
,
148 [out] LONG *pacpResultStart
,
149 [out] LONG *pacpResultEnd
);
151 HRESULT GetSelection
(
154 [out, size_is(ulCount
), length_is(*pcFetched
)] TS_SELECTION_ACP
*pSelection
,
155 [out] ULONG
*pcFetched
);
157 HRESULT SetSelection
(
159 [in, size_is(ulCount
)] const TS_SELECTION_ACP
*pSelection
);
164 [out, size_is(cchPlainReq
), length_is(*pcchPlainRet
)] WCHAR
*pchPlain
,
165 [in] ULONG cchPlainReq
,
166 [out] ULONG
*pcchPlainRet
,
167 [out, size_is(cRunInfoReq
), length_is(*pcRunInfoRet
)] TS_RUNINFO
*prgRunInfo
,
168 [in] ULONG cRunInfoReq
,
169 [out] ULONG
*pcRunInfoRet
,
170 [out] LONG *pacpNext
);
176 [in, size_is(cch
)] const WCHAR
*pchText
,
178 [out] TS_TEXTCHANGE
*pChange
);
180 HRESULT GetFormattedText
(
183 [out] IDataObject
**ppDataObject
);
187 [in] REFGUID rguidService
,
189 [out, iid_is(riid
)] IUnknown
**ppunk
);
191 HRESULT QueryInsertEmbedded
(
192 [in] const GUID
*pguidService
,
193 [in] const FORMATETC
*pFormatEtc
,
194 [out] BOOL
*pfInsertable
);
196 HRESULT InsertEmbedded
(
200 [in] IDataObject
*pDataObject
,
201 [out] TS_TEXTCHANGE
*pChange
);
204 HRESULT InsertTextAtSelection
(
206 [in, size_is(cch
)] const WCHAR
*pchText
,
208 [out] LONG *pacpStart
,
210 [out] TS_TEXTCHANGE
*pChange
);
212 HRESULT InsertEmbeddedAtSelection
(
214 [in] IDataObject
*pDataObject
,
215 [out] LONG *pacpStart
,
217 [out] TS_TEXTCHANGE
*pChange
);
219 HRESULT RequestSupportedAttrs
(
221 [in] ULONG cFilterAttrs
,
222 [in, size_is(cFilterAttrs
), unique] const TS_ATTRID
*paFilterAttrs
);
224 HRESULT RequestAttrsAtPosition
(
226 [in] ULONG cFilterAttrs
,
227 [in, size_is(cFilterAttrs
), unique] const TS_ATTRID
*paFilterAttrs
,
230 HRESULT RequestAttrsTransitioningAtPosition
(
232 [in] ULONG cFilterAttrs
,
233 [in, size_is(cFilterAttrs
), unique] const TS_ATTRID
*paFilterAttrs
,
236 HRESULT FindNextAttrTransition
(
239 [in] ULONG cFilterAttrs
,
240 [in, size_is(cFilterAttrs
), unique] const TS_ATTRID
*paFilterAttrs
,
242 [out] LONG *pacpNext
,
244 [out] LONG *plFoundOffset
);
246 HRESULT RetrieveRequestedAttrs
(
248 [out, size_is(ulCount
), length_is(*pcFetched
)] TS_ATTRVAL
*paAttrVals
,
249 [out] ULONG
*pcFetched
);
254 HRESULT GetActiveView
(
255 [out] TsViewCookie
*pvcView
);
257 HRESULT GetACPFromPoint
(
258 [in] TsViewCookie vcView
,
259 [in] const POINT
*ptScreen
,
264 [in] TsViewCookie vcView
,
268 [out] BOOL
*pfClipped
);
270 HRESULT GetScreenExt
(
271 [in] TsViewCookie vcView
,
275 [in] TsViewCookie vcView
,