winedump: Recognize IMAGE_DEBUG_TYPE_CLSID.
[wine] / include / textserv.h
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 #ifndef _TEXTSERV_H
20 #define _TEXTSERV_H
21
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25
26 EXTERN_C const IID IID_ITextServices;
27 EXTERN_C const IID IID_ITextHost;
28
29 /*****************************************************************************
30  * ITextServices interface
31  */
32 #define INTERFACE ITextServices
33 DECLARE_INTERFACE_(ITextServices,IUnknown)
34 {
35     /*** IUnknown methods ***/
36     STDMETHOD(QueryInterface)(THIS_
37         REFIID riid,
38         void** ppvObject) PURE;
39
40     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
41
42     STDMETHOD_(ULONG,Release)(THIS) PURE;
43
44     /*** ITextServices methods ***/
45
46     STDMETHOD(TxSendMessage)( THIS_
47         UINT msg, WPARAM wparam, LPARAM lparam, LRESULT* plresult) PURE;
48
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;
62
63     STDMETHOD(TxGetHScroll)( THIS_
64         LONG* plMin,
65         LONG* plMax,
66         LONG* plPos,
67         LONG* plPage,
68         BOOL* pfEnabled) PURE;
69
70     STDMETHOD(TxGetVScroll)( THIS_
71         LONG* plMin,
72         LONG* plMax,
73         LONG* plPos,
74         LONG* plPage,
75         BOOL* pfEnabled) PURE;
76
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;
87
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;
99
100     STDMETHOD(OnTxInplaceActivate)( THIS_
101         LPCRECT prcClient) PURE;
102
103     STDMETHOD(OnTxInplaceDeactivate)( THIS ) PURE;
104
105     STDMETHOD(OnTxUIActivate)( THIS ) PURE;
106
107     STDMETHOD(OnTxUIDeactivate)( THIS ) PURE;
108
109     STDMETHOD(TxGetText)( THIS_
110         BSTR* pbstrText) PURE;
111
112     STDMETHOD(TxSetText)( THIS_
113         LPCWSTR pszText) PURE;
114
115     STDMETHOD(TxGetCurrentTargetX)( THIS_
116         LONG* x) PURE;
117
118     STDMETHOD(TxGetBaseLinePos)( THIS_
119         LONG* x) PURE;
120
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;
130
131     STDMETHOD(TxGetDropTarget)( THIS_
132         IDropTarget** ppDropTarget) PURE;
133
134     STDMETHOD(OnTxPropertyBitsChange)( THIS_
135         DWORD dwMask,
136         DWORD dwBits) PURE;
137
138     STDMETHOD(TxGetCachedSize)( THIS_
139         DWORD* pdwWidth,
140         DWORD* pdwHeight) PURE;
141
142 };
143 #undef INTERFACE
144
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
151
152 typedef enum _TXTBACKSTYLE {
153     TXTBACK_TRANSPARENT = 0,
154     TXTBACK_OPAQUE
155 } TXTBACKSTYLE;
156
157 enum TXTHITRESULT {
158     TXTHITRESULT_NOHIT = 0,
159     TXTHITRESULT_TRANSPARENT = 1,
160     TXTHITRESULT_CLOSE = 2,
161     TXTHITRESULT_HIT = 3
162 };
163
164 enum TXTNATURALSIZE {
165     TXTNS_FITTOCONTENT = 1,
166     TXTNS_ROUNDTOLINE = 2
167 };
168
169 enum TXTVIEW {
170     TXTVIEW_ACTIVE = 0,
171     TXTVIEW_INACTIVE = 1
172 };
173
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
196
197 /*****************************************************************************
198  * ITextHost interface
199  */
200 #define INTERFACE ITextHost
201 DECLARE_INTERFACE_(ITextHost,IUnknown)
202 {
203     /*** IUnknown methods ***/
204     STDMETHOD(QueryInterface)(THIS_
205         REFIID riid,
206         void** ppvObject) PURE;
207
208     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
209
210     STDMETHOD_(ULONG,Release)(THIS) PURE;
211
212     /*** ITextHost methods ***/
213     STDMETHOD_(HDC,TxGetDC)( THIS
214         ) PURE;
215
216     STDMETHOD_(INT,TxReleaseDC)( THIS_
217         HDC hdc) PURE;
218
219     STDMETHOD_(BOOL,TxShowScrollBar)( THIS_
220         INT fnBar,
221         BOOL fShow) PURE;
222
223     STDMETHOD_(BOOL,TxEnableScrollBar)( THIS_
224         INT fuSBFlags,
225         INT fuArrowflags) PURE;
226
227     STDMETHOD_(BOOL,TxSetScrollRange)( THIS_
228         INT fnBar,
229         LONG nMinPos,
230         INT nMaxPos,
231         BOOL fRedraw) PURE;
232
233     STDMETHOD_(BOOL,TxSetScrollPos)( THIS_
234         INT fnBar,
235         INT nPos,
236         BOOL fRedraw) PURE;
237
238     STDMETHOD_(void,TxInvalidateRect)( THIS_
239         LPCRECT prc,
240         BOOL fMode) PURE;
241
242     STDMETHOD_(void,TxViewChange)( THIS_
243         BOOL fUpdate) PURE;
244
245     STDMETHOD_(BOOL,TxCreateCaret)( THIS_
246         HBITMAP hbmp,
247         INT xWidth,
248         INT yHeight) PURE;
249
250     STDMETHOD_(BOOL,TxShowCaret)( THIS_
251         BOOL fShow) PURE;
252
253     STDMETHOD_(BOOL,TxSetCaretPos)( THIS_
254         INT x,
255         INT y) PURE;
256
257     STDMETHOD_(BOOL,TxSetTimer)( THIS_
258         UINT idTimer,
259         UINT uTimeout) PURE;
260
261     STDMETHOD_(void,TxKillTimer)( THIS_
262         UINT idTimer) PURE;
263
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;
272
273     STDMETHOD_(void,TxSetCapture)( THIS_
274         BOOL fCapture) PURE;
275
276     STDMETHOD_(void,TxSetFocus)( THIS
277         ) PURE;
278
279     STDMETHOD_(void,TxSetCursor)( THIS_
280         HCURSOR hcur,
281         BOOL fText) PURE;
282
283     STDMETHOD_(BOOL,TxScreenToClient)( THIS_
284         LPPOINT lppt) PURE;
285
286     STDMETHOD_(BOOL,TxClientToScreen)( THIS_
287         LPPOINT lppt) PURE;
288
289     STDMETHOD(TxActivate)( THIS_
290         LONG* plOldState) PURE;
291
292     STDMETHOD(TxDeactivate)( THIS_
293         LONG lNewState) PURE;
294
295     STDMETHOD(TxGetClientRect)( THIS_
296         LPRECT prc) PURE;
297
298     STDMETHOD(TxGetViewInset)( THIS_
299         LPRECT prc) PURE;
300
301     STDMETHOD(TxGetCharFormat)( THIS_
302         const CHARFORMATW** ppCF) PURE;
303
304     STDMETHOD(TxGetParaFormat)( THIS_
305         const PARAFORMAT** ppPF) PURE;
306
307     STDMETHOD_(COLORREF,TxGetSysColor)( THIS_
308         int nIndex) PURE;
309
310     STDMETHOD(TxGetBackStyle)( THIS_
311         TXTBACKSTYLE* pStyle) PURE;
312
313     STDMETHOD(TxGetMaxLength)( THIS_
314         DWORD* plength) PURE;
315
316     STDMETHOD(TxGetScrollBars)( THIS_
317         DWORD* pdwScrollBar) PURE;
318
319     STDMETHOD(TxGetPasswordChar)( THIS_
320         WCHAR* pch) PURE;
321
322     STDMETHOD(TxGetAcceleratorPos)( THIS_
323         LONG* pch) PURE;
324
325     STDMETHOD(TxGetExtent)( THIS_
326         LPSIZEL lpExtent) PURE;
327
328     STDMETHOD(OnTxCharFormatChange)( THIS_
329         const CHARFORMATW* pcf) PURE;
330
331     STDMETHOD(OnTxParaFormatChange)( THIS_
332         const PARAFORMAT* ppf) PURE;
333
334     STDMETHOD(TxGetPropertyBits)( THIS_
335         DWORD dwMask,
336         DWORD* pdwBits) PURE;
337
338     STDMETHOD(TxNotify)( THIS_
339         DWORD iNotify,
340         void* pv) PURE;
341
342     STDMETHOD_(HIMC,TxImmGetContext)( THIS
343         ) PURE;
344
345     STDMETHOD_(void,TxImmReleaseContext)( THIS_
346         HIMC himc) PURE;
347
348     STDMETHOD(TxGetSelectionBarWidth)( THIS_
349         LONG* lSelBarWidth) PURE;
350
351 };
352 #undef INTERFACE
353
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
360
361 HRESULT WINAPI CreateTextServices(IUnknown*,ITextHost*,IUnknown**);
362
363 typedef HRESULT (WINAPI *PCreateTextServices)(IUnknown*,ITextHost*,IUnknown**);
364
365 #ifdef __cplusplus
366 }
367 #endif
368
369 #endif /* _TEXTSERV_H */