usp10: Handle multi-glyph clusters in ScriptStringOut.
[wine.git] / include / textserv.h
blob0d509a66ef88f2ac9aded3d98389cf2a1f7e1c31
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 EXTERN_C const IID IID_ITextServices;
27 EXTERN_C const IID IID_ITextHost;
29 /*****************************************************************************
30 * ITextServices interface
32 #define INTERFACE ITextServices
33 DECLARE_INTERFACE_(ITextServices,IUnknown)
35 /*** IUnknown methods ***/
36 STDMETHOD(QueryInterface)(THIS_
37 REFIID riid,
38 void** ppvObject) PURE;
40 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
42 STDMETHOD_(ULONG,Release)(THIS) PURE;
44 /*** ITextServices methods ***/
46 STDMETHOD(TxSendMessage)( THIS_
47 UINT msg, WPARAM wparam, LPARAM lparam, LRESULT* plresult) PURE;
49 STDMETHOD(TxDraw)( THIS_
50 DWORD dwDrawAspect,
51 LONG lindex,
52 void* pvAspect,
53 DVTARGETDEVICE* ptd,
54 HDC hdcDraw,
55 HDC hicTargetDev,
56 LPCRECTL lprcBounds,
57 LPCRECTL lprcWBounds,
58 LPRECT lprcUpdate,
59 BOOL (CALLBACK * pfnContinue)(DWORD),
60 DWORD dwContinue,
61 LONG lViewId) PURE;
63 STDMETHOD(TxGetHScroll)( THIS_
64 LONG* plMin,
65 LONG* plMax,
66 LONG* plPos,
67 LONG* plPage,
68 BOOL* pfEnabled) PURE;
70 STDMETHOD(TxGetVScroll)( THIS_
71 LONG* plMin,
72 LONG* plMax,
73 LONG* plPos,
74 LONG* plPage,
75 BOOL* pfEnabled) PURE;
77 STDMETHOD(OnTxSetCursor)( THIS_
78 DWORD dwDrawAspect,
79 LONG lindex,
80 void* pvAspect,
81 DVTARGETDEVICE* ptd,
82 HDC hdcDraw,
83 HDC hicTargetDev,
84 LPCRECT lprcClient,
85 INT x,
86 INT y) PURE;
88 STDMETHOD(TxQueryHitPoint)( THIS_
89 DWORD dwDrawAspect,
90 LONG lindex,
91 void* pvAspect,
92 DVTARGETDEVICE* ptd,
93 HDC hdcDraw,
94 HDC hicTargetDev,
95 LPCRECT lprcClient,
96 INT x,
97 INT y,
98 DWORD* pHitResult) PURE;
100 STDMETHOD(OnTxInplaceActivate)( THIS_
101 LPCRECT prcClient) PURE;
103 STDMETHOD(OnTxInplaceDeactivate)( THIS ) PURE;
105 STDMETHOD(OnTxUIActivate)( THIS ) PURE;
107 STDMETHOD(OnTxUIDeactivate)( THIS ) PURE;
109 STDMETHOD(TxGetText)( THIS_
110 BSTR* pbstrText) PURE;
112 STDMETHOD(TxSetText)( THIS_
113 LPCWSTR pszText) PURE;
115 STDMETHOD(TxGetCurrentTargetX)( THIS_
116 LONG* x) PURE;
118 STDMETHOD(TxGetBaseLinePos)( THIS_
119 LONG* x) PURE;
121 STDMETHOD(TxGetNaturalSize)( THIS_
122 DWORD dwAspect,
123 HDC hdcDraw,
124 HDC hicTargetDev,
125 DVTARGETDEVICE* ptd,
126 DWORD dwMode,
127 const SIZEL* psizelExtent,
128 LONG* pwidth,
129 LONG* pheight) PURE;
131 STDMETHOD(TxGetDropTarget)( THIS_
132 IDropTarget** ppDropTarget) PURE;
134 STDMETHOD(OnTxPropertyBitsChange)( THIS_
135 DWORD dwMask,
136 DWORD dwBits) PURE;
138 STDMETHOD(TxGetCachedSize)( THIS_
139 DWORD* pdwWidth,
140 DWORD* pdwHeight) PURE;
144 #ifdef COBJMACROS
145 /*** IUnknown methods ***/
146 #define ITextServices_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
147 #define ITextServices_AddRef(p) (p)->lpVtbl->AddRef(p)
148 #define ITextServices_Release(p) (p)->lpVtbl->Release(p)
149 #endif
151 #undef INTERFACE
153 typedef enum _TXTBACKSTYLE {
154 TXTBACK_TRANSPARENT = 0,
155 TXTBACK_OPAQUE
156 } TXTBACKSTYLE;
158 enum TXTHITRESULT {
159 TXTHITRESULT_NOHIT = 0,
160 TXTHITRESULT_TRANSPARENT = 1,
161 TXTHITRESULT_CLOSE = 2,
162 TXTHITRESULT_HIT = 3
165 enum TXTNATURALSIZE {
166 TXTNS_FITTOCONTENT = 1,
167 TXTNS_ROUNDTOLINE = 2
170 enum TXTVIEW {
171 TXTVIEW_ACTIVE = 0,
172 TXTVIEW_INACTIVE = 1
175 #define TXTBIT_RICHTEXT 0x000001
176 #define TXTBIT_MULTILINE 0x000002
177 #define TXTBIT_READONLY 0x000004
178 #define TXTBIT_SHOWACCELERATOR 0x000008
179 #define TXTBIT_USEPASSWORD 0x000010
180 #define TXTBIT_HIDESELECTION 0x000020
181 #define TXTBIT_SAVESELECTION 0x000040
182 #define TXTBIT_AUTOWORDSEL 0x000080
183 #define TXTBIT_VERTICAL 0x000100
184 #define TXTBIT_SELBARCHANGE 0x000200
185 #define TXTBIT_WORDWRAP 0x000400
186 #define TXTBIT_ALLOWBEEP 0x000800
187 #define TXTBIT_DISABLEDRAG 0x001000
188 #define TXTBIT_VIEWINSETCHANGE 0x002000
189 #define TXTBIT_BACKSTYLECHANGE 0x004000
190 #define TXTBIT_MAXLENGTHCHANGE 0x008000
191 #define TXTBIT_SCROLLBARCHANGE 0x010000
192 #define TXTBIT_CHARFORMATCHANGE 0x020000
193 #define TXTBIT_PARAFORMATCHANGE 0x040000
194 #define TXTBIT_EXTENTCHANGE 0x080000
195 #define TXTBIT_CLIENTRECTCHANGE 0x100000
196 #define TXTBIT_USECURRENTBKG 0x200000
198 /*****************************************************************************
199 * ITextHost interface
201 #define INTERFACE ITextHost
202 DECLARE_INTERFACE_(ITextHost,IUnknown)
204 /*** IUnknown methods ***/
205 STDMETHOD(QueryInterface)(THIS_
206 REFIID riid,
207 void** ppvObject) PURE;
209 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
211 STDMETHOD_(ULONG,Release)(THIS) PURE;
213 /*** ITextHost methods ***/
214 STDMETHOD_(HDC,TxGetDC)( THIS
215 ) PURE;
217 STDMETHOD_(INT,TxReleaseDC)( THIS_
218 HDC hdc) PURE;
220 STDMETHOD_(BOOL,TxShowScrollBar)( THIS_
221 INT fnBar,
222 BOOL fShow) PURE;
224 STDMETHOD_(BOOL,TxEnableScrollBar)( THIS_
225 INT fuSBFlags,
226 INT fuArrowflags) PURE;
228 STDMETHOD_(BOOL,TxSetScrollRange)( THIS_
229 INT fnBar,
230 LONG nMinPos,
231 INT nMaxPos,
232 BOOL fRedraw) PURE;
234 STDMETHOD_(BOOL,TxSetScrollPos)( THIS_
235 INT fnBar,
236 INT nPos,
237 BOOL fRedraw) PURE;
239 STDMETHOD_(void,TxInvalidateRect)( THIS_
240 LPCRECT prc,
241 BOOL fMode) PURE;
243 STDMETHOD_(void,TxViewChange)( THIS_
244 BOOL fUpdate) PURE;
246 STDMETHOD_(BOOL,TxCreateCaret)( THIS_
247 HBITMAP hbmp,
248 INT xWidth,
249 INT yHeight) PURE;
251 STDMETHOD_(BOOL,TxShowCaret)( THIS_
252 BOOL fShow) PURE;
254 STDMETHOD_(BOOL,TxSetCaretPos)( THIS_
255 INT x,
256 INT y) PURE;
258 STDMETHOD_(BOOL,TxSetTimer)( THIS_
259 UINT idTimer,
260 UINT uTimeout) PURE;
262 STDMETHOD_(void,TxKillTimer)( THIS_
263 UINT idTimer) PURE;
265 STDMETHOD_(void,TxScrollWindowEx)( THIS_
266 INT dx,
267 INT dy,
268 LPCRECT lprcScroll,
269 LPCRECT lprcClip,
270 HRGN hRgnUpdate,
271 LPRECT lprcUpdate,
272 UINT fuScroll) PURE;
274 STDMETHOD_(void,TxSetCapture)( THIS_
275 BOOL fCapture) PURE;
277 STDMETHOD_(void,TxSetFocus)( THIS
278 ) PURE;
280 STDMETHOD_(void,TxSetCursor)( THIS_
281 HCURSOR hcur,
282 BOOL fText) PURE;
284 STDMETHOD_(BOOL,TxScreenToClient)( THIS_
285 LPPOINT lppt) PURE;
287 STDMETHOD_(BOOL,TxClientToScreen)( THIS_
288 LPPOINT lppt) PURE;
290 STDMETHOD(TxActivate)( THIS_
291 LONG* plOldState) PURE;
293 STDMETHOD(TxDeactivate)( THIS_
294 LONG lNewState) PURE;
296 STDMETHOD(TxGetClientRect)( THIS_
297 LPRECT prc) PURE;
299 STDMETHOD(TxGetViewInset)( THIS_
300 LPRECT prc) PURE;
302 STDMETHOD(TxGetCharFormat)( THIS_
303 const CHARFORMATW** ppCF) PURE;
305 STDMETHOD(TxGetParaFormat)( THIS_
306 const PARAFORMAT** ppPF) PURE;
308 STDMETHOD_(COLORREF,TxGetSysColor)( THIS_
309 int nIndex) PURE;
311 STDMETHOD(TxGetBackStyle)( THIS_
312 TXTBACKSTYLE* pStyle) PURE;
314 STDMETHOD(TxGetMaxLength)( THIS_
315 DWORD* plength) PURE;
317 STDMETHOD(TxGetScrollBars)( THIS_
318 DWORD* pdwScrollBar) PURE;
320 STDMETHOD(TxGetPasswordChar)( THIS_
321 WCHAR* pch) PURE;
323 STDMETHOD(TxGetAcceleratorPos)( THIS_
324 LONG* pch) PURE;
326 STDMETHOD(TxGetExtent)( THIS_
327 LPSIZEL lpExtent) PURE;
329 STDMETHOD(OnTxCharFormatChange)( THIS_
330 const CHARFORMATW* pcf) PURE;
332 STDMETHOD(OnTxParaFormatChange)( THIS_
333 const PARAFORMAT* ppf) PURE;
335 STDMETHOD(TxGetPropertyBits)( THIS_
336 DWORD dwMask,
337 DWORD* pdwBits) PURE;
339 STDMETHOD(TxNotify)( THIS_
340 DWORD iNotify,
341 void* pv) PURE;
343 STDMETHOD_(HIMC,TxImmGetContext)( THIS
344 ) PURE;
346 STDMETHOD_(void,TxImmReleaseContext)( THIS_
347 HIMC himc) PURE;
349 STDMETHOD(TxGetSelectionBarWidth)( THIS_
350 LONG* lSelBarWidth) PURE;
354 #ifdef COBJMACROS
355 /*** IUnknown methods ***/
356 #define ITextHost_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
357 #define ITextHost_AddRef(p) (p)->lpVtbl->AddRef(p)
358 #define ITextHost_Release(p) (p)->lpVtbl->Release(p)
359 #endif
361 #undef INTERFACE
363 HRESULT WINAPI CreateTextServices(IUnknown*,ITextHost*,IUnknown**);
365 typedef HRESULT (WINAPI *PCreateTextServices)(IUnknown*,ITextHost*,IUnknown**);
367 #ifdef __cplusplus
369 #endif
371 #endif /* _TEXTSERV_H */