1 | /*
|
---|
2 | * Copyright (C) 2005 Mike McCormack
|
---|
3 | *
|
---|
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.
|
---|
8 | *
|
---|
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.
|
---|
13 | *
|
---|
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
|
---|
17 | */
|
---|
18 |
|
---|
19 | /*
|
---|
20 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef _TEXTSERV_H
|
---|
29 | #define _TEXTSERV_H
|
---|
30 |
|
---|
31 | #ifdef __cplusplus
|
---|
32 | extern "C" {
|
---|
33 | #endif
|
---|
34 |
|
---|
35 | EXTERN_C const IID IID_ITextServices;
|
---|
36 | EXTERN_C const IID IID_ITextHost;
|
---|
37 |
|
---|
38 | /*****************************************************************************
|
---|
39 | * ITextServices interface
|
---|
40 | */
|
---|
41 | #define INTERFACE ITextServices
|
---|
42 | DECLARE_INTERFACE_(ITextServices,IUnknown)
|
---|
43 | {
|
---|
44 | /*** IUnknown methods ***/
|
---|
45 | STDMETHOD(QueryInterface)(THIS_
|
---|
46 | REFIID riid,
|
---|
47 | void** ppvObject) PURE;
|
---|
48 |
|
---|
49 | STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
---|
50 |
|
---|
51 | STDMETHOD_(ULONG,Release)(THIS) PURE;
|
---|
52 |
|
---|
53 | /*** ITextServices methods ***/
|
---|
54 |
|
---|
55 | STDMETHOD(TxSendMessage)( THIS_
|
---|
56 | UINT msg, WPARAM wparam, LPARAM lparam, LRESULT* plresult) PURE;
|
---|
57 |
|
---|
58 | STDMETHOD(TxDraw)( THIS_
|
---|
59 | DWORD dwDrawAspect,
|
---|
60 | LONG lindex,
|
---|
61 | void* pvAspect,
|
---|
62 | DVTARGETDEVICE* ptd,
|
---|
63 | HDC hdcDraw,
|
---|
64 | HDC hicTargetDev,
|
---|
65 | LPCRECTL lprcBounds,
|
---|
66 | LPCRECTL lprcWBounds,
|
---|
67 | LPRECT lprcUpdate,
|
---|
68 | BOOL (CALLBACK * pfnContinue)(DWORD),
|
---|
69 | DWORD dwContinue,
|
---|
70 | LONG lViewId) PURE;
|
---|
71 |
|
---|
72 | STDMETHOD(TxGetHScroll)( THIS_
|
---|
73 | LONG* plMin,
|
---|
74 | LONG* plMax,
|
---|
75 | LONG* plPos,
|
---|
76 | LONG* plPage,
|
---|
77 | BOOL* pfEnabled) PURE;
|
---|
78 |
|
---|
79 | STDMETHOD(TxGetVScroll)( THIS_
|
---|
80 | LONG* plMin,
|
---|
81 | LONG* plMax,
|
---|
82 | LONG* plPos,
|
---|
83 | LONG* plPage,
|
---|
84 | BOOL* pfEnabled) PURE;
|
---|
85 |
|
---|
86 | STDMETHOD(OnTxSetCursor)( THIS_
|
---|
87 | DWORD dwDrawAspect,
|
---|
88 | LONG lindex,
|
---|
89 | void* pvAspect,
|
---|
90 | DVTARGETDEVICE* ptd,
|
---|
91 | HDC hdcDraw,
|
---|
92 | HDC hicTargetDev,
|
---|
93 | LPCRECT lprcClient,
|
---|
94 | INT x,
|
---|
95 | INT y) PURE;
|
---|
96 |
|
---|
97 | STDMETHOD(TxQueryHitPoint)( THIS_
|
---|
98 | DWORD dwDrawAspect,
|
---|
99 | LONG lindex,
|
---|
100 | void* pvAspect,
|
---|
101 | DVTARGETDEVICE* ptd,
|
---|
102 | HDC hdcDraw,
|
---|
103 | HDC hicTargetDev,
|
---|
104 | LPCRECT lprcClient,
|
---|
105 | INT x,
|
---|
106 | INT y,
|
---|
107 | DWORD* pHitResult) PURE;
|
---|
108 |
|
---|
109 | STDMETHOD(OnTxInplaceActivate)( THIS_
|
---|
110 | LPCRECT prcClient) PURE;
|
---|
111 |
|
---|
112 | STDMETHOD(OnTxInplaceDeactivate)( THIS ) PURE;
|
---|
113 |
|
---|
114 | STDMETHOD(OnTxUIActivate)( THIS ) PURE;
|
---|
115 |
|
---|
116 | STDMETHOD(OnTxUIDeactivate)( THIS ) PURE;
|
---|
117 |
|
---|
118 | STDMETHOD(TxGetText)( THIS_
|
---|
119 | BSTR* pbstrText) PURE;
|
---|
120 |
|
---|
121 | STDMETHOD(TxSetText)( THIS_
|
---|
122 | LPCWSTR pszText) PURE;
|
---|
123 |
|
---|
124 | STDMETHOD(TxGetCurrentTargetX)( THIS_
|
---|
125 | LONG* x) PURE;
|
---|
126 |
|
---|
127 | STDMETHOD(TxGetBaseLinePos)( THIS_
|
---|
128 | LONG* x) PURE;
|
---|
129 |
|
---|
130 | STDMETHOD(TxGetNaturalSize)( THIS_
|
---|
131 | DWORD dwAspect,
|
---|
132 | HDC hdcDraw,
|
---|
133 | HDC hicTargetDev,
|
---|
134 | DVTARGETDEVICE* ptd,
|
---|
135 | DWORD dwMode,
|
---|
136 | const SIZEL* psizelExtent,
|
---|
137 | LONG* pwidth,
|
---|
138 | LONG* pheight) PURE;
|
---|
139 |
|
---|
140 | STDMETHOD(TxGetDropTarget)( THIS_
|
---|
141 | IDropTarget** ppDropTarget) PURE;
|
---|
142 |
|
---|
143 | STDMETHOD(OnTxPropertyBitsChange)( THIS_
|
---|
144 | DWORD dwMask,
|
---|
145 | DWORD dwBits) PURE;
|
---|
146 |
|
---|
147 | STDMETHOD(TxGetCachedSize)( THIS_
|
---|
148 | DWORD* pdwWidth,
|
---|
149 | DWORD* pdwHeight) PURE;
|
---|
150 |
|
---|
151 | };
|
---|
152 | #undef INTERFACE
|
---|
153 |
|
---|
154 | #ifdef COBJMACROS
|
---|
155 | /*** IUnknown methods ***/
|
---|
156 | #define ITextServices_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
---|
157 | #define ITextServices_AddRef(p) (p)->lpVtbl->AddRef(p)
|
---|
158 | #define ITextServices_Release(p) (p)->lpVtbl->Release(p)
|
---|
159 | #endif
|
---|
160 |
|
---|
161 | typedef enum _TXTBACKSTYLE {
|
---|
162 | TXTBACK_TRANSPARENT = 0,
|
---|
163 | TXTBACK_OPAQUE
|
---|
164 | } TXTBACKSTYLE;
|
---|
165 |
|
---|
166 | enum TXTHITRESULT {
|
---|
167 | TXTHITRESULT_NOHIT = 0,
|
---|
168 | TXTHITRESULT_TRANSPARENT = 1,
|
---|
169 | TXTHITRESULT_CLOSE = 2,
|
---|
170 | TXTHITRESULT_HIT = 3
|
---|
171 | };
|
---|
172 |
|
---|
173 | enum TXTNATURALSIZE {
|
---|
174 | TXTNS_FITTOCONTENT = 1,
|
---|
175 | TXTNS_ROUNDTOLINE = 2
|
---|
176 | };
|
---|
177 |
|
---|
178 | enum TXTVIEW {
|
---|
179 | TXTVIEW_ACTIVE = 0,
|
---|
180 | TXTVIEW_INACTIVE = 1
|
---|
181 | };
|
---|
182 |
|
---|
183 | #define TXTBIT_RICHTEXT 0x000001
|
---|
184 | #define TXTBIT_MULTILINE 0x000002
|
---|
185 | #define TXTBIT_READONLY 0x000004
|
---|
186 | #define TXTBIT_SHOWACCELERATOR 0x000008
|
---|
187 | #define TXTBIT_USEPASSWORD 0x000010
|
---|
188 | #define TXTBIT_HIDESELECTION 0x000020
|
---|
189 | #define TXTBIT_SAVESELECTION 0x000040
|
---|
190 | #define TXTBIT_AUTOWORDSEL 0x000080
|
---|
191 | #define TXTBIT_VERTICAL 0x000100
|
---|
192 | #define TXTBIT_SELBARCHANGE 0x000200
|
---|
193 | #define TXTBIT_WORDWRAP 0x000400
|
---|
194 | #define TXTBIT_ALLOWBEEP 0x000800
|
---|
195 | #define TXTBIT_DISABLEDRAG 0x001000
|
---|
196 | #define TXTBIT_VIEWINSETCHANGE 0x002000
|
---|
197 | #define TXTBIT_BACKSTYLECHANGE 0x004000
|
---|
198 | #define TXTBIT_MAXLENGTHCHANGE 0x008000
|
---|
199 | #define TXTBIT_SCROLLBARCHANGE 0x010000
|
---|
200 | #define TXTBIT_CHARFORMATCHANGE 0x020000
|
---|
201 | #define TXTBIT_PARAFORMATCHANGE 0x040000
|
---|
202 | #define TXTBIT_EXTENTCHANGE 0x080000
|
---|
203 | #define TXTBIT_CLIENTRECTCHANGE 0x100000
|
---|
204 | #define TXTBIT_USECURRENTBKG 0x200000
|
---|
205 |
|
---|
206 | /*****************************************************************************
|
---|
207 | * ITextHost interface
|
---|
208 | */
|
---|
209 | #define INTERFACE ITextHost
|
---|
210 | DECLARE_INTERFACE_(ITextHost,IUnknown)
|
---|
211 | {
|
---|
212 | /*** IUnknown methods ***/
|
---|
213 | STDMETHOD(QueryInterface)(THIS_
|
---|
214 | REFIID riid,
|
---|
215 | void** ppvObject) PURE;
|
---|
216 |
|
---|
217 | STDMETHOD_(ULONG,AddRef)(THIS) PURE;
|
---|
218 |
|
---|
219 | STDMETHOD_(ULONG,Release)(THIS) PURE;
|
---|
220 |
|
---|
221 | /*** ITextHost methods ***/
|
---|
222 | STDMETHOD_(HDC,TxGetDC)( THIS
|
---|
223 | ) PURE;
|
---|
224 |
|
---|
225 | STDMETHOD_(INT,TxReleaseDC)( THIS_
|
---|
226 | HDC hdc) PURE;
|
---|
227 |
|
---|
228 | STDMETHOD_(BOOL,TxShowScrollBar)( THIS_
|
---|
229 | INT fnBar,
|
---|
230 | BOOL fShow) PURE;
|
---|
231 |
|
---|
232 | STDMETHOD_(BOOL,TxEnableScrollBar)( THIS_
|
---|
233 | INT fuSBFlags,
|
---|
234 | INT fuArrowflags) PURE;
|
---|
235 |
|
---|
236 | STDMETHOD_(BOOL,TxSetScrollRange)( THIS_
|
---|
237 | INT fnBar,
|
---|
238 | LONG nMinPos,
|
---|
239 | INT nMaxPos,
|
---|
240 | BOOL fRedraw) PURE;
|
---|
241 |
|
---|
242 | STDMETHOD_(BOOL,TxSetScrollPos)( THIS_
|
---|
243 | INT fnBar,
|
---|
244 | INT nPos,
|
---|
245 | BOOL fRedraw) PURE;
|
---|
246 |
|
---|
247 | STDMETHOD_(void,TxInvalidateRect)( THIS_
|
---|
248 | LPCRECT prc,
|
---|
249 | BOOL fMode) PURE;
|
---|
250 |
|
---|
251 | STDMETHOD_(void,TxViewChange)( THIS_
|
---|
252 | BOOL fUpdate) PURE;
|
---|
253 |
|
---|
254 | STDMETHOD_(BOOL,TxCreateCaret)( THIS_
|
---|
255 | HBITMAP hbmp,
|
---|
256 | INT xWidth,
|
---|
257 | INT yHeight) PURE;
|
---|
258 |
|
---|
259 | STDMETHOD_(BOOL,TxShowCaret)( THIS_
|
---|
260 | BOOL fShow) PURE;
|
---|
261 |
|
---|
262 | STDMETHOD_(BOOL,TxSetCaretPos)( THIS_
|
---|
263 | INT x,
|
---|
264 | INT y) PURE;
|
---|
265 |
|
---|
266 | STDMETHOD_(BOOL,TxSetTimer)( THIS_
|
---|
267 | UINT idTimer,
|
---|
268 | UINT uTimeout) PURE;
|
---|
269 |
|
---|
270 | STDMETHOD_(void,TxKillTimer)( THIS_
|
---|
271 | UINT idTimer) PURE;
|
---|
272 |
|
---|
273 | STDMETHOD_(void,TxScrollWindowEx)( THIS_
|
---|
274 | INT dx,
|
---|
275 | INT dy,
|
---|
276 | LPCRECT lprcScroll,
|
---|
277 | LPCRECT lprcClip,
|
---|
278 | HRGN hRgnUpdate,
|
---|
279 | LPRECT lprcUpdate,
|
---|
280 | UINT fuScroll) PURE;
|
---|
281 |
|
---|
282 | STDMETHOD_(void,TxSetCapture)( THIS_
|
---|
283 | BOOL fCapture) PURE;
|
---|
284 |
|
---|
285 | STDMETHOD_(void,TxSetFocus)( THIS
|
---|
286 | ) PURE;
|
---|
287 |
|
---|
288 | STDMETHOD_(void,TxSetCursor)( THIS_
|
---|
289 | HCURSOR hcur,
|
---|
290 | BOOL fText) PURE;
|
---|
291 |
|
---|
292 | STDMETHOD_(BOOL,TxScreenToClient)( THIS_
|
---|
293 | LPPOINT lppt) PURE;
|
---|
294 |
|
---|
295 | STDMETHOD_(BOOL,TxClientToScreen)( THIS_
|
---|
296 | LPPOINT lppt) PURE;
|
---|
297 |
|
---|
298 | STDMETHOD(TxActivate)( THIS_
|
---|
299 | LONG* plOldState) PURE;
|
---|
300 |
|
---|
301 | STDMETHOD(TxDeactivate)( THIS_
|
---|
302 | LONG lNewState) PURE;
|
---|
303 |
|
---|
304 | STDMETHOD(TxGetClientRect)( THIS_
|
---|
305 | LPRECT prc) PURE;
|
---|
306 |
|
---|
307 | STDMETHOD(TxGetViewInset)( THIS_
|
---|
308 | LPRECT prc) PURE;
|
---|
309 |
|
---|
310 | STDMETHOD(TxGetCharFormat)( THIS_
|
---|
311 | const CHARFORMATW** ppCF) PURE;
|
---|
312 |
|
---|
313 | STDMETHOD(TxGetParaFormat)( THIS_
|
---|
314 | const PARAFORMAT** ppPF) PURE;
|
---|
315 |
|
---|
316 | STDMETHOD_(COLORREF,TxGetSysColor)( THIS_
|
---|
317 | int nIndex) PURE;
|
---|
318 |
|
---|
319 | STDMETHOD(TxGetBackStyle)( THIS_
|
---|
320 | TXTBACKSTYLE* pStyle) PURE;
|
---|
321 |
|
---|
322 | STDMETHOD(TxGetMaxLength)( THIS_
|
---|
323 | DWORD* plength) PURE;
|
---|
324 |
|
---|
325 | STDMETHOD(TxGetScrollBars)( THIS_
|
---|
326 | DWORD* pdwScrollBar) PURE;
|
---|
327 |
|
---|
328 | STDMETHOD(TxGetPasswordChar)( THIS_
|
---|
329 | WCHAR* pch) PURE;
|
---|
330 |
|
---|
331 | STDMETHOD(TxGetAcceleratorPos)( THIS_
|
---|
332 | LONG* pch) PURE;
|
---|
333 |
|
---|
334 | STDMETHOD(TxGetExtent)( THIS_
|
---|
335 | LPSIZEL lpExtent) PURE;
|
---|
336 |
|
---|
337 | STDMETHOD(OnTxCharFormatChange)( THIS_
|
---|
338 | const CHARFORMATW* pcf) PURE;
|
---|
339 |
|
---|
340 | STDMETHOD(OnTxParaFormatChange)( THIS_
|
---|
341 | const PARAFORMAT* ppf) PURE;
|
---|
342 |
|
---|
343 | STDMETHOD(TxGetPropertyBits)( THIS_
|
---|
344 | DWORD dwMask,
|
---|
345 | DWORD* pdwBits) PURE;
|
---|
346 |
|
---|
347 | STDMETHOD(TxNotify)( THIS_
|
---|
348 | DWORD iNotify,
|
---|
349 | void* pv) PURE;
|
---|
350 |
|
---|
351 | STDMETHOD_(HIMC,TxImmGetContext)( THIS
|
---|
352 | ) PURE;
|
---|
353 |
|
---|
354 | STDMETHOD_(void,TxImmReleaseContext)( THIS_
|
---|
355 | HIMC himc) PURE;
|
---|
356 |
|
---|
357 | STDMETHOD(TxGetSelectionBarWidth)( THIS_
|
---|
358 | LONG* lSelBarWidth) PURE;
|
---|
359 |
|
---|
360 | };
|
---|
361 | #undef INTERFACE
|
---|
362 |
|
---|
363 | #ifdef COBJMACROS
|
---|
364 | /*** IUnknown methods ***/
|
---|
365 | #define ITextHost_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
|
---|
366 | #define ITextHost_AddRef(p) (p)->lpVtbl->AddRef(p)
|
---|
367 | #define ITextHost_Release(p) (p)->lpVtbl->Release(p)
|
---|
368 | #endif
|
---|
369 |
|
---|
370 | HRESULT WINAPI CreateTextServices(IUnknown*,ITextHost*,IUnknown**);
|
---|
371 |
|
---|
372 | typedef HRESULT (WINAPI *PCreateTextServices)(IUnknown*,ITextHost*,IUnknown**);
|
---|
373 |
|
---|
374 | #ifdef __cplusplus
|
---|
375 | }
|
---|
376 | #endif
|
---|
377 |
|
---|
378 | #endif /* _TEXTSERV_H */
|
---|