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