1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/graphics/windowing/windowserver/test/tauto/TMODCHG.H Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,116 @@
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 __TMODCHG_H__
1.27 +#define __TMODCHG_H__
1.28 +
1.29 +#include <e32std.h>
1.30 +#include <e32svr.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 +
1.37 +class CTModifiersChanged;
1.38 +
1.39 +class CMCWindow : public CTWin
1.40 + {
1.41 +public:
1.42 + CMCWindow(CTModifiersChanged *aTest);
1.43 + void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
1.44 + void Draw();
1.45 + void DrawModSetLine(const TDesC &aDes,TInt aModifier,TInt iSettableModifiers);
1.46 +protected:
1.47 + CTModifiersChanged *iTest;
1.48 + TRgb iBack;
1.49 + TInt iLineHeight;
1.50 + TInt iFontAscent;
1.51 + TInt iYpos;
1.52 + TInt iXpos1;
1.53 + TInt iXpos2;
1.54 + };
1.55 +
1.56 +class CTEventWindowGroup : public CTWindowGroup
1.57 + {
1.58 +public:
1.59 + CTEventWindowGroup(CTClient *aClient, CTModifiersChanged *iTest);
1.60 + void ConstructL();
1.61 + void ModifiersChanged(const TModifiersChangedEvent &aModifiersChanged ,const TTime &aTime);
1.62 + void KeyL(const TKeyEvent &aKey,const TTime &aTime);
1.63 +private:
1.64 + CTModifiersChanged *iTest;
1.65 + };
1.66 +
1.67 +class CTModifiersChanged : public CTWsGraphicsBase
1.68 + {
1.69 +public:
1.70 + CTModifiersChanged(CTestStep* aStep);
1.71 + ~CTModifiersChanged();
1.72 + TestState DoTestL();
1.73 + void ConstructL();
1.74 + void EndTest();
1.75 + TInt SubState() const;
1.76 + void IncSubState();
1.77 + void BadParams();
1.78 + void ModifierChangedEventsL();
1.79 + void SetModifiers();
1.80 + void CheckModifier(TEventModifier aModifier);
1.81 + void TestModifiersState(const TModifiersChangedEvent &aModifiersChanged);
1.82 +protected:
1.83 +//from CTGraphicsStep
1.84 + virtual void RunTestCaseL(TInt aCurTestCase);
1.85 +private:
1.86 + inline TestClient* Client() {return TheClient;}
1.87 + void SendEvents();
1.88 + void ResetModifiers();
1.89 + static TInt TimeOut(TAny* aTest);
1.90 + void TimeOut();
1.91 +public:
1.92 + TBool iModSetTest;
1.93 + TInt iSettable;
1.94 +private:
1.95 + enum {KTimeOutAfter=30000000}; // 30 seconds (test takes 8 sec on h4)
1.96 +private:
1.97 + TSize iWinSize;
1.98 + TInt iSubState;
1.99 + CTEventWindowGroup *iEventGroup;
1.100 + CMCWindow *iWin;
1.101 + TBool iSkipFirstModifierEvents;
1.102 + TInt iSkipCounter;
1.103 + CTimeOut* iTimeOut;
1.104 + TBool iSubSchedulerRunning;
1.105 + };
1.106 +
1.107 +class CTModifiersChangedStep : public CTGraphicsStep
1.108 + {
1.109 +public:
1.110 + CTModifiersChangedStep();
1.111 +protected:
1.112 + //from CTGraphicsStep
1.113 + virtual CTGraphicsBase* CreateTestL();
1.114 + };
1.115 +
1.116 +_LIT(KTModifiersChangedStep,"TModifiersChanged");
1.117 +
1.118 +
1.119 +#endif