1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/boardsupport/haitest/bspsvs/suite/bsp/digitiser/src/T_DigitiserDriverData.cpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,284 @@
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 +#include "T_DigitiserDriverData.h"
1.22 +
1.23 +
1.24 +//These are attributes for the touch screen device
1.25 +_LIT(KEnumPen, "EPen");
1.26 +_LIT(KEnumPenX, "EPenX");
1.27 +_LIT(KEnumPenY, "EPenY");
1.28 +_LIT(KEnumPenState, "EPenState");
1.29 +
1.30 +//These are attributes for the sound driver device
1.31 +_LIT(KEnumPenClick, "EPenClick");
1.32 +_LIT(KEnumPenClickVolumeMax, "EPenClickVolumeMax");
1.33 +_LIT(KEnumPenClickState, "EPenClickState");
1.34 +_LIT(KEnumPenClickVolume, "EPenClickVolume");
1.35 +
1.36 +//These are the attributes for the power controller
1.37 + _LIT(KEnumPenDisplayOn, "EPenDisplayOn");
1.38 +
1.39 + //These are the attributes for the lcd screen device
1.40 + _LIT(KEnumDisplayState, "EDisplayState");
1.41 + _LIT(KEnumDisplayMode, "EDisplayMode");
1.42 +
1.43 + //This represents a NULL attribute
1.44 +_LIT(KEnumNull, "");
1.45 +
1.46 +const CT_HALData::THalTableLookup CT_DigitiserDriverData::iTableLookup[] =
1.47 + {
1.48 +/**
1.49 +* Enum as a descriptor Enum Prepare input Prepare paramters Validation of Store data returned after aFlag indicating
1.50 +* value prior to prior to value returned successful HAL::Get or if validation
1.51 +* HAL::Set call HAL::Get call after a successful HAL::Set call is mandatory
1.52 +* HAL::Get call
1.53 +*/
1.54 +
1.55 + KEnumPen, HALData::EPen, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPen, ETrue,
1.56 + KEnumPenState, HALData::EPenState, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenState, ETrue,
1.57 + KEnumPenX, HALData::EPenX, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenX, ETrue,
1.58 + KEnumPenY, HALData::EPenY, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenY, ETrue,
1.59 + KEnumPenClick, HALData::EPenClick, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClick, ETrue,
1.60 + KEnumPenClickVolumeMax, HALData::EPenClickVolumeMax, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClickVolumeMax, ETrue,
1.61 + KEnumPenClickState, HALData::EPenClickState, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClickState, ETrue,
1.62 + KEnumPenClickVolume, HALData::EPenClickVolume, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClickVolume, ETrue,
1.63 + KEnumPenDisplayOn, HALData::EPenDisplayOn, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenDisplayOn, ETrue,
1.64 + KEnumDisplayState, HALData::EDisplayState, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetDisplayState, ETrue,
1.65 + KEnumDisplayMode, HALData::EDisplayMode, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetDisplayMode, EFalse,
1.66 + KEnumNull, (HALData::TAttribute)0, NULL, NULL, NULL, NULL, NULL
1.67 + };
1.68 +
1.69 +//////////////////////////////////////////////////////////////////////
1.70 +// Construction/Destruction
1.71 +//////////////////////////////////////////////////////////////////////
1.72 +
1.73 +CT_DigitiserDriverData* CT_DigitiserDriverData::NewL()
1.74 + {
1.75 + CT_DigitiserDriverData* digit=new (ELeave) CT_DigitiserDriverData();
1.76 + CleanupStack::PushL(digit);
1.77 + digit->ConstructL();
1.78 + CleanupStack::Pop(digit);
1.79 + return digit;
1.80 + }
1.81 +
1.82 +
1.83 +CT_DigitiserDriverData::CT_DigitiserDriverData()
1.84 +: CT_HALData(iTableLookup)
1.85 +, iPenState(-1)
1.86 +, iPen(-1)
1.87 +, iPenX(-1)
1.88 +, iPenY(-1)
1.89 +, iPenClick(-1)
1.90 +, iPenClickVolumeMax(-1)
1.91 +, iPenClickState(-1)
1.92 +, iPenClickVolume (-1)
1.93 +, iPenDisplayOn(-1)
1.94 +, iDisplayState(-1)
1.95 +, iDisplayMode(-1)
1.96 + {
1.97 + }
1.98 +
1.99 +void CT_DigitiserDriverData::ConstructL()
1.100 +/**
1.101 + * Second phase construction
1.102 + *
1.103 + * @internalComponent
1.104 + *
1.105 + * @return N/A
1.106 + *
1.107 + * @pre None
1.108 + * @post None
1.109 + *
1.110 + * @leave system wide error
1.111 + */
1.112 + {
1.113 +
1.114 + }
1.115 +
1.116 +CT_DigitiserDriverData::~CT_DigitiserDriverData()
1.117 +/**
1.118 + * Public destructor
1.119 + */
1.120 + {
1.121 + }
1.122 +
1.123 +TAny* CT_DigitiserDriverData::GetObject()
1.124 +/**
1.125 + * Return a pointer to the object that the data wraps
1.126 + *
1.127 + * @return pointer to the object that the data wraps
1.128 + */
1.129 + {
1.130 + return NULL;
1.131 + }
1.132 +
1.133 +TBool CT_DigitiserDriverData::GetPrepareDummy(CDataWrapperBase* /*aThis*/, const TDesC& /*aSection*/, TInt& /*aValueStart*/, TInt& /*aValueEnd*/)
1.134 +/**
1.135 + * This a dummy place holder function that does nothing see HAL_Data
1.136 + *
1.137 + * @return a boolean value
1.138 + *
1.139 + */
1.140 + {
1.141 + return ETrue;
1.142 + }
1.143 +
1.144 +void CT_DigitiserDriverData::SetPen(CDataWrapperBase* aThis, TInt aValue)
1.145 +/**
1.146 + * Store whether the pen/digitiser is availabe for input
1.147 + *
1.148 + * @param aThis a pointer to the data wrapper base class
1.149 + * @param aValue an integer value to use in set
1.150 + *
1.151 + */
1.152 + {
1.153 + static_cast<CT_DigitiserDriverData*>(aThis)->iPen=aValue;
1.154 + }
1.155 +
1.156 +void CT_DigitiserDriverData::SetPenX(CDataWrapperBase* aThis, TInt aValue)
1.157 + /**
1.158 + *
1.159 + * Store pen/digitiser horizontal resolution in pixels
1.160 + *
1.161 + * @param aThis a pointer to the data wrapper base class
1.162 + * @param aValue an integer value to use in set
1.163 + */
1.164 + {
1.165 + static_cast<CT_DigitiserDriverData*>(aThis)->iPenX=aValue;
1.166 + }
1.167 +
1.168 + void CT_DigitiserDriverData::SetPenY(CDataWrapperBase* aThis, TInt aValue)
1.169 + /**
1.170 + * Store pen/digitiser vertical resolution in pixels
1.171 + *
1.172 + * @param aThis a pointer to the data wrapper base class
1.173 + * @param aValue an integer value to use in set
1.174 + *
1.175 + */
1.176 + {
1.177 + static_cast<CT_DigitiserDriverData*>(aThis)->iPenY=aValue;
1.178 + }
1.179 +
1.180 +void CT_DigitiserDriverData::SetPenState(CDataWrapperBase* aThis, TInt aValue)
1.181 + /**
1.182 + * Store Pen Clicking ability
1.183 + *
1.184 + * @param aThis a pointer to the data wrapper base class
1.185 + * @param aValue an integer value to use in set
1.186 + *
1.187 + */
1.188 + {
1.189 + static_cast<CT_DigitiserDriverData*>(aThis)->iPenState=aValue;
1.190 + }
1.191 +
1.192 +void CT_DigitiserDriverData::SetPenClick(CDataWrapperBase* aThis, TInt aValue)
1.193 + /**
1.194 + * Store Pen Click
1.195 + *
1.196 + * @param aThis a pointer to the data wrapper base class
1.197 + * @param aValue an integer value to use in set
1.198 + */
1.199 + {
1.200 + static_cast<CT_DigitiserDriverData*>(aThis)->iPenClick=aValue;
1.201 + }
1.202 +
1.203 +void CT_DigitiserDriverData::SetPenClickVolumeMax(CDataWrapperBase* aThis, TInt aValue)
1.204 + /**
1.205 + * Store maximum Pen Click Volume
1.206 + *
1.207 + * @param aThis a pointer to the data wrapper base class
1.208 + * @param aValue an integer value to use in set
1.209 + */
1.210 + {
1.211 + static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickVolumeMax=aValue;
1.212 + }
1.213 +
1.214 +void CT_DigitiserDriverData::SetPenClickState(CDataWrapperBase* aThis, TInt aValue)
1.215 + /**
1.216 + * Store pen click state
1.217 + *
1.218 + * @param aThis a pointer to the data wrapper base class
1.219 + * @param aValue an integer value to use in set
1.220 + *
1.221 + */
1.222 + {
1.223 + static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickState=aValue;
1.224 + }
1.225 +
1.226 +void CT_DigitiserDriverData::SetPenClickVolume(CDataWrapperBase* aThis, TInt aValue)
1.227 + /**
1.228 + * Store pen click volume
1.229 + *
1.230 + * @param aThis a pointer to the data wrapper base class
1.231 + * @param aValue an integer value to use in set
1.232 + */
1.233 + {
1.234 + static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickVolume=aValue;
1.235 + }
1.236 +
1.237 +void CT_DigitiserDriverData::SetPenDisplayOn(CDataWrapperBase* aThis, TInt aValue)
1.238 + /**
1.239 + * Store PenDisplay On
1.240 + * @param aThis a pointer to the data wrapper base class
1.241 + * @param aValue an integer value to use in set
1.242 + *
1.243 + */
1.244 + {
1.245 + static_cast<CT_DigitiserDriverData*>(aThis)->iPenDisplayOn=aValue;
1.246 + }
1.247 +
1.248 +void CT_DigitiserDriverData::SetDisplayState(CDataWrapperBase* aThis, TInt aValue)
1.249 + /**
1.250 + * Store DisplayState
1.251 + * @param aThis a pointer to the data wrapper base class
1.252 + * @param aValue an integer value to use in set
1.253 + *
1.254 + */
1.255 + {
1.256 + static_cast<CT_DigitiserDriverData*>(aThis)->iDisplayState=aValue;
1.257 + }
1.258 +
1.259 + void CT_DigitiserDriverData::SetDisplayMode(CDataWrapperBase* aThis, TInt aValue)
1.260 + /**
1.261 + * Store DisplayMode
1.262 + * @param aThis a pointer to the data wrapper base class
1.263 + * @param aValue an integer value to use in set
1.264 + *
1.265 + */
1.266 + {
1.267 + static_cast<CT_DigitiserDriverData*>(aThis)->iDisplayMode=aValue;
1.268 + }
1.269 +
1.270 +TBool CT_DigitiserDriverData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
1.271 +/**
1.272 + * Process a command read from the ini file
1.273 + *
1.274 + * @param aCommand The command to process
1.275 + * @param aSection The section in the ini containing data for the command
1.276 + * @param aAsyncErrorIndex Command index for async calls to return errors to
1.277 + *
1.278 + * @return ETrue if the command is processed
1.279 + *
1.280 + * @leave System wide error
1.281 + */
1.282 + {
1.283 + TBool ret=ETrue;
1.284 + ret=CT_HALData::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
1.285 + return ret;
1.286 + }
1.287 +