os/boardsupport/haitest/bspsvs/suite/hal/inc/T_HALData.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/boardsupport/haitest/bspsvs/suite/hal/inc/T_HALData.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,78 @@
     1.4 +/*
     1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#if (!defined __T_HAL_DATA_H__)
    1.23 +#define __T_HAL_DATA_H__
    1.24 +
    1.25 +
    1.26 +//	User Includes
    1.27 +#include "DataWrapperBase.h"
    1.28 +
    1.29 +//	EPOC Includes
    1.30 +#include <hal.h>
    1.31 +
    1.32 +typedef	TBool (*THalFunctionSetPrepare)(CDataWrapperBase* aDataWrapper, const TDesC& aSectName, TInt& aValue);
    1.33 +typedef	TBool (*THalFunctionGetPrepare)(CDataWrapperBase* aDataWrapper, const TDesC& aSectName, TInt& aValueStart, TInt& aValueEnd);
    1.34 +typedef	void (*THalFunctionGetValidation)(CDataWrapperBase* aDataWrapper, const TDesC& aSectName, TInt aValue, TBool aForceValidation);
    1.35 +typedef	void (*THalFunctionStore)(CDataWrapperBase* aDataWrapper, TInt aValue);
    1.36 +
    1.37 +/**
    1.38 + * Test Active Notification class
    1.39 + *
    1.40 + */
    1.41 +class CT_HALData : public CDataWrapperBase
    1.42 +	{
    1.43 +public:
    1.44 +	struct THalTableLookup
    1.45 +		{
    1.46 +		const TDesC&				iHalString;
    1.47 +		HALData::TAttribute			iHalAttribute;
    1.48 +		THalFunctionSetPrepare		iHalFunctionSetPrepare;
    1.49 +		THalFunctionGetPrepare		iHalFunctionGetPrepare;
    1.50 +		THalFunctionGetValidation	iHalFunctionGetValidation;
    1.51 +		THalFunctionStore			iHalFunctionStore;
    1.52 +		TBool						iHalForceValidation;
    1.53 +		};
    1.54 +
    1.55 +public:
    1.56 +	CT_HALData(const THalTableLookup* aTable);
    1.57 +	~CT_HALData();
    1.58 +
    1.59 +	virtual TAny*	GetObject();
    1.60 +	virtual TBool	DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex);
    1.61 +
    1.62 +	static void		GetValidationBool(CDataWrapperBase* aThis, const TDesC& aSection, TInt aValue, TBool aForceValidation);
    1.63 +	static void		GetValidationInt(CDataWrapperBase* aThis, const TDesC& aSection, TInt aValue, TBool aForceValidation);
    1.64 +	static void		GetValidationUint(CDataWrapperBase* aThis, const TDesC& aSection, TInt aValue, TBool aForceValidation);
    1.65 +
    1.66 +	static TBool	SetPrepareInt(CDataWrapperBase* aThis, const TDesC& aSection, TInt& aValue);
    1.67 +	static TBool	SetPrepareUint(CDataWrapperBase* aThis, const TDesC& aSection, TInt& aValue);
    1.68 +
    1.69 +protected:
    1.70 +	const THalTableLookup*		LookUp(const TDesC& aValue);
    1.71 +
    1.72 +private:
    1.73 +	TInt	DoCmdSet(const TDesC& aSection);
    1.74 +	TInt	DoCmdGet(const TDesC& aSection);
    1.75 +
    1.76 +protected:
    1.77 +	const THalTableLookup*	iTable;
    1.78 +	TInt					iValue;
    1.79 +	};
    1.80 +
    1.81 +#endif /* __T_HAL_DATA_H__ */