1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TPNTKEY.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,112 @@
1.4 +
1.5 +// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of "Eclipse Public License v1.0"
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +/**
1.21 + @file
1.22 + @test
1.23 + @internalComponent - Internal Symbian test code
1.24 +*/
1.25 +
1.26 +#ifndef __TPNTKEY_H__
1.27 +#define __TPNTKEY_H__
1.28 +
1.29 +#include <e32std.h>
1.30 +#include <hal.h>
1.31 +#include <w32std.h>
1.32 +#include "../tlib/testbase.h"
1.33 +#include "AUTO.H"
1.34 +#include "TGraphicsHarness.h"
1.35 +
1.36 +const TInt ENumPntKeyTests=6;
1.37 +const TUint EModifierMask=EModifierCtrl|EModifierShift|EModifierFunc;
1.38 +
1.39 +class CTPntKey;
1.40 +
1.41 +class CTPntKeyWindow : public CTWin
1.42 + {
1.43 +private:
1.44 + enum {KPointerMoveBufferSize=32};
1.45 +public:
1.46 + CTPntKeyWindow(CTPntKey *aTest);
1.47 + ~CTPntKeyWindow();
1.48 + void SetUpLD(TPoint pos,TSize size,CTWinBase *parent);
1.49 + void PointerL(const TPointerEvent &pointer,const TTime &aTime);
1.50 + void KeyUpL(const TKeyEvent &aKey,const TTime &);
1.51 + void KeyDownL(const TKeyEvent &aKey,const TTime &);
1.52 + void WinKeyL(const TKeyEvent &aKey,const TTime &);
1.53 + void SwitchOn(const TTime &aTime);
1.54 + void NextKey();
1.55 + void Test(TInt aCheck);
1.56 + void Error(TInt aWhere);
1.57 + void DrawButton(const TRect &aRect, const TDesC &aText);
1.58 + void Draw();
1.59 + void SendEvent();
1.60 + void SimulatePointerDownUp(const TRect& aRect);
1.61 + inline TInt KeyCount() {return iKeyCount;}
1.62 +private:
1.63 + TInt iKeyCount;
1.64 + TRect iKey1;
1.65 + TRect iKey2;
1.66 + TRect iKey3;
1.67 + static TInt iTestScanCodes[ENumPntKeyTests];
1.68 + static TUint iTestCodes[ENumPntKeyTests];
1.69 + static TUint iTestModifiers[ENumPntKeyTests];
1.70 + CTPntKey *iTest;
1.71 + };
1.72 +
1.73 +class CTPntKey : public CTWsGraphicsBase
1.74 +{
1.75 +private:
1.76 + enum {KTimeOutAfter=60000000}; //60secs
1.77 +
1.78 +public:
1.79 + CTPntKey(CTestStep* aStep);
1.80 + ~CTPntKey();
1.81 + void ConstructL();
1.82 + static TInt TimeOut(TAny* aTest);
1.83 + void TimeOut();
1.84 + void Failed(TInt aWhere);
1.85 + inline TBool NoDigitiser() const {return iNoDigitiser;}
1.86 +
1.87 +protected: //from CTGraphicsStep
1.88 + virtual void RunTestCaseL(TInt aCurTestCase);
1.89 +
1.90 +private:
1.91 + inline TestClient *Client() {return TheClient;}
1.92 +
1.93 +private:
1.94 + CTimeOut* iTimeOut;
1.95 + CTPntKeyWindow *iWin;
1.96 + TSize iWinSize;
1.97 + TInt iState;
1.98 + TBool iFailed;
1.99 + TBool iOldPointerState;
1.100 + TBool iNoDigitiser;
1.101 + };
1.102 +
1.103 +class CTPntKeyStep : public CTGraphicsStep
1.104 + {
1.105 +public:
1.106 + CTPntKeyStep();
1.107 +protected:
1.108 + //from CTGraphicsStep
1.109 + virtual CTGraphicsBase* CreateTestL();
1.110 + };
1.111 +
1.112 +_LIT(KTPntKeyStep,"TPntKey");
1.113 +
1.114 +
1.115 +#endif