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
);
41 const DWORD TS_LF_SYNC
= 0x1;
42 const DWORD TS_LF_READ
= 0x2;
43 const DWORD TS_LF_READWRITE
= 0x6;
45 typedef [uuid(05fcf85b
-5e9c
-4c3e
-ab71
-29471d4f38e7
)] enum { TS_AE_NONE
, TS_AE_START
, TS_AE_END
} TsActiveSelEnd
;
46 typedef [uuid(033b0df0
-f193
-4170-b47b
-141afc247878
)] enum { TS_RT_PLAIN
, TS_RT_HIDDEN
, TS_RT_OPAQUE
} TsRunType
;
47 typedef [uuid(ef3457d9
-8446-49a7
-a9e6
-b50d9d5f3fd9
)] GUID TS_ATTRID
;
49 typedef [uuid(fec4f516
-c503
-45b1
-a5fd
-7a3d8ab07049
)] struct TS_STATUS
55 typedef [uuid(f3181bd6
-bcf0
-41d3
-a81c
-474b17ec38fb
)] struct TS_TEXTCHANGE
62 typedef [uuid(7ecc3ffa
-8f73
-4d91
-98ed
-76f8ac5b1600
)] struct TS_SELECTIONSTYLE
68 typedef [uuid(c4b9c33b
-8a0d
-4426-bebe
-d444a4701fe9
)] struct TS_SELECTION_ACP
72 TS_SELECTIONSTYLE style
;
75 typedef [uuid(a6231949
-37c5
-4b74
-a24e
-2a26c327201d
)] struct TS_RUNINFO
81 typedef [uuid(2cc2b33f
-1174-4507-b8d9
-5bc0eb37c197
)] struct TS_ATTRVAL
88 typedef [uuid(7899d7c4
-5f07
-493c
-a89a
-fac8e777f476
)] enum { TS_LC_CREATE
, TS_LC_CHANGE
, TS_LC_DESTROY
} TsLayoutCode
;
89 typedef [uuid(1faf509e
-44c1
-458e-950a
-38a96705a62b
)] DWORD TsViewCookie
;
93 uuid(22d44c94
-a419
-4542-a272
-ae26093ececf
),
94 pointer_default(unique)
96 interface ITextStoreACPSink
: IUnknown
100 [in] const TS_TEXTCHANGE
*pChange
);
102 HRESULT OnSelectionChange
();
104 HRESULT OnLayoutChange
(
105 [in] TsLayoutCode lcode
,
106 [in] TsViewCookie vcView
);
108 HRESULT OnStatusChange
(
111 HRESULT OnAttrsChange
(
115 [in, size_is(cAttrs
)] const TS_ATTRID
*paAttrs
);
117 HRESULT OnLockGranted
(
118 [in] DWORD dwLockFlags
);
120 HRESULT OnStartEditTransaction
();
122 HRESULT OnEndEditTransaction
();
127 uuid(28888fe3
-c2a0
-483a
-a3ea
-8cb1ce51ff3d
),
128 pointer_default(unique)
130 interface ITextStoreACP
: IUnknown
134 [in, iid_is(riid
)] IUnknown
*punk
,
137 HRESULT UnadviseSink
(
138 [in] IUnknown
*punk
);
141 [in] DWORD dwLockFlags
,
142 [out] HRESULT *phrSession
);
145 [out] TS_STATUS
*pdcs
);
148 [in] LONG acpTestStart
,
149 [in] LONG acpTestEnd
,
151 [out] LONG *pacpResultStart
,
152 [out] LONG *pacpResultEnd
);
154 HRESULT GetSelection
(
157 [out, size_is(ulCount
), length_is(*pcFetched
)] TS_SELECTION_ACP
*pSelection
,
158 [out] ULONG
*pcFetched
);
160 HRESULT SetSelection
(
162 [in, size_is(ulCount
)] const TS_SELECTION_ACP
*pSelection
);
167 [out, size_is(cchPlainReq
), length_is(*pcchPlainRet
)] WCHAR
*pchPlain
,
168 [in] ULONG cchPlainReq
,
169 [out] ULONG
*pcchPlainRet
,
170 [out, size_is(cRunInfoReq
), length_is(*pcRunInfoRet
)] TS_RUNINFO
*prgRunInfo
,
171 [in] ULONG cRunInfoReq
,
172 [out] ULONG
*pcRunInfoRet
,
173 [out] LONG *pacpNext
);
179 [in, size_is(cch
)] const WCHAR
*pchText
,
181 [out] TS_TEXTCHANGE
*pChange
);
183 HRESULT GetFormattedText
(
186 [out] IDataObject
**ppDataObject
);
190 [in] REFGUID rguidService
,
192 [out, iid_is(riid
)] IUnknown
**ppunk
);
194 HRESULT QueryInsertEmbedded
(
195 [in] const GUID
*pguidService
,
196 [in] const FORMATETC
*pFormatEtc
,
197 [out] BOOL
*pfInsertable
);
199 HRESULT InsertEmbedded
(
203 [in] IDataObject
*pDataObject
,
204 [out] TS_TEXTCHANGE
*pChange
);
207 HRESULT InsertTextAtSelection
(
209 [in, size_is(cch
)] const WCHAR
*pchText
,
211 [out] LONG *pacpStart
,
213 [out] TS_TEXTCHANGE
*pChange
);
215 HRESULT InsertEmbeddedAtSelection
(
217 [in] IDataObject
*pDataObject
,
218 [out] LONG *pacpStart
,
220 [out] TS_TEXTCHANGE
*pChange
);
222 HRESULT RequestSupportedAttrs
(
224 [in] ULONG cFilterAttrs
,
225 [in, size_is(cFilterAttrs
), unique] const TS_ATTRID
*paFilterAttrs
);
227 HRESULT RequestAttrsAtPosition
(
229 [in] ULONG cFilterAttrs
,
230 [in, size_is(cFilterAttrs
), unique] const TS_ATTRID
*paFilterAttrs
,
233 HRESULT RequestAttrsTransitioningAtPosition
(
235 [in] ULONG cFilterAttrs
,
236 [in, size_is(cFilterAttrs
), unique] const TS_ATTRID
*paFilterAttrs
,
239 HRESULT FindNextAttrTransition
(
242 [in] ULONG cFilterAttrs
,
243 [in, size_is(cFilterAttrs
), unique] const TS_ATTRID
*paFilterAttrs
,
245 [out] LONG *pacpNext
,
247 [out] LONG *plFoundOffset
);
249 HRESULT RetrieveRequestedAttrs
(
251 [out, size_is(ulCount
), length_is(*pcFetched
)] TS_ATTRVAL
*paAttrVals
,
252 [out] ULONG
*pcFetched
);
257 HRESULT GetActiveView
(
258 [out] TsViewCookie
*pvcView
);
260 HRESULT GetACPFromPoint
(
261 [in] TsViewCookie vcView
,
262 [in] const POINT
*ptScreen
,
267 [in] TsViewCookie vcView
,
271 [out] BOOL
*pfClipped
);
273 HRESULT GetScreenExt
(
274 [in] TsViewCookie vcView
,
278 [in] TsViewCookie vcView
,