|
1 /* |
|
2 * Copyright (c) 2005-2009 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 the License "Symbian Foundation License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "T_DataWindowBase.h" |
|
19 #include "T_GraphicsUtil.h" |
|
20 |
|
21 |
|
22 /*@{*/ |
|
23 //Commands |
|
24 _LIT(KCmdActivate, "Activate"); |
|
25 _LIT(KCmdSetPosition, "SetPosition"); |
|
26 _LIT(KCmdSetSizeErr, "SetSizeErr"); |
|
27 _LIT(KCmdSetExtentErr, "SetExtentErr"); |
|
28 _LIT(KCmdSize, "Size"); |
|
29 _LIT(KCmdInquireOffset, "InquireOffset"); |
|
30 _LIT(KCmdPointerFilter, "PointerFilter"); |
|
31 _LIT(KCmdSetPointerGrab, "SetPointerGrab"); |
|
32 _LIT(KCmdClaimPointerGrab, "ClaimPointerGrab"); |
|
33 _LIT(KCmdSetPointerCapture, "SetPointerCapture"); |
|
34 _LIT(KCmdSetPointerCapturePriority, "SetPointerCapturePriority"); |
|
35 _LIT(KCmdGetPointerCapturePriority, "GetPointerCapturePriority"); |
|
36 _LIT(KCmdSetVisible, "SetVisible"); |
|
37 _LIT(KCmdSetShadowHeight, "SetShadowHeight"); |
|
38 _LIT(KCmdSetShadowDisabled, "SetShadowDisabled"); |
|
39 _LIT(KCmdPosition, "Position"); |
|
40 _LIT(KCmdAbsPosition, "AbsPosition"); |
|
41 _LIT(KCmdSetCornerType, "SetCornerType"); |
|
42 _LIT(KCmdSetShape, "SetShape"); |
|
43 _LIT(KCmdSetRequiredDisplayMode, "SetRequiredDisplayMode"); |
|
44 _LIT(KCmdDisplayMode, "DisplayMode"); |
|
45 _LIT(KCmdEnableBackup, "EnableBackup"); |
|
46 _LIT(KCmdRequestPointerRepeatEvent, "RequestPointerRepeatEvent"); |
|
47 _LIT(KCmdCancelPointerRepeatEventRequest, "CancelPointerRepeatEventRequest"); |
|
48 _LIT(KCmdAllocPointerMoveBuffer, "AllocPointerMoveBuffer"); |
|
49 _LIT(KCmdFreePointerMoveBuffer, "FreePointerMoveBuffer"); |
|
50 _LIT(KCmdEnablePointerMoveBuffer, "EnablePointerMoveBuffer"); |
|
51 _LIT(KCmdDisablePointerMoveBuffer, "DisablePointerMoveBuffer"); |
|
52 _LIT(KCmdRetrievePointerMoveBuffer, "RetrievePointerMoveBuffer"); |
|
53 _LIT(KCmdDiscardPointerMoveBuffer, "DiscardPointerMoveBuffer"); |
|
54 _LIT(KCmdAddKeyRect, "AddKeyRect"); |
|
55 _LIT(KCmdRemoveAllKeyRects, "RemoveAllKeyRects"); |
|
56 _LIT(KCmdPasswordWindow, "PasswordWindow"); |
|
57 _LIT(KCmdFadeBehind, "FadeBehind"); |
|
58 _LIT(KCmdIsFaded, "IsFaded"); |
|
59 _LIT(KCmdIsNonFading, "IsNonFading"); |
|
60 _LIT(KCmdMoveToGroup, "MoveToGroup"); |
|
61 |
|
62 // Fields |
|
63 _LIT(KFldActivatedByPointerSwitchOn, "activatedbypointerswitchon"); |
|
64 _LIT(KFldBackupType, "backuptype"); |
|
65 _LIT(KFldCornerFlags, "cornerflags"); |
|
66 _LIT(KFldCornerType, "cornertype"); |
|
67 _LIT(KFldExpected, "expected"); |
|
68 _LIT(KFldExpectedNumOfPoints, "expected_numofpoints"); |
|
69 _LIT(KFldFade, "fade"); |
|
70 _LIT(KFldFlags, "flags"); |
|
71 _LIT(KFldHeight, "height"); |
|
72 _LIT(KFldIdentifier, "identifier"); |
|
73 _LIT(KFldIdentifier_Name, "identifier_name"); |
|
74 _LIT(KFldMaxPoints, "maxpoints"); |
|
75 _LIT(KFldMode, "mode"); |
|
76 _LIT(KFldPasswordMode, "passwordmode"); |
|
77 _LIT(KFldPoint, "point"); |
|
78 _LIT(KFldPriority, "priority"); |
|
79 _LIT(KFldRect, "rect"); |
|
80 _LIT(KFldRegion, "region"); |
|
81 _LIT(KFldScanCode, "scancode"); |
|
82 _LIT(KFldSendUpEvent, "sendupevent"); |
|
83 _LIT(KFldSize, "size"); |
|
84 _LIT(KFldState, "state"); |
|
85 _LIT(KFldTime, "time"); |
|
86 _LIT(KFldWindow, "window"); |
|
87 _LIT(KFldFilterMask, "filterMask"); |
|
88 _LIT(KFldFilter, "filter"); |
|
89 |
|
90 /// Logging |
|
91 _LIT(KLogError, "Error=%d"); |
|
92 _LIT(KLogMissingParameter, "Missing parameter '%S'"); |
|
93 _LIT(KLogMissingExpectedValue, "Missing expected value '%S'"); |
|
94 _LIT(KLogNotAsExpectedValue, "'%S' is not as expected value"); |
|
95 _LIT(KLogNotExpectedValueInt, "'%S' is not as expected=%d, actual=%d"); |
|
96 /*@}*/ |
|
97 |
|
98 ////////////////////////////////////////////////////////////////////// |
|
99 // Construction/Destruction |
|
100 ////////////////////////////////////////////////////////////////////// |
|
101 |
|
102 CT_DataWindowBase::CT_DataWindowBase() |
|
103 : CT_DataWindowTreeNode() |
|
104 { |
|
105 } |
|
106 |
|
107 RWindowTreeNode* CT_DataWindowBase::GetWindowTreeNode() const |
|
108 { |
|
109 return GetWindowBase(); |
|
110 } |
|
111 |
|
112 |
|
113 /** |
|
114 * Process a command read from the ini file |
|
115 * |
|
116 * @param aCommand the command to process |
|
117 * @param aSection the entry in the ini file requiring the command to be processed |
|
118 * @param aAsyncErrorIndex index of command. used for async calls |
|
119 * |
|
120 * @return ETrue if the command is processed |
|
121 */ |
|
122 TBool CT_DataWindowBase::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex) |
|
123 { |
|
124 TBool ret = ETrue; |
|
125 |
|
126 if ( aCommand==KCmdActivate ) |
|
127 { |
|
128 DoCmdActivate(); |
|
129 } |
|
130 else if ( aCommand==KCmdSetPosition ) |
|
131 { |
|
132 DoCmdSetPosition(aSection); |
|
133 } |
|
134 else if ( aCommand==KCmdSetSizeErr ) |
|
135 { |
|
136 DoCmdSetSizeErr(aSection); |
|
137 } |
|
138 else if ( aCommand==KCmdSetExtentErr ) |
|
139 { |
|
140 DoCmdSetExtentErr(aSection); |
|
141 } |
|
142 else if ( aCommand==KCmdSize ) |
|
143 { |
|
144 DoCmdSize(aSection); |
|
145 } |
|
146 else if ( aCommand==KCmdInquireOffset ) |
|
147 { |
|
148 DoCmdInquireOffsetL(aSection); |
|
149 } |
|
150 else if ( aCommand==KCmdPointerFilter ) |
|
151 { |
|
152 DoCmdPointerFilter(aSection); |
|
153 } |
|
154 else if ( aCommand==KCmdSetPointerGrab ) |
|
155 { |
|
156 DoCmdSetPointerGrab(aSection); |
|
157 } |
|
158 else if ( aCommand==KCmdClaimPointerGrab ) |
|
159 { |
|
160 DoCmdClaimPointerGrab(aSection); |
|
161 } |
|
162 else if ( aCommand==KCmdSetPointerCapture ) |
|
163 { |
|
164 DoCmdSetPointerCapture(aSection); |
|
165 } |
|
166 else if ( aCommand==KCmdSetPointerCapturePriority ) |
|
167 { |
|
168 DoCmdSetPointerCapturePriority(aSection); |
|
169 } |
|
170 else if ( aCommand==KCmdGetPointerCapturePriority ) |
|
171 { |
|
172 DoCmdGetPointerCapturePriority(aSection); |
|
173 } |
|
174 else if ( aCommand==KCmdSetVisible ) |
|
175 { |
|
176 DoCmdSetVisible(aSection); |
|
177 } |
|
178 else if ( aCommand==KCmdSetShadowHeight ) |
|
179 { |
|
180 DoCmdSetShadowHeight(aSection); |
|
181 } |
|
182 else if ( aCommand==KCmdSetShadowDisabled ) |
|
183 { |
|
184 DoCmdSetShadowDisabled(aSection); |
|
185 } |
|
186 else if ( aCommand==KCmdPosition ) |
|
187 { |
|
188 DoCmdPosition(aSection); |
|
189 } |
|
190 else if ( aCommand==KCmdAbsPosition ) |
|
191 { |
|
192 DoCmdAbsPosition(aSection); |
|
193 } |
|
194 else if ( aCommand==KCmdSetCornerType ) |
|
195 { |
|
196 DoCmdSetCornerType(aSection); |
|
197 } |
|
198 else if ( aCommand==KCmdSetShape ) |
|
199 { |
|
200 DoCmdSetShapeL(aSection); |
|
201 } |
|
202 else if ( aCommand==KCmdSetRequiredDisplayMode ) |
|
203 { |
|
204 DoCmdSetRequiredDisplayMode(aSection); |
|
205 } |
|
206 else if ( aCommand==KCmdDisplayMode ) |
|
207 { |
|
208 DoCmdDisplayMode(aSection); |
|
209 } |
|
210 else if ( aCommand==KCmdEnableBackup ) |
|
211 { |
|
212 DoCmdEnableBackup(aSection); |
|
213 } |
|
214 else if ( aCommand==KCmdRequestPointerRepeatEvent ) |
|
215 { |
|
216 DoCmdRequestPointerRepeatEvent(aSection); |
|
217 } |
|
218 else if ( aCommand==KCmdCancelPointerRepeatEventRequest ) |
|
219 { |
|
220 DoCmdCancelPointerRepeatEventRequest(); |
|
221 } |
|
222 else if ( aCommand==KCmdAllocPointerMoveBuffer ) |
|
223 { |
|
224 DoCmdAllocPointerMoveBuffer(aSection); |
|
225 } |
|
226 else if ( aCommand==KCmdFreePointerMoveBuffer ) |
|
227 { |
|
228 DoCmdFreePointerMoveBuffer(); |
|
229 } |
|
230 else if ( aCommand==KCmdEnablePointerMoveBuffer ) |
|
231 { |
|
232 DoCmdEnablePointerMoveBuffer(); |
|
233 } |
|
234 else if ( aCommand==KCmdDisablePointerMoveBuffer ) |
|
235 { |
|
236 DoCmdDisablePointerMoveBuffer(); |
|
237 } |
|
238 else if ( aCommand==KCmdRetrievePointerMoveBuffer ) |
|
239 { |
|
240 DoCmdRetrievePointerMoveBufferL(aSection); |
|
241 } |
|
242 else if ( aCommand==KCmdDiscardPointerMoveBuffer ) |
|
243 { |
|
244 DoCmdDiscardPointerMoveBuffer(); |
|
245 } |
|
246 else if ( aCommand==KCmdAddKeyRect ) |
|
247 { |
|
248 DoCmdAddKeyRect(aSection); |
|
249 } |
|
250 else if ( aCommand==KCmdRemoveAllKeyRects ) |
|
251 { |
|
252 DoCmdRemoveAllKeyRects(); |
|
253 } |
|
254 else if ( aCommand==KCmdPasswordWindow ) |
|
255 { |
|
256 DoCmdPasswordWindow(aSection); |
|
257 } |
|
258 else if ( aCommand==KCmdFadeBehind ) |
|
259 { |
|
260 DoCmdFadeBehind(aSection); |
|
261 } |
|
262 else if ( aCommand==KCmdIsFaded ) |
|
263 { |
|
264 DoCmdIsFaded(aSection); |
|
265 } |
|
266 else if ( aCommand==KCmdIsNonFading ) |
|
267 { |
|
268 DoCmdIsNonFading(aSection); |
|
269 } |
|
270 else if ( aCommand==KCmdMoveToGroup ) |
|
271 { |
|
272 DoCmdMoveToGroupL(aSection); |
|
273 } |
|
274 else |
|
275 { |
|
276 ret=CT_DataWindowTreeNode::DoCommandL(aCommand, aSection, aAsyncErrorIndex); |
|
277 } |
|
278 |
|
279 return ret; |
|
280 } |
|
281 |
|
282 |
|
283 void CT_DataWindowBase::DoCmdActivate() |
|
284 { |
|
285 // No command input parameter to process |
|
286 |
|
287 // Execute command and log parameters |
|
288 INFO_PRINTF1(_L("execute Activate()")); |
|
289 GetWindowBase()->Activate(); |
|
290 |
|
291 // No command return value and output parameter to display and check |
|
292 } |
|
293 |
|
294 |
|
295 void CT_DataWindowBase::DoCmdSetPosition(const TDesC& aSection) |
|
296 { |
|
297 // Get test data for command input parameter(s) |
|
298 TPoint datPoint; |
|
299 |
|
300 if ( !GetPointFromConfig(aSection, KFldPoint, datPoint) ) |
|
301 { |
|
302 ERR_PRINTF2(KLogMissingParameter, &KFldPoint); |
|
303 SetBlockResult(EFail); |
|
304 } |
|
305 else |
|
306 { |
|
307 // Execute command and log parameters |
|
308 INFO_PRINTF1(_L("execute SetPosition(TPoint)")); |
|
309 GetWindowBase()->SetPosition(datPoint); |
|
310 |
|
311 // No command return value and output parameter to display and check |
|
312 } |
|
313 } |
|
314 |
|
315 |
|
316 void CT_DataWindowBase::DoCmdSetSizeErr(const TDesC& aSection) |
|
317 { |
|
318 // Get test data for command input parameter(s) |
|
319 TSize datSize; |
|
320 |
|
321 if ( !GetSizeFromConfig(aSection, KFldSize, datSize) ) |
|
322 { |
|
323 ERR_PRINTF2(KLogMissingParameter, &KFldSize); |
|
324 SetBlockResult(EFail); |
|
325 } |
|
326 else |
|
327 { |
|
328 // Execute command and log parameters |
|
329 INFO_PRINTF1(_L("execute SetSizeErr(TSize)")); |
|
330 TInt returnCode = GetWindowBase()->SetSizeErr(datSize); |
|
331 |
|
332 // Check the command return code, if !=KErrNone then stop this command |
|
333 if ( returnCode!=KErrNone ) |
|
334 { |
|
335 ERR_PRINTF2(KLogError, returnCode); |
|
336 SetError(returnCode); |
|
337 } |
|
338 |
|
339 // No command output parameter to display and check |
|
340 } |
|
341 } |
|
342 |
|
343 |
|
344 void CT_DataWindowBase::DoCmdSetExtentErr(const TDesC& aSection) |
|
345 { |
|
346 TBool dataOk=ETrue; |
|
347 |
|
348 // Get test data for command input parameter(s) |
|
349 TPoint datPoint; |
|
350 if ( !GetPointFromConfig(aSection, KFldPoint, datPoint) ) |
|
351 { |
|
352 dataOk=EFalse; |
|
353 ERR_PRINTF2(KLogMissingParameter, &KFldPoint); |
|
354 SetBlockResult(EFail); |
|
355 } |
|
356 |
|
357 TSize datSize; |
|
358 if ( !GetSizeFromConfig(aSection, KFldSize, datSize) ) |
|
359 { |
|
360 dataOk=EFalse; |
|
361 ERR_PRINTF2(KLogMissingParameter, &KFldSize); |
|
362 SetBlockResult(EFail); |
|
363 } |
|
364 |
|
365 if ( dataOk ) |
|
366 { |
|
367 // Execute command and log parameters |
|
368 INFO_PRINTF1(_L("execute SetExtentErr(TPoint, TSize)")); |
|
369 TInt returnCode = GetWindowBase()->SetExtentErr(datPoint, datSize); |
|
370 |
|
371 // Check the command return code, if !=KErrNone then stop this command |
|
372 if ( returnCode!=KErrNone ) |
|
373 { |
|
374 ERR_PRINTF2(KLogError, returnCode); |
|
375 SetError(returnCode); |
|
376 } |
|
377 |
|
378 // No command output parameter to display and check |
|
379 } |
|
380 } |
|
381 |
|
382 |
|
383 void CT_DataWindowBase::DoCmdSize(const TDesC& aSection) |
|
384 { |
|
385 // No command input parameter to process |
|
386 |
|
387 // Execute command and log parameters |
|
388 INFO_PRINTF1(_L("execute Size()")); |
|
389 TSize actualResult = GetWindowBase()->Size(); |
|
390 |
|
391 // Diaplay command return value, check if it matches the expected value |
|
392 TSize expectResult; |
|
393 |
|
394 if ( !GetSizeFromConfig(aSection, KFldExpected, expectResult) ) |
|
395 { |
|
396 ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected); |
|
397 SetBlockResult(EFail); |
|
398 } |
|
399 else if ( actualResult!=expectResult ) |
|
400 { |
|
401 ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected); |
|
402 SetBlockResult(EFail); |
|
403 } |
|
404 } |
|
405 |
|
406 |
|
407 void CT_DataWindowBase::DoCmdInquireOffsetL(const TDesC& aSection) |
|
408 { |
|
409 // Get test data for command input parameter(s) |
|
410 TPtrC windowName; |
|
411 RWindowTreeNode* window=NULL; |
|
412 if ( GetStringFromConfig(aSection, KFldWindow, windowName) ) |
|
413 { |
|
414 window = static_cast<RWindowTreeNode*>(GetDataObjectL(windowName)); |
|
415 } |
|
416 |
|
417 if ( window==NULL ) |
|
418 { |
|
419 ERR_PRINTF2(KLogMissingParameter, &KFldWindow); |
|
420 SetBlockResult(EFail); |
|
421 } |
|
422 else |
|
423 { |
|
424 // Execute command and log parameters |
|
425 INFO_PRINTF1(_L("execute InquireOffset(RWindowTreeNode)")); |
|
426 TPoint actualResult = GetWindowBase()->InquireOffset(*window); |
|
427 |
|
428 // Diaplay command return value, check if it matches the expected value |
|
429 TPoint expectResult; |
|
430 |
|
431 if ( !GetPointFromConfig(aSection, KFldExpected, expectResult) ) |
|
432 { |
|
433 ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected); |
|
434 SetBlockResult(EFail); |
|
435 } |
|
436 else if ( actualResult!=expectResult ) |
|
437 { |
|
438 ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected); |
|
439 SetBlockResult(EFail); |
|
440 } |
|
441 } |
|
442 } |
|
443 |
|
444 |
|
445 void CT_DataWindowBase::DoCmdPointerFilter(const TDesC& aSection) |
|
446 { |
|
447 TBool dataOk=ETrue; |
|
448 |
|
449 TUint32 eventFilterMask=0; |
|
450 if ( !CT_GraphicsUtil::ReadPointerFilter(*this, aSection, KFldFilterMask, (TUint&)eventFilterMask) ) |
|
451 { |
|
452 dataOk=EFalse; |
|
453 ERR_PRINTF2(KLogMissingParameter, &KFldFilterMask); |
|
454 SetBlockResult(EFail); |
|
455 } |
|
456 |
|
457 TUint32 eventFilter=0; |
|
458 if ( !CT_GraphicsUtil::ReadPointerFilter(*this, aSection, KFldFilter, (TUint&)eventFilter) ) |
|
459 { |
|
460 dataOk=EFalse; |
|
461 ERR_PRINTF2(KLogMissingParameter, &KFldFilter); |
|
462 SetBlockResult(EFail); |
|
463 } |
|
464 |
|
465 if ( dataOk ) |
|
466 { |
|
467 INFO_PRINTF3(_L("execute PointerFilter(0x%x, 0x%x)"), eventFilterMask, eventFilter); |
|
468 GetWindowBase()->PointerFilter(eventFilterMask, eventFilter); |
|
469 } |
|
470 } |
|
471 |
|
472 |
|
473 void CT_DataWindowBase::DoCmdSetPointerGrab(const TDesC& aSection) |
|
474 { |
|
475 // Get test data for command input parameter(s) |
|
476 TBool datState = EFalse; |
|
477 |
|
478 if ( !GetBoolFromConfig(aSection, KFldState, datState) ) |
|
479 { |
|
480 ERR_PRINTF2(KLogMissingParameter, &KFldState); |
|
481 SetBlockResult(EFail); |
|
482 } |
|
483 else |
|
484 { |
|
485 // Execute command and log parameters |
|
486 INFO_PRINTF1(_L("execute SetPointerGrab(TBool)")); |
|
487 GetWindowBase()->SetPointerGrab(datState); |
|
488 |
|
489 // No command return value and output parameter to display and check |
|
490 } |
|
491 } |
|
492 |
|
493 |
|
494 void CT_DataWindowBase::DoCmdClaimPointerGrab(const TDesC& aSection) |
|
495 { |
|
496 // Get test data for command input parameter(s) |
|
497 TBool datSendUpEvent = EFalse; |
|
498 |
|
499 if ( !GetBoolFromConfig(aSection, KFldSendUpEvent, datSendUpEvent) ) |
|
500 { |
|
501 ERR_PRINTF2(KLogMissingParameter, &KFldSendUpEvent); |
|
502 SetBlockResult(EFail); |
|
503 } |
|
504 else |
|
505 { |
|
506 // Execute command and log parameters |
|
507 INFO_PRINTF1(_L("execute ClaimPointerGrab(TBool)")); |
|
508 GetWindowBase()->ClaimPointerGrab(datSendUpEvent); |
|
509 |
|
510 // No command return value and output parameter to display and check |
|
511 } |
|
512 } |
|
513 |
|
514 |
|
515 void CT_DataWindowBase::DoCmdSetPointerCapture(const TDesC& aSection) |
|
516 { |
|
517 // Get test data for command input parameter(s) |
|
518 RWindowBase::TCaptureFlags datFlags; |
|
519 |
|
520 if ( !CT_GraphicsUtil::ReadCaptureFlags(*this, aSection, KFldFlags, (TUint&)datFlags) ) |
|
521 { |
|
522 ERR_PRINTF2(KLogMissingParameter, &KFldFlags); |
|
523 SetBlockResult(EFail); |
|
524 } |
|
525 else |
|
526 { |
|
527 // Execute command and log parameters |
|
528 INFO_PRINTF1(_L("execute SetPointerCapture(TInt)")); |
|
529 GetWindowBase()->SetPointerCapture(datFlags); |
|
530 |
|
531 // No command return value and output parameter to display and check |
|
532 } |
|
533 } |
|
534 |
|
535 |
|
536 void CT_DataWindowBase::DoCmdSetPointerCapturePriority(const TDesC& aSection) |
|
537 { |
|
538 // Get test data for command input parameter(s) |
|
539 TInt datPriority; |
|
540 |
|
541 if ( !GetIntFromConfig(aSection, KFldPriority, datPriority) ) |
|
542 { |
|
543 ERR_PRINTF2(KLogMissingParameter, &KFldPriority); |
|
544 SetBlockResult(EFail); |
|
545 } |
|
546 else |
|
547 { |
|
548 // Execute command and log parameters |
|
549 INFO_PRINTF1(_L("execute SetPointerCapturePriority(TInt)")); |
|
550 GetWindowBase()->SetPointerCapturePriority(datPriority); |
|
551 |
|
552 // No command return value and output parameter to display and check |
|
553 } |
|
554 } |
|
555 |
|
556 |
|
557 void CT_DataWindowBase::DoCmdGetPointerCapturePriority(const TDesC& aSection) |
|
558 { |
|
559 // No command input parameter to process |
|
560 |
|
561 // Execute command and log parameters |
|
562 INFO_PRINTF1(_L("execute GetPointerCapturePriority()")); |
|
563 TInt actualResult = GetWindowBase()->GetPointerCapturePriority(); |
|
564 |
|
565 // Diaplay command return value, check if it matches the expected value |
|
566 TInt expectResult; |
|
567 if ( !GetIntFromConfig(aSection, KFldExpected, expectResult) ) |
|
568 { |
|
569 ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected); |
|
570 SetBlockResult(EFail); |
|
571 } |
|
572 else if ( actualResult!=expectResult ) |
|
573 { |
|
574 ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult); |
|
575 SetBlockResult(EFail); |
|
576 } |
|
577 |
|
578 // No command output parameter to display and check |
|
579 } |
|
580 |
|
581 |
|
582 void CT_DataWindowBase::DoCmdSetVisible(const TDesC& aSection) |
|
583 { |
|
584 // Get test data for command input parameter(s) |
|
585 TBool datState = EFalse; |
|
586 |
|
587 if ( !GetBoolFromConfig(aSection, KFldState, datState) ) |
|
588 { |
|
589 ERR_PRINTF2(KLogMissingParameter, &KFldState); |
|
590 SetBlockResult(EFail); |
|
591 } |
|
592 else |
|
593 { |
|
594 // Execute command and log parameters |
|
595 INFO_PRINTF1(_L("execute SetVisible(TBool)")); |
|
596 GetWindowBase()->SetVisible(datState); |
|
597 |
|
598 // No command return value and output parameter to display and check |
|
599 } |
|
600 } |
|
601 |
|
602 |
|
603 void CT_DataWindowBase::DoCmdSetShadowHeight(const TDesC& aSection) |
|
604 { |
|
605 // Get test data for command input parameter(s) |
|
606 TInt datHeight; |
|
607 |
|
608 if ( !GetIntFromConfig(aSection, KFldHeight, datHeight) ) |
|
609 { |
|
610 ERR_PRINTF2(KLogMissingParameter, &KFldHeight); |
|
611 SetBlockResult(EFail); |
|
612 } |
|
613 else |
|
614 { |
|
615 // Execute command and log parameters |
|
616 INFO_PRINTF1(_L("execute SetShadowHeight(TInt)")); |
|
617 GetWindowBase()->SetShadowHeight(datHeight); |
|
618 |
|
619 // No command return value and output parameter to display and check |
|
620 } |
|
621 } |
|
622 |
|
623 |
|
624 void CT_DataWindowBase::DoCmdSetShadowDisabled(const TDesC& aSection) |
|
625 { |
|
626 // Get test data for command input parameter(s) |
|
627 TBool datState = EFalse; |
|
628 |
|
629 if ( !GetBoolFromConfig(aSection, KFldState, datState) ) |
|
630 { |
|
631 ERR_PRINTF2(KLogMissingParameter, &KFldState); |
|
632 SetBlockResult(EFail); |
|
633 } |
|
634 else |
|
635 { |
|
636 // Execute command and log parameters |
|
637 INFO_PRINTF1(_L("execute SetShadowDisabled(TBool)")); |
|
638 GetWindowBase()->SetShadowDisabled(datState); |
|
639 |
|
640 // No command return value and output parameter to display and check |
|
641 } |
|
642 } |
|
643 |
|
644 |
|
645 void CT_DataWindowBase::DoCmdPosition(const TDesC& aSection) |
|
646 { |
|
647 TPoint actual=GetWindowBase()->Position(); |
|
648 INFO_PRINTF3(_L("execute Position()=(%d,%d)"), actual.iX, actual.iY); |
|
649 |
|
650 // Diaplay command return value, check if it matches the expected value |
|
651 TPoint expected; |
|
652 if ( !GetPointFromConfig(aSection, KFldExpected, expected) ) |
|
653 { |
|
654 ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected); |
|
655 SetBlockResult(EFail); |
|
656 } |
|
657 else |
|
658 { |
|
659 if ( actual!=expected ) |
|
660 { |
|
661 ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected); |
|
662 SetBlockResult(EFail); |
|
663 } |
|
664 } |
|
665 } |
|
666 |
|
667 |
|
668 void CT_DataWindowBase::DoCmdAbsPosition(const TDesC& aSection) |
|
669 { |
|
670 // Execute command and log parameters |
|
671 INFO_PRINTF1(_L("execute AbsPosition()")); |
|
672 TPoint actual=GetWindowBase()->AbsPosition(); |
|
673 |
|
674 // Diaplay command return value, check if it matches the expected value |
|
675 TPoint expected; |
|
676 if ( !GetPointFromConfig(aSection, KFldExpected, expected) ) |
|
677 { |
|
678 ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected); |
|
679 SetBlockResult(EFail); |
|
680 } |
|
681 else |
|
682 { |
|
683 if ( actual!=expected ) |
|
684 { |
|
685 ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected); |
|
686 SetBlockResult(EFail); |
|
687 } |
|
688 } |
|
689 } |
|
690 |
|
691 |
|
692 void CT_DataWindowBase::DoCmdSetCornerType(const TDesC& aSection) |
|
693 { |
|
694 TBool dataOk=ETrue; |
|
695 |
|
696 // Get test data for command input parameter(s) |
|
697 TCornerType datCornerType; |
|
698 if ( !CT_GraphicsUtil::ReadCornerType(*this, aSection, KFldCornerType, datCornerType) ) |
|
699 { |
|
700 dataOk=EFalse; |
|
701 ERR_PRINTF2(KLogMissingParameter, &KFldCornerType); |
|
702 SetBlockResult(EFail); |
|
703 } |
|
704 |
|
705 TInt datCornerFlags; |
|
706 if ( !GetHexFromConfig(aSection, KFldCornerFlags, datCornerFlags) ) |
|
707 { |
|
708 dataOk=EFalse; |
|
709 ERR_PRINTF2(KLogMissingParameter, &KFldCornerFlags); |
|
710 SetBlockResult(EFail); |
|
711 } |
|
712 |
|
713 if ( dataOk ) |
|
714 { |
|
715 // Execute command and log parameters |
|
716 INFO_PRINTF1(_L("execute SetCornerType(TCornerType, TInt)")); |
|
717 GetWindowBase()->SetCornerType(datCornerType, datCornerFlags); |
|
718 } |
|
719 } |
|
720 |
|
721 |
|
722 void CT_DataWindowBase::DoCmdSetShapeL(const TDesC& aSection) |
|
723 { |
|
724 // Get test data for command input parameter(s) |
|
725 RRegion region(1); |
|
726 CleanupClosePushL(region); |
|
727 |
|
728 if ( !GetRegionFromConfig(aSection, KFldRegion, region) ) |
|
729 { |
|
730 ERR_PRINTF2(KLogMissingParameter, &KFldRegion); |
|
731 SetBlockResult(EFail); |
|
732 } |
|
733 else |
|
734 { |
|
735 // Execute command and log parameters |
|
736 INFO_PRINTF1(_L("execute SetShape(TRegion)")); |
|
737 TInt err=GetWindowBase()->SetShape(region); |
|
738 |
|
739 // Check the command return code, if !=KErrNone then stop this command |
|
740 if ( err!=KErrNone ) |
|
741 { |
|
742 ERR_PRINTF2(KLogError, err); |
|
743 SetError(err); |
|
744 } |
|
745 |
|
746 // No command output parameter to display and check |
|
747 } |
|
748 CleanupStack::PopAndDestroy(®ion); |
|
749 } |
|
750 |
|
751 |
|
752 void CT_DataWindowBase::DoCmdSetRequiredDisplayMode(const TDesC& aSection) |
|
753 { |
|
754 // Get test data for command input parameter(s) |
|
755 TDisplayMode datMode; |
|
756 |
|
757 if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldMode, datMode) ) |
|
758 { |
|
759 ERR_PRINTF2(KLogMissingParameter, &KFldMode); |
|
760 SetBlockResult(EFail); |
|
761 } |
|
762 else |
|
763 { |
|
764 // Execute command and log parameters |
|
765 TInt actual=GetWindowBase()->SetRequiredDisplayMode(datMode); |
|
766 INFO_PRINTF2(_L("execute SetRequiredDisplayMode(TDisplayMode)=%d"), actual); |
|
767 |
|
768 // Diaplay command return value, check if it matches the expected value |
|
769 TDisplayMode expected; |
|
770 if ( CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldExpected, expected) ) |
|
771 { |
|
772 if ( actual!=expected ) |
|
773 { |
|
774 ERR_PRINTF2(KLogNotAsExpectedValue, &KFldExpected); |
|
775 SetBlockResult(EFail); |
|
776 } |
|
777 } |
|
778 } |
|
779 } |
|
780 |
|
781 void CT_DataWindowBase::DoCmdDisplayMode(const TDesC& aSection) |
|
782 { |
|
783 // No command input parameter to process |
|
784 |
|
785 // Execute command and log parameters |
|
786 INFO_PRINTF1(_L("execute DisplayMode()")); |
|
787 TDisplayMode actualResult = GetWindowBase()->DisplayMode(); |
|
788 |
|
789 // Diaplay command return value, check if it matches the expected value |
|
790 TDisplayMode expectResult; |
|
791 if ( !CT_GraphicsUtil::ReadDisplayMode(*this, aSection, KFldExpected, expectResult) ) |
|
792 { |
|
793 ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected); |
|
794 SetBlockResult(EFail); |
|
795 } |
|
796 else if ( actualResult!=expectResult ) |
|
797 { |
|
798 ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult); |
|
799 SetBlockResult(EFail); |
|
800 } |
|
801 } |
|
802 |
|
803 |
|
804 void CT_DataWindowBase::DoCmdEnableBackup(const TDesC& aSection) |
|
805 { |
|
806 // Get test data for command input parameter(s) |
|
807 TWindowBackupType datBackupType; |
|
808 |
|
809 if ( !CT_GraphicsUtil::ReadWindowBackupType(*this, aSection, KFldBackupType, (TUint&)datBackupType) ) |
|
810 { |
|
811 ERR_PRINTF2(KLogMissingParameter, &KFldBackupType); |
|
812 SetBlockResult(EFail); |
|
813 } |
|
814 else |
|
815 { |
|
816 // Execute command and log parameters |
|
817 INFO_PRINTF1(_L("execute EnableBackup(TUint)")); |
|
818 GetWindowBase()->EnableBackup(datBackupType); |
|
819 |
|
820 // No command return value and output parameter to display and check |
|
821 } |
|
822 } |
|
823 |
|
824 |
|
825 void CT_DataWindowBase::DoCmdRequestPointerRepeatEvent(const TDesC& aSection) |
|
826 { |
|
827 TBool dataOk=ETrue; |
|
828 |
|
829 // Get test data for command input parameter(s) |
|
830 TInt datTime=0; |
|
831 if ( !GetIntFromConfig(aSection, KFldTime, datTime) ) |
|
832 { |
|
833 dataOk=EFalse; |
|
834 ERR_PRINTF2(KLogMissingParameter, &KFldTime); |
|
835 SetBlockResult(EFail); |
|
836 } |
|
837 |
|
838 TRect datRect; |
|
839 if ( !GetRectFromConfig(aSection, KFldRect, datRect) ) |
|
840 { |
|
841 dataOk=EFalse; |
|
842 ERR_PRINTF2(KLogMissingParameter, &KFldRect); |
|
843 SetBlockResult(EFail); |
|
844 } |
|
845 |
|
846 if ( dataOk ) |
|
847 { |
|
848 // Execute command and log parameters |
|
849 INFO_PRINTF1(_L("execute RequestPointerRepeatEvent(TTimeIntervalMicroSeconds32, TRect)")); |
|
850 GetWindowBase()->RequestPointerRepeatEvent((TTimeIntervalMicroSeconds32)datTime, datRect); |
|
851 |
|
852 // No command return value and output parameter to display and check |
|
853 } |
|
854 } |
|
855 |
|
856 void CT_DataWindowBase::DoCmdCancelPointerRepeatEventRequest() |
|
857 { |
|
858 // No command input parameter to process |
|
859 |
|
860 // Execute command and log parameters |
|
861 INFO_PRINTF1(_L("execute CancelPointerRepeatEventRequest()")); |
|
862 GetWindowBase()->CancelPointerRepeatEventRequest(); |
|
863 |
|
864 // No command return value and output parameter to display and check |
|
865 } |
|
866 |
|
867 |
|
868 void CT_DataWindowBase::DoCmdAllocPointerMoveBuffer(const TDesC& aSection) |
|
869 { |
|
870 TBool dataOk=ETrue; |
|
871 |
|
872 // Get test data for command input parameter(s) |
|
873 TInt datMaxPoints; |
|
874 if ( !GetIntFromConfig(aSection, KFldMaxPoints, datMaxPoints) ) |
|
875 { |
|
876 dataOk=EFalse; |
|
877 ERR_PRINTF2(KLogMissingParameter, &KFldMaxPoints); |
|
878 SetBlockResult(EFail); |
|
879 } |
|
880 |
|
881 TInt datFlags; |
|
882 if ( !GetIntFromConfig(aSection, KFldFlags, datFlags) ) |
|
883 { |
|
884 dataOk=EFalse; |
|
885 ERR_PRINTF2(KLogMissingParameter, &KFldFlags); |
|
886 SetBlockResult(EFail); |
|
887 } |
|
888 |
|
889 if ( dataOk ) |
|
890 { |
|
891 // Execute command and log parameters |
|
892 INFO_PRINTF1(_L("execute AllocPointerMoveBuffer(TInt, TUint)")); |
|
893 TInt returnCode = GetWindowBase()->AllocPointerMoveBuffer(datMaxPoints, datFlags); |
|
894 |
|
895 // Check the command return code, if !=KErrNone then stop this command |
|
896 if ( returnCode!=KErrNone ) |
|
897 { |
|
898 ERR_PRINTF2(KLogError, returnCode); |
|
899 SetError(returnCode); |
|
900 } |
|
901 |
|
902 // No command output parameter to display and check |
|
903 } |
|
904 } |
|
905 |
|
906 |
|
907 void CT_DataWindowBase::DoCmdFreePointerMoveBuffer() |
|
908 { |
|
909 // No command input parameter to process |
|
910 |
|
911 // Execute command and log parameters |
|
912 INFO_PRINTF1(_L("execute FreePointerMoveBuffer()")); |
|
913 GetWindowBase()->FreePointerMoveBuffer(); |
|
914 |
|
915 // No command return value and output parameter to display and check |
|
916 } |
|
917 |
|
918 |
|
919 void CT_DataWindowBase::DoCmdEnablePointerMoveBuffer() |
|
920 { |
|
921 // No command input parameter to process |
|
922 |
|
923 // Execute command and log parameters |
|
924 INFO_PRINTF1(_L("execute EnablePointerMoveBuffer()")); |
|
925 GetWindowBase()->EnablePointerMoveBuffer(); |
|
926 |
|
927 // No command return value and output parameter to display and check |
|
928 } |
|
929 |
|
930 |
|
931 void CT_DataWindowBase::DoCmdDisablePointerMoveBuffer() |
|
932 { |
|
933 // No command input parameter to process |
|
934 |
|
935 // Execute command and log parameters |
|
936 INFO_PRINTF1(_L("execute DisablePointerMoveBuffer()")); |
|
937 GetWindowBase()->DisablePointerMoveBuffer(); |
|
938 |
|
939 // No command return value and output parameter to display and check |
|
940 } |
|
941 |
|
942 void CT_DataWindowBase::DoCmdRetrievePointerMoveBufferL(const TDesC& aSection) |
|
943 { |
|
944 const TInt KPointerMoveBufferSize = 50; |
|
945 TInt maxPoints=KPointerMoveBufferSize; |
|
946 GetIntFromConfig(aSection, KFldMaxPoints, maxPoints); |
|
947 |
|
948 TPoint* pnts = new (ELeave) TPoint[maxPoints]; |
|
949 CleanupArrayDeletePushL(pnts); |
|
950 TPtr8 ptr((TUint8 *)pnts,sizeof(TPoint)*maxPoints); |
|
951 |
|
952 INFO_PRINTF1(_L("execute RetrievePointerMoveBuffer(TDes8&)")); |
|
953 TInt err=GetWindowBase()->RetrievePointerMoveBuffer(ptr); |
|
954 |
|
955 if ( err<KErrNone ) |
|
956 { |
|
957 ERR_PRINTF2(KLogError, err); |
|
958 SetError(err); |
|
959 } |
|
960 else |
|
961 { |
|
962 TInt numberOfPointsInBuffer = ptr.Length() / sizeof(TPoint); |
|
963 TInt expectedNumOfPoints=0; |
|
964 |
|
965 for (TInt i=0; ; i++) |
|
966 { |
|
967 TBuf<KMaxTestExecuteCommandLength> tempStore; |
|
968 tempStore.Format(_L("%S%d"), &KFldExpected, i+1); |
|
969 |
|
970 TPoint expectedPoint; |
|
971 if ( GetPointFromConfig(aSection, tempStore, expectedPoint) ) |
|
972 { |
|
973 expectedNumOfPoints++; |
|
974 if ( i<numberOfPointsInBuffer ) |
|
975 { |
|
976 if ( pnts[i]!=expectedPoint ) |
|
977 { |
|
978 ERR_PRINTF2(KLogNotAsExpectedValue, &tempStore); |
|
979 ERR_PRINTF3(_L("%d%d"), pnts[i].iX, pnts[i].iY); |
|
980 SetBlockResult(EFail); |
|
981 } |
|
982 } |
|
983 } |
|
984 else |
|
985 { |
|
986 break; |
|
987 } |
|
988 } |
|
989 |
|
990 if ( numberOfPointsInBuffer!=expectedNumOfPoints ) |
|
991 { |
|
992 ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpectedNumOfPoints, expectedNumOfPoints, numberOfPointsInBuffer); |
|
993 SetBlockResult(EFail); |
|
994 } |
|
995 } |
|
996 |
|
997 CleanupStack::PopAndDestroy(pnts); |
|
998 } |
|
999 |
|
1000 void CT_DataWindowBase::DoCmdDiscardPointerMoveBuffer() |
|
1001 { |
|
1002 // No command input parameter to process |
|
1003 |
|
1004 // Execute command and log parameters |
|
1005 INFO_PRINTF1(_L("execute DiscardPointerMoveBuffer()")); |
|
1006 GetWindowBase()->DiscardPointerMoveBuffer(); |
|
1007 |
|
1008 // No command return value and output parameter to display and check |
|
1009 } |
|
1010 |
|
1011 |
|
1012 void CT_DataWindowBase::DoCmdAddKeyRect(const TDesC& aSection) |
|
1013 { |
|
1014 TBool dataOk=ETrue; |
|
1015 |
|
1016 // Get test data for command input parameter(s) |
|
1017 TRect datRect; |
|
1018 if ( !GetRectFromConfig(aSection, KFldRect, datRect) ) |
|
1019 { |
|
1020 dataOk=EFalse; |
|
1021 ERR_PRINTF2(KLogMissingParameter, &KFldRect); |
|
1022 SetBlockResult(EFail); |
|
1023 } |
|
1024 |
|
1025 TInt datScanCode; |
|
1026 if ( !CT_GraphicsUtil::ReadStdScanCode(*this, aSection, KFldScanCode, (TStdScanCode&)datScanCode) ) |
|
1027 { |
|
1028 dataOk=EFalse; |
|
1029 ERR_PRINTF2(KLogMissingParameter, &KFldScanCode); |
|
1030 SetBlockResult(EFail); |
|
1031 } |
|
1032 |
|
1033 TBool datActivatedByPointerSwitchOn; |
|
1034 if ( !GetBoolFromConfig(aSection, KFldActivatedByPointerSwitchOn, datActivatedByPointerSwitchOn) ) |
|
1035 { |
|
1036 dataOk=EFalse; |
|
1037 ERR_PRINTF2(KLogMissingParameter, &KFldActivatedByPointerSwitchOn); |
|
1038 SetBlockResult(EFail); |
|
1039 } |
|
1040 |
|
1041 if ( dataOk ) |
|
1042 { |
|
1043 // Execute command and log parameters |
|
1044 INFO_PRINTF1(_L("execute AddKeyRect(TRect, TInt, TBool)")); |
|
1045 TInt returnCode = GetWindowBase()->AddKeyRect(datRect, datScanCode, datActivatedByPointerSwitchOn); |
|
1046 |
|
1047 // Check the command return code, if !=KErrNone then stop this command |
|
1048 if ( returnCode!=KErrNone ) |
|
1049 { |
|
1050 ERR_PRINTF2(KLogError, returnCode); |
|
1051 SetError(returnCode); |
|
1052 } |
|
1053 |
|
1054 // No command output parameter to display and check |
|
1055 } |
|
1056 } |
|
1057 |
|
1058 |
|
1059 void CT_DataWindowBase::DoCmdRemoveAllKeyRects() |
|
1060 { |
|
1061 // No command input parameter to process |
|
1062 |
|
1063 // Execute command and log parameters |
|
1064 INFO_PRINTF1(_L("execute RemoveAllKeyRects()")); |
|
1065 GetWindowBase()->RemoveAllKeyRects(); |
|
1066 |
|
1067 // No command return value and output parameter to display and check |
|
1068 } |
|
1069 |
|
1070 |
|
1071 void CT_DataWindowBase::DoCmdPasswordWindow(const TDesC& aSection) |
|
1072 { |
|
1073 // Get test data for command input parameter(s) |
|
1074 TPasswordMode datPasswordMode; |
|
1075 |
|
1076 if ( !CT_GraphicsUtil::ReadPasswordMode(*this, aSection, KFldPasswordMode, datPasswordMode) ) |
|
1077 { |
|
1078 ERR_PRINTF2(KLogMissingParameter, &KFldPasswordMode); |
|
1079 SetBlockResult(EFail); |
|
1080 } |
|
1081 else |
|
1082 { |
|
1083 // Execute command and log parameters |
|
1084 INFO_PRINTF1(_L("execute PasswordWindow(TPasswordMode)")); |
|
1085 TInt returnCode = GetWindowBase()->PasswordWindow(datPasswordMode); |
|
1086 |
|
1087 // Check the command return code, if !=KErrNone then stop this command |
|
1088 if ( returnCode!=KErrNone ) |
|
1089 { |
|
1090 ERR_PRINTF2(KLogError, returnCode); |
|
1091 SetError(returnCode); |
|
1092 } |
|
1093 |
|
1094 // No command output parameter to display and check |
|
1095 } |
|
1096 } |
|
1097 |
|
1098 |
|
1099 void CT_DataWindowBase::DoCmdFadeBehind(const TDesC& aSection) |
|
1100 { |
|
1101 // Get test data for command input parameter(s) |
|
1102 TBool datFade; |
|
1103 |
|
1104 if ( !GetBoolFromConfig(aSection, KFldFade, datFade) ) |
|
1105 { |
|
1106 ERR_PRINTF2(KLogMissingParameter, &KFldFade); |
|
1107 SetBlockResult(EFail); |
|
1108 } |
|
1109 else |
|
1110 { |
|
1111 // Execute command and log parameters |
|
1112 INFO_PRINTF1(_L("execute FadeBehind(TBool)")); |
|
1113 GetWindowBase()->FadeBehind(datFade); |
|
1114 |
|
1115 // No command return value and output parameter to display and check |
|
1116 } |
|
1117 } |
|
1118 |
|
1119 |
|
1120 void CT_DataWindowBase::DoCmdIsFaded(const TDesC& aSection) |
|
1121 { |
|
1122 // Execute command and log parameters |
|
1123 INFO_PRINTF1(_L("execute IsFaded()")); |
|
1124 TBool actualResult = GetWindowBase()->IsFaded(); |
|
1125 |
|
1126 // Diaplay command return value, check if it matches the expected value |
|
1127 TBool expectResult; |
|
1128 if ( !GetBoolFromConfig(aSection, KFldExpected, expectResult) ) |
|
1129 { |
|
1130 ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected()); |
|
1131 SetBlockResult(EFail); |
|
1132 } |
|
1133 else |
|
1134 { |
|
1135 if ( (actualResult!=0) != expectResult ) |
|
1136 { |
|
1137 ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult); |
|
1138 SetBlockResult(EFail); |
|
1139 } |
|
1140 } |
|
1141 } |
|
1142 |
|
1143 |
|
1144 void CT_DataWindowBase::DoCmdIsNonFading(const TDesC& aSection) |
|
1145 { |
|
1146 // Execute command and log parameters |
|
1147 INFO_PRINTF1(_L("execute IsNonFading()")); |
|
1148 TBool actualResult = GetWindowBase()->IsNonFading(); |
|
1149 |
|
1150 // Diaplay command return value, check if it matches the expected value |
|
1151 TBool expectResult; |
|
1152 if ( !GetBoolFromConfig(aSection, KFldExpected, expectResult) ) |
|
1153 { |
|
1154 ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected()); |
|
1155 SetBlockResult(EFail); |
|
1156 } |
|
1157 else |
|
1158 { |
|
1159 if ( (actualResult!=0) != expectResult ) |
|
1160 { |
|
1161 ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult); |
|
1162 SetBlockResult(EFail); |
|
1163 } |
|
1164 } |
|
1165 } |
|
1166 |
|
1167 |
|
1168 void CT_DataWindowBase::DoCmdMoveToGroupL(const TDesC& aSection) |
|
1169 { |
|
1170 TBool dataOk=ETrue; |
|
1171 |
|
1172 // Get test data for command input parameter(s) |
|
1173 TInt datIdentifier; |
|
1174 if ( !GetIntFromConfig(aSection, KFldIdentifier, datIdentifier) ) |
|
1175 { |
|
1176 TPtrC identifierName; |
|
1177 RWindowGroup* identifier = NULL; |
|
1178 if ( GetStringFromConfig(aSection, KFldIdentifier_Name, identifierName) ) |
|
1179 { |
|
1180 identifier = static_cast<RWindowGroup*>(GetDataObjectL(identifierName)); |
|
1181 } |
|
1182 |
|
1183 if ( identifier==NULL ) |
|
1184 { |
|
1185 dataOk=EFalse; |
|
1186 ERR_PRINTF2(KLogMissingParameter, &KFldIdentifier); |
|
1187 SetBlockResult(EFail); |
|
1188 } |
|
1189 else |
|
1190 { |
|
1191 datIdentifier = identifier->Identifier(); |
|
1192 INFO_PRINTF3(_L("get '%S_name' identifier = %d to MoveToGroup"), &KFldIdentifier, datIdentifier); |
|
1193 } |
|
1194 } |
|
1195 |
|
1196 if ( dataOk ) |
|
1197 { |
|
1198 // Execute command and log parameters |
|
1199 INFO_PRINTF1(_L("execute MoveToGroup(TInt)")); |
|
1200 TInt returnCode = GetWindowBase()->MoveToGroup(datIdentifier); |
|
1201 |
|
1202 // Check the command return code, if !=KErrNone then stop this command |
|
1203 if ( returnCode!=KErrNone ) |
|
1204 { |
|
1205 ERR_PRINTF2(KLogError, returnCode); |
|
1206 SetError(returnCode); |
|
1207 } |
|
1208 |
|
1209 // No command output parameter to display and check |
|
1210 } |
|
1211 } |