sl@0: // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // wins\specific\multitouch.h sl@0: // sl@0: // sl@0: #ifndef MULTITOUCH_H sl@0: #define MULTITOUCH_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "multitouchwindowsheader.h" sl@0: sl@0: #ifndef WM_INPUT sl@0: #define WM_INPUT 0x00ff sl@0: #endif sl@0: sl@0: /** sl@0: * The main class for Multitouch sl@0: */ sl@0: class DMultiTouch sl@0: { sl@0: public: sl@0: DMultiTouch(TInt aProximityStep, TInt aPressureStep); sl@0: void OnWmInput(HWND aHWnd,TUint aMessage,TUint aWParam,TUint aLParam,HWND aParentHwnd); sl@0: void ShowPrimaryCursor(HWND aHWnd); sl@0: static bool Init(); sl@0: static void ShowCursors(); sl@0: static void HideCursors(); sl@0: BOOL Register(); sl@0: BOOL UnRegister(); sl@0: sl@0: public: sl@0: static int iNumberOfMice; sl@0: static bool iMultiTouchSupported; sl@0: static bool iMultiTouchCreated; sl@0: static bool iMultiTouchTempEnabled; sl@0: int iZMaxRange; sl@0: int iPressureStep; sl@0: int iProximityStep; sl@0: int iMaxPressure; sl@0: }; sl@0: sl@0: extern DMultiTouch* TheMultiTouch; sl@0: extern void MultiTouchWndPointer(TUint message,TInt aXpos,TInt aYpos, TInt aPointerId, TInt aZ); sl@0: sl@0: /** sl@0: * The class of the Cursor Window sl@0: */ sl@0: class CursorWindow sl@0: { sl@0: public: sl@0: CursorWindow(); sl@0: HWND Create(HMODULE hm, HWND hwndParent, int number); sl@0: BOOL SetCursor(HCURSOR hc); sl@0: void GetPosition(POINT& pt); sl@0: void SetPosition(POINT& pt); sl@0: void Show(); sl@0: void Hide(); sl@0: sl@0: HWND iHwnd; sl@0: int iNumber; sl@0: HCURSOR iCursor; sl@0: POINT iHotspot; sl@0: }; sl@0: sl@0: /** sl@0: * The class encapsulating each mouse device sl@0: */ sl@0: class DMultiMouse sl@0: { sl@0: public: sl@0: DMultiMouse(); sl@0: static TInt Add(RAWINPUTDEVICELIST& aDev); sl@0: static DMultiMouse* Find(HANDLE aHandle); sl@0: void HandleRawMouseEvent(RAWMOUSE& aEvent, HWND aWnd); sl@0: void CreateCursor(LPVOID aArg, HWND aWnd); sl@0: enum sl@0: {KMaxMice = 8}; sl@0: sl@0: private: sl@0: void CorrectSystemMouse(); sl@0: void ShowMousePos(HWND aHWnd); sl@0: sl@0: private: sl@0: int iX; sl@0: int iY; sl@0: int iZ; sl@0: HANDLE iDevice; sl@0: int iId; sl@0: sl@0: public: sl@0: bool iIsPrimary; sl@0: CursorWindow iCursorWnd; sl@0: sl@0: static DMultiMouse iMice[KMaxMice]; sl@0: static int iNumMice; sl@0: static DMultiMouse* iPrimary; sl@0: static int iMouseId; sl@0: }; sl@0: sl@0: #endif