os/graphics/windowing/windowserver/test/tauto/TMODCHG.H
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     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 __TMODCHG_H__
    24 #define __TMODCHG_H__
    25 
    26 #include <e32std.h>
    27 #include <e32svr.h>
    28 #include <w32std.h>
    29 #include "../tlib/testbase.h"
    30 #include "AUTO.H"
    31 #include "TGraphicsHarness.h"
    32 
    33 
    34 class CTModifiersChanged;
    35 
    36 class CMCWindow : public CTWin
    37 	{
    38 public:
    39 	CMCWindow(CTModifiersChanged *aTest);
    40 	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
    41 	void Draw();
    42 	void DrawModSetLine(const TDesC &aDes,TInt aModifier,TInt iSettableModifiers);
    43 protected:
    44 	CTModifiersChanged *iTest;
    45 	TRgb iBack;
    46 	TInt iLineHeight;
    47 	TInt iFontAscent;
    48 	TInt iYpos;
    49 	TInt iXpos1;
    50 	TInt iXpos2;
    51 	};
    52 
    53 class CTEventWindowGroup : public CTWindowGroup
    54 	{
    55 public:
    56 	CTEventWindowGroup(CTClient *aClient, CTModifiersChanged *iTest);
    57 	void ConstructL();
    58 	void ModifiersChanged(const TModifiersChangedEvent &aModifiersChanged ,const TTime &aTime);
    59 	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
    60 private:
    61 	CTModifiersChanged *iTest;	
    62 	};
    63 	
    64 class CTModifiersChanged : public CTWsGraphicsBase
    65 	{
    66 public:
    67 	CTModifiersChanged(CTestStep* aStep);
    68 	~CTModifiersChanged();
    69 	TestState DoTestL();
    70 	void ConstructL();
    71 	void EndTest();
    72 	TInt SubState() const;
    73 	void IncSubState();
    74 	void BadParams();
    75 	void ModifierChangedEventsL();
    76 	void SetModifiers();
    77 	void CheckModifier(TEventModifier aModifier);
    78 	void TestModifiersState(const TModifiersChangedEvent &aModifiersChanged);
    79 protected:
    80 //from 	CTGraphicsStep
    81 	virtual void RunTestCaseL(TInt aCurTestCase);
    82 private:
    83 	inline TestClient* Client() {return TheClient;}
    84 	void SendEvents();
    85 	void ResetModifiers();
    86 	static TInt TimeOut(TAny* aTest);
    87 	void TimeOut();
    88 public:
    89 	TBool iModSetTest;
    90 	TInt iSettable;
    91 private:
    92 	enum {KTimeOutAfter=30000000};	// 30 seconds (test takes 8 sec on h4)
    93 private:
    94 	TSize iWinSize;	
    95 	TInt iSubState;
    96 	CTEventWindowGroup *iEventGroup;
    97 	CMCWindow *iWin;
    98 	TBool iSkipFirstModifierEvents;
    99 	TInt iSkipCounter;
   100 	CTimeOut* iTimeOut;
   101 	TBool iSubSchedulerRunning;
   102 	};
   103 
   104 class CTModifiersChangedStep : public CTGraphicsStep
   105 	{
   106 public:
   107 	CTModifiersChangedStep();
   108 protected:	
   109 	//from CTGraphicsStep
   110 	virtual CTGraphicsBase* CreateTestL();
   111 	};
   112 
   113 _LIT(KTModifiersChangedStep,"TModifiersChanged");
   114 
   115 
   116 #endif