sl@0: sl@0: // Copyright (c) 1996-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: // sl@0: sl@0: /** sl@0: @file sl@0: @test sl@0: @internalComponent - Internal Symbian test code sl@0: */ sl@0: sl@0: #ifndef __TPNTKEY_H__ sl@0: #define __TPNTKEY_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include "../tlib/testbase.h" sl@0: #include "AUTO.H" sl@0: #include "TGraphicsHarness.h" sl@0: sl@0: const TInt ENumPntKeyTests=6; sl@0: const TUint EModifierMask=EModifierCtrl|EModifierShift|EModifierFunc; sl@0: sl@0: class CTPntKey; sl@0: sl@0: class CTPntKeyWindow : public CTWin sl@0: { sl@0: private: sl@0: enum {KPointerMoveBufferSize=32}; sl@0: public: sl@0: CTPntKeyWindow(CTPntKey *aTest); sl@0: ~CTPntKeyWindow(); sl@0: void SetUpLD(TPoint pos,TSize size,CTWinBase *parent); sl@0: void PointerL(const TPointerEvent &pointer,const TTime &aTime); sl@0: void KeyUpL(const TKeyEvent &aKey,const TTime &); sl@0: void KeyDownL(const TKeyEvent &aKey,const TTime &); sl@0: void WinKeyL(const TKeyEvent &aKey,const TTime &); sl@0: void SwitchOn(const TTime &aTime); sl@0: void NextKey(); sl@0: void Test(TInt aCheck); sl@0: void Error(TInt aWhere); sl@0: void DrawButton(const TRect &aRect, const TDesC &aText); sl@0: void Draw(); sl@0: void SendEvent(); sl@0: void SimulatePointerDownUp(const TRect& aRect); sl@0: inline TInt KeyCount() {return iKeyCount;} sl@0: private: sl@0: TInt iKeyCount; sl@0: TRect iKey1; sl@0: TRect iKey2; sl@0: TRect iKey3; sl@0: static TInt iTestScanCodes[ENumPntKeyTests]; sl@0: static TUint iTestCodes[ENumPntKeyTests]; sl@0: static TUint iTestModifiers[ENumPntKeyTests]; sl@0: CTPntKey *iTest; sl@0: }; sl@0: sl@0: class CTPntKey : public CTWsGraphicsBase sl@0: { sl@0: private: sl@0: enum {KTimeOutAfter=60000000}; //60secs sl@0: sl@0: public: sl@0: CTPntKey(CTestStep* aStep); sl@0: ~CTPntKey(); sl@0: void ConstructL(); sl@0: static TInt TimeOut(TAny* aTest); sl@0: void TimeOut(); sl@0: void Failed(TInt aWhere); sl@0: inline TBool NoDigitiser() const {return iNoDigitiser;} sl@0: sl@0: protected: //from CTGraphicsStep sl@0: virtual void RunTestCaseL(TInt aCurTestCase); sl@0: sl@0: private: sl@0: inline TestClient *Client() {return TheClient;} sl@0: sl@0: private: sl@0: CTimeOut* iTimeOut; sl@0: CTPntKeyWindow *iWin; sl@0: TSize iWinSize; sl@0: TInt iState; sl@0: TBool iFailed; sl@0: TBool iOldPointerState; sl@0: TBool iNoDigitiser; sl@0: }; sl@0: sl@0: class CTPntKeyStep : public CTGraphicsStep sl@0: { sl@0: public: sl@0: CTPntKeyStep(); sl@0: protected: sl@0: //from CTGraphicsStep sl@0: virtual CTGraphicsBase* CreateTestL(); sl@0: }; sl@0: sl@0: _LIT(KTPntKeyStep,"TPntKey"); sl@0: sl@0: sl@0: #endif