/*++
    Copyright (c) 2000  Microsoft Corporation

    Module Name:
        tabsrv.idl

    Abstract:
        This module contains the server interface of TabSrv.

    Author:
        Michael Tsang (MikeTs) 05-Jun-2000

    Environment:
        User mode

    Revision History:
--*/

import "WTypes.idl";

[
    uuid(95a0c486-01fc-47eb-82f1-fb35a00097a8),
    version(1.0),
    helpstring("TabSrv Control Panel Interface")
]

interface TabSrv
{
    const int NUM_LINEAR_XPTS                   = 32;
    const int NUM_LINEAR_YPTS                   = 24;
    const ULONG GESTURE_FEATURE_RECOG_ENABLED   = 0x00000001;
    const ULONG GESTURE_FEATURE_PRESSHOLD_ENABLED = 0x00000002;
    const ULONG GESTURE_FEATURE_MOUSE_ENABLED   = 0x00000004;
    const ULONG GESTURE_FEATURE_UNUSED_BITS     = 0xfffffff8;
    const int   NO_GESTURE                      = -1;
    const int   UP_SPIKE                        = 0;
    const int   DOWN_SPIKE                      = 1;
    const int   LEFT_SPIKE                      = 2;
    const int   RIGHT_SPIKE                     = 3;
    const int   NUM_GESTURES                    = 4;
    const int   BUTTON_1                        = 0;
    const int   BUTTON_2                        = 1;
    const int   BUTTON_3                        = 2;
    const int   BUTTON_4                        = 3;
    const int   BUTTON_5                        = 4;
    const int   NUM_BUTTONS                     = 5;

    typedef enum _SW_ACTION
    {
        SWNoAction = 0,
        SWRightButton,
#ifdef DEBUG
        SWDebugModeToggle
#endif
    } SW_ACTION;

    typedef struct _LINEAR_PT
    {
        USHORT wRefPtX;
        USHORT wRefPtY;
        USHORT wDigiPtX;
        USHORT wDigiPtY;
    } LINEAR_PT, *PLINEAR_PT;

    typedef struct _LINEAR_MAP
    {
        ULONG     dwcbLen;
        USHORT    wNumXPts;
        USHORT    wNumYPts;
        LINEAR_PT Data[NUM_LINEAR_YPTS][NUM_LINEAR_XPTS];
    } LINEAR_MAP, *PLINEAR_MAP;

    typedef enum _BUTTON_ACTION
    {
        ButtonNoAction = 0,
        InvokeNoteBook,
        PageUp,
        PageDown,
        AltEsc,
        AltTab,
        Enter,
        Esc
    } BUTTON_ACTION;

    typedef struct _BUTTON_SETTINGS
    {
        ULONG         dwcbLen;
        BUTTON_ACTION ButtonMap[NUM_BUTTONS];
        ULONG         dwHotKeyButtons;
    } BUTTON_SETTINGS, *PBUTTON_SETTINGS;

    typedef enum _GESTRUE_ACTION
    {
        GestureNoAction = 0,
        PopupSuperTIP,
        PopupMIP,
        SendHotkey
    } GESTURE_ACTION;

    typedef struct _GESTURE_SETTINGS
    {
        ULONG          dwcbLen;
        ULONG          dwfFeatures;
        int            iRadius;
        int            iMinOutPts;
        int            iMaxTimeToInspect;
        int            iAspectRatio;
        int            iCheckTime;
        int            iPointsToExamine;
        int            iStopDist;
        int            iStopTime;
        int            iPressHoldTime;
        int            iHoldTolerance;
        int            iCancelPressHoldTime;
        GESTURE_ACTION GestureMap[NUM_GESTURES];
    } GESTURE_SETTINGS, *PGESTURE_SETTINGS;

    typedef enum _EVTNOTIFY
    {
        RawPtEvent = 0,
        GestureEvent
    } EVTNOTIFY;

    typedef DWORD_PTR HEVTNOTIFY;
    typedef DWORD_PTR HWIN;

    HEVTNOTIFY
    TabSrvRegisterEventNotify(
        [in] handle_t  hBinding,
        [in] EVTNOTIFY Event,
        [in] HWIN      hWnd,
        [in] UINT      uiMsg
        );

    BOOL
    TabSrvDeregisterEventNotify(
        [in] handle_t   hBinding,
        [in] HEVTNOTIFY hEventNotify
        );

    void
    TabSrvGetLastRawDigiReport(
        [in]  handle_t hBinding,
        [out] WORD *pwButtonState,
        [out] WORD *pwX,
        [out] WORD *pwY
        );

    void
    TabSrvSetPenTilt(
        [in] handle_t hBinding,
        [in] LONG     dx,
        [in] LONG     dy
        );

    BOOL
    TabSrvGetLinearityMap(
        [in]  handle_t    hBinding,
        [out] PLINEAR_MAP LinearityMap
        );

    void
    TabSrvSetLinearityMap(
        [in] handle_t    hBinding,
        [in] PLINEAR_MAP LinearityMap
        );

    BOOL
    TabSrvGetPenFeatures(
        [in]  handle_t hBinding,
        [in]  WORD   wReportID,
        [in]  WORD   wUsagePage,
        [in]  WORD   wUsage,
        [out] DWORD *pdwFeature
        );

    BOOL
    TabSrvSetPenFeatures(
        [in] handle_t hBinding,
        [in] WORD  wReportID,
        [in] WORD  wUsagePage,
        [in] WORD  wUsage,
        [in] DWORD dwFeature
        );

    BOOL
    TabSrvGetGestureSettings(
        [in]  handle_t          hBinding,
        [out] PGESTURE_SETTINGS GestureSettings
        );

    BOOL
    TabSrvSetGestureSettings(
        [in] handle_t          hBinding,
        [in] PGESTURE_SETTINGS GestureSettings
        );

    BOOL
    TabSrvGetButtonSettings(
        [in]  handle_t         hBinding,
        [out] PBUTTON_SETTINGS ButtonSettings
        );

    BOOL
    TabSrvSetButtonSettings(
        [in] handle_t         hBinding,
        [in] PBUTTON_SETTINGS ButtonSettings
        );
}

