po: Update Lithuanian translation.
[wine.git] / include / textserv.h
blob6198f6900ffe61a68cd845f54a4ed8b9c79a1501
1 /*
2 * Copyright (C) 2005 Mike McCormack
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 _TEXTSERV_H
20 #define _TEXTSERV_H
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
26 #ifdef __cplusplus
27 #define THISCALLMETHOD_(type,method) virtual type __thiscall method
28 #else
29 #define THISCALLMETHOD_(type,method) type (__thiscall *method)
30 #endif
32 EXTERN_C const IID IID_ITextServices;
33 EXTERN_C const IID IID_ITextHost;
34 EXTERN_C const IID IID_ITextHost2;
36 /*****************************************************************************
37 * ITextServices interface
39 #define INTERFACE ITextServices
40 DECLARE_INTERFACE_(ITextServices,IUnknown)
42 /*** IUnknown methods ***/
43 STDMETHOD(QueryInterface)(THIS_
44 REFIID riid,
45 void** ppvObject) PURE;
47 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
49 STDMETHOD_(ULONG,Release)(THIS) PURE;
51 /*** ITextServices methods ***/
53 THISCALLMETHOD_(HRESULT,TxSendMessage)( THIS_
54 UINT msg, WPARAM wparam, LPARAM lparam, LRESULT* plresult) PURE;
56 THISCALLMETHOD_(HRESULT,TxDraw)( THIS_
57 DWORD dwDrawAspect,
58 LONG lindex,
59 void* pvAspect,
60 DVTARGETDEVICE* ptd,
61 HDC hdcDraw,
62 HDC hicTargetDev,
63 LPCRECTL lprcBounds,
64 LPCRECTL lprcWBounds,
65 LPRECT lprcUpdate,
66 BOOL (CALLBACK * pfnContinue)(DWORD),
67 DWORD dwContinue,
68 LONG lViewId) PURE;
70 THISCALLMETHOD_(HRESULT,TxGetHScroll)( THIS_
71 LONG* plMin,
72 LONG* plMax,
73 LONG* plPos,
74 LONG* plPage,
75 BOOL* pfEnabled) PURE;
77 THISCALLMETHOD_(HRESULT,TxGetVScroll)( THIS_
78 LONG* plMin,
79 LONG* plMax,
80 LONG* plPos,
81 LONG* plPage,
82 BOOL* pfEnabled) PURE;
84 THISCALLMETHOD_(HRESULT,OnTxSetCursor)( THIS_
85 DWORD dwDrawAspect,
86 LONG lindex,
87 void* pvAspect,
88 DVTARGETDEVICE* ptd,
89 HDC hdcDraw,
90 HDC hicTargetDev,
91 LPCRECT lprcClient,
92 INT x,
93 INT y) PURE;
95 THISCALLMETHOD_(HRESULT,TxQueryHitPoint)( THIS_
96 DWORD dwDrawAspect,
97 LONG lindex,
98 void* pvAspect,
99 DVTARGETDEVICE* ptd,
100 HDC hdcDraw,
101 HDC hicTargetDev,
102 LPCRECT lprcClient,
103 INT x,
104 INT y,
105 DWORD* pHitResult) PURE;
107 THISCALLMETHOD_(HRESULT,OnTxInPlaceActivate)( THIS_
108 LPCRECT prcClient) PURE;
110 THISCALLMETHOD_(HRESULT,OnTxInPlaceDeactivate)( THIS ) PURE;
112 THISCALLMETHOD_(HRESULT,OnTxUIActivate)( THIS ) PURE;
114 THISCALLMETHOD_(HRESULT,OnTxUIDeactivate)( THIS ) PURE;
116 THISCALLMETHOD_(HRESULT,TxGetText)( THIS_
117 BSTR* pbstrText) PURE;
119 THISCALLMETHOD_(HRESULT,TxSetText)( THIS_
120 LPCWSTR pszText) PURE;
122 THISCALLMETHOD_(HRESULT,TxGetCurTargetX)( THIS_
123 LONG* x) PURE;
125 THISCALLMETHOD_(HRESULT,TxGetBaseLinePos)( THIS_
126 LONG* x) PURE;
128 THISCALLMETHOD_(HRESULT,TxGetNaturalSize)( THIS_
129 DWORD dwAspect,
130 HDC hdcDraw,
131 HDC hicTargetDev,
132 DVTARGETDEVICE* ptd,
133 DWORD dwMode,
134 const SIZEL* psizelExtent,
135 LONG* pwidth,
136 LONG* pheight) PURE;
138 THISCALLMETHOD_(HRESULT,TxGetDropTarget)( THIS_
139 IDropTarget** ppDropTarget) PURE;
141 THISCALLMETHOD_(HRESULT,OnTxPropertyBitsChange)( THIS_
142 DWORD dwMask,
143 DWORD dwBits) PURE;
145 THISCALLMETHOD_(HRESULT,TxGetCachedSize)( THIS_
146 DWORD* pdwWidth,
147 DWORD* pdwHeight) PURE;
150 #undef INTERFACE
152 #ifdef COBJMACROS
153 /*** IUnknown methods ***/
154 #define ITextServices_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
155 #define ITextServices_AddRef(p) (p)->lpVtbl->AddRef(p)
156 #define ITextServices_Release(p) (p)->lpVtbl->Release(p)
157 #endif
159 typedef enum _TXTBACKSTYLE {
160 TXTBACK_TRANSPARENT = 0,
161 TXTBACK_OPAQUE
162 } TXTBACKSTYLE;
164 enum TXTHITRESULT {
165 TXTHITRESULT_NOHIT = 0,
166 TXTHITRESULT_TRANSPARENT = 1,
167 TXTHITRESULT_CLOSE = 2,
168 TXTHITRESULT_HIT = 3
171 enum TXTNATURALSIZE {
172 TXTNS_FITTOCONTENT = 1,
173 TXTNS_ROUNDTOLINE = 2
176 enum TXTVIEW {
177 TXTVIEW_ACTIVE = 0,
178 TXTVIEW_INACTIVE = -1
181 #define TXTBIT_RICHTEXT 0x000001
182 #define TXTBIT_MULTILINE 0x000002
183 #define TXTBIT_READONLY 0x000004
184 #define TXTBIT_SHOWACCELERATOR 0x000008
185 #define TXTBIT_USEPASSWORD 0x000010
186 #define TXTBIT_HIDESELECTION 0x000020
187 #define TXTBIT_SAVESELECTION 0x000040
188 #define TXTBIT_AUTOWORDSEL 0x000080
189 #define TXTBIT_VERTICAL 0x000100
190 #define TXTBIT_SELBARCHANGE 0x000200
191 #define TXTBIT_WORDWRAP 0x000400
192 #define TXTBIT_ALLOWBEEP 0x000800
193 #define TXTBIT_DISABLEDRAG 0x001000
194 #define TXTBIT_VIEWINSETCHANGE 0x002000
195 #define TXTBIT_BACKSTYLECHANGE 0x004000
196 #define TXTBIT_MAXLENGTHCHANGE 0x008000
197 #define TXTBIT_SCROLLBARCHANGE 0x010000
198 #define TXTBIT_CHARFORMATCHANGE 0x020000
199 #define TXTBIT_PARAFORMATCHANGE 0x040000
200 #define TXTBIT_EXTENTCHANGE 0x080000
201 #define TXTBIT_CLIENTRECTCHANGE 0x100000
202 #define TXTBIT_USECURRENTBKG 0x200000
204 /*****************************************************************************
205 * ITextHost interface
207 #define INTERFACE ITextHost
208 DECLARE_INTERFACE_(ITextHost,IUnknown)
210 /*** IUnknown methods ***/
211 STDMETHOD(QueryInterface)(THIS_
212 REFIID riid,
213 void** ppvObject) PURE;
215 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
217 STDMETHOD_(ULONG,Release)(THIS) PURE;
219 /*** ITextHost methods ***/
220 THISCALLMETHOD_(HDC,TxGetDC)( THIS
221 ) PURE;
223 THISCALLMETHOD_(INT,TxReleaseDC)( THIS_
224 HDC hdc) PURE;
226 THISCALLMETHOD_(BOOL,TxShowScrollBar)( THIS_
227 INT fnBar,
228 BOOL fShow) PURE;
230 THISCALLMETHOD_(BOOL,TxEnableScrollBar)( THIS_
231 INT fuSBFlags,
232 INT fuArrowflags) PURE;
234 THISCALLMETHOD_(BOOL,TxSetScrollRange)( THIS_
235 INT fnBar,
236 LONG nMinPos,
237 INT nMaxPos,
238 BOOL fRedraw) PURE;
240 THISCALLMETHOD_(BOOL,TxSetScrollPos)( THIS_
241 INT fnBar,
242 INT nPos,
243 BOOL fRedraw) PURE;
245 THISCALLMETHOD_(void,TxInvalidateRect)( THIS_
246 LPCRECT prc,
247 BOOL fMode) PURE;
249 THISCALLMETHOD_(void,TxViewChange)( THIS_
250 BOOL fUpdate) PURE;
252 THISCALLMETHOD_(BOOL,TxCreateCaret)( THIS_
253 HBITMAP hbmp,
254 INT xWidth,
255 INT yHeight) PURE;
257 THISCALLMETHOD_(BOOL,TxShowCaret)( THIS_
258 BOOL fShow) PURE;
260 THISCALLMETHOD_(BOOL,TxSetCaretPos)( THIS_
261 INT x,
262 INT y) PURE;
264 THISCALLMETHOD_(BOOL,TxSetTimer)( THIS_
265 UINT idTimer,
266 UINT uTimeout) PURE;
268 THISCALLMETHOD_(void,TxKillTimer)( THIS_
269 UINT idTimer) PURE;
271 THISCALLMETHOD_(void,TxScrollWindowEx)( THIS_
272 INT dx,
273 INT dy,
274 LPCRECT lprcScroll,
275 LPCRECT lprcClip,
276 HRGN hRgnUpdate,
277 LPRECT lprcUpdate,
278 UINT fuScroll) PURE;
280 THISCALLMETHOD_(void,TxSetCapture)( THIS_
281 BOOL fCapture) PURE;
283 THISCALLMETHOD_(void,TxSetFocus)( THIS
284 ) PURE;
286 THISCALLMETHOD_(void,TxSetCursor)( THIS_
287 HCURSOR hcur,
288 BOOL fText) PURE;
290 THISCALLMETHOD_(BOOL,TxScreenToClient)( THIS_
291 LPPOINT lppt) PURE;
293 THISCALLMETHOD_(BOOL,TxClientToScreen)( THIS_
294 LPPOINT lppt) PURE;
296 THISCALLMETHOD_(HRESULT,TxActivate)( THIS_
297 LONG* plOldState) PURE;
299 THISCALLMETHOD_(HRESULT,TxDeactivate)( THIS_
300 LONG lNewState) PURE;
302 THISCALLMETHOD_(HRESULT,TxGetClientRect)( THIS_
303 LPRECT prc) PURE;
305 THISCALLMETHOD_(HRESULT,TxGetViewInset)( THIS_
306 LPRECT prc) PURE;
308 THISCALLMETHOD_(HRESULT,TxGetCharFormat)( THIS_
309 const CHARFORMATW** ppCF) PURE;
311 THISCALLMETHOD_(HRESULT,TxGetParaFormat)( THIS_
312 const PARAFORMAT** ppPF) PURE;
314 THISCALLMETHOD_(COLORREF,TxGetSysColor)( THIS_
315 int nIndex) PURE;
317 THISCALLMETHOD_(HRESULT,TxGetBackStyle)( THIS_
318 TXTBACKSTYLE* pStyle) PURE;
320 THISCALLMETHOD_(HRESULT,TxGetMaxLength)( THIS_
321 DWORD* plength) PURE;
323 THISCALLMETHOD_(HRESULT,TxGetScrollBars)( THIS_
324 DWORD* pdwScrollBar) PURE;
326 THISCALLMETHOD_(HRESULT,TxGetPasswordChar)( THIS_
327 WCHAR* pch) PURE;
329 THISCALLMETHOD_(HRESULT,TxGetAcceleratorPos)( THIS_
330 LONG* pch) PURE;
332 THISCALLMETHOD_(HRESULT,TxGetExtent)( THIS_
333 LPSIZEL lpExtent) PURE;
335 THISCALLMETHOD_(HRESULT,OnTxCharFormatChange)( THIS_
336 const CHARFORMATW* pcf) PURE;
338 THISCALLMETHOD_(HRESULT,OnTxParaFormatChange)( THIS_
339 const PARAFORMAT* ppf) PURE;
341 THISCALLMETHOD_(HRESULT,TxGetPropertyBits)( THIS_
342 DWORD dwMask,
343 DWORD* pdwBits) PURE;
345 THISCALLMETHOD_(HRESULT,TxNotify)( THIS_
346 DWORD iNotify,
347 void* pv) PURE;
349 THISCALLMETHOD_(HIMC,TxImmGetContext)( THIS
350 ) PURE;
352 THISCALLMETHOD_(void,TxImmReleaseContext)( THIS_
353 HIMC himc) PURE;
355 THISCALLMETHOD_(HRESULT,TxGetSelectionBarWidth)( THIS_
356 LONG* lSelBarWidth) PURE;
359 #undef INTERFACE
361 #ifdef COBJMACROS
362 /*** IUnknown methods ***/
363 #define ITextHost_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
364 #define ITextHost_AddRef(p) (p)->lpVtbl->AddRef(p)
365 #define ITextHost_Release(p) (p)->lpVtbl->Release(p)
366 #endif
368 /*****************************************************************************
369 * ITextHost2 interface
371 #define INTERFACE ITextHost2
372 DECLARE_INTERFACE_(ITextHost2,ITextHost)
374 /*** IUnknown methods ***/
375 STDMETHOD(QueryInterface)( THIS_ REFIID riid, void** ppvObject ) PURE;
376 STDMETHOD_(ULONG,AddRef)( THIS ) PURE;
377 STDMETHOD_(ULONG,Release)( THIS ) PURE;
378 /*** ITextHost methods ***/
379 THISCALLMETHOD_(HDC,TxGetDC)( THIS ) PURE;
380 THISCALLMETHOD_(INT,TxReleaseDC)( THIS_ HDC hdc ) PURE;
381 THISCALLMETHOD_(BOOL,TxShowScrollBar)( THIS_ INT fnBar, BOOL fShow ) PURE;
382 THISCALLMETHOD_(BOOL,TxEnableScrollBar)( THIS_ INT fuSBFlags, INT fuArrowflags ) PURE;
383 THISCALLMETHOD_(BOOL,TxSetScrollRange)( THIS_ INT fnBar, LONG nMinPos, INT nMaxPos, BOOL fRedraw ) PURE;
384 THISCALLMETHOD_(BOOL,TxSetScrollPos)( THIS_ INT fnBar, INT nPos, BOOL fRedraw ) PURE;
385 THISCALLMETHOD_(void,TxInvalidateRect)( THIS_ LPCRECT prc, BOOL fMode ) PURE;
386 THISCALLMETHOD_(void,TxViewChange)( THIS_ BOOL fUpdate ) PURE;
387 THISCALLMETHOD_(BOOL,TxCreateCaret)( THIS_ HBITMAP hbmp, INT xWidth, INT yHeight ) PURE;
388 THISCALLMETHOD_(BOOL,TxShowCaret)( THIS_ BOOL fShow ) PURE;
389 THISCALLMETHOD_(BOOL,TxSetCaretPos)( THIS_ INT x, INT y ) PURE;
390 THISCALLMETHOD_(BOOL,TxSetTimer)( THIS_ UINT idTimer, UINT uTimeout ) PURE;
391 THISCALLMETHOD_(void,TxKillTimer)( THIS_ UINT idTimer ) PURE;
392 THISCALLMETHOD_(void,TxScrollWindowEx)( THIS_ INT dx, INT dy, LPCRECT lprcScroll, LPCRECT lprcClip,
393 HRGN hRgnUpdate, LPRECT lprcUpdate, UINT fuScroll ) PURE;
394 THISCALLMETHOD_(void,TxSetCapture)( THIS_ BOOL fCapture ) PURE;
395 THISCALLMETHOD_(void,TxSetFocus)( THIS ) PURE;
396 THISCALLMETHOD_(void,TxSetCursor)( THIS_ HCURSOR hcur, BOOL fText ) PURE;
397 THISCALLMETHOD_(BOOL,TxScreenToClient)( THIS_ LPPOINT lppt ) PURE;
398 THISCALLMETHOD_(BOOL,TxClientToScreen)( THIS_ LPPOINT lppt ) PURE;
399 THISCALLMETHOD_(HRESULT,TxActivate)( THIS_ LONG* plOldState ) PURE;
400 THISCALLMETHOD_(HRESULT,TxDeactivate)( THIS_ LONG lNewState ) PURE;
401 THISCALLMETHOD_(HRESULT,TxGetClientRect)( THIS_ LPRECT prc ) PURE;
402 THISCALLMETHOD_(HRESULT,TxGetViewInset)( THIS_ LPRECT prc ) PURE;
403 THISCALLMETHOD_(HRESULT,TxGetCharFormat)( THIS_ const CHARFORMATW** ppCF ) PURE;
404 THISCALLMETHOD_(HRESULT,TxGetParaFormat)( THIS_ const PARAFORMAT** ppPF ) PURE;
405 THISCALLMETHOD_(COLORREF,TxGetSysColor)( THIS_ int nIndex ) PURE;
406 THISCALLMETHOD_(HRESULT,TxGetBackStyle)( THIS_ TXTBACKSTYLE* pStyle ) PURE;
407 THISCALLMETHOD_(HRESULT,TxGetMaxLength)( THIS_ DWORD* plength ) PURE;
408 THISCALLMETHOD_(HRESULT,TxGetScrollBars)( THIS_ DWORD* pdwScrollBar ) PURE;
409 THISCALLMETHOD_(HRESULT,TxGetPasswordChar)( THIS_ WCHAR* pch ) PURE;
410 THISCALLMETHOD_(HRESULT,TxGetAcceleratorPos)( THIS_ LONG* pch ) PURE;
411 THISCALLMETHOD_(HRESULT,TxGetExtent)( THIS_ LPSIZEL lpExtent ) PURE;
412 THISCALLMETHOD_(HRESULT,OnTxCharFormatChange)( THIS_ const CHARFORMATW* pcf ) PURE;
413 THISCALLMETHOD_(HRESULT,OnTxParaFormatChange)( THIS_ const PARAFORMAT* ppf ) PURE;
414 THISCALLMETHOD_(HRESULT,TxGetPropertyBits)( THIS_ DWORD dwMask, DWORD* pdwBits ) PURE;
415 THISCALLMETHOD_(HRESULT,TxNotify)( THIS_ DWORD iNotify, void* pv ) PURE;
416 THISCALLMETHOD_(HIMC,TxImmGetContext)( THIS ) PURE;
417 THISCALLMETHOD_(void,TxImmReleaseContext)( THIS_ HIMC himc ) PURE;
418 THISCALLMETHOD_(HRESULT,TxGetSelectionBarWidth)( THIS_ LONG* lSelBarWidth ) PURE;
419 /* ITextHost2 methods */
420 THISCALLMETHOD_(BOOL,TxIsDoubleClickPending)( THIS ) PURE;
421 THISCALLMETHOD_(HRESULT,TxGetWindow)( THIS_ HWND *hwnd ) PURE;
422 THISCALLMETHOD_(HRESULT,TxSetForegroundWindow)( THIS ) PURE;
423 THISCALLMETHOD_(HPALETTE,TxGetPalette)( THIS ) PURE;
424 THISCALLMETHOD_(HRESULT,TxGetEastAsianFlags)( THIS_ LONG *flags ) PURE;
425 THISCALLMETHOD_(HCURSOR,TxSetCursor2)( THIS_ HCURSOR cursor, BOOL text ) PURE;
426 THISCALLMETHOD_(void,TxFreeTextServicesNotification)( THIS ) PURE;
427 THISCALLMETHOD_(HRESULT,TxGetEditStyle)( THIS_ DWORD item, DWORD *data ) PURE;
428 THISCALLMETHOD_(HRESULT,TxGetWindowStyles)( THIS_ DWORD *style, DWORD *ex_style ) PURE;
429 THISCALLMETHOD_(HRESULT,TxShowDropCaret)( THIS_ BOOL show, HDC hdc, const RECT *rect ) PURE;
430 THISCALLMETHOD_(HRESULT,TxDestroyCaret)( THIS ) PURE;
431 THISCALLMETHOD_(HRESULT,TxGetHorzExtent)( THIS_ LONG *horz_extent ) PURE;
433 #undef INTERFACE
435 #ifdef COBJMACROS
436 /*** IUnknown methods ***/
437 #define ITextHost2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
438 #define ITextHost2_AddRef(p) (p)->lpVtbl->AddRef(p)
439 #define ITextHost2_Release(p) (p)->lpVtbl->Release(p)
440 #endif
442 HRESULT WINAPI CreateTextServices(IUnknown*,ITextHost*,IUnknown**);
444 typedef HRESULT (WINAPI *PCreateTextServices)(IUnknown*,ITextHost*,IUnknown**);
446 #ifdef __cplusplus
448 #endif
450 #endif /* _TEXTSERV_H */