kernel32: Use wide-char string literals.
[wine.git] / include / textserv.h
blob1272a6bba001126c6afdbac5e4f0fd835dc5a7b2
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;
35 /*****************************************************************************
36 * ITextServices interface
38 #define INTERFACE ITextServices
39 DECLARE_INTERFACE_(ITextServices,IUnknown)
41 /*** IUnknown methods ***/
42 STDMETHOD(QueryInterface)(THIS_
43 REFIID riid,
44 void** ppvObject) PURE;
46 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
48 STDMETHOD_(ULONG,Release)(THIS) PURE;
50 /*** ITextServices methods ***/
52 THISCALLMETHOD_(HRESULT,TxSendMessage)( THIS_
53 UINT msg, WPARAM wparam, LPARAM lparam, LRESULT* plresult) PURE;
55 THISCALLMETHOD_(HRESULT,TxDraw)( THIS_
56 DWORD dwDrawAspect,
57 LONG lindex,
58 void* pvAspect,
59 DVTARGETDEVICE* ptd,
60 HDC hdcDraw,
61 HDC hicTargetDev,
62 LPCRECTL lprcBounds,
63 LPCRECTL lprcWBounds,
64 LPRECT lprcUpdate,
65 BOOL (CALLBACK * pfnContinue)(DWORD),
66 DWORD dwContinue,
67 LONG lViewId) PURE;
69 THISCALLMETHOD_(HRESULT,TxGetHScroll)( THIS_
70 LONG* plMin,
71 LONG* plMax,
72 LONG* plPos,
73 LONG* plPage,
74 BOOL* pfEnabled) PURE;
76 THISCALLMETHOD_(HRESULT,TxGetVScroll)( THIS_
77 LONG* plMin,
78 LONG* plMax,
79 LONG* plPos,
80 LONG* plPage,
81 BOOL* pfEnabled) PURE;
83 THISCALLMETHOD_(HRESULT,OnTxSetCursor)( THIS_
84 DWORD dwDrawAspect,
85 LONG lindex,
86 void* pvAspect,
87 DVTARGETDEVICE* ptd,
88 HDC hdcDraw,
89 HDC hicTargetDev,
90 LPCRECT lprcClient,
91 INT x,
92 INT y) PURE;
94 THISCALLMETHOD_(HRESULT,TxQueryHitPoint)( THIS_
95 DWORD dwDrawAspect,
96 LONG lindex,
97 void* pvAspect,
98 DVTARGETDEVICE* ptd,
99 HDC hdcDraw,
100 HDC hicTargetDev,
101 LPCRECT lprcClient,
102 INT x,
103 INT y,
104 DWORD* pHitResult) PURE;
106 THISCALLMETHOD_(HRESULT,OnTxInplaceActivate)( THIS_
107 LPCRECT prcClient) PURE;
109 THISCALLMETHOD_(HRESULT,OnTxInplaceDeactivate)( THIS ) PURE;
111 THISCALLMETHOD_(HRESULT,OnTxUIActivate)( THIS ) PURE;
113 THISCALLMETHOD_(HRESULT,OnTxUIDeactivate)( THIS ) PURE;
115 THISCALLMETHOD_(HRESULT,TxGetText)( THIS_
116 BSTR* pbstrText) PURE;
118 THISCALLMETHOD_(HRESULT,TxSetText)( THIS_
119 LPCWSTR pszText) PURE;
121 THISCALLMETHOD_(HRESULT,TxGetCurTargetX)( THIS_
122 LONG* x) PURE;
124 THISCALLMETHOD_(HRESULT,TxGetBaseLinePos)( THIS_
125 LONG* x) PURE;
127 THISCALLMETHOD_(HRESULT,TxGetNaturalSize)( THIS_
128 DWORD dwAspect,
129 HDC hdcDraw,
130 HDC hicTargetDev,
131 DVTARGETDEVICE* ptd,
132 DWORD dwMode,
133 const SIZEL* psizelExtent,
134 LONG* pwidth,
135 LONG* pheight) PURE;
137 THISCALLMETHOD_(HRESULT,TxGetDropTarget)( THIS_
138 IDropTarget** ppDropTarget) PURE;
140 THISCALLMETHOD_(HRESULT,OnTxPropertyBitsChange)( THIS_
141 DWORD dwMask,
142 DWORD dwBits) PURE;
144 THISCALLMETHOD_(HRESULT,TxGetCachedSize)( THIS_
145 DWORD* pdwWidth,
146 DWORD* pdwHeight) PURE;
149 #undef INTERFACE
151 #ifdef COBJMACROS
152 /*** IUnknown methods ***/
153 #define ITextServices_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
154 #define ITextServices_AddRef(p) (p)->lpVtbl->AddRef(p)
155 #define ITextServices_Release(p) (p)->lpVtbl->Release(p)
156 #endif
158 typedef enum _TXTBACKSTYLE {
159 TXTBACK_TRANSPARENT = 0,
160 TXTBACK_OPAQUE
161 } TXTBACKSTYLE;
163 enum TXTHITRESULT {
164 TXTHITRESULT_NOHIT = 0,
165 TXTHITRESULT_TRANSPARENT = 1,
166 TXTHITRESULT_CLOSE = 2,
167 TXTHITRESULT_HIT = 3
170 enum TXTNATURALSIZE {
171 TXTNS_FITTOCONTENT = 1,
172 TXTNS_ROUNDTOLINE = 2
175 enum TXTVIEW {
176 TXTVIEW_ACTIVE = 0,
177 TXTVIEW_INACTIVE = -1
180 #define TXTBIT_RICHTEXT 0x000001
181 #define TXTBIT_MULTILINE 0x000002
182 #define TXTBIT_READONLY 0x000004
183 #define TXTBIT_SHOWACCELERATOR 0x000008
184 #define TXTBIT_USEPASSWORD 0x000010
185 #define TXTBIT_HIDESELECTION 0x000020
186 #define TXTBIT_SAVESELECTION 0x000040
187 #define TXTBIT_AUTOWORDSEL 0x000080
188 #define TXTBIT_VERTICAL 0x000100
189 #define TXTBIT_SELBARCHANGE 0x000200
190 #define TXTBIT_WORDWRAP 0x000400
191 #define TXTBIT_ALLOWBEEP 0x000800
192 #define TXTBIT_DISABLEDRAG 0x001000
193 #define TXTBIT_VIEWINSETCHANGE 0x002000
194 #define TXTBIT_BACKSTYLECHANGE 0x004000
195 #define TXTBIT_MAXLENGTHCHANGE 0x008000
196 #define TXTBIT_SCROLLBARCHANGE 0x010000
197 #define TXTBIT_CHARFORMATCHANGE 0x020000
198 #define TXTBIT_PARAFORMATCHANGE 0x040000
199 #define TXTBIT_EXTENTCHANGE 0x080000
200 #define TXTBIT_CLIENTRECTCHANGE 0x100000
201 #define TXTBIT_USECURRENTBKG 0x200000
203 /*****************************************************************************
204 * ITextHost interface
206 #define INTERFACE ITextHost
207 DECLARE_INTERFACE_(ITextHost,IUnknown)
209 /*** IUnknown methods ***/
210 STDMETHOD(QueryInterface)(THIS_
211 REFIID riid,
212 void** ppvObject) PURE;
214 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
216 STDMETHOD_(ULONG,Release)(THIS) PURE;
218 /*** ITextHost methods ***/
219 THISCALLMETHOD_(HDC,TxGetDC)( THIS
220 ) PURE;
222 THISCALLMETHOD_(INT,TxReleaseDC)( THIS_
223 HDC hdc) PURE;
225 THISCALLMETHOD_(BOOL,TxShowScrollBar)( THIS_
226 INT fnBar,
227 BOOL fShow) PURE;
229 THISCALLMETHOD_(BOOL,TxEnableScrollBar)( THIS_
230 INT fuSBFlags,
231 INT fuArrowflags) PURE;
233 THISCALLMETHOD_(BOOL,TxSetScrollRange)( THIS_
234 INT fnBar,
235 LONG nMinPos,
236 INT nMaxPos,
237 BOOL fRedraw) PURE;
239 THISCALLMETHOD_(BOOL,TxSetScrollPos)( THIS_
240 INT fnBar,
241 INT nPos,
242 BOOL fRedraw) PURE;
244 THISCALLMETHOD_(void,TxInvalidateRect)( THIS_
245 LPCRECT prc,
246 BOOL fMode) PURE;
248 THISCALLMETHOD_(void,TxViewChange)( THIS_
249 BOOL fUpdate) PURE;
251 THISCALLMETHOD_(BOOL,TxCreateCaret)( THIS_
252 HBITMAP hbmp,
253 INT xWidth,
254 INT yHeight) PURE;
256 THISCALLMETHOD_(BOOL,TxShowCaret)( THIS_
257 BOOL fShow) PURE;
259 THISCALLMETHOD_(BOOL,TxSetCaretPos)( THIS_
260 INT x,
261 INT y) PURE;
263 THISCALLMETHOD_(BOOL,TxSetTimer)( THIS_
264 UINT idTimer,
265 UINT uTimeout) PURE;
267 THISCALLMETHOD_(void,TxKillTimer)( THIS_
268 UINT idTimer) PURE;
270 THISCALLMETHOD_(void,TxScrollWindowEx)( THIS_
271 INT dx,
272 INT dy,
273 LPCRECT lprcScroll,
274 LPCRECT lprcClip,
275 HRGN hRgnUpdate,
276 LPRECT lprcUpdate,
277 UINT fuScroll) PURE;
279 THISCALLMETHOD_(void,TxSetCapture)( THIS_
280 BOOL fCapture) PURE;
282 THISCALLMETHOD_(void,TxSetFocus)( THIS
283 ) PURE;
285 THISCALLMETHOD_(void,TxSetCursor)( THIS_
286 HCURSOR hcur,
287 BOOL fText) PURE;
289 THISCALLMETHOD_(BOOL,TxScreenToClient)( THIS_
290 LPPOINT lppt) PURE;
292 THISCALLMETHOD_(BOOL,TxClientToScreen)( THIS_
293 LPPOINT lppt) PURE;
295 THISCALLMETHOD_(HRESULT,TxActivate)( THIS_
296 LONG* plOldState) PURE;
298 THISCALLMETHOD_(HRESULT,TxDeactivate)( THIS_
299 LONG lNewState) PURE;
301 THISCALLMETHOD_(HRESULT,TxGetClientRect)( THIS_
302 LPRECT prc) PURE;
304 THISCALLMETHOD_(HRESULT,TxGetViewInset)( THIS_
305 LPRECT prc) PURE;
307 THISCALLMETHOD_(HRESULT,TxGetCharFormat)( THIS_
308 const CHARFORMATW** ppCF) PURE;
310 THISCALLMETHOD_(HRESULT,TxGetParaFormat)( THIS_
311 const PARAFORMAT** ppPF) PURE;
313 THISCALLMETHOD_(COLORREF,TxGetSysColor)( THIS_
314 int nIndex) PURE;
316 THISCALLMETHOD_(HRESULT,TxGetBackStyle)( THIS_
317 TXTBACKSTYLE* pStyle) PURE;
319 THISCALLMETHOD_(HRESULT,TxGetMaxLength)( THIS_
320 DWORD* plength) PURE;
322 THISCALLMETHOD_(HRESULT,TxGetScrollBars)( THIS_
323 DWORD* pdwScrollBar) PURE;
325 THISCALLMETHOD_(HRESULT,TxGetPasswordChar)( THIS_
326 WCHAR* pch) PURE;
328 THISCALLMETHOD_(HRESULT,TxGetAcceleratorPos)( THIS_
329 LONG* pch) PURE;
331 THISCALLMETHOD_(HRESULT,TxGetExtent)( THIS_
332 LPSIZEL lpExtent) PURE;
334 THISCALLMETHOD_(HRESULT,OnTxCharFormatChange)( THIS_
335 const CHARFORMATW* pcf) PURE;
337 THISCALLMETHOD_(HRESULT,OnTxParaFormatChange)( THIS_
338 const PARAFORMAT* ppf) PURE;
340 THISCALLMETHOD_(HRESULT,TxGetPropertyBits)( THIS_
341 DWORD dwMask,
342 DWORD* pdwBits) PURE;
344 THISCALLMETHOD_(HRESULT,TxNotify)( THIS_
345 DWORD iNotify,
346 void* pv) PURE;
348 THISCALLMETHOD_(HIMC,TxImmGetContext)( THIS
349 ) PURE;
351 THISCALLMETHOD_(void,TxImmReleaseContext)( THIS_
352 HIMC himc) PURE;
354 THISCALLMETHOD_(HRESULT,TxGetSelectionBarWidth)( THIS_
355 LONG* lSelBarWidth) PURE;
358 #undef INTERFACE
360 #ifdef COBJMACROS
361 /*** IUnknown methods ***/
362 #define ITextHost_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
363 #define ITextHost_AddRef(p) (p)->lpVtbl->AddRef(p)
364 #define ITextHost_Release(p) (p)->lpVtbl->Release(p)
365 #endif
367 HRESULT WINAPI CreateTextServices(IUnknown*,ITextHost*,IUnknown**);
369 typedef HRESULT (WINAPI *PCreateTextServices)(IUnknown*,ITextHost*,IUnknown**);
371 #ifdef __cplusplus
373 #endif
375 #endif /* _TEXTSERV_H */