Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #ifndef _TEXTSERV_H
      7 #define _TEXTSERV_H
      8 
      9 EXTERN_C const IID IID_ITextServices;
     10 EXTERN_C const IID IID_ITextHost;
     11 
     12 #define S_MSG_KEY_IGNORED MAKE_HRESULT(SEVERITY_SUCCESS,FACILITY_ITF,0x201)
     13 
     14 enum TXTBACKSTYLE {
     15   TXTBACK_TRANSPARENT = 0,TXTBACK_OPAQUE
     16 };
     17 
     18 enum TXTHITRESULT {
     19   TXTHITRESULT_NOHIT = 0,TXTHITRESULT_TRANSPARENT = 1,TXTHITRESULT_CLOSE = 2,TXTHITRESULT_HIT = 3
     20 };
     21 
     22 enum TXTNATURALSIZE {
     23   TXTNS_FITTOCONTENT = 1,TXTNS_ROUNDTOLINE = 2
     24 };
     25 
     26 enum TXTVIEW {
     27   TXTVIEW_ACTIVE = 0,TXTVIEW_INACTIVE = -1
     28 };
     29 
     30 enum CHANGETYPE {
     31   CN_GENERIC = 0,CN_TEXTCHANGED = 1,CN_NEWUNDO = 2,CN_NEWREDO = 4
     32 };
     33 
     34 struct CHANGENOTIFY {
     35   DWORD dwChangeType;
     36   void *pvCookieData;
     37 };
     38 
     39 #define TXTBIT_RICHTEXT 1
     40 #define TXTBIT_MULTILINE 2
     41 #define TXTBIT_READONLY 4
     42 #define TXTBIT_SHOWACCELERATOR 8
     43 #define TXTBIT_USEPASSWORD 0x10
     44 #define TXTBIT_HIDESELECTION 0x20
     45 #define TXTBIT_SAVESELECTION 0x40
     46 #define TXTBIT_AUTOWORDSEL 0x80
     47 #define TXTBIT_VERTICAL 0x100
     48 #define TXTBIT_SELBARCHANGE 0x200
     49 
     50 #define TXTBIT_WORDWRAP 0x400
     51 
     52 #define TXTBIT_ALLOWBEEP 0x800
     53 #define TXTBIT_DISABLEDRAG 0x1000
     54 #define TXTBIT_VIEWINSETCHANGE 0x2000
     55 #define TXTBIT_BACKSTYLECHANGE 0x4000
     56 #define TXTBIT_MAXLENGTHCHANGE 0x8000
     57 #define TXTBIT_SCROLLBARCHANGE 0x10000
     58 #define TXTBIT_CHARFORMATCHANGE 0x20000
     59 #define TXTBIT_PARAFORMATCHANGE 0x40000
     60 #define TXTBIT_EXTENTCHANGE 0x80000
     61 #define TXTBIT_CLIENTRECTCHANGE 0x100000
     62 #define TXTBIT_USECURRENTBKG 0x200000
     63 
     64 class ITextServices : public IUnknown {
     65 public:
     66   virtual HRESULT TxSendMessage(UINT msg,WPARAM wparam,LPARAM lparam,LRESULT *plresult) = 0;
     67   virtual HRESULT TxDraw(DWORD dwDrawAspect,LONG lindex,void *pvAspect,DVTARGETDEVICE *ptd,HDC hdcDraw,HDC hicTargetDev,LPCRECTL lprcBounds,LPCRECTL lprcWBounds,LPRECT lprcUpdate,WINBOOL (CALLBACK *pfnContinue) (DWORD),DWORD dwContinue,LONG lViewId) = 0;
     68   virtual HRESULT TxGetHScroll(LONG *plMin,LONG *plMax,LONG *plPos,LONG *plPage,WINBOOL *pfEnabled) = 0;
     69   virtual HRESULT TxGetVScroll(LONG *plMin,LONG *plMax,LONG *plPos,LONG *plPage,WINBOOL *pfEnabled) = 0;
     70   virtual HRESULT OnTxSetCursor(DWORD dwDrawAspect,LONG lindex,void *pvAspect,DVTARGETDEVICE *ptd,HDC hdcDraw,HDC hicTargetDev,LPCRECT lprcClient,INT x,INT y) = 0;
     71   virtual HRESULT TxQueryHitPoint(DWORD dwDrawAspect,LONG lindex,void *pvAspect,DVTARGETDEVICE *ptd,HDC hdcDraw,HDC hicTargetDev,LPCRECT lprcClient,INT x,INT y,DWORD *pHitResult) = 0;
     72   virtual HRESULT OnTxInPlaceActivate(LPCRECT prcClient) = 0;
     73   virtual HRESULT OnTxInPlaceDeactivate() = 0;
     74   virtual HRESULT OnTxUIActivate() = 0;
     75   virtual HRESULT OnTxUIDeactivate() = 0;
     76   virtual HRESULT TxGetText(BSTR *pbstrText) = 0;
     77   virtual HRESULT TxSetText(LPCWSTR pszText) = 0;
     78   virtual HRESULT TxGetCurTargetX(LONG *) = 0;
     79   virtual HRESULT TxGetBaseLinePos(LONG *) = 0;
     80   virtual HRESULT TxGetNaturalSize(DWORD dwAspect,HDC hdcDraw,HDC hicTargetDev,DVTARGETDEVICE *ptd,DWORD dwMode,const SIZEL *psizelExtent,LONG *pwidth,LONG *pheight) = 0;
     81   virtual HRESULT TxGetDropTarget(IDropTarget **ppDropTarget) = 0;
     82   virtual HRESULT OnTxPropertyBitsChange(DWORD dwMask,DWORD dwBits) = 0;
     83   virtual HRESULT TxGetCachedSize(DWORD *pdwWidth,DWORD *pdwHeight)=0;
     84 };
     85 
     86 class ITextHost : public IUnknown {
     87 public:
     88   virtual HDC TxGetDC() = 0;
     89   virtual INT TxReleaseDC(HDC hdc) = 0;
     90   virtual WINBOOL TxShowScrollBar(INT fnBar,WINBOOL fShow) = 0;
     91   virtual WINBOOL TxEnableScrollBar (INT fuSBFlags,INT fuArrowflags) = 0;
     92   virtual WINBOOL TxSetScrollRange(INT fnBar,LONG nMinPos,INT nMaxPos,WINBOOL fRedraw) = 0;
     93   virtual WINBOOL TxSetScrollPos (INT fnBar,INT nPos,WINBOOL fRedraw) = 0;
     94   virtual void TxInvalidateRect(LPCRECT prc,WINBOOL fMode) = 0;
     95   virtual void TxViewChange(WINBOOL fUpdate) = 0;
     96   virtual WINBOOL TxCreateCaret(HBITMAP hbmp,INT xWidth,INT yHeight) = 0;
     97   virtual WINBOOL TxShowCaret(WINBOOL fShow) = 0;
     98   virtual WINBOOL TxSetCaretPos(INT x,INT y) = 0;
     99   virtual WINBOOL TxSetTimer(UINT idTimer,UINT uTimeout) = 0;
    100   virtual void TxKillTimer(UINT idTimer) = 0;
    101   virtual void TxScrollWindowEx (INT dx,INT dy,LPCRECT lprcScroll,LPCRECT lprcClip,HRGN hrgnUpdate,LPRECT lprcUpdate,UINT fuScroll) = 0;
    102   virtual void TxSetCapture(WINBOOL fCapture) = 0;
    103   virtual void TxSetFocus() = 0;
    104   virtual void TxSetCursor(HCURSOR hcur,WINBOOL fText) = 0;
    105   virtual WINBOOL TxScreenToClient (LPPOINT lppt) = 0;
    106   virtual WINBOOL TxClientToScreen (LPPOINT lppt) = 0;
    107   virtual HRESULT TxActivate(LONG *plOldState) = 0;
    108   virtual HRESULT TxDeactivate(LONG lNewState) = 0;
    109   virtual HRESULT TxGetClientRect(LPRECT prc) = 0;
    110   virtual HRESULT TxGetViewInset(LPRECT prc) = 0;
    111   virtual HRESULT TxGetCharFormat(const CHARFORMATW **ppCF) = 0;
    112   virtual HRESULT TxGetParaFormat(const PARAFORMAT **ppPF) = 0;
    113   virtual COLORREF TxGetSysColor(int nIndex) = 0;
    114   virtual HRESULT TxGetBackStyle(TXTBACKSTYLE *pstyle) = 0;
    115   virtual HRESULT TxGetMaxLength(DWORD *plength) = 0;
    116   virtual HRESULT TxGetScrollBars(DWORD *pdwScrollBar) = 0;
    117   virtual HRESULT TxGetPasswordChar(TCHAR *pch) = 0;
    118   virtual HRESULT TxGetAcceleratorPos(LONG *pcp) = 0;
    119   virtual HRESULT TxGetExtent(LPSIZEL lpExtent) = 0;
    120   virtual HRESULT OnTxCharFormatChange (const CHARFORMATW *pcf) = 0;
    121   virtual HRESULT OnTxParaFormatChange (const PARAFORMAT *ppf) = 0;
    122   virtual HRESULT TxGetPropertyBits(DWORD dwMask,DWORD *pdwBits) = 0;
    123   virtual HRESULT TxNotify(DWORD iNotify,void *pv) = 0;
    124   virtual HIMC TxImmGetContext() = 0;
    125   virtual void TxImmReleaseContext(HIMC himc) = 0;
    126   virtual HRESULT TxGetSelectionBarWidth (LONG *lSelBarWidth) = 0;
    127 };
    128 
    129 STDAPI CreateTextServices(IUnknown *punkOuter,ITextHost *pITextHost,IUnknown **ppUnk);
    130 typedef HRESULT (WINAPI *PCreateTextServices)(IUnknown *punkOuter,ITextHost *pITextHost,IUnknown **ppUnk);
    131 #endif
    132