os/boardsupport/haitest/bspsvs/suite/hal/inc/T_HALData.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_HAL_DATA_H__)
    20 #define __T_HAL_DATA_H__
    21 
    22 
    23 //	User Includes
    24 #include "DataWrapperBase.h"
    25 
    26 //	EPOC Includes
    27 #include <hal.h>
    28 
    29 typedef	TBool (*THalFunctionSetPrepare)(CDataWrapperBase* aDataWrapper, const TDesC& aSectName, TInt& aValue);
    30 typedef	TBool (*THalFunctionGetPrepare)(CDataWrapperBase* aDataWrapper, const TDesC& aSectName, TInt& aValueStart, TInt& aValueEnd);
    31 typedef	void (*THalFunctionGetValidation)(CDataWrapperBase* aDataWrapper, const TDesC& aSectName, TInt aValue, TBool aForceValidation);
    32 typedef	void (*THalFunctionStore)(CDataWrapperBase* aDataWrapper, TInt aValue);
    33 
    34 /**
    35  * Test Active Notification class
    36  *
    37  */
    38 class CT_HALData : public CDataWrapperBase
    39 	{
    40 public:
    41 	struct THalTableLookup
    42 		{
    43 		const TDesC&				iHalString;
    44 		HALData::TAttribute			iHalAttribute;
    45 		THalFunctionSetPrepare		iHalFunctionSetPrepare;
    46 		THalFunctionGetPrepare		iHalFunctionGetPrepare;
    47 		THalFunctionGetValidation	iHalFunctionGetValidation;
    48 		THalFunctionStore			iHalFunctionStore;
    49 		TBool						iHalForceValidation;
    50 		};
    51 
    52 public:
    53 	CT_HALData(const THalTableLookup* aTable);
    54 	~CT_HALData();
    55 
    56 	virtual TAny*	GetObject();
    57 	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
    58 
    59 	static void		GetValidationBool(CDataWrapperBase* aThis, const TDesC& aSection, TInt aValue, TBool aForceValidation);
    60 	static void		GetValidationInt(CDataWrapperBase* aThis, const TDesC& aSection, TInt aValue, TBool aForceValidation);
    61 	static void		GetValidationUint(CDataWrapperBase* aThis, const TDesC& aSection, TInt aValue, TBool aForceValidation);
    62 
    63 	static TBool	SetPrepareInt(CDataWrapperBase* aThis, const TDesC& aSection, TInt& aValue);
    64 	static TBool	SetPrepareUint(CDataWrapperBase* aThis, const TDesC& aSection, TInt& aValue);
    65 
    66 protected:
    67 	const THalTableLookup*		LookUp(const TDesC& aValue);
    68 
    69 private:
    70 	TInt	DoCmdSet(const TDesC& aSection);
    71 	TInt	DoCmdGet(const TDesC& aSection);
    72 
    73 protected:
    74 	const THalTableLookup*	iTable;
    75 	TInt					iValue;
    76 	};
    77 
    78 #endif /* __T_HAL_DATA_H__ */