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.
sl@0
     1
sl@0
     2
// Copyright (c) 1996-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
// All rights reserved.
sl@0
     4
// This component and the accompanying materials are made available
sl@0
     5
// under the terms of "Eclipse Public License v1.0"
sl@0
     6
// which accompanies this distribution, and is available
sl@0
     7
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
//
sl@0
     9
// Initial Contributors:
sl@0
    10
// Nokia Corporation - initial contribution.
sl@0
    11
//
sl@0
    12
// Contributors:
sl@0
    13
//
sl@0
    14
// Description:
sl@0
    15
//
sl@0
    16
sl@0
    17
/**
sl@0
    18
 @file
sl@0
    19
 @test
sl@0
    20
 @internalComponent - Internal Symbian test code
sl@0
    21
*/
sl@0
    22
sl@0
    23
#ifndef __TMODCHG_H__
sl@0
    24
#define __TMODCHG_H__
sl@0
    25
sl@0
    26
#include <e32std.h>
sl@0
    27
#include <e32svr.h>
sl@0
    28
#include <w32std.h>
sl@0
    29
#include "../tlib/testbase.h"
sl@0
    30
#include "AUTO.H"
sl@0
    31
#include "TGraphicsHarness.h"
sl@0
    32
sl@0
    33
sl@0
    34
class CTModifiersChanged;
sl@0
    35
sl@0
    36
class CMCWindow : public CTWin
sl@0
    37
	{
sl@0
    38
public:
sl@0
    39
	CMCWindow(CTModifiersChanged *aTest);
sl@0
    40
	void SetUpL(TPoint pos,TSize size,CTWinBase *parent, CWindowGc &aGc);
sl@0
    41
	void Draw();
sl@0
    42
	void DrawModSetLine(const TDesC &aDes,TInt aModifier,TInt iSettableModifiers);
sl@0
    43
protected:
sl@0
    44
	CTModifiersChanged *iTest;
sl@0
    45
	TRgb iBack;
sl@0
    46
	TInt iLineHeight;
sl@0
    47
	TInt iFontAscent;
sl@0
    48
	TInt iYpos;
sl@0
    49
	TInt iXpos1;
sl@0
    50
	TInt iXpos2;
sl@0
    51
	};
sl@0
    52
sl@0
    53
class CTEventWindowGroup : public CTWindowGroup
sl@0
    54
	{
sl@0
    55
public:
sl@0
    56
	CTEventWindowGroup(CTClient *aClient, CTModifiersChanged *iTest);
sl@0
    57
	void ConstructL();
sl@0
    58
	void ModifiersChanged(const TModifiersChangedEvent &aModifiersChanged ,const TTime &aTime);
sl@0
    59
	void KeyL(const TKeyEvent &aKey,const TTime &aTime);
sl@0
    60
private:
sl@0
    61
	CTModifiersChanged *iTest;	
sl@0
    62
	};
sl@0
    63
	
sl@0
    64
class CTModifiersChanged : public CTWsGraphicsBase
sl@0
    65
	{
sl@0
    66
public:
sl@0
    67
	CTModifiersChanged(CTestStep* aStep);
sl@0
    68
	~CTModifiersChanged();
sl@0
    69
	TestState DoTestL();
sl@0
    70
	void ConstructL();
sl@0
    71
	void EndTest();
sl@0
    72
	TInt SubState() const;
sl@0
    73
	void IncSubState();
sl@0
    74
	void BadParams();
sl@0
    75
	void ModifierChangedEventsL();
sl@0
    76
	void SetModifiers();
sl@0
    77
	void CheckModifier(TEventModifier aModifier);
sl@0
    78
	void TestModifiersState(const TModifiersChangedEvent &aModifiersChanged);
sl@0
    79
protected:
sl@0
    80
//from 	CTGraphicsStep
sl@0
    81
	virtual void RunTestCaseL(TInt aCurTestCase);
sl@0
    82
private:
sl@0
    83
	inline TestClient* Client() {return TheClient;}
sl@0
    84
	void SendEvents();
sl@0
    85
	void ResetModifiers();
sl@0
    86
	static TInt TimeOut(TAny* aTest);
sl@0
    87
	void TimeOut();
sl@0
    88
public:
sl@0
    89
	TBool iModSetTest;
sl@0
    90
	TInt iSettable;
sl@0
    91
private:
sl@0
    92
	enum {KTimeOutAfter=30000000};	// 30 seconds (test takes 8 sec on h4)
sl@0
    93
private:
sl@0
    94
	TSize iWinSize;	
sl@0
    95
	TInt iSubState;
sl@0
    96
	CTEventWindowGroup *iEventGroup;
sl@0
    97
	CMCWindow *iWin;
sl@0
    98
	TBool iSkipFirstModifierEvents;
sl@0
    99
	TInt iSkipCounter;
sl@0
   100
	CTimeOut* iTimeOut;
sl@0
   101
	TBool iSubSchedulerRunning;
sl@0
   102
	};
sl@0
   103
sl@0
   104
class CTModifiersChangedStep : public CTGraphicsStep
sl@0
   105
	{
sl@0
   106
public:
sl@0
   107
	CTModifiersChangedStep();
sl@0
   108
protected:	
sl@0
   109
	//from CTGraphicsStep
sl@0
   110
	virtual CTGraphicsBase* CreateTestL();
sl@0
   111
	};
sl@0
   112
sl@0
   113
_LIT(KTModifiersChangedStep,"TModifiersChanged");
sl@0
   114
sl@0
   115
sl@0
   116
#endif