sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
#include "T_DigitiserDriverData.h"
|
sl@0
|
19 |
|
sl@0
|
20 |
|
sl@0
|
21 |
//These are attributes for the touch screen device
|
sl@0
|
22 |
_LIT(KEnumPen, "EPen");
|
sl@0
|
23 |
_LIT(KEnumPenX, "EPenX");
|
sl@0
|
24 |
_LIT(KEnumPenY, "EPenY");
|
sl@0
|
25 |
_LIT(KEnumPenState, "EPenState");
|
sl@0
|
26 |
|
sl@0
|
27 |
//These are attributes for the sound driver device
|
sl@0
|
28 |
_LIT(KEnumPenClick, "EPenClick");
|
sl@0
|
29 |
_LIT(KEnumPenClickVolumeMax, "EPenClickVolumeMax");
|
sl@0
|
30 |
_LIT(KEnumPenClickState, "EPenClickState");
|
sl@0
|
31 |
_LIT(KEnumPenClickVolume, "EPenClickVolume");
|
sl@0
|
32 |
|
sl@0
|
33 |
//These are the attributes for the power controller
|
sl@0
|
34 |
_LIT(KEnumPenDisplayOn, "EPenDisplayOn");
|
sl@0
|
35 |
|
sl@0
|
36 |
//These are the attributes for the lcd screen device
|
sl@0
|
37 |
_LIT(KEnumDisplayState, "EDisplayState");
|
sl@0
|
38 |
_LIT(KEnumDisplayMode, "EDisplayMode");
|
sl@0
|
39 |
|
sl@0
|
40 |
//This represents a NULL attribute
|
sl@0
|
41 |
_LIT(KEnumNull, "");
|
sl@0
|
42 |
|
sl@0
|
43 |
const CT_HALData::THalTableLookup CT_DigitiserDriverData::iTableLookup[] =
|
sl@0
|
44 |
{
|
sl@0
|
45 |
/**
|
sl@0
|
46 |
* Enum as a descriptor Enum Prepare input Prepare paramters Validation of Store data returned after aFlag indicating
|
sl@0
|
47 |
* value prior to prior to value returned successful HAL::Get or if validation
|
sl@0
|
48 |
* HAL::Set call HAL::Get call after a successful HAL::Set call is mandatory
|
sl@0
|
49 |
* HAL::Get call
|
sl@0
|
50 |
*/
|
sl@0
|
51 |
|
sl@0
|
52 |
KEnumPen, HALData::EPen, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPen, ETrue,
|
sl@0
|
53 |
KEnumPenState, HALData::EPenState, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenState, ETrue,
|
sl@0
|
54 |
KEnumPenX, HALData::EPenX, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenX, ETrue,
|
sl@0
|
55 |
KEnumPenY, HALData::EPenY, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenY, ETrue,
|
sl@0
|
56 |
KEnumPenClick, HALData::EPenClick, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClick, ETrue,
|
sl@0
|
57 |
KEnumPenClickVolumeMax, HALData::EPenClickVolumeMax, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClickVolumeMax, ETrue,
|
sl@0
|
58 |
KEnumPenClickState, HALData::EPenClickState, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClickState, ETrue,
|
sl@0
|
59 |
KEnumPenClickVolume, HALData::EPenClickVolume, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenClickVolume, ETrue,
|
sl@0
|
60 |
KEnumPenDisplayOn, HALData::EPenDisplayOn, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetPenDisplayOn, ETrue,
|
sl@0
|
61 |
KEnumDisplayState, HALData::EDisplayState, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetDisplayState, ETrue,
|
sl@0
|
62 |
KEnumDisplayMode, HALData::EDisplayMode, SetPrepareInt, GetPrepareDummy, GetValidationInt, SetDisplayMode, EFalse,
|
sl@0
|
63 |
KEnumNull, (HALData::TAttribute)0, NULL, NULL, NULL, NULL, NULL
|
sl@0
|
64 |
};
|
sl@0
|
65 |
|
sl@0
|
66 |
//////////////////////////////////////////////////////////////////////
|
sl@0
|
67 |
// Construction/Destruction
|
sl@0
|
68 |
//////////////////////////////////////////////////////////////////////
|
sl@0
|
69 |
|
sl@0
|
70 |
CT_DigitiserDriverData* CT_DigitiserDriverData::NewL()
|
sl@0
|
71 |
{
|
sl@0
|
72 |
CT_DigitiserDriverData* digit=new (ELeave) CT_DigitiserDriverData();
|
sl@0
|
73 |
CleanupStack::PushL(digit);
|
sl@0
|
74 |
digit->ConstructL();
|
sl@0
|
75 |
CleanupStack::Pop(digit);
|
sl@0
|
76 |
return digit;
|
sl@0
|
77 |
}
|
sl@0
|
78 |
|
sl@0
|
79 |
|
sl@0
|
80 |
CT_DigitiserDriverData::CT_DigitiserDriverData()
|
sl@0
|
81 |
: CT_HALData(iTableLookup)
|
sl@0
|
82 |
, iPenState(-1)
|
sl@0
|
83 |
, iPen(-1)
|
sl@0
|
84 |
, iPenX(-1)
|
sl@0
|
85 |
, iPenY(-1)
|
sl@0
|
86 |
, iPenClick(-1)
|
sl@0
|
87 |
, iPenClickVolumeMax(-1)
|
sl@0
|
88 |
, iPenClickState(-1)
|
sl@0
|
89 |
, iPenClickVolume (-1)
|
sl@0
|
90 |
, iPenDisplayOn(-1)
|
sl@0
|
91 |
, iDisplayState(-1)
|
sl@0
|
92 |
, iDisplayMode(-1)
|
sl@0
|
93 |
{
|
sl@0
|
94 |
}
|
sl@0
|
95 |
|
sl@0
|
96 |
void CT_DigitiserDriverData::ConstructL()
|
sl@0
|
97 |
/**
|
sl@0
|
98 |
* Second phase construction
|
sl@0
|
99 |
*
|
sl@0
|
100 |
* @internalComponent
|
sl@0
|
101 |
*
|
sl@0
|
102 |
* @return N/A
|
sl@0
|
103 |
*
|
sl@0
|
104 |
* @pre None
|
sl@0
|
105 |
* @post None
|
sl@0
|
106 |
*
|
sl@0
|
107 |
* @leave system wide error
|
sl@0
|
108 |
*/
|
sl@0
|
109 |
{
|
sl@0
|
110 |
|
sl@0
|
111 |
}
|
sl@0
|
112 |
|
sl@0
|
113 |
CT_DigitiserDriverData::~CT_DigitiserDriverData()
|
sl@0
|
114 |
/**
|
sl@0
|
115 |
* Public destructor
|
sl@0
|
116 |
*/
|
sl@0
|
117 |
{
|
sl@0
|
118 |
}
|
sl@0
|
119 |
|
sl@0
|
120 |
TAny* CT_DigitiserDriverData::GetObject()
|
sl@0
|
121 |
/**
|
sl@0
|
122 |
* Return a pointer to the object that the data wraps
|
sl@0
|
123 |
*
|
sl@0
|
124 |
* @return pointer to the object that the data wraps
|
sl@0
|
125 |
*/
|
sl@0
|
126 |
{
|
sl@0
|
127 |
return NULL;
|
sl@0
|
128 |
}
|
sl@0
|
129 |
|
sl@0
|
130 |
TBool CT_DigitiserDriverData::GetPrepareDummy(CDataWrapperBase* /*aThis*/, const TDesC& /*aSection*/, TInt& /*aValueStart*/, TInt& /*aValueEnd*/)
|
sl@0
|
131 |
/**
|
sl@0
|
132 |
* This a dummy place holder function that does nothing see HAL_Data
|
sl@0
|
133 |
*
|
sl@0
|
134 |
* @return a boolean value
|
sl@0
|
135 |
*
|
sl@0
|
136 |
*/
|
sl@0
|
137 |
{
|
sl@0
|
138 |
return ETrue;
|
sl@0
|
139 |
}
|
sl@0
|
140 |
|
sl@0
|
141 |
void CT_DigitiserDriverData::SetPen(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
142 |
/**
|
sl@0
|
143 |
* Store whether the pen/digitiser is availabe for input
|
sl@0
|
144 |
*
|
sl@0
|
145 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
146 |
* @param aValue an integer value to use in set
|
sl@0
|
147 |
*
|
sl@0
|
148 |
*/
|
sl@0
|
149 |
{
|
sl@0
|
150 |
static_cast<CT_DigitiserDriverData*>(aThis)->iPen=aValue;
|
sl@0
|
151 |
}
|
sl@0
|
152 |
|
sl@0
|
153 |
void CT_DigitiserDriverData::SetPenX(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
154 |
/**
|
sl@0
|
155 |
*
|
sl@0
|
156 |
* Store pen/digitiser horizontal resolution in pixels
|
sl@0
|
157 |
*
|
sl@0
|
158 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
159 |
* @param aValue an integer value to use in set
|
sl@0
|
160 |
*/
|
sl@0
|
161 |
{
|
sl@0
|
162 |
static_cast<CT_DigitiserDriverData*>(aThis)->iPenX=aValue;
|
sl@0
|
163 |
}
|
sl@0
|
164 |
|
sl@0
|
165 |
void CT_DigitiserDriverData::SetPenY(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
166 |
/**
|
sl@0
|
167 |
* Store pen/digitiser vertical resolution in pixels
|
sl@0
|
168 |
*
|
sl@0
|
169 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
170 |
* @param aValue an integer value to use in set
|
sl@0
|
171 |
*
|
sl@0
|
172 |
*/
|
sl@0
|
173 |
{
|
sl@0
|
174 |
static_cast<CT_DigitiserDriverData*>(aThis)->iPenY=aValue;
|
sl@0
|
175 |
}
|
sl@0
|
176 |
|
sl@0
|
177 |
void CT_DigitiserDriverData::SetPenState(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
178 |
/**
|
sl@0
|
179 |
* Store Pen Clicking ability
|
sl@0
|
180 |
*
|
sl@0
|
181 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
182 |
* @param aValue an integer value to use in set
|
sl@0
|
183 |
*
|
sl@0
|
184 |
*/
|
sl@0
|
185 |
{
|
sl@0
|
186 |
static_cast<CT_DigitiserDriverData*>(aThis)->iPenState=aValue;
|
sl@0
|
187 |
}
|
sl@0
|
188 |
|
sl@0
|
189 |
void CT_DigitiserDriverData::SetPenClick(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
190 |
/**
|
sl@0
|
191 |
* Store Pen Click
|
sl@0
|
192 |
*
|
sl@0
|
193 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
194 |
* @param aValue an integer value to use in set
|
sl@0
|
195 |
*/
|
sl@0
|
196 |
{
|
sl@0
|
197 |
static_cast<CT_DigitiserDriverData*>(aThis)->iPenClick=aValue;
|
sl@0
|
198 |
}
|
sl@0
|
199 |
|
sl@0
|
200 |
void CT_DigitiserDriverData::SetPenClickVolumeMax(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
201 |
/**
|
sl@0
|
202 |
* Store maximum Pen Click Volume
|
sl@0
|
203 |
*
|
sl@0
|
204 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
205 |
* @param aValue an integer value to use in set
|
sl@0
|
206 |
*/
|
sl@0
|
207 |
{
|
sl@0
|
208 |
static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickVolumeMax=aValue;
|
sl@0
|
209 |
}
|
sl@0
|
210 |
|
sl@0
|
211 |
void CT_DigitiserDriverData::SetPenClickState(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
212 |
/**
|
sl@0
|
213 |
* Store pen click state
|
sl@0
|
214 |
*
|
sl@0
|
215 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
216 |
* @param aValue an integer value to use in set
|
sl@0
|
217 |
*
|
sl@0
|
218 |
*/
|
sl@0
|
219 |
{
|
sl@0
|
220 |
static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickState=aValue;
|
sl@0
|
221 |
}
|
sl@0
|
222 |
|
sl@0
|
223 |
void CT_DigitiserDriverData::SetPenClickVolume(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
224 |
/**
|
sl@0
|
225 |
* Store pen click volume
|
sl@0
|
226 |
*
|
sl@0
|
227 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
228 |
* @param aValue an integer value to use in set
|
sl@0
|
229 |
*/
|
sl@0
|
230 |
{
|
sl@0
|
231 |
static_cast<CT_DigitiserDriverData*>(aThis)->iPenClickVolume=aValue;
|
sl@0
|
232 |
}
|
sl@0
|
233 |
|
sl@0
|
234 |
void CT_DigitiserDriverData::SetPenDisplayOn(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
235 |
/**
|
sl@0
|
236 |
* Store PenDisplay On
|
sl@0
|
237 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
238 |
* @param aValue an integer value to use in set
|
sl@0
|
239 |
*
|
sl@0
|
240 |
*/
|
sl@0
|
241 |
{
|
sl@0
|
242 |
static_cast<CT_DigitiserDriverData*>(aThis)->iPenDisplayOn=aValue;
|
sl@0
|
243 |
}
|
sl@0
|
244 |
|
sl@0
|
245 |
void CT_DigitiserDriverData::SetDisplayState(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
246 |
/**
|
sl@0
|
247 |
* Store DisplayState
|
sl@0
|
248 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
249 |
* @param aValue an integer value to use in set
|
sl@0
|
250 |
*
|
sl@0
|
251 |
*/
|
sl@0
|
252 |
{
|
sl@0
|
253 |
static_cast<CT_DigitiserDriverData*>(aThis)->iDisplayState=aValue;
|
sl@0
|
254 |
}
|
sl@0
|
255 |
|
sl@0
|
256 |
void CT_DigitiserDriverData::SetDisplayMode(CDataWrapperBase* aThis, TInt aValue)
|
sl@0
|
257 |
/**
|
sl@0
|
258 |
* Store DisplayMode
|
sl@0
|
259 |
* @param aThis a pointer to the data wrapper base class
|
sl@0
|
260 |
* @param aValue an integer value to use in set
|
sl@0
|
261 |
*
|
sl@0
|
262 |
*/
|
sl@0
|
263 |
{
|
sl@0
|
264 |
static_cast<CT_DigitiserDriverData*>(aThis)->iDisplayMode=aValue;
|
sl@0
|
265 |
}
|
sl@0
|
266 |
|
sl@0
|
267 |
TBool CT_DigitiserDriverData::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex)
|
sl@0
|
268 |
/**
|
sl@0
|
269 |
* Process a command read from the ini file
|
sl@0
|
270 |
*
|
sl@0
|
271 |
* @param aCommand The command to process
|
sl@0
|
272 |
* @param aSection The section in the ini containing data for the command
|
sl@0
|
273 |
* @param aAsyncErrorIndex Command index for async calls to return errors to
|
sl@0
|
274 |
*
|
sl@0
|
275 |
* @return ETrue if the command is processed
|
sl@0
|
276 |
*
|
sl@0
|
277 |
* @leave System wide error
|
sl@0
|
278 |
*/
|
sl@0
|
279 |
{
|
sl@0
|
280 |
TBool ret=ETrue;
|
sl@0
|
281 |
ret=CT_HALData::DoCommandL(aCommand, aSection, aAsyncErrorIndex);
|
sl@0
|
282 |
return ret;
|
sl@0
|
283 |
}
|
sl@0
|
284 |
|