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
27 #define THISCALLMETHOD_(type,method) virtual type __thiscall method
29 #define THISCALLMETHOD_(type,method) type (__thiscall *method)
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_
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_
65 BOOL (CALLBACK
* pfnContinue
)(DWORD
),
69 THISCALLMETHOD_(HRESULT
,TxGetHScroll
)( THIS_
74 BOOL
* pfEnabled
) PURE
;
76 THISCALLMETHOD_(HRESULT
,TxGetVScroll
)( THIS_
81 BOOL
* pfEnabled
) PURE
;
83 THISCALLMETHOD_(HRESULT
,OnTxSetCursor
)( THIS_
94 THISCALLMETHOD_(HRESULT
,TxQueryHitPoint
)( THIS_
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_
124 THISCALLMETHOD_(HRESULT
,TxGetBaseLinePos
)( THIS_
127 THISCALLMETHOD_(HRESULT
,TxGetNaturalSize
)( THIS_
133 const SIZEL
* psizelExtent
,
137 THISCALLMETHOD_(HRESULT
,TxGetDropTarget
)( THIS_
138 IDropTarget
** ppDropTarget
) PURE
;
140 THISCALLMETHOD_(HRESULT
,OnTxPropertyBitsChange
)( THIS_
144 THISCALLMETHOD_(HRESULT
,TxGetCachedSize
)( THIS_
146 DWORD
* pdwHeight
) PURE
;
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)
158 typedef enum _TXTBACKSTYLE
{
159 TXTBACK_TRANSPARENT
= 0,
164 TXTHITRESULT_NOHIT
= 0,
165 TXTHITRESULT_TRANSPARENT
= 1,
166 TXTHITRESULT_CLOSE
= 2,
170 enum TXTNATURALSIZE
{
171 TXTNS_FITTOCONTENT
= 1,
172 TXTNS_ROUNDTOLINE
= 2
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_
212 void** ppvObject
) PURE
;
214 STDMETHOD_(ULONG
,AddRef
)(THIS
) PURE
;
216 STDMETHOD_(ULONG
,Release
)(THIS
) PURE
;
218 /*** ITextHost methods ***/
219 THISCALLMETHOD_(HDC
,TxGetDC
)( THIS
222 THISCALLMETHOD_(INT
,TxReleaseDC
)( THIS_
225 THISCALLMETHOD_(BOOL
,TxShowScrollBar
)( THIS_
229 THISCALLMETHOD_(BOOL
,TxEnableScrollBar
)( THIS_
231 INT fuArrowflags
) PURE
;
233 THISCALLMETHOD_(BOOL
,TxSetScrollRange
)( THIS_
239 THISCALLMETHOD_(BOOL
,TxSetScrollPos
)( THIS_
244 THISCALLMETHOD_(void,TxInvalidateRect
)( THIS_
248 THISCALLMETHOD_(void,TxViewChange
)( THIS_
251 THISCALLMETHOD_(BOOL
,TxCreateCaret
)( THIS_
256 THISCALLMETHOD_(BOOL
,TxShowCaret
)( THIS_
259 THISCALLMETHOD_(BOOL
,TxSetCaretPos
)( THIS_
263 THISCALLMETHOD_(BOOL
,TxSetTimer
)( THIS_
267 THISCALLMETHOD_(void,TxKillTimer
)( THIS_
270 THISCALLMETHOD_(void,TxScrollWindowEx
)( THIS_
279 THISCALLMETHOD_(void,TxSetCapture
)( THIS_
282 THISCALLMETHOD_(void,TxSetFocus
)( THIS
285 THISCALLMETHOD_(void,TxSetCursor
)( THIS_
289 THISCALLMETHOD_(BOOL
,TxScreenToClient
)( THIS_
292 THISCALLMETHOD_(BOOL
,TxClientToScreen
)( THIS_
295 THISCALLMETHOD_(HRESULT
,TxActivate
)( THIS_
296 LONG
* plOldState
) PURE
;
298 THISCALLMETHOD_(HRESULT
,TxDeactivate
)( THIS_
299 LONG lNewState
) PURE
;
301 THISCALLMETHOD_(HRESULT
,TxGetClientRect
)( THIS_
304 THISCALLMETHOD_(HRESULT
,TxGetViewInset
)( THIS_
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_
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_
328 THISCALLMETHOD_(HRESULT
,TxGetAcceleratorPos
)( THIS_
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_
342 DWORD
* pdwBits
) PURE
;
344 THISCALLMETHOD_(HRESULT
,TxNotify
)( THIS_
348 THISCALLMETHOD_(HIMC
,TxImmGetContext
)( THIS
351 THISCALLMETHOD_(void,TxImmReleaseContext
)( THIS_
354 THISCALLMETHOD_(HRESULT
,TxGetSelectionBarWidth
)( THIS_
355 LONG
* lSelBarWidth
) PURE
;
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)
367 HRESULT WINAPI
CreateTextServices(IUnknown
*,ITextHost
*,IUnknown
**);
369 typedef HRESULT (WINAPI
*PCreateTextServices
)(IUnknown
*,ITextHost
*,IUnknown
**);
375 #endif /* _TEXTSERV_H */