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
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_
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_
59 BOOL (CALLBACK
* pfnContinue
)(DWORD
),
63 STDMETHOD(TxGetHScroll
)( THIS_
68 BOOL
* pfEnabled
) PURE
;
70 STDMETHOD(TxGetVScroll
)( THIS_
75 BOOL
* pfEnabled
) PURE
;
77 STDMETHOD(OnTxSetCursor
)( THIS_
88 STDMETHOD(TxQueryHitPoint
)( THIS_
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_
118 STDMETHOD(TxGetBaseLinePos
)( THIS_
121 STDMETHOD(TxGetNaturalSize
)( THIS_
127 const SIZEL
* psizelExtent
,
131 STDMETHOD(TxGetDropTarget
)( THIS_
132 IDropTarget
** ppDropTarget
) PURE
;
134 STDMETHOD(OnTxPropertyBitsChange
)( THIS_
138 STDMETHOD(TxGetCachedSize
)( THIS_
140 DWORD
* pdwHeight
) PURE
;
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)
153 typedef enum _TXTBACKSTYLE
{
154 TXTBACK_TRANSPARENT
= 0,
159 TXTHITRESULT_NOHIT
= 0,
160 TXTHITRESULT_TRANSPARENT
= 1,
161 TXTHITRESULT_CLOSE
= 2,
165 enum TXTNATURALSIZE
{
166 TXTNS_FITTOCONTENT
= 1,
167 TXTNS_ROUNDTOLINE
= 2
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_
207 void** ppvObject
) PURE
;
209 STDMETHOD_(ULONG
,AddRef
)(THIS
) PURE
;
211 STDMETHOD_(ULONG
,Release
)(THIS
) PURE
;
213 /*** ITextHost methods ***/
214 STDMETHOD_(HDC
,TxGetDC
)( THIS
217 STDMETHOD_(INT
,TxReleaseDC
)( THIS_
220 STDMETHOD_(BOOL
,TxShowScrollBar
)( THIS_
224 STDMETHOD_(BOOL
,TxEnableScrollBar
)( THIS_
226 INT fuArrowflags
) PURE
;
228 STDMETHOD_(BOOL
,TxSetScrollRange
)( THIS_
234 STDMETHOD_(BOOL
,TxSetScrollPos
)( THIS_
239 STDMETHOD_(void,TxInvalidateRect
)( THIS_
243 STDMETHOD_(void,TxViewChange
)( THIS_
246 STDMETHOD_(BOOL
,TxCreateCaret
)( THIS_
251 STDMETHOD_(BOOL
,TxShowCaret
)( THIS_
254 STDMETHOD_(BOOL
,TxSetCaretPos
)( THIS_
258 STDMETHOD_(BOOL
,TxSetTimer
)( THIS_
262 STDMETHOD_(void,TxKillTimer
)( THIS_
265 STDMETHOD_(void,TxScrollWindowEx
)( THIS_
274 STDMETHOD_(void,TxSetCapture
)( THIS_
277 STDMETHOD_(void,TxSetFocus
)( THIS
280 STDMETHOD_(void,TxSetCursor
)( THIS_
284 STDMETHOD_(BOOL
,TxScreenToClient
)( THIS_
287 STDMETHOD_(BOOL
,TxClientToScreen
)( THIS_
290 STDMETHOD(TxActivate
)( THIS_
291 LONG
* plOldState
) PURE
;
293 STDMETHOD(TxDeactivate
)( THIS_
294 LONG lNewState
) PURE
;
296 STDMETHOD(TxGetClientRect
)( THIS_
299 STDMETHOD(TxGetViewInset
)( THIS_
302 STDMETHOD(TxGetCharFormat
)( THIS_
303 const CHARFORMATW
** ppCF
) PURE
;
305 STDMETHOD(TxGetParaFormat
)( THIS_
306 const PARAFORMAT
** ppPF
) PURE
;
308 STDMETHOD_(COLORREF
,TxGetSysColor
)( THIS_
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_
323 STDMETHOD(TxGetAcceleratorPos
)( THIS_
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_
337 DWORD
* pdwBits
) PURE
;
339 STDMETHOD(TxNotify
)( THIS_
343 STDMETHOD_(HIMC
,TxImmGetContext
)( THIS
346 STDMETHOD_(void,TxImmReleaseContext
)( THIS_
349 STDMETHOD(TxGetSelectionBarWidth
)( THIS_
350 LONG
* lSelBarWidth
) PURE
;
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)
363 HRESULT WINAPI
CreateTextServices(IUnknown
*,ITextHost
*,IUnknown
**);
365 typedef HRESULT (WINAPI
*PCreateTextServices
)(IUnknown
*,ITextHost
*,IUnknown
**);
371 #endif /* _TEXTSERV_H */