First public contribution.
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
18 #include "T_DigitiserDriverData.h"
21 //These are attributes for the touch screen device
22 _LIT(KEnumPen, "EPen");
23 _LIT(KEnumPenX, "EPenX");
24 _LIT(KEnumPenY, "EPenY");
25 _LIT(KEnumPenState, "EPenState");
27 //These are attributes for the sound driver device
28 _LIT(KEnumPenClick, "EPenClick");
29 _LIT(KEnumPenClickVolumeMax, "EPenClickVolumeMax");
30 _LIT(KEnumPenClickState, "EPenClickState");
31 _LIT(KEnumPenClickVolume, "EPenClickVolume");
33 //These are the attributes for the power controller
34 _LIT(KEnumPenDisplayOn, "EPenDisplayOn");
36 //These are the attributes for the lcd screen device
37 _LIT(KEnumDisplayState, "EDisplayState");
38 _LIT(KEnumDisplayMode, "EDisplayMode");
40 //This represents a NULL attribute
43 const CT_HALData::THalTableLookup CT_DigitiserDriverData::iTableLookup[] =
46 * Enum as a descriptor Enum Prepare input Prepare paramters Validation of Store data returned after aFlag indicating
47 * value prior to prior to value returned successful HAL::Get or if validation
48 * HAL::Set call HAL::Get call after a successful HAL::Set call is mandatory
52 KEnumPen, HALData::EPen, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPen, ETrue,
53 KEnumPenState, HALData::EPenState, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenState, ETrue,
54 KEnumPenX, HALData::EPenX, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenX, ETrue,
55 KEnumPenY, HALData::EPenY, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenY, ETrue,
56 KEnumPenClick, HALData::EPenClick, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClick, ETrue,
57 KEnumPenClickVolumeMax, HALData::EPenClickVolumeMax, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClickVolumeMax, ETrue,
58 KEnumPenClickState, HALData::EPenClickState, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClickState, ETrue,
59 KEnumPenClickVolume, HALData::EPenClickVolume, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClickVolume, ETrue,
60 KEnumPenDisplayOn, HALData::EPenDisplayOn, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenDisplayOn, ETrue,
61 KEnumDisplayState, HALData::EDisplayState, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetDisplayState, ETrue,
62 KEnumDisplayMode, HALData::EDisplayMode, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetDisplayMode, EFalse,
63 KEnumNull, (HALData::TAttribute)0, NULL, NULL, NULL, NULL, NULL
66 //////////////////////////////////////////////////////////////////////
67 // Construction/Destruction
68 //////////////////////////////////////////////////////////////////////
70 CT_DigitiserDriverData* CT_DigitiserDriverData::NewL()
72 CT_DigitiserDriverData* digit=new (ELeave) CT_DigitiserDriverData();
73 CleanupStack::PushL(digit);
75 CleanupStack::Pop(digit);
80 CT_DigitiserDriverData::CT_DigitiserDriverData()
81 : CT_HALData(iTableLookup)
87 , iPenClickVolumeMax(-1)
89 , iPenClickVolume (-1)
96 void CT_DigitiserDriverData::ConstructL()
98 * Second phase construction
107 * @leave system wide error
113 CT_DigitiserDriverData::~CT_DigitiserDriverData()
120 TAny* CT_DigitiserDriverData::GetObject()
122 * Return a pointer to the object that the data wraps
124 * @return pointer to the object that the data wraps
130 TBool CT_DigitiserDriverData::GetPrepareDummy(CDataWrapperBase* /*aThis*/, const TDesC& /*aSection*/, TInt& /*aValueStart*/, TInt& /*aValueEnd*/)
132 * This a dummy place holder function that does nothing see HAL_Data
134 * @return a boolean value
141 void CT_DigitiserDriverData::SetPen(CDataWrapperBase* aThis, TInt aValue)
143 * Store whether the pen/digitiser is availabe for input
145 * @param aThis a pointer to the data wrapper base class
146 * @param aValue an integer value to use in set
150 static_cast<CT_DigitiserDriverData*>(aThis)->iPen=aValue;
153 void CT_DigitiserDriverData::SetPenX(CDataWrapperBase* aThis, TInt aValue)
156 * Store pen/digitiser horizontal resolution in pixels
158 * @param aThis a pointer to the data wrapper base class
159 * @param aValue an integer value to use in set
162 static_cast<CT_DigitiserDriverData*>(aThis)->iPenX=aValue;
165 void CT_DigitiserDriverData::SetPenY(CDataWrapperBase* aThis, TInt aValue)
167 * Store pen/digitiser vertical resolution in pixels
169 * @param aThis a pointer to the data wrapper base class
170 * @param aValue an integer value to use in set
174 static_cast<CT_DigitiserDriverData*>(aThis)->iPenY=aValue;
177 void CT_DigitiserDriverData::SetPenState(CDataWrapperBase* aThis, TInt aValue)
179 * Store Pen Clicking ability
181 * @param aThis a pointer to the data wrapper base class
182 * @param aValue an integer value to use in set
186 static_cast<CT_DigitiserDriverData*>(aThis)->iPenState=aValue;
189 void CT_DigitiserDriverData::SetPenClick(CDataWrapperBase* aThis, TInt aValue)
193 * @param aThis a pointer to the data wrapper base class
194 * @param aValue an integer value to use in set
197 static_cast<CT_DigitiserDriverData*>(aThis)->iPenClick=aValue;
200 void CT_DigitiserDriverData::SetPenClickVolumeMax(CDataWrapperBase* aThis, TInt aValue)
202 * Store maximum Pen Click Volume
204 * @param aThis a pointer to the data wrapper base class
205 * @param aValue an integer value to use in set
208 static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickVolumeMax=aValue;
211 void CT_DigitiserDriverData::SetPenClickState(CDataWrapperBase* aThis, TInt aValue)
213 * Store pen click state
215 * @param aThis a pointer to the data wrapper base class
216 * @param aValue an integer value to use in set
220 static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickState=aValue;
223 void CT_DigitiserDriverData::SetPenClickVolume(CDataWrapperBase* aThis, TInt aValue)
225 * Store pen click volume
227 * @param aThis a pointer to the data wrapper base class
228 * @param aValue an integer value to use in set
231 static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickVolume=aValue;
234 void CT_DigitiserDriverData::SetPenDisplayOn(CDataWrapperBase* aThis, TInt aValue)
236 * Store PenDisplay On
237 * @param aThis a pointer to the data wrapper base class
238 * @param aValue an integer value to use in set
242 static_cast<CT_DigitiserDriverData*>(aThis)->iPenDisplayOn=aValue;
245 void CT_DigitiserDriverData::SetDisplayState(CDataWrapperBase* aThis, TInt aValue)
248 * @param aThis a pointer to the data wrapper base class
249 * @param aValue an integer value to use in set
253 static_cast<CT_DigitiserDriverData*>(aThis)->iDisplayState=aValue;
256 void CT_DigitiserDriverData::SetDisplayMode(CDataWrapperBase* aThis, TInt aValue)
259 * @param aThis a pointer to the data wrapper base class
260 * @param aValue an integer value to use in set
264 static_cast<CT_DigitiserDriverData*>(aThis)->iDisplayMode=aValue;
267 TBool CT_DigitiserDriverData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
269 * Process a command read from the ini file
271 * @param aCommand The command to process
272 * @param aSection The section in the ini containing data for the command
273 * @param aAsyncErrorIndex Command index for async calls to return errors to
275 * @return ETrue if the command is processed
277 * @leave System wide error
281 ret=CT_HALData::DoCommandL(aCommand, aSection, aAsyncErrorIndex);