wine/include/textserv.h

451 lines
14 KiB
C
Raw Normal View History

2005-07-01 19:12:44 +00:00
/*
* Copyright (C) 2005 Mike McCormack
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
2005-07-01 19:12:44 +00:00
*/
#ifndef _TEXTSERV_H
#define _TEXTSERV_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
#define THISCALLMETHOD_(type,method) virtual type __thiscall method
#else
#define THISCALLMETHOD_(type,method) type (__thiscall *method)
#endif
EXTERN_C const IID IID_ITextServices;
EXTERN_C const IID IID_ITextHost;
EXTERN_C const IID IID_ITextHost2;
2005-07-01 19:12:44 +00:00
/*****************************************************************************
* ITextServices interface
*/
#define INTERFACE ITextServices
DECLARE_INTERFACE_(ITextServices,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_
REFIID riid,
void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** ITextServices methods ***/
THISCALLMETHOD_(HRESULT,TxSendMessage)( THIS_
2005-07-01 19:12:44 +00:00
UINT msg, WPARAM wparam, LPARAM lparam, LRESULT* plresult) PURE;
THISCALLMETHOD_(HRESULT,TxDraw)( THIS_
2005-07-01 19:12:44 +00:00
DWORD dwDrawAspect,
LONG lindex,
void* pvAspect,
DVTARGETDEVICE* ptd,
HDC hdcDraw,
HDC hicTargetDev,
LPCRECTL lprcBounds,
LPCRECTL lprcWBounds,
LPRECT lprcUpdate,
BOOL (CALLBACK * pfnContinue)(DWORD),
DWORD dwContinue,
LONG lViewId) PURE;
THISCALLMETHOD_(HRESULT,TxGetHScroll)( THIS_
2005-07-01 19:12:44 +00:00
LONG* plMin,
LONG* plMax,
LONG* plPos,
LONG* plPage,
BOOL* pfEnabled) PURE;
THISCALLMETHOD_(HRESULT,TxGetVScroll)( THIS_
2005-07-01 19:12:44 +00:00
LONG* plMin,
LONG* plMax,
LONG* plPos,
LONG* plPage,
BOOL* pfEnabled) PURE;
THISCALLMETHOD_(HRESULT,OnTxSetCursor)( THIS_
2005-07-01 19:12:44 +00:00
DWORD dwDrawAspect,
LONG lindex,
void* pvAspect,
DVTARGETDEVICE* ptd,
HDC hdcDraw,
HDC hicTargetDev,
LPCRECT lprcClient,
INT x,
INT y) PURE;
THISCALLMETHOD_(HRESULT,TxQueryHitPoint)( THIS_
2005-07-01 19:12:44 +00:00
DWORD dwDrawAspect,
LONG lindex,
void* pvAspect,
DVTARGETDEVICE* ptd,
HDC hdcDraw,
HDC hicTargetDev,
LPCRECT lprcClient,
INT x,
INT y,
DWORD* pHitResult) PURE;
THISCALLMETHOD_(HRESULT,OnTxInPlaceActivate)( THIS_
2005-07-01 19:12:44 +00:00
LPCRECT prcClient) PURE;
THISCALLMETHOD_(HRESULT,OnTxInPlaceDeactivate)( THIS ) PURE;
THISCALLMETHOD_(HRESULT,OnTxUIActivate)( THIS ) PURE;
2005-07-01 19:12:44 +00:00
THISCALLMETHOD_(HRESULT,OnTxUIDeactivate)( THIS ) PURE;
2005-07-01 19:12:44 +00:00
THISCALLMETHOD_(HRESULT,TxGetText)( THIS_
2005-07-01 19:12:44 +00:00
BSTR* pbstrText) PURE;
THISCALLMETHOD_(HRESULT,TxSetText)( THIS_
2005-07-01 19:12:44 +00:00
LPCWSTR pszText) PURE;
THISCALLMETHOD_(HRESULT,TxGetCurTargetX)( THIS_
2005-07-01 19:12:44 +00:00
LONG* x) PURE;
THISCALLMETHOD_(HRESULT,TxGetBaseLinePos)( THIS_
2005-07-01 19:12:44 +00:00
LONG* x) PURE;
THISCALLMETHOD_(HRESULT,TxGetNaturalSize)( THIS_
2005-07-01 19:12:44 +00:00
DWORD dwAspect,
HDC hdcDraw,
HDC hicTargetDev,
DVTARGETDEVICE* ptd,
DWORD dwMode,
const SIZEL* psizelExtent,
LONG* pwidth,
LONG* pheight) PURE;
THISCALLMETHOD_(HRESULT,TxGetDropTarget)( THIS_
2005-07-01 19:12:44 +00:00
IDropTarget** ppDropTarget) PURE;
THISCALLMETHOD_(HRESULT,OnTxPropertyBitsChange)( THIS_
2005-07-01 19:12:44 +00:00
DWORD dwMask,
DWORD dwBits) PURE;
THISCALLMETHOD_(HRESULT,TxGetCachedSize)( THIS_
2005-07-01 19:12:44 +00:00
DWORD* pdwWidth,
DWORD* pdwHeight) PURE;
};
#undef INTERFACE
2005-07-01 19:12:44 +00:00
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define ITextServices_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ITextServices_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ITextServices_Release(p) (p)->lpVtbl->Release(p)
#endif
typedef enum _TXTBACKSTYLE {
TXTBACK_TRANSPARENT = 0,
TXTBACK_OPAQUE
} TXTBACKSTYLE;
enum TXTHITRESULT {
TXTHITRESULT_NOHIT = 0,
TXTHITRESULT_TRANSPARENT = 1,
TXTHITRESULT_CLOSE = 2,
TXTHITRESULT_HIT = 3
};
enum TXTNATURALSIZE {
TXTNS_FITTOCONTENT = 1,
TXTNS_ROUNDTOLINE = 2
};
enum TXTVIEW {
TXTVIEW_ACTIVE = 0,
TXTVIEW_INACTIVE = -1
2005-07-01 19:12:44 +00:00
};
2005-07-05 16:18:22 +00:00
#define TXTBIT_RICHTEXT 0x000001
#define TXTBIT_MULTILINE 0x000002
#define TXTBIT_READONLY 0x000004
#define TXTBIT_SHOWACCELERATOR 0x000008
#define TXTBIT_USEPASSWORD 0x000010
#define TXTBIT_HIDESELECTION 0x000020
#define TXTBIT_SAVESELECTION 0x000040
#define TXTBIT_AUTOWORDSEL 0x000080
#define TXTBIT_VERTICAL 0x000100
#define TXTBIT_SELBARCHANGE 0x000200
#define TXTBIT_WORDWRAP 0x000400
#define TXTBIT_ALLOWBEEP 0x000800
#define TXTBIT_DISABLEDRAG 0x001000
#define TXTBIT_VIEWINSETCHANGE 0x002000
#define TXTBIT_BACKSTYLECHANGE 0x004000
#define TXTBIT_MAXLENGTHCHANGE 0x008000
#define TXTBIT_SCROLLBARCHANGE 0x010000
#define TXTBIT_CHARFORMATCHANGE 0x020000
#define TXTBIT_PARAFORMATCHANGE 0x040000
#define TXTBIT_EXTENTCHANGE 0x080000
#define TXTBIT_CLIENTRECTCHANGE 0x100000
#define TXTBIT_USECURRENTBKG 0x200000
2005-07-01 19:12:44 +00:00
/*****************************************************************************
* ITextHost interface
*/
#define INTERFACE ITextHost
DECLARE_INTERFACE_(ITextHost,IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_
REFIID riid,
void** ppvObject) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** ITextHost methods ***/
THISCALLMETHOD_(HDC,TxGetDC)( THIS
2005-07-01 19:12:44 +00:00
) PURE;
THISCALLMETHOD_(INT,TxReleaseDC)( THIS_
2005-07-01 19:12:44 +00:00
HDC hdc) PURE;
THISCALLMETHOD_(BOOL,TxShowScrollBar)( THIS_
2005-07-01 19:12:44 +00:00
INT fnBar,
BOOL fShow) PURE;
THISCALLMETHOD_(BOOL,TxEnableScrollBar)( THIS_
2005-07-01 19:12:44 +00:00
INT fuSBFlags,
INT fuArrowflags) PURE;
THISCALLMETHOD_(BOOL,TxSetScrollRange)( THIS_
2005-07-01 19:12:44 +00:00
INT fnBar,
LONG nMinPos,
INT nMaxPos,
BOOL fRedraw) PURE;
THISCALLMETHOD_(BOOL,TxSetScrollPos)( THIS_
2005-07-01 19:12:44 +00:00
INT fnBar,
INT nPos,
BOOL fRedraw) PURE;
THISCALLMETHOD_(void,TxInvalidateRect)( THIS_
2005-07-01 19:12:44 +00:00
LPCRECT prc,
BOOL fMode) PURE;
THISCALLMETHOD_(void,TxViewChange)( THIS_
2005-07-01 19:12:44 +00:00
BOOL fUpdate) PURE;
THISCALLMETHOD_(BOOL,TxCreateCaret)( THIS_
2005-07-01 19:12:44 +00:00
HBITMAP hbmp,
INT xWidth,
INT yHeight) PURE;
THISCALLMETHOD_(BOOL,TxShowCaret)( THIS_
2005-07-01 19:12:44 +00:00
BOOL fShow) PURE;
THISCALLMETHOD_(BOOL,TxSetCaretPos)( THIS_
2005-07-01 19:12:44 +00:00
INT x,
INT y) PURE;
THISCALLMETHOD_(BOOL,TxSetTimer)( THIS_
2005-07-01 19:12:44 +00:00
UINT idTimer,
UINT uTimeout) PURE;
THISCALLMETHOD_(void,TxKillTimer)( THIS_
2005-07-01 19:12:44 +00:00
UINT idTimer) PURE;
THISCALLMETHOD_(void,TxScrollWindowEx)( THIS_
2005-07-01 19:12:44 +00:00
INT dx,
INT dy,
LPCRECT lprcScroll,
LPCRECT lprcClip,
HRGN hRgnUpdate,
LPRECT lprcUpdate,
UINT fuScroll) PURE;
THISCALLMETHOD_(void,TxSetCapture)( THIS_
2005-07-01 19:12:44 +00:00
BOOL fCapture) PURE;
THISCALLMETHOD_(void,TxSetFocus)( THIS
2005-07-01 19:12:44 +00:00
) PURE;
THISCALLMETHOD_(void,TxSetCursor)( THIS_
2005-07-01 19:12:44 +00:00
HCURSOR hcur,
BOOL fText) PURE;
THISCALLMETHOD_(BOOL,TxScreenToClient)( THIS_
2005-07-01 19:12:44 +00:00
LPPOINT lppt) PURE;
THISCALLMETHOD_(BOOL,TxClientToScreen)( THIS_
2005-07-01 19:12:44 +00:00
LPPOINT lppt) PURE;
THISCALLMETHOD_(HRESULT,TxActivate)( THIS_
2005-07-01 19:12:44 +00:00
LONG* plOldState) PURE;
THISCALLMETHOD_(HRESULT,TxDeactivate)( THIS_
2005-07-01 19:12:44 +00:00
LONG lNewState) PURE;
THISCALLMETHOD_(HRESULT,TxGetClientRect)( THIS_
2005-07-01 19:12:44 +00:00
LPRECT prc) PURE;
THISCALLMETHOD_(HRESULT,TxGetViewInset)( THIS_
2005-07-01 19:12:44 +00:00
LPRECT prc) PURE;
THISCALLMETHOD_(HRESULT,TxGetCharFormat)( THIS_
2005-07-01 19:12:44 +00:00
const CHARFORMATW** ppCF) PURE;
THISCALLMETHOD_(HRESULT,TxGetParaFormat)( THIS_
2005-07-01 19:12:44 +00:00
const PARAFORMAT** ppPF) PURE;
THISCALLMETHOD_(COLORREF,TxGetSysColor)( THIS_
2005-07-01 19:12:44 +00:00
int nIndex) PURE;
THISCALLMETHOD_(HRESULT,TxGetBackStyle)( THIS_
2005-07-01 19:12:44 +00:00
TXTBACKSTYLE* pStyle) PURE;
THISCALLMETHOD_(HRESULT,TxGetMaxLength)( THIS_
2005-07-01 19:12:44 +00:00
DWORD* plength) PURE;
THISCALLMETHOD_(HRESULT,TxGetScrollBars)( THIS_
2005-07-01 19:12:44 +00:00
DWORD* pdwScrollBar) PURE;
THISCALLMETHOD_(HRESULT,TxGetPasswordChar)( THIS_
2005-07-01 19:12:44 +00:00
WCHAR* pch) PURE;
THISCALLMETHOD_(HRESULT,TxGetAcceleratorPos)( THIS_
2005-07-01 19:12:44 +00:00
LONG* pch) PURE;
THISCALLMETHOD_(HRESULT,TxGetExtent)( THIS_
2005-07-01 19:12:44 +00:00
LPSIZEL lpExtent) PURE;
THISCALLMETHOD_(HRESULT,OnTxCharFormatChange)( THIS_
2005-07-01 19:12:44 +00:00
const CHARFORMATW* pcf) PURE;
THISCALLMETHOD_(HRESULT,OnTxParaFormatChange)( THIS_
2005-07-01 19:12:44 +00:00
const PARAFORMAT* ppf) PURE;
THISCALLMETHOD_(HRESULT,TxGetPropertyBits)( THIS_
2005-07-01 19:12:44 +00:00
DWORD dwMask,
DWORD* pdwBits) PURE;
THISCALLMETHOD_(HRESULT,TxNotify)( THIS_
2005-07-01 19:12:44 +00:00
DWORD iNotify,
void* pv) PURE;
THISCALLMETHOD_(HIMC,TxImmGetContext)( THIS
2005-07-01 19:12:44 +00:00
) PURE;
THISCALLMETHOD_(void,TxImmReleaseContext)( THIS_
2005-07-01 19:12:44 +00:00
HIMC himc) PURE;
THISCALLMETHOD_(HRESULT,TxGetSelectionBarWidth)( THIS_
2005-07-01 19:12:44 +00:00
LONG* lSelBarWidth) PURE;
};
#undef INTERFACE
2005-07-01 19:12:44 +00:00
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define ITextHost_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ITextHost_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ITextHost_Release(p) (p)->lpVtbl->Release(p)
#endif
/*****************************************************************************
* ITextHost2 interface
*/
#define INTERFACE ITextHost2
DECLARE_INTERFACE_(ITextHost2,ITextHost)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)( THIS_ REFIID riid, void** ppvObject ) PURE;
STDMETHOD_(ULONG,AddRef)( THIS ) PURE;
STDMETHOD_(ULONG,Release)( THIS ) PURE;
/*** ITextHost methods ***/
THISCALLMETHOD_(HDC,TxGetDC)( THIS ) PURE;
THISCALLMETHOD_(INT,TxReleaseDC)( THIS_ HDC hdc ) PURE;
THISCALLMETHOD_(BOOL,TxShowScrollBar)( THIS_ INT fnBar, BOOL fShow ) PURE;
THISCALLMETHOD_(BOOL,TxEnableScrollBar)( THIS_ INT fuSBFlags, INT fuArrowflags ) PURE;
THISCALLMETHOD_(BOOL,TxSetScrollRange)( THIS_ INT fnBar, LONG nMinPos, INT nMaxPos, BOOL fRedraw ) PURE;
THISCALLMETHOD_(BOOL,TxSetScrollPos)( THIS_ INT fnBar, INT nPos, BOOL fRedraw ) PURE;
THISCALLMETHOD_(void,TxInvalidateRect)( THIS_ LPCRECT prc, BOOL fMode ) PURE;
THISCALLMETHOD_(void,TxViewChange)( THIS_ BOOL fUpdate ) PURE;
THISCALLMETHOD_(BOOL,TxCreateCaret)( THIS_ HBITMAP hbmp, INT xWidth, INT yHeight ) PURE;
THISCALLMETHOD_(BOOL,TxShowCaret)( THIS_ BOOL fShow ) PURE;
THISCALLMETHOD_(BOOL,TxSetCaretPos)( THIS_ INT x, INT y ) PURE;
THISCALLMETHOD_(BOOL,TxSetTimer)( THIS_ UINT idTimer, UINT uTimeout ) PURE;
THISCALLMETHOD_(void,TxKillTimer)( THIS_ UINT idTimer ) PURE;
THISCALLMETHOD_(void,TxScrollWindowEx)( THIS_ INT dx, INT dy, LPCRECT lprcScroll, LPCRECT lprcClip,
HRGN hRgnUpdate, LPRECT lprcUpdate, UINT fuScroll ) PURE;
THISCALLMETHOD_(void,TxSetCapture)( THIS_ BOOL fCapture ) PURE;
THISCALLMETHOD_(void,TxSetFocus)( THIS ) PURE;
THISCALLMETHOD_(void,TxSetCursor)( THIS_ HCURSOR hcur, BOOL fText ) PURE;
THISCALLMETHOD_(BOOL,TxScreenToClient)( THIS_ LPPOINT lppt ) PURE;
THISCALLMETHOD_(BOOL,TxClientToScreen)( THIS_ LPPOINT lppt ) PURE;
THISCALLMETHOD_(HRESULT,TxActivate)( THIS_ LONG* plOldState ) PURE;
THISCALLMETHOD_(HRESULT,TxDeactivate)( THIS_ LONG lNewState ) PURE;
THISCALLMETHOD_(HRESULT,TxGetClientRect)( THIS_ LPRECT prc ) PURE;
THISCALLMETHOD_(HRESULT,TxGetViewInset)( THIS_ LPRECT prc ) PURE;
THISCALLMETHOD_(HRESULT,TxGetCharFormat)( THIS_ const CHARFORMATW** ppCF ) PURE;
THISCALLMETHOD_(HRESULT,TxGetParaFormat)( THIS_ const PARAFORMAT** ppPF ) PURE;
THISCALLMETHOD_(COLORREF,TxGetSysColor)( THIS_ int nIndex ) PURE;
THISCALLMETHOD_(HRESULT,TxGetBackStyle)( THIS_ TXTBACKSTYLE* pStyle ) PURE;
THISCALLMETHOD_(HRESULT,TxGetMaxLength)( THIS_ DWORD* plength ) PURE;
THISCALLMETHOD_(HRESULT,TxGetScrollBars)( THIS_ DWORD* pdwScrollBar ) PURE;
THISCALLMETHOD_(HRESULT,TxGetPasswordChar)( THIS_ WCHAR* pch ) PURE;
THISCALLMETHOD_(HRESULT,TxGetAcceleratorPos)( THIS_ LONG* pch ) PURE;
THISCALLMETHOD_(HRESULT,TxGetExtent)( THIS_ LPSIZEL lpExtent ) PURE;
THISCALLMETHOD_(HRESULT,OnTxCharFormatChange)( THIS_ const CHARFORMATW* pcf ) PURE;
THISCALLMETHOD_(HRESULT,OnTxParaFormatChange)( THIS_ const PARAFORMAT* ppf ) PURE;
THISCALLMETHOD_(HRESULT,TxGetPropertyBits)( THIS_ DWORD dwMask, DWORD* pdwBits ) PURE;
THISCALLMETHOD_(HRESULT,TxNotify)( THIS_ DWORD iNotify, void* pv ) PURE;
THISCALLMETHOD_(HIMC,TxImmGetContext)( THIS ) PURE;
THISCALLMETHOD_(void,TxImmReleaseContext)( THIS_ HIMC himc ) PURE;
THISCALLMETHOD_(HRESULT,TxGetSelectionBarWidth)( THIS_ LONG* lSelBarWidth ) PURE;
/* ITextHost2 methods */
THISCALLMETHOD_(BOOL,TxIsDoubleClickPending)( THIS ) PURE;
THISCALLMETHOD_(HRESULT,TxGetWindow)( THIS_ HWND *hwnd ) PURE;
THISCALLMETHOD_(HRESULT,TxSetForegroundWindow)( THIS ) PURE;
THISCALLMETHOD_(HPALETTE,TxGetPalette)( THIS ) PURE;
THISCALLMETHOD_(HRESULT,TxGetEastAsianFlags)( THIS_ LONG *flags ) PURE;
THISCALLMETHOD_(HCURSOR,TxSetCursor2)( THIS_ HCURSOR cursor, BOOL text ) PURE;
THISCALLMETHOD_(void,TxFreeTextServicesNotification)( THIS ) PURE;
THISCALLMETHOD_(HRESULT,TxGetEditStyle)( THIS_ DWORD item, DWORD *data ) PURE;
THISCALLMETHOD_(HRESULT,TxGetWindowStyles)( THIS_ DWORD *style, DWORD *ex_style ) PURE;
THISCALLMETHOD_(HRESULT,TxShowDropCaret)( THIS_ BOOL show, HDC hdc, const RECT *rect ) PURE;
THISCALLMETHOD_(HRESULT,TxDestroyCaret)( THIS ) PURE;
THISCALLMETHOD_(HRESULT,TxGetHorzExtent)( THIS_ LONG *horz_extent ) PURE;
};
#undef INTERFACE
#ifdef COBJMACROS
/*** IUnknown methods ***/
#define ITextHost2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ITextHost2_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ITextHost2_Release(p) (p)->lpVtbl->Release(p)
#endif
HRESULT WINAPI CreateTextServices(IUnknown*,ITextHost*,IUnknown**);
typedef HRESULT (WINAPI *PCreateTextServices)(IUnknown*,ITextHost*,IUnknown**);
2005-07-01 19:12:44 +00:00
#ifdef __cplusplus
}
#endif
#endif /* _TEXTSERV_H */