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;
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)
152 typedef enum _TXTBACKSTYLE {
153 TXTBACK_TRANSPARENT = 0,
158 TXTHITRESULT_NOHIT = 0,
159 TXTHITRESULT_TRANSPARENT = 1,
160 TXTHITRESULT_CLOSE = 2,
164 enum TXTNATURALSIZE {
165 TXTNS_FITTOCONTENT = 1,
166 TXTNS_ROUNDTOLINE = 2
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_
206 void** ppvObject) PURE;
208 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
210 STDMETHOD_(ULONG,Release)(THIS) PURE;
212 /*** ITextHost methods ***/
213 STDMETHOD_(HDC,TxGetDC)( THIS
216 STDMETHOD_(INT,TxReleaseDC)( THIS_
219 STDMETHOD_(BOOL,TxShowScrollBar)( THIS_
223 STDMETHOD_(BOOL,TxEnableScrollBar)( THIS_
225 INT fuArrowflags) PURE;
227 STDMETHOD_(BOOL,TxSetScrollRange)( THIS_
233 STDMETHOD_(BOOL,TxSetScrollPos)( THIS_
238 STDMETHOD_(void,TxInvalidateRect)( THIS_
242 STDMETHOD_(void,TxViewChange)( THIS_
245 STDMETHOD_(BOOL,TxCreateCaret)( THIS_
250 STDMETHOD_(BOOL,TxShowCaret)( THIS_
253 STDMETHOD_(BOOL,TxSetCaretPos)( THIS_
257 STDMETHOD_(BOOL,TxSetTimer)( THIS_
261 STDMETHOD_(void,TxKillTimer)( THIS_
264 STDMETHOD_(void,TxScrollWindowEx)( THIS_
273 STDMETHOD_(void,TxSetCapture)( THIS_
276 STDMETHOD_(void,TxSetFocus)( THIS
279 STDMETHOD_(void,TxSetCursor)( THIS_
283 STDMETHOD_(BOOL,TxScreenToClient)( THIS_
286 STDMETHOD_(BOOL,TxClientToScreen)( THIS_
289 STDMETHOD(TxActivate)( THIS_
290 LONG* plOldState) PURE;
292 STDMETHOD(TxDeactivate)( THIS_
293 LONG lNewState) PURE;
295 STDMETHOD(TxGetClientRect)( THIS_
298 STDMETHOD(TxGetViewInset)( THIS_
301 STDMETHOD(TxGetCharFormat)( THIS_
302 const CHARFORMATW** ppCF) PURE;
304 STDMETHOD(TxGetParaFormat)( THIS_
305 const PARAFORMAT** ppPF) PURE;
307 STDMETHOD_(COLORREF,TxGetSysColor)( THIS_
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_
322 STDMETHOD(TxGetAcceleratorPos)( THIS_
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_
336 DWORD* pdwBits) PURE;
338 STDMETHOD(TxNotify)( THIS_
342 STDMETHOD_(HIMC,TxImmGetContext)( THIS
345 STDMETHOD_(void,TxImmReleaseContext)( THIS_
348 STDMETHOD(TxGetSelectionBarWidth)( THIS_
349 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)
361 HRESULT WINAPI CreateTextServices(IUnknown*,ITextHost*,IUnknown**);
363 typedef HRESULT (WINAPI *PCreateTextServices)(IUnknown*,ITextHost*,IUnknown**);
369 #endif /* _TEXTSERV_H */