user32/tests: Don't release a random DC handle.
[wine.git] / include / textserv.h
blob3efb8798388f68caa7067692b9cf86bb99b95e8c
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;
143 #undef INTERFACE
145 #ifdef COBJMACROS
146 /*** IUnknown methods ***/
147 #define ITextServices_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
148 #define ITextServices_AddRef(p) (p)->lpVtbl->AddRef(p)
149 #define ITextServices_Release(p) (p)->lpVtbl->Release(p)
150 #endif
152 typedef enum _TXTBACKSTYLE {
153 TXTBACK_TRANSPARENT = 0,
154 TXTBACK_OPAQUE
155 } TXTBACKSTYLE;
157 enum TXTHITRESULT {
158 TXTHITRESULT_NOHIT = 0,
159 TXTHITRESULT_TRANSPARENT = 1,
160 TXTHITRESULT_CLOSE = 2,
161 TXTHITRESULT_HIT = 3
164 enum TXTNATURALSIZE {
165 TXTNS_FITTOCONTENT = 1,
166 TXTNS_ROUNDTOLINE = 2
169 enum TXTVIEW {
170 TXTVIEW_ACTIVE = 0,
171 TXTVIEW_INACTIVE = 1
174 #define TXTBIT_RICHTEXT 0x000001
175 #define TXTBIT_MULTILINE 0x000002
176 #define TXTBIT_READONLY 0x000004
177 #define TXTBIT_SHOWACCELERATOR 0x000008
178 #define TXTBIT_USEPASSWORD 0x000010
179 #define TXTBIT_HIDESELECTION 0x000020
180 #define TXTBIT_SAVESELECTION 0x000040
181 #define TXTBIT_AUTOWORDSEL 0x000080
182 #define TXTBIT_VERTICAL 0x000100
183 #define TXTBIT_SELBARCHANGE 0x000200
184 #define TXTBIT_WORDWRAP 0x000400
185 #define TXTBIT_ALLOWBEEP 0x000800
186 #define TXTBIT_DISABLEDRAG 0x001000
187 #define TXTBIT_VIEWINSETCHANGE 0x002000
188 #define TXTBIT_BACKSTYLECHANGE 0x004000
189 #define TXTBIT_MAXLENGTHCHANGE 0x008000
190 #define TXTBIT_SCROLLBARCHANGE 0x010000
191 #define TXTBIT_CHARFORMATCHANGE 0x020000
192 #define TXTBIT_PARAFORMATCHANGE 0x040000
193 #define TXTBIT_EXTENTCHANGE 0x080000
194 #define TXTBIT_CLIENTRECTCHANGE 0x100000
195 #define TXTBIT_USECURRENTBKG 0x200000
197 /*****************************************************************************
198 * ITextHost interface
200 #define INTERFACE ITextHost
201 DECLARE_INTERFACE_(ITextHost,IUnknown)
203 /*** IUnknown methods ***/
204 STDMETHOD(QueryInterface)(THIS_
205 REFIID riid,
206 void** ppvObject) PURE;
208 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
210 STDMETHOD_(ULONG,Release)(THIS) PURE;
212 /*** ITextHost methods ***/
213 STDMETHOD_(HDC,TxGetDC)( THIS
214 ) PURE;
216 STDMETHOD_(INT,TxReleaseDC)( THIS_
217 HDC hdc) PURE;
219 STDMETHOD_(BOOL,TxShowScrollBar)( THIS_
220 INT fnBar,
221 BOOL fShow) PURE;
223 STDMETHOD_(BOOL,TxEnableScrollBar)( THIS_
224 INT fuSBFlags,
225 INT fuArrowflags) PURE;
227 STDMETHOD_(BOOL,TxSetScrollRange)( THIS_
228 INT fnBar,
229 LONG nMinPos,
230 INT nMaxPos,
231 BOOL fRedraw) PURE;
233 STDMETHOD_(BOOL,TxSetScrollPos)( THIS_
234 INT fnBar,
235 INT nPos,
236 BOOL fRedraw) PURE;
238 STDMETHOD_(void,TxInvalidateRect)( THIS_
239 LPCRECT prc,
240 BOOL fMode) PURE;
242 STDMETHOD_(void,TxViewChange)( THIS_
243 BOOL fUpdate) PURE;
245 STDMETHOD_(BOOL,TxCreateCaret)( THIS_
246 HBITMAP hbmp,
247 INT xWidth,
248 INT yHeight) PURE;
250 STDMETHOD_(BOOL,TxShowCaret)( THIS_
251 BOOL fShow) PURE;
253 STDMETHOD_(BOOL,TxSetCaretPos)( THIS_
254 INT x,
255 INT y) PURE;
257 STDMETHOD_(BOOL,TxSetTimer)( THIS_
258 UINT idTimer,
259 UINT uTimeout) PURE;
261 STDMETHOD_(void,TxKillTimer)( THIS_
262 UINT idTimer) PURE;
264 STDMETHOD_(void,TxScrollWindowEx)( THIS_
265 INT dx,
266 INT dy,
267 LPCRECT lprcScroll,
268 LPCRECT lprcClip,
269 HRGN hRgnUpdate,
270 LPRECT lprcUpdate,
271 UINT fuScroll) PURE;
273 STDMETHOD_(void,TxSetCapture)( THIS_
274 BOOL fCapture) PURE;
276 STDMETHOD_(void,TxSetFocus)( THIS
277 ) PURE;
279 STDMETHOD_(void,TxSetCursor)( THIS_
280 HCURSOR hcur,
281 BOOL fText) PURE;
283 STDMETHOD_(BOOL,TxScreenToClient)( THIS_
284 LPPOINT lppt) PURE;
286 STDMETHOD_(BOOL,TxClientToScreen)( THIS_
287 LPPOINT lppt) PURE;
289 STDMETHOD(TxActivate)( THIS_
290 LONG* plOldState) PURE;
292 STDMETHOD(TxDeactivate)( THIS_
293 LONG lNewState) PURE;
295 STDMETHOD(TxGetClientRect)( THIS_
296 LPRECT prc) PURE;
298 STDMETHOD(TxGetViewInset)( THIS_
299 LPRECT prc) PURE;
301 STDMETHOD(TxGetCharFormat)( THIS_
302 const CHARFORMATW** ppCF) PURE;
304 STDMETHOD(TxGetParaFormat)( THIS_
305 const PARAFORMAT** ppPF) PURE;
307 STDMETHOD_(COLORREF,TxGetSysColor)( THIS_
308 int nIndex) PURE;
310 STDMETHOD(TxGetBackStyle)( THIS_
311 TXTBACKSTYLE* pStyle) PURE;
313 STDMETHOD(TxGetMaxLength)( THIS_
314 DWORD* plength) PURE;
316 STDMETHOD(TxGetScrollBars)( THIS_
317 DWORD* pdwScrollBar) PURE;
319 STDMETHOD(TxGetPasswordChar)( THIS_
320 WCHAR* pch) PURE;
322 STDMETHOD(TxGetAcceleratorPos)( THIS_
323 LONG* pch) PURE;
325 STDMETHOD(TxGetExtent)( THIS_
326 LPSIZEL lpExtent) PURE;
328 STDMETHOD(OnTxCharFormatChange)( THIS_
329 const CHARFORMATW* pcf) PURE;
331 STDMETHOD(OnTxParaFormatChange)( THIS_
332 const PARAFORMAT* ppf) PURE;
334 STDMETHOD(TxGetPropertyBits)( THIS_
335 DWORD dwMask,
336 DWORD* pdwBits) PURE;
338 STDMETHOD(TxNotify)( THIS_
339 DWORD iNotify,
340 void* pv) PURE;
342 STDMETHOD_(HIMC,TxImmGetContext)( THIS
343 ) PURE;
345 STDMETHOD_(void,TxImmReleaseContext)( THIS_
346 HIMC himc) PURE;
348 STDMETHOD(TxGetSelectionBarWidth)( THIS_
349 LONG* lSelBarWidth) PURE;
352 #undef INTERFACE
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 HRESULT WINAPI CreateTextServices(IUnknown*,ITextHost*,IUnknown**);
363 typedef HRESULT (WINAPI *PCreateTextServices)(IUnknown*,ITextHost*,IUnknown**);
365 #ifdef __cplusplus
367 #endif
369 #endif /* _TEXTSERV_H */