os/boardsupport/haitest/bspsvs/suite/e32/inc/T_ActiveRConsoleRead.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2005-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 
    19 #if (!defined __T_ACTIVE_R_CONSOLE_READ_H__)
    20 #define __T_ACTIVE_R_CONSOLE_READ_H__
    21 
    22 //	EPOC includes
    23 #include <e32twin.h>
    24 #include <e32keys.h> 
    25 
    26 //	User Includes
    27 #include "DataWrapperBase.h"
    28 #include "ActiveCallbackBase.h"
    29 #include "DrawUtils.h"
    30  
    31 class CT_ActiveRConsoleRead : public CActiveCallbackBase
    32 
    33 /**
    34 * Test Active Notification class
    35 @test
    36 @publishedPartner
    37 @see CActiveCallbackBase
    38 */
    39 	{
    40 protected:
    41 	enum TEventOccurance
    42 		{
    43 		EEventOccuranceOnce,
    44 		EEventOccuranceZeroOrMore,
    45 		EEventOccuranceOneOrMore,
    46 		};
    47 
    48 	struct TEventConfig
    49 		{
    50 		TInt			iEventType;
    51 		TEventOccurance	iEventOccurance;
    52 		TBool			iDataVerify;
    53 		TBool			iDataDraw;
    54 		};
    55 
    56 public:
    57 	/**
    58 	* Public  destructor
    59 	*/
    60 	static	CT_ActiveRConsoleRead*	NewL(CDataWrapperBase& aDataWrapperBase);
    61 	~CT_ActiveRConsoleRead();
    62 	TBool	KickStartL (const TDesC& aSection, const TInt aAsyncErrorIndex,RConsole& aConsole);
    63 	TBool	VerifyDataAndKick(const TInt aAsyncErrorIndex, RConsole& aConsole);
    64 	TConsoleKey	GetConsoleKey();
    65 	
    66 	
    67 	 		
    68 protected:
    69 	CT_ActiveRConsoleRead(CDataWrapperBase& aDataWrapperBase);	
    70 	void 	DestroyData();
    71 	TBool	ExitEvent();
    72 	void	DrawData();
    73 
    74 private:
    75 	TBool	KickNext(const TInt aAsyncErrorIndex, RConsole& aConsole);
    76 	void	Kick (const TInt aAsyncErrorIndex, RConsole& aConsole);
    77 
    78 private:
    79    	TPtrC	iSection;
    80     TUint8	iColourValueBlack;
    81     TUint8	iColourValueWhite;
    82     TInt	iEventIndex;
    83     TInt	iEventCount;
    84     TInt	iTimeOut;
    85     TInt	iErrorMargin;
    86     TBool	iHasExitKeyCode;
    87     TBool	iHasExitRectangle;
    88     TInt	iExitKeyCode;
    89     TRect	iExitRectangle;
    90 	TInt	iTestIndex;
    91 	TInt	iNumberOfTests;
    92 
    93 	TBool	iHasExpectedKeyCode;
    94 	TBool	iHasExpectedRectangle;
    95     TInt	iExpectedKeyCode;
    96     TRect	iExpectedRectangle;
    97 
    98     RArray<TEventConfig>	iEvent;
    99     TEventConfig 			iExpectedConfig;
   100     TConsoleKey             iKey;
   101  
   102 
   103    
   104     static const CDataWrapperBase::TEnumEntryTable	iEnumRawEventTable[];
   105 	static const CDataWrapperBase::TEnumEntryTable	iEnumKeyCodeTable[];
   106 	static const CDataWrapperBase::TEnumEntryTable	iEnumEventOccuranceTable[];
   107 	};
   108  
   109 #endif /*__T_ACTIVE_R_CONSOLE_READ_H__ */