wrc: Avoid a crash if a file didn't contain any resources.
[wine/hacks.git] / include / textstor.idl
blob2e79e3c9beaf58efb03daab7f16b2f4bca3ff802
1 /*
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
19 #ifndef DO_NO_IMPORTS
20 import "oaidl.idl";
21 #endif
23 cpp_quote("#define TS_E_READONLY MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0209)")
24 cpp_quote("#define TS_E_NOLOCK MAKE_HRESULT(SEVERITY_ERROR, FACILITY_ITF, 0x0201)")
27 const ULONG TS_DEFAULT_SELECTION = ~0u;
29 const DWORD TS_SD_READONLY = 0x001;
30 const DWORD TS_SD_LOADING = 0x002;
32 const DWORD TS_SS_DISJOINTSEL = 0x001;
33 const DWORD TS_SS_REGIONS = 0x002;
34 const DWORD TS_SS_TRANSITORY = 0x004;
35 const DWORD TS_SS_NOHIDDENTEXT = 0x008;
37 const DWORD TS_AS_TEXT_CHANGE = 0x01;
38 const DWORD TS_AS_SEL_CHANGE = 0x02;
39 const DWORD TS_AS_LAYOUT_CHANGE = 0x04;
40 const DWORD TS_AS_ATTR_CHANGE = 0x08;
41 const DWORD TS_AS_STATUS_CHANGE = 0x10;
43 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);
45 const DWORD TS_LF_SYNC = 0x1;
46 const DWORD TS_LF_READ = 0x2;
47 const DWORD TS_LF_READWRITE = 0x6;
49 const WCHAR TS_CHAR_EMBEDDED = 0xfffc;
50 const WCHAR TS_CHAR_REGION = 0x0000;
51 const WCHAR TS_CHAR_REPLACEMENT = 0xfffd;
53 typedef [uuid(05fcf85b-5e9c-4c3e-ab71-29471d4f38e7)] enum { TS_AE_NONE, TS_AE_START, TS_AE_END } TsActiveSelEnd;
54 typedef [uuid(033b0df0-f193-4170-b47b-141afc247878)] enum { TS_RT_PLAIN, TS_RT_HIDDEN, TS_RT_OPAQUE } TsRunType;
55 typedef [uuid(ef3457d9-8446-49a7-a9e6-b50d9d5f3fd9)] GUID TS_ATTRID;
57 typedef [uuid(fec4f516-c503-45b1-a5fd-7a3d8ab07049)] struct TS_STATUS
59 DWORD dwDynamicFlags;
60 DWORD dwStaticFlags;
61 } TS_STATUS;
63 typedef [uuid(f3181bd6-bcf0-41d3-a81c-474b17ec38fb)] struct TS_TEXTCHANGE
65 LONG acpStart;
66 LONG acpOldEnd;
67 LONG acpNewEnd;
68 } TS_TEXTCHANGE;
70 typedef [uuid(7ecc3ffa-8f73-4d91-98ed-76f8ac5b1600)] struct TS_SELECTIONSTYLE
72 TsActiveSelEnd ase;
73 BOOL fInterimChar;
74 } TS_SELECTIONSTYLE;
76 typedef [uuid(c4b9c33b-8a0d-4426-bebe-d444a4701fe9)] struct TS_SELECTION_ACP
78 LONG acpStart;
79 LONG acpEnd;
80 TS_SELECTIONSTYLE style;
81 } TS_SELECTION_ACP;
83 typedef [uuid(a6231949-37c5-4b74-a24e-2a26c327201d)] struct TS_RUNINFO
85 ULONG uCount;
86 TsRunType type;
87 } TS_RUNINFO;
89 typedef [uuid(2cc2b33f-1174-4507-b8d9-5bc0eb37c197)] struct TS_ATTRVAL
91 TS_ATTRID idAttr;
92 DWORD dwOverlapId;
93 VARIANT varValue;
94 } TS_ATTRVAL;
96 typedef [uuid(7899d7c4-5f07-493c-a89a-fac8e777f476)] enum { TS_LC_CREATE, TS_LC_CHANGE, TS_LC_DESTROY } TsLayoutCode;
97 typedef [uuid(1faf509e-44c1-458e-950a-38a96705a62b)] DWORD TsViewCookie;
100 object,
101 uuid(22d44c94-a419-4542-a272-ae26093ececf),
102 pointer_default(unique)
104 interface ITextStoreACPSink : IUnknown
106 HRESULT OnTextChange(
107 [in] DWORD dwFlags,
108 [in] const TS_TEXTCHANGE *pChange);
110 HRESULT OnSelectionChange();
112 HRESULT OnLayoutChange(
113 [in] TsLayoutCode lcode,
114 [in] TsViewCookie vcView);
116 HRESULT OnStatusChange(
117 [in] DWORD dwFlags);
119 HRESULT OnAttrsChange(
120 [in] LONG acpStart,
121 [in] LONG acpEnd,
122 [in] ULONG cAttrs,
123 [in, size_is(cAttrs)] const TS_ATTRID *paAttrs);
125 HRESULT OnLockGranted(
126 [in] DWORD dwLockFlags);
128 HRESULT OnStartEditTransaction();
130 HRESULT OnEndEditTransaction();
134 object,
135 uuid(28888fe3-c2a0-483a-a3ea-8cb1ce51ff3d),
136 pointer_default(unique)
138 interface ITextStoreACP : IUnknown
140 HRESULT AdviseSink(
141 [in] REFIID riid,
142 [in, iid_is(riid)] IUnknown *punk,
143 [in] DWORD dwMask);
145 HRESULT UnadviseSink(
146 [in] IUnknown *punk);
148 HRESULT RequestLock(
149 [in] DWORD dwLockFlags,
150 [out] HRESULT *phrSession);
152 HRESULT GetStatus(
153 [out] TS_STATUS *pdcs);
155 HRESULT QueryInsert(
156 [in] LONG acpTestStart,
157 [in] LONG acpTestEnd,
158 [in] ULONG cch,
159 [out] LONG *pacpResultStart,
160 [out] LONG *pacpResultEnd);
162 HRESULT GetSelection(
163 [in] ULONG ulIndex,
164 [in] ULONG ulCount,
165 [out, size_is(ulCount), length_is(*pcFetched)] TS_SELECTION_ACP *pSelection,
166 [out] ULONG *pcFetched);
168 HRESULT SetSelection(
169 [in] ULONG ulCount,
170 [in, size_is(ulCount)] const TS_SELECTION_ACP *pSelection);
172 HRESULT GetText(
173 [in] LONG acpStart,
174 [in] LONG acpEnd,
175 [out, size_is(cchPlainReq), length_is(*pcchPlainRet)] WCHAR *pchPlain,
176 [in] ULONG cchPlainReq,
177 [out] ULONG *pcchPlainRet,
178 [out, size_is(cRunInfoReq), length_is(*pcRunInfoRet)] TS_RUNINFO *prgRunInfo,
179 [in] ULONG cRunInfoReq,
180 [out] ULONG *pcRunInfoRet,
181 [out] LONG *pacpNext);
183 HRESULT SetText(
184 [in] DWORD dwFlags,
185 [in] LONG acpStart,
186 [in] LONG acpEnd,
187 [in, size_is(cch)] const WCHAR *pchText,
188 [in] ULONG cch,
189 [out] TS_TEXTCHANGE *pChange);
191 HRESULT GetFormattedText(
192 [in] LONG acpStart,
193 [in] LONG acpEnd,
194 [out] IDataObject **ppDataObject);
196 HRESULT GetEmbedded(
197 [in] LONG acpPos,
198 [in] REFGUID rguidService,
199 [in] REFIID riid,
200 [out, iid_is(riid)] IUnknown **ppunk);
202 HRESULT QueryInsertEmbedded(
203 [in] const GUID *pguidService,
204 [in] const FORMATETC *pFormatEtc,
205 [out] BOOL *pfInsertable);
207 HRESULT InsertEmbedded(
208 [in] DWORD dwFlags,
209 [in] LONG acpStart,
210 [in] LONG acpEnd,
211 [in] IDataObject *pDataObject,
212 [out] TS_TEXTCHANGE *pChange);
215 HRESULT InsertTextAtSelection(
216 [in] DWORD dwFlags,
217 [in, size_is(cch)] const WCHAR *pchText,
218 [in] ULONG cch,
219 [out] LONG *pacpStart,
220 [out] LONG *pacpEnd,
221 [out] TS_TEXTCHANGE *pChange);
223 HRESULT InsertEmbeddedAtSelection(
224 [in] DWORD dwFlags,
225 [in] IDataObject *pDataObject,
226 [out] LONG *pacpStart,
227 [out] LONG *pacpEnd,
228 [out] TS_TEXTCHANGE *pChange);
230 HRESULT RequestSupportedAttrs(
231 [in] DWORD dwFlags,
232 [in] ULONG cFilterAttrs,
233 [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs);
235 HRESULT RequestAttrsAtPosition(
236 [in] LONG acpPos,
237 [in] ULONG cFilterAttrs,
238 [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs,
239 [in] DWORD dwFlags);
241 HRESULT RequestAttrsTransitioningAtPosition(
242 [in] LONG acpPos,
243 [in] ULONG cFilterAttrs,
244 [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs,
245 [in] DWORD dwFlags);
247 HRESULT FindNextAttrTransition(
248 [in] LONG acpStart,
249 [in] LONG acpHalt,
250 [in] ULONG cFilterAttrs,
251 [in, size_is(cFilterAttrs), unique] const TS_ATTRID *paFilterAttrs,
252 [in] DWORD dwFlags,
253 [out] LONG *pacpNext,
254 [out] BOOL *pfFound,
255 [out] LONG *plFoundOffset);
257 HRESULT RetrieveRequestedAttrs(
258 [in] ULONG ulCount,
259 [out, size_is(ulCount), length_is(*pcFetched)] TS_ATTRVAL *paAttrVals,
260 [out] ULONG *pcFetched);
262 HRESULT GetEndACP(
263 [out] LONG *pacp);
265 HRESULT GetActiveView(
266 [out] TsViewCookie *pvcView);
268 HRESULT GetACPFromPoint(
269 [in] TsViewCookie vcView,
270 [in] const POINT *ptScreen,
271 [in] DWORD dwFlags,
272 [out] LONG *pacp);
274 HRESULT GetTextExt(
275 [in] TsViewCookie vcView,
276 [in] LONG acpStart,
277 [in] LONG acpEnd,
278 [out] RECT *prc,
279 [out] BOOL *pfClipped);
281 HRESULT GetScreenExt(
282 [in] TsViewCookie vcView,
283 [out] RECT *prc);
285 HRESULT GetWnd(
286 [in] TsViewCookie vcView,
287 [out] HWND *phwnd);