windowing/windowserver/tauto/TPNTKEY.H
changeset 116 171fae344dd4
parent 103 2717213c588a
equal deleted inserted replaced
103:2717213c588a 116:171fae344dd4
     1 
       
     2 // Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 // All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 //
       
     9 // Initial Contributors:
       
    10 // Nokia Corporation - initial contribution.
       
    11 //
       
    12 // Contributors:
       
    13 //
       
    14 // Description:
       
    15 //
       
    16 
       
    17 /**
       
    18  @file
       
    19  @test
       
    20  @internalComponent - Internal Symbian test code
       
    21 */
       
    22 
       
    23 #ifndef __TPNTKEY_H__
       
    24 #define __TPNTKEY_H__
       
    25 
       
    26 #include <e32std.h>
       
    27 #include <hal.h>
       
    28 #include <w32std.h>
       
    29 #include "../tlib/testbase.h"
       
    30 #include "AUTO.H"
       
    31 #include "TGraphicsHarness.h"
       
    32 
       
    33 const TInt ENumPntKeyTests=6;
       
    34 const TUint EModifierMask=EModifierCtrl|EModifierShift|EModifierFunc;
       
    35 
       
    36 class CTPntKey;
       
    37 
       
    38 class CTPntKeyWindow : public CTWin
       
    39 	{
       
    40 private:
       
    41 	enum {KPointerMoveBufferSize=32};
       
    42 public:
       
    43 	CTPntKeyWindow(CTPntKey *aTest);
       
    44 	~CTPntKeyWindow();
       
    45 	void SetUpLD(TPoint pos,TSize size,CTWinBase *parent);
       
    46 	void PointerL(const TPointerEvent &pointer,const TTime &aTime);
       
    47 	void KeyUpL(const TKeyEvent &aKey,const TTime &);
       
    48 	void KeyDownL(const TKeyEvent &aKey,const TTime &);
       
    49 	void WinKeyL(const TKeyEvent &aKey,const TTime &);
       
    50 	void SwitchOn(const TTime &aTime);
       
    51 	void NextKey();
       
    52 	void Test(TInt aCheck);
       
    53 	void Error(TInt aWhere);
       
    54 	void DrawButton(const TRect &aRect, const TDesC &aText);
       
    55 	void Draw();
       
    56 	void SendEvent();
       
    57 	void SimulatePointerDownUp(const TRect& aRect);
       
    58 	inline TInt KeyCount() {return iKeyCount;}
       
    59 private:	
       
    60 	TInt iKeyCount;
       
    61 	TRect iKey1;
       
    62 	TRect iKey2;
       
    63 	TRect iKey3;
       
    64 	static TInt iTestScanCodes[ENumPntKeyTests];
       
    65 	static TUint iTestCodes[ENumPntKeyTests];
       
    66 	static TUint iTestModifiers[ENumPntKeyTests];
       
    67 	CTPntKey *iTest;
       
    68 	};
       
    69 	
       
    70 class CTPntKey : public CTWsGraphicsBase
       
    71 {
       
    72 private:
       
    73 	enum {KTimeOutAfter=60000000};	//60secs
       
    74 	
       
    75 public:
       
    76 	CTPntKey(CTestStep* aStep);
       
    77 	~CTPntKey();
       
    78 	void ConstructL();
       
    79 	static TInt TimeOut(TAny* aTest);
       
    80 	void TimeOut();
       
    81 	void Failed(TInt aWhere);
       
    82 	inline TBool NoDigitiser() const {return iNoDigitiser;}
       
    83 	
       
    84 protected:	//from CTGraphicsStep
       
    85 	virtual void RunTestCaseL(TInt aCurTestCase);
       
    86 	
       
    87 private:
       
    88 	inline TestClient *Client() {return TheClient;}
       
    89 	
       
    90 private:
       
    91 	CTimeOut* iTimeOut;
       
    92 	CTPntKeyWindow *iWin;
       
    93 	TSize iWinSize;
       
    94 	TInt iState;
       
    95 	TBool iFailed;
       
    96 	TBool iOldPointerState;
       
    97 	TBool iNoDigitiser;
       
    98 	};
       
    99 
       
   100 class CTPntKeyStep : public CTGraphicsStep
       
   101 	{
       
   102 public:
       
   103 	CTPntKeyStep();
       
   104 protected:	
       
   105 	//from CTGraphicsStep
       
   106 	virtual CTGraphicsBase* CreateTestL();
       
   107 	};
       
   108 
       
   109 _LIT(KTPntKeyStep,"TPntKey");
       
   110 
       
   111 
       
   112 #endif