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 DEFINE_GUID(IID_ITextServices,0x8d33f740,0xcf58,0x11ce,0xa8,0x9d,0x00,0xaa,0x00,0x6c,0xad,0xc5);
27 DEFINE_GUID(IID_ITextHost, 0xc5bdd8d0,0xd26e,0x11ce,0xa8,0x9e,0x00,0xaa,0x00,0x6c,0xad,0xc5);
28 DEFINE_GUID(IID_ITextHost2, 0xc5bdd8d0,0xd26e,0x11ce,0xa8,0x9e,0x00,0xaa,0x00,0x6c,0xad,0xc5);
30 /*****************************************************************************
31 * ITextServices interface
33 #define INTERFACE ITextServices
34 DECLARE_INTERFACE_(ITextServices,IUnknown)
36 /*** IUnknown methods ***/
37 STDMETHOD(QueryInterface)(THIS_
39 void** ppvObject) PURE;
41 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
43 STDMETHOD_(ULONG,Release)(THIS) PURE;
45 /*** ITextServices methods ***/
47 STDMETHOD(TxSendMessage)( THIS_
48 UINT msg, WPARAM wparam, LPARAM lparam, LRESULT* plresult) PURE;
50 STDMETHOD(TxDraw)( THIS_
60 BOOL (CALLBACK * pfnContinue)(DWORD),
64 STDMETHOD(TxGetHScroll)( THIS_
69 BOOL* pfEnabled) PURE;
71 STDMETHOD(TxGetVScroll)( THIS_
76 BOOL* pfEnabled) PURE;
78 STDMETHOD(OnTxSetCursor)( THIS_
89 STDMETHOD(TxQueryHitPoint)( THIS_
99 DWORD* pHitResult) PURE;
101 STDMETHOD(OnTxInplaceActivate)( THIS_
102 LPCRECT prcClient) PURE;
104 STDMETHOD(OnTxInplaceDeactivate)( THIS ) PURE;
106 STDMETHOD(OnTxUIActivate)( THIS ) PURE;
108 STDMETHOD(OnTxUIDeactivate)( THIS ) PURE;
110 STDMETHOD(TxGetText)( THIS_
111 BSTR* pbstrText) PURE;
113 STDMETHOD(TxSetText)( THIS_
114 LPCWSTR pszText) PURE;
116 STDMETHOD(TxGetCurrentTargetX)( THIS_
119 STDMETHOD(TxGetBaseLinePos)( THIS_
122 STDMETHOD(TxGetNaturalSize)( THIS_
128 const SIZEL* psizelExtent,
132 STDMETHOD(TxGetDropTarget)( THIS_
133 IDropTarget** ppDropTarget) PURE;
135 STDMETHOD(OnTxPropertyBitsChange)( THIS_
139 STDMETHOD(TxGetCachedSize)( THIS_
141 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)
154 typedef enum _TXTBACKSTYLE {
155 TXTBACK_TRANSPARENT = 0,
160 TXTHITRESULT_NOHIT = 0,
161 TXTHITRESULT_TRANSPARENT = 1,
162 TXTHITRESULT_CLOSE = 2,
166 enum TXTNATURALSIZE {
167 TXTNS_FITTOCONTENT = 1,
168 TXTNS_ROUNDTOLINE = 2
176 #define TXTBIT_RICHTEXT 0x000001
177 #define TXTBIT_MULTILINE 0x000002
178 #define TXTBIT_READONLY 0x000004
179 #define TXTBIT_SHOWACCELERATOR 0x000008
180 #define TXTBIT_USEPASSWORD 0x000010
181 #define TXTBIT_HIDESELECTION 0x000020
182 #define TXTBIT_SAVESELECTION 0x000040
183 #define TXTBIT_AUTOWORDSEL 0x000080
184 #define TXTBIT_VERTICAL 0x000100
185 #define TXTBIT_SELBARCHANGE 0x000200
186 #define TXTBIT_WORDWRAP 0x000400
187 #define TXTBIT_ALLOWBEEP 0x000800
188 #define TXTBIT_DISABLEDRAG 0x001000
189 #define TXTBIT_VIEWINSETCHANGE 0x002000
190 #define TXTBIT_BACKSTYLECHANGE 0x004000
191 #define TXTBIT_MAXLENGTHCHANGE 0x008000
192 #define TXTBIT_SCROLLBARCHANGE 0x010000
193 #define TXTBIT_CHARFORMATCHANGE 0x020000
194 #define TXTBIT_PARAFORMATCHANGE 0x040000
195 #define TXTBIT_EXTENTCHANGE 0x080000
196 #define TXTBIT_CLIENTRECTCHANGE 0x100000
197 #define TXTBIT_USECURRENTBKG 0x200000
199 /*****************************************************************************
200 * ITextHost interface
202 #define INTERFACE ITextHost
203 DECLARE_INTERFACE_(ITextHost,IUnknown)
205 /*** IUnknown methods ***/
206 STDMETHOD(QueryInterface)(THIS_
208 void** ppvObject) PURE;
210 STDMETHOD_(ULONG,AddRef)(THIS) PURE;
212 STDMETHOD_(ULONG,Release)(THIS) PURE;
214 /*** ITextHost methods ***/
215 STDMETHOD_(HDC,TxGetDC)( THIS
218 STDMETHOD_(INT,TxReleaseDC)( THIS_
221 STDMETHOD_(BOOL,TxShowScrollBar)( THIS_
225 STDMETHOD_(BOOL,TxEnableScrollBar)( THIS_
227 INT fuArrowflags) PURE;
229 STDMETHOD_(BOOL,TxSetScrollRange)( THIS_
235 STDMETHOD_(BOOL,TxSetScrollPos)( THIS_
240 STDMETHOD_(void,TxInvalidateRect)( THIS_
244 STDMETHOD_(void,TxViewChange)( THIS_
247 STDMETHOD_(BOOL,TxCreateCaret)( THIS_
252 STDMETHOD_(BOOL,TxShowCaret)( THIS_
255 STDMETHOD_(BOOL,TxSetCaretPos)( THIS_
259 STDMETHOD_(BOOL,TxSetTimer)( THIS_
263 STDMETHOD_(void,TxKillTimer)( THIS_
266 STDMETHOD_(void,TxScrollWindowEx)( THIS_
275 STDMETHOD_(void,TxSetCapture)( THIS_
278 STDMETHOD_(void,TxSetFocus)( THIS
281 STDMETHOD_(void,TxSetCursor)( THIS_
285 STDMETHOD_(BOOL,TxScreenToClient)( THIS_
288 STDMETHOD_(BOOL,TxClientToScreen)( THIS_
291 STDMETHOD(TxActivate)( THIS_
292 LONG* plOldState) PURE;
294 STDMETHOD(TxDeactivate)( THIS_
295 LONG lNewState) PURE;
297 STDMETHOD(TxGetClientRect)( THIS_
300 STDMETHOD(TxGetViewInset)( THIS_
303 STDMETHOD(TxGetCharFormat)( THIS_
304 const CHARFORMATW** ppCF) PURE;
306 STDMETHOD(TxGetParaFormat)( THIS_
307 const PARAFORMAT** ppPF) PURE;
309 STDMETHOD_(COLORREF,TxGetSysColor)( THIS_
312 STDMETHOD(TxGetBackStyle)( THIS_
313 TXTBACKSTYLE* pStyle) PURE;
315 STDMETHOD(TxGetMaxLength)( THIS_
316 DWORD* plength) PURE;
318 STDMETHOD(TxGetScrollbars)( THIS_
319 DWORD* pdwScrollBar) PURE;
321 STDMETHOD(TxGetPasswordChar)( THIS_
324 STDMETHOD(TxGetAcceleratorPos)( THIS_
327 STDMETHOD(TxGetExtent)( THIS_
328 LPSIZEL lpExtent) PURE;
330 STDMETHOD(OnTxCharFormatChange)( THIS_
331 const CHARFORMATW* pcf) PURE;
333 STDMETHOD(OnTxParaFormatChange)( THIS_
334 const PARAFORMAT* ppf) PURE;
336 STDMETHOD(TxGetPropertyBits)( THIS_
338 DWORD* pdwBits) PURE;
340 STDMETHOD(TxNotify)( THIS_
344 STDMETHOD_(HIMC,TxImmGetContext)( THIS
347 STDMETHOD_(void,TxImmReleaseContext)( THIS_
350 STDMETHOD(TxGetSelectionBarWidth)( THIS_
351 LONG* lSelBarWidth) PURE;
356 /*** IUnknown methods ***/
357 #define ITextHost_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
358 #define ITextHost_AddRef(p) (p)->lpVtbl->AddRef(p)
359 #define ITextHost_Release(p) (p)->lpVtbl->Release(p)
360 /*** ITextHost methods ***/
361 #define ITextHost_TxGetDC(p) (p)->lpVtbl->TxGetDC(p)
362 #define ITextHost_TxReleaseDC(p,a) (p)->lpVtbl->TxReleaseDC(p,a)
363 #define ITextHost_TxShowScrollBar(p,a,b) (p)->lpVtbl->TxShowScrollBar(p,a,b)
364 #define ITextHost_TxEnableScrollBar(p,a,b) (p)->lpVtbl->TxEnableScrollBar(p,a,b)
365 #define ITextHost_TxSetScrollRange(p,a,b,c,d) (p)->lpVtbl->TxSetScrollRange(p,a,b,c,d)
366 #define ITextHost_TxSetScrollPos(p,a,b,c) (p)->lpVtbl->TxSetScrollPos(p,a,b,c)
367 #define ITextHost_TxInvalidateRect(p,a,b) (p)->lpVtbl->TxInvalidateRect(p,a,b)
368 #define ITextHost_TxViewChange(p,a) (p)->lpVtbl->TxViewChange(p,a)
369 #define ITextHost_TxCreateCaret(p,a,b,c) (p)->lpVtbl->TxCreateCaret(p,a,b,c)
370 #define ITextHost_TxShowCaret(p,a) (p)->lpVtbl->TxShowCaret(p,a)
371 #define ITextHost_TxSetCarentPos(p,a,b) (p)->lpVtbl->TxSetCarentPos(p,a,b)
372 #define ITextHost_TxSetTimer(p,a,b) (p)->lpVtbl->TxSetTimer(p,a,b)
373 #define ITextHost_TxKillTimer(p,a) (p)->lpVtbl->TxKillTimer(p,a)
374 #define ITextHost_TxScrollWindowEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->TxScrollWindowEx(p,a,b,c,d,e,f,g)
375 #define ITextHost_TxSetCapture(p,a) (p)->lpVtbl->TxSetCapture(p,a)
376 #define ITextHost_TxSetFocus(p) (p)->lpVtbl->TxSetFocus(p)
377 #define ITextHost_TxSetCursor(p,a,b) (p)->lpVtbl->TxSetCursor(p,a,b)
378 #define ITextHost_TxScreenToClient(p,a) (p)->lpVtbl->TxScreenToClient(p,a)
379 #define ITextHost_TxClientToScreen(p,a) (p)->lpVtbl->TxClientToScreen(p,a)
380 #define ITextHost_TxActivate(p,a) (p)->lpVtbl->TxActivate(p,a)
381 #define ITextHost_TxDeactivate(p,a) (p)->lpVtbl->TxDeactivate(p,a)
382 #define ITextHost_TxGetClientRect(p,a) (p)->lpVtbl->TxGetClientRect(p,a)
383 #define ITextHost_TxGetViewInset(p,a) (p)->lpVtbl->TxGetViewInset(p,a)
384 #define ITextHost_TxGetCharFormat(p,a) (p)->lpVtbl->TxGetCharFormat(p,a)
385 #define ITextHost_TxGetParaFormat(p,a) (p)->lpVtbl->TxGetParaFormat(p,a)
386 #define ITextHost_TxGetSysColor(p,a) (p)->lpVtbl->TxGetSysColor(p,a)
387 #define ITextHost_TxGetBackStyle(p,a) (p)->lpVtbl->TxGetBackStyle(p,a)
388 #define ITextHost_TxGetMaxLength(p,a) (p)->lpVtbl->TxGetMaxLength(p,a)
389 #define ITextHost_TxGetScrollbars(p,a) (p)->lpVtbl->TxGetScrollbars(p,a)
390 #define ITextHost_TxGetPasswordChar(p,a) (p)->lpVtbl->TxGetPasswordChar(p,a)
391 #define ITextHost_TxGetAcceleratorPos(p,a) (p)->lpVtbl->TxGetAcceleratorPos(p,a)
392 #define ITextHost_TxGetExtent(p,a) (p)->lpVtbl->TxGetExtent(p,a)
393 #define ITextHost_OnTxCharFormatChange(p,a) (p)->lpVtbl->OnTxCharFormatChange(p,a)
394 #define ITextHost_OnTxParaFormatChange(p,a) (p)->lpVtbl->OnTxParaFormatChange(p,a)
395 #define ITextHost_TxGetPropertyBits(p,a,b) (p)->lpVtbl->TxGetPropertyBits(p,a,b)
396 #define ITextHost_TxNotify(p,a,b) (p)->lpVtbl->TxNotify(p,a,b)
397 #define ITextHost_TxImmGetContext(p) (p)->lpVtbl->TxImmGetContext(p)
398 #define ITextHost_TxImmReleaseContext(p,a) (p)->lpVtbl->TxImmReleaseContext(p,a)
399 #define ITextHost_TxGetSelectionBarWidth(p,a) (p)->lpVtbl->TxGetSelectionBarWidth(p,a)
404 HRESULT WINAPI CreateTextServices(IUnknown*,ITextHost*,IUnknown**);
406 typedef HRESULT (WINAPI *PCreateTextServices)(IUnknown*,ITextHost*,IUnknown**);
412 #endif /* _TEXTSERV_H */