|
1 /* |
|
2 * Copyright (c) 2002 - 2007 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: test api of alf_core_toolkit |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // [INCLUDE FILES] |
|
21 #include <e32svr.h> |
|
22 #include <stifparser.h> |
|
23 #include <fbs.h> |
|
24 #include <stiftestinterface.h> |
|
25 #include <uiacceltk/huienv.h> |
|
26 #include <uiacceltk/huicontrol.h> |
|
27 #include <uiacceltk/huitimedvalue.h> |
|
28 #include <uiacceltk/huimappingfunctions.h> |
|
29 |
|
30 #include "testuiaifcoretoolkit.h" |
|
31 |
|
32 // ----------------------------------------------------------------------------- |
|
33 // CTestUiAifCoreToolkit::TestMHMFMappingFunctionChangedL |
|
34 // ----------------------------------------------------------------------------- |
|
35 // |
|
36 TInt CTestUiAifCoreToolkit::TestMHMFMappingFunctionChangedL( CStifItemParser& /*aItem*/ ) |
|
37 { |
|
38 |
|
39 // Print to UI |
|
40 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
41 _LIT( KHuiTimedValue, "In TestMHMFMappingFunctionChangedL" ); |
|
42 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
43 // Print to log file |
|
44 iLog->Log( KHuiTimedValue ); |
|
45 |
|
46 THuiConstantMappingFunction* function = new( ELeave ) THuiConstantMappingFunction(); |
|
47 CleanupStack::PushL( function ); |
|
48 STIF_ASSERT_NOT_NULL( function ); |
|
49 function->MappingFunctionChanged(); |
|
50 CleanupStack::Pop( function ); |
|
51 delete function; |
|
52 function = NULL; |
|
53 |
|
54 return KErrNone; |
|
55 } |
|
56 |
|
57 // ----------------------------------------------------------------------------- |
|
58 // CTestUiAifCoreToolkit::TestMHMFMappingFunctionClearChangedL |
|
59 // ----------------------------------------------------------------------------- |
|
60 // |
|
61 TInt CTestUiAifCoreToolkit::TestMHMFMappingFunctionClearChangedL( CStifItemParser& /*aItem*/ ) |
|
62 { |
|
63 |
|
64 // Print to UI |
|
65 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
66 _LIT( KHuiTimedValue, "In TestMHMFMappingFunctionClearChangedL" ); |
|
67 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
68 // Print to log file |
|
69 iLog->Log( KHuiTimedValue ); |
|
70 |
|
71 THuiConstantMappingFunction* function = new( ELeave ) THuiConstantMappingFunction(); |
|
72 CleanupStack::PushL( function ); |
|
73 STIF_ASSERT_NOT_NULL( function ); |
|
74 function->MappingFunctionClearChanged(); |
|
75 CleanupStack::Pop( function ); |
|
76 delete function; |
|
77 function = NULL; |
|
78 |
|
79 return KErrNone; |
|
80 } |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // CTestUiAifCoreToolkit::TestTHTVConstructor |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 TInt CTestUiAifCoreToolkit::TestTHTVConstructor( CStifItemParser& /*aItem*/ ) |
|
87 { |
|
88 |
|
89 // Print to UI |
|
90 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
91 _LIT( KHuiTimedValue, "In TestTHTVConstructor" ); |
|
92 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
93 // Print to log file |
|
94 iLog->Log( KHuiTimedValue ); |
|
95 |
|
96 THuiTimedValue value; |
|
97 |
|
98 return KErrNone; |
|
99 } |
|
100 |
|
101 // ----------------------------------------------------------------------------- |
|
102 // CTestUiAifCoreToolkit::TestTHTVConstructorWithValue |
|
103 // ----------------------------------------------------------------------------- |
|
104 // |
|
105 TInt CTestUiAifCoreToolkit::TestTHTVConstructorWithValue( CStifItemParser& /*aItem*/ ) |
|
106 { |
|
107 |
|
108 // Print to UI |
|
109 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
110 _LIT( KHuiTimedValue, "In TestTHTVConstructorWithValue" ); |
|
111 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
112 // Print to log file |
|
113 iLog->Log( KHuiTimedValue ); |
|
114 |
|
115 THuiTimedValue value( 1 ); |
|
116 |
|
117 return KErrNone; |
|
118 } |
|
119 |
|
120 // ----------------------------------------------------------------------------- |
|
121 // CTestUiAifCoreToolkit::TestTHTVStyle |
|
122 // ----------------------------------------------------------------------------- |
|
123 // |
|
124 TInt CTestUiAifCoreToolkit::TestTHTVStyle( CStifItemParser& /*aItem*/ ) |
|
125 { |
|
126 |
|
127 // Print to UI |
|
128 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
129 _LIT( KHuiTimedValue, "In TestTHTVStyle" ); |
|
130 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
131 // Print to log file |
|
132 iLog->Log( KHuiTimedValue ); |
|
133 |
|
134 THuiTimedValue value; |
|
135 THuiInterpolationStyle style = value.Style(); |
|
136 STIF_ASSERT_EQUALS( style, EHuiTimedValueStyleAdaptive ); |
|
137 |
|
138 return KErrNone; |
|
139 } |
|
140 |
|
141 // ----------------------------------------------------------------------------- |
|
142 // CTestUiAifCoreToolkit::TestTHTVSetStyle |
|
143 // ----------------------------------------------------------------------------- |
|
144 // |
|
145 TInt CTestUiAifCoreToolkit::TestTHTVSetStyle( CStifItemParser& /*aItem*/ ) |
|
146 { |
|
147 |
|
148 // Print to UI |
|
149 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
150 _LIT( KHuiTimedValue, "In TestTHTVSetStyle" ); |
|
151 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
152 // Print to log file |
|
153 iLog->Log( KHuiTimedValue ); |
|
154 |
|
155 THuiTimedValue value; |
|
156 value.SetStyle( EHuiTimedValueStyleNone ); |
|
157 THuiInterpolationStyle style = value.Style(); |
|
158 STIF_ASSERT_EQUALS( style, EHuiTimedValueStyleNone ); |
|
159 |
|
160 return KErrNone; |
|
161 } |
|
162 |
|
163 // ----------------------------------------------------------------------------- |
|
164 // CTestUiAifCoreToolkit::TestTHTVSetFunction |
|
165 // ----------------------------------------------------------------------------- |
|
166 // |
|
167 TInt CTestUiAifCoreToolkit::TestTHTVSetFunction( CStifItemParser& /*aItem*/ ) |
|
168 { |
|
169 |
|
170 // Print to UI |
|
171 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
172 _LIT( KHuiTimedValue, "In TestTHTVSetFunction" ); |
|
173 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
174 // Print to log file |
|
175 iLog->Log( KHuiTimedValue ); |
|
176 |
|
177 THuiTimedValue value; |
|
178 value.SetFunction( NULL ); |
|
179 |
|
180 return KErrNone; |
|
181 } |
|
182 |
|
183 // ----------------------------------------------------------------------------- |
|
184 // CTestUiAifCoreToolkit::TestTHTVSetMappingMode |
|
185 // ----------------------------------------------------------------------------- |
|
186 // |
|
187 TInt CTestUiAifCoreToolkit::TestTHTVSetMappingMode( CStifItemParser& /*aItem*/ ) |
|
188 { |
|
189 |
|
190 // Print to UI |
|
191 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
192 _LIT( KHuiTimedValue, "In TestTHTVSetMappingMode" ); |
|
193 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
194 // Print to log file |
|
195 iLog->Log( KHuiTimedValue ); |
|
196 |
|
197 THuiTimedValue value; |
|
198 value.SetMappingMode( 0 ); |
|
199 |
|
200 return KErrNone; |
|
201 } |
|
202 |
|
203 // ----------------------------------------------------------------------------- |
|
204 // CTestUiAifCoreToolkit::TestTHTVNow |
|
205 // ----------------------------------------------------------------------------- |
|
206 // |
|
207 TInt CTestUiAifCoreToolkit::TestTHTVNow( CStifItemParser& /*aItem*/ ) |
|
208 { |
|
209 |
|
210 // Print to UI |
|
211 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
212 _LIT( KHuiTimedValue, "In TestTHTVNow" ); |
|
213 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
214 // Print to log file |
|
215 iLog->Log( KHuiTimedValue ); |
|
216 |
|
217 THuiTimedValue value; |
|
218 value.Now(); |
|
219 |
|
220 return KErrNone; |
|
221 } |
|
222 |
|
223 // ----------------------------------------------------------------------------- |
|
224 // CTestUiAifCoreToolkit::TestTHTVUnmappedNow |
|
225 // ----------------------------------------------------------------------------- |
|
226 // |
|
227 TInt CTestUiAifCoreToolkit::TestTHTVUnmappedNow( CStifItemParser& /*aItem*/ ) |
|
228 { |
|
229 |
|
230 // Print to UI |
|
231 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
232 _LIT( KHuiTimedValue, "In TestTHTVUnmappedNow" ); |
|
233 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
234 // Print to log file |
|
235 iLog->Log( KHuiTimedValue ); |
|
236 |
|
237 THuiTimedValue value; |
|
238 value.UnmappedNow(); |
|
239 |
|
240 return KErrNone; |
|
241 } |
|
242 |
|
243 // ----------------------------------------------------------------------------- |
|
244 // CTestUiAifCoreToolkit::TestTHTVTarget |
|
245 // ----------------------------------------------------------------------------- |
|
246 // |
|
247 TInt CTestUiAifCoreToolkit::TestTHTVTarget( CStifItemParser& /*aItem*/ ) |
|
248 { |
|
249 |
|
250 // Print to UI |
|
251 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
252 _LIT( KHuiTimedValue, "In TestTHTVTarget" ); |
|
253 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
254 // Print to log file |
|
255 iLog->Log( KHuiTimedValue ); |
|
256 |
|
257 THuiTimedValue value; |
|
258 value.Target(); |
|
259 |
|
260 return KErrNone; |
|
261 } |
|
262 |
|
263 // ----------------------------------------------------------------------------- |
|
264 // CTestUiAifCoreToolkit::TestTHTVSetValue |
|
265 // ----------------------------------------------------------------------------- |
|
266 // |
|
267 TInt CTestUiAifCoreToolkit::TestTHTVSetValue( CStifItemParser& /*aItem*/ ) |
|
268 { |
|
269 |
|
270 // Print to UI |
|
271 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
272 _LIT( KHuiTimedValue, "In TestTHTVSetValue" ); |
|
273 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
274 // Print to log file |
|
275 iLog->Log( KHuiTimedValue ); |
|
276 |
|
277 THuiTimedValue value; |
|
278 value.Set( 1 ); |
|
279 |
|
280 return KErrNone; |
|
281 } |
|
282 |
|
283 // ----------------------------------------------------------------------------- |
|
284 // CTestUiAifCoreToolkit::TestTHTVSetValueTime |
|
285 // ----------------------------------------------------------------------------- |
|
286 // |
|
287 TInt CTestUiAifCoreToolkit::TestTHTVSetValueTime( CStifItemParser& /*aItem*/ ) |
|
288 { |
|
289 |
|
290 // Print to UI |
|
291 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
292 _LIT( KHuiTimedValue, "In TestTHTVSetValueTime" ); |
|
293 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
294 // Print to log file |
|
295 iLog->Log( KHuiTimedValue ); |
|
296 |
|
297 THuiTimedValue value; |
|
298 value.Set( 1, 1 ); |
|
299 |
|
300 return KErrNone; |
|
301 } |
|
302 |
|
303 // ----------------------------------------------------------------------------- |
|
304 // CTestUiAifCoreToolkit::TestTHTVSetWithSpeed |
|
305 // ----------------------------------------------------------------------------- |
|
306 // |
|
307 TInt CTestUiAifCoreToolkit::TestTHTVSetWithSpeed( CStifItemParser& /*aItem*/ ) |
|
308 { |
|
309 |
|
310 // Print to UI |
|
311 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
312 _LIT( KHuiTimedValue, "In TestTHTVSetWithSpeed" ); |
|
313 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
314 // Print to log file |
|
315 iLog->Log( KHuiTimedValue ); |
|
316 |
|
317 THuiTimedValue value; |
|
318 value.SetWithSpeed( 1, 1 ); |
|
319 |
|
320 return KErrNone; |
|
321 } |
|
322 |
|
323 // ----------------------------------------------------------------------------- |
|
324 // CTestUiAifCoreToolkit::TestTHTVRemainingTime |
|
325 // ----------------------------------------------------------------------------- |
|
326 // |
|
327 TInt CTestUiAifCoreToolkit::TestTHTVRemainingTime( CStifItemParser& /*aItem*/ ) |
|
328 { |
|
329 |
|
330 // Print to UI |
|
331 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
332 _LIT( KHuiTimedValue, "In TestTHTVRemainingTime" ); |
|
333 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
334 // Print to log file |
|
335 iLog->Log( KHuiTimedValue ); |
|
336 |
|
337 THuiTimedValue value; |
|
338 value.RemainingTime(); |
|
339 |
|
340 return KErrNone; |
|
341 } |
|
342 |
|
343 // ----------------------------------------------------------------------------- |
|
344 // CTestUiAifCoreToolkit::TestTHTVFinish |
|
345 // ----------------------------------------------------------------------------- |
|
346 // |
|
347 TInt CTestUiAifCoreToolkit::TestTHTVFinish( CStifItemParser& /*aItem*/ ) |
|
348 { |
|
349 |
|
350 // Print to UI |
|
351 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
352 _LIT( KHuiTimedValue, "In TestTHTVFinish" ); |
|
353 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
354 // Print to log file |
|
355 iLog->Log( KHuiTimedValue ); |
|
356 |
|
357 THuiTimedValue value; |
|
358 value.Finish(); |
|
359 |
|
360 return KErrNone; |
|
361 } |
|
362 |
|
363 // ----------------------------------------------------------------------------- |
|
364 // CTestUiAifCoreToolkit::TestTHTVChanged |
|
365 // ----------------------------------------------------------------------------- |
|
366 // |
|
367 TInt CTestUiAifCoreToolkit::TestTHTVChanged( CStifItemParser& /*aItem*/ ) |
|
368 { |
|
369 |
|
370 // Print to UI |
|
371 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
372 _LIT( KHuiTimedValue, "In TestTHTVChanged" ); |
|
373 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
374 // Print to log file |
|
375 iLog->Log( KHuiTimedValue ); |
|
376 |
|
377 THuiTimedValue value; |
|
378 value.Changed(); |
|
379 |
|
380 return KErrNone; |
|
381 } |
|
382 |
|
383 // ----------------------------------------------------------------------------- |
|
384 // CTestUiAifCoreToolkit::TestTHTVInterpolating |
|
385 // ----------------------------------------------------------------------------- |
|
386 // |
|
387 TInt CTestUiAifCoreToolkit::TestTHTVInterpolating( CStifItemParser& /*aItem*/ ) |
|
388 { |
|
389 |
|
390 // Print to UI |
|
391 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
392 _LIT( KHuiTimedValue, "In TestTHTVInterpolating" ); |
|
393 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
394 // Print to log file |
|
395 iLog->Log( KHuiTimedValue ); |
|
396 |
|
397 THuiTimedValue value; |
|
398 value.Interpolating(); |
|
399 |
|
400 return KErrNone; |
|
401 } |
|
402 |
|
403 // ----------------------------------------------------------------------------- |
|
404 // CTestUiAifCoreToolkit::TestTHTVClearChanged |
|
405 // ----------------------------------------------------------------------------- |
|
406 // |
|
407 TInt CTestUiAifCoreToolkit::TestTHTVClearChanged( CStifItemParser& /*aItem*/ ) |
|
408 { |
|
409 |
|
410 // Print to UI |
|
411 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
412 _LIT( KHuiTimedValue, "In TestTHTVClearChanged" ); |
|
413 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
414 // Print to log file |
|
415 iLog->Log( KHuiTimedValue ); |
|
416 |
|
417 THuiTimedValue value; |
|
418 value.ClearChanged(); |
|
419 |
|
420 return KErrNone; |
|
421 } |
|
422 |
|
423 // ----------------------------------------------------------------------------- |
|
424 // CTestUiAifCoreToolkit::TestTHTVEnableClock |
|
425 // ----------------------------------------------------------------------------- |
|
426 // |
|
427 TInt CTestUiAifCoreToolkit::TestTHTVEnableClock( CStifItemParser& /*aItem*/ ) |
|
428 { |
|
429 |
|
430 // Print to UI |
|
431 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
432 _LIT( KHuiTimedValue, "In TestTHTVEnableClock" ); |
|
433 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
434 // Print to log file |
|
435 iLog->Log( KHuiTimedValue ); |
|
436 |
|
437 THuiTimedValue value; |
|
438 value.EnableClock(); |
|
439 value.EnableClock( EFalse ); |
|
440 |
|
441 return KErrNone; |
|
442 } |
|
443 |
|
444 // ----------------------------------------------------------------------------- |
|
445 // CTestUiAifCoreToolkit::TestTHTVSuspend |
|
446 // ----------------------------------------------------------------------------- |
|
447 // |
|
448 TInt CTestUiAifCoreToolkit::TestTHTVSuspend( CStifItemParser& /*aItem*/ ) |
|
449 { |
|
450 |
|
451 // Print to UI |
|
452 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
453 _LIT( KHuiTimedValue, "In TestTHTVSuspend" ); |
|
454 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
455 // Print to log file |
|
456 iLog->Log( KHuiTimedValue ); |
|
457 |
|
458 THuiTimedValue value; |
|
459 value.Suspend(); |
|
460 value.Suspend( EFalse ); |
|
461 |
|
462 return KErrNone; |
|
463 } |
|
464 |
|
465 // ----------------------------------------------------------------------------- |
|
466 // CTestUiAifCoreToolkit::TestTHTVoperatorEqualTo |
|
467 // ----------------------------------------------------------------------------- |
|
468 // |
|
469 TInt CTestUiAifCoreToolkit::TestTHTVoperatorEqualTo( CStifItemParser& /*aItem*/ ) |
|
470 { |
|
471 |
|
472 // Print to UI |
|
473 _LIT( KTestuiaifcoretoolkit, "testuiaifcoretoolkit" ); |
|
474 _LIT( KHuiTimedValue, "In TestTHTVoperatorEqualTo" ); |
|
475 TestModuleIf().Printf( 0, KTestuiaifcoretoolkit, KHuiTimedValue ); |
|
476 // Print to log file |
|
477 iLog->Log( KHuiTimedValue ); |
|
478 |
|
479 THuiTimedValue value; |
|
480 THuiTimedValue otheValue; |
|
481 value = otheValue; |
|
482 |
|
483 return KErrNone; |
|
484 } |