haitest/bspsvs/suite/bsp/keypad/inc/T_KeypadDriverData.h
changeset 0 cec860690d41
equal deleted inserted replaced
-1:000000000000 0:cec860690d41
       
     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_KEYPAD_DRIVER_DATA_H__)
       
    20 #define __T_KEYPAD_DRIVER_DATA_H__
       
    21 
       
    22 //	User Includes
       
    23 #include "T_HALData.h"
       
    24 #include "ActiveCallbackBase.h"
       
    25 
       
    26 //	Epoc Includes
       
    27 #include <e32twin.h>
       
    28 
       
    29 /**
       
    30  * Test Active Notification class
       
    31  *
       
    32  */
       
    33 class CT_KeypadDriverData : public CT_HALData
       
    34 	{
       
    35 public:
       
    36 	/**
       
    37 	* Public destructor
       
    38 	*/
       
    39 	~CT_KeypadDriverData();
       
    40 
       
    41 	/**
       
    42 	* Two phase constructor
       
    43 	*
       
    44 	* @leave	system wide error
       
    45 	*/
       
    46 	static	CT_KeypadDriverData*	NewL();
       
    47 
       
    48 	virtual TAny*	GetObject();
       
    49 	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
       
    50    
       
    51 protected:
       
    52 	/**
       
    53 	* Protected constructor. First phase construction
       
    54 	*/
       
    55 	CT_KeypadDriverData();
       
    56 
       
    57 	void	ConstructL();
       
    58 
       
    59 	static TBool	GetPrepareNothing(CDataWrapperBase* aThis, const TDesC& aSection, TInt& aValueStart, TInt& aValueEnd);
       
    60 
       
    61 	static void		SetKeyboardState(CDataWrapperBase* aThis, TInt aValue);
       
    62 	static void		SetKeyboard(CDataWrapperBase* aThis, TInt aValue);
       
    63 	static void		SetKeyboardDeviceKeys(CDataWrapperBase* aThis, TInt aValue);
       
    64 	static void		SetKeyboardAppKeys(CDataWrapperBase* aThis, TInt aValue);
       
    65 	static void		SetKeyboardClick(CDataWrapperBase* aThis, TInt aValue);
       
    66 	static void		SetKeyboardClickVolumeMax(CDataWrapperBase* aThis, TInt aValue);
       
    67 	static void		SetKeyboardClickState(CDataWrapperBase* aThis, TInt aValue);
       
    68 	static void		SetKeyboardClickVolume(CDataWrapperBase* aThis, TInt aValue);
       
    69 
       
    70 private: 
       
    71 
       
    72 	void			DoCmdGetScanCodesL(const TDesC& aSection);
       
    73 	void			DoCmdGetModifiersL(const TDesC& aSection);
       
    74 	void			DoCmdTestAllKeysL(const TInt aAsyncErrorIndex);
       
    75 	void			DoCmdTestOneModifierOneOtherKeyL(const TDesC& aSection, const TInt aAsyncErrorIndex);
       
    76 	void			DoCmdTestTwoKeysL(const TDesC& aSection, const TInt aAsyncErrorIndex);
       
    77 	void			DoCmdTestMultipleKeysL(const TDesC& aSection, const TInt aAsyncErrorIndex);
       
    78 	void			DoCmdVerifyKeypadState(const TDesC& aSection, const TInt aAsyncErrorIndex);
       
    79 	void			DoCmdPromptUser(const TDesC& aSection, const TInt aAsyncErrorIndex);
       
    80 	void 			DoCancel(CActive* aActive, TInt aIndex); 			// cancel the request
       
    81 	void 			RunL(CActive* aActive, TInt aIndex);				// handle completed request
       
    82 
       
    83 	//utility functions
       
    84  	void			ProcessResults();
       
    85 
       
    86 protected:
       
    87 	TInt							iKeyboardState;
       
    88 	TInt							iKeyboard;
       
    89 	TInt							iKeyboardDeviceKeys;
       
    90 	TInt							iKeyboardAppKeys;
       
    91 	TInt							iKeyboardClick;
       
    92 	TInt							iKeyboardClickVolumeMax;
       
    93 	TInt							iKeyboardClickState;
       
    94 	TInt							iKeyboardClickVolume;
       
    95 	CActiveCallback*				iActiveKey;
       
    96 	CActiveCallback*				iActiveCombination;
       
    97 	CActiveCallbackBase*			iActiveKeypadState;
       
    98 	CActiveCallback*				iActivePrompt;
       
    99 	TInt							iExpectedState;
       
   100 	TInt							iKeyCount;
       
   101 	TInt							iCombinationCount;
       
   102 	TInt							iCombinationKeyCount;
       
   103 	TBool							iFailTest;
       
   104 	TPtrC							iUserPromptStr;
       
   105 	TPtrC							iPassKeyStr;
       
   106 	TInt							iPassKey;
       
   107 
       
   108 
       
   109 private:	
       
   110 	RConsole						iConsole;
       
   111 	TConsoleKey						iKey;
       
   112 	static const TEnumEntryTable	iEnumTableScanCodes[];
       
   113 	static const TEnumEntryTable	iEnumTableCoverage[];
       
   114 	static const THalTableLookup	iTableLookup[];
       
   115 	RArray<TPtrC>					iPossibleScanCodeStrStore;
       
   116 	RArray<TInt>					iPossibleScanCodeStore;
       
   117 	RArray<TPtrC>					iPossibleModifierStrStore;
       
   118 	RArray<TInt>					iPossibleModifierStore;
       
   119 	RArray<TPtrC>					iAllPossibleKeysStrStore;
       
   120 	RArray<TInt>					iAllPossibleKeysStore;
       
   121 	RArray<TIniDataName>			iCombinationStrStore;
       
   122 	RArray<TInt>					iExpectedStore;
       
   123 	RArray<TInt>					iActualStore;
       
   124 	RArray<TInt>					iEventStore;
       
   125 	};
       
   126 
       
   127 #endif /* __T_KEYPAD_DRIVER_DATA_H__ */