|
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 "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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #include "T_DataWindow.h" |
|
19 #include "T_GraphicsUtil.h" |
|
20 |
|
21 /*@{*/ |
|
22 _LIT(KDataClassname, "RWindow"); |
|
23 |
|
24 //Commands |
|
25 _LIT(KCmdnew, "new"); |
|
26 _LIT(KCmdDestructor, "~"); |
|
27 _LIT(KCmdConstruct, "Construct"); |
|
28 _LIT(KCmdBeginRedraw, "BeginRedraw"); |
|
29 _LIT(KCmdEndRedraw, "EndRedraw"); |
|
30 _LIT(KCmdInvalidate, "Invalidate"); |
|
31 _LIT(KCmdGetInvalidRegion, "GetInvalidRegion"); |
|
32 _LIT(KCmdSetBackgroundColor, "SetBackgroundColor"); |
|
33 _LIT(KCmdSetSize, "SetSize"); |
|
34 _LIT(KCmdSetExtent, "SetExtent"); |
|
35 _LIT(KCmdHandleTransparencyUpdate, "HandleTransparencyUpdate"); |
|
36 _LIT(KCmdSetTransparencyFactor, "SetTransparencyFactor"); |
|
37 _LIT(KCmdSetTransparencyBitmap, "SetTransparencyBitmap"); |
|
38 _LIT(KCmdSetTransparencyWsBitmap, "SetTransparencyWsBitmap"); |
|
39 _LIT(KCmdSetNonTransparent, "SetNonTransparent"); |
|
40 _LIT(KCmdEnableRedrawStore, "EnableRedrawStore"); |
|
41 _LIT(KCmdSetTransparencyAlphaChannel, "SetTransparencyAlphaChannel"); |
|
42 _LIT(KCmdSetTransparentRegion, "SetTransparentRegion"); |
|
43 _LIT(KCmdSetTransparencyPolicy, "SetTransparencyPolicy"); |
|
44 _LIT(KCmdIsRedrawStoreEnabled, "IsRedrawStoreEnabled"); |
|
45 _LIT(KCmdEnableOSB, "EnableOSB"); |
|
46 |
|
47 // Fields |
|
48 _LIT(KFldColor, "color"); |
|
49 _LIT(KFldEnabled, "enabled"); |
|
50 _LIT(KFldExpected, "expected"); |
|
51 _LIT(KFldFlag, "flag"); |
|
52 _LIT(KFldHandle, "handle"); |
|
53 _LIT(KFldParent, "parent"); |
|
54 _LIT(KFldPoint, "point"); |
|
55 _LIT(KFldPolicy, "policy"); |
|
56 _LIT(KFldRect, "rect"); |
|
57 _LIT(KFldRegion, "region"); |
|
58 _LIT(KFldSize, "size"); |
|
59 _LIT(KFldTransparencyBitmap, "transparencybitmap"); |
|
60 _LIT(KFldTransparencyFactor, "transparencyfactor"); |
|
61 _LIT(KFldWs, "ws"); |
|
62 |
|
63 /// Logging |
|
64 _LIT(KLogError, "Error=%d"); |
|
65 _LIT(KLogMissingParameter, "Missing parameter '%S'"); |
|
66 _LIT(KLogMissingExpectedValue, "Missing expected value '%S'"); |
|
67 _LIT(KLogNotExpectedValueInt, "'%S' is not as expected=%d, actual=%d"); |
|
68 |
|
69 /*@}*/ |
|
70 |
|
71 ////////////////////////////////////////////////////////////////////// |
|
72 // Construction/Destruction |
|
73 ////////////////////////////////////////////////////////////////////// |
|
74 |
|
75 CT_DataWindow* CT_DataWindow::NewL() |
|
76 { |
|
77 CT_DataWindow* ret=new (ELeave) CT_DataWindow(); |
|
78 CleanupStack::PushL(ret); |
|
79 ret->ConstructL(); |
|
80 CleanupStack::Pop(ret); |
|
81 return ret; |
|
82 } |
|
83 |
|
84 CT_DataWindow::CT_DataWindow() |
|
85 : CT_DataDrawableWindow() |
|
86 , iWindow(NULL) |
|
87 { |
|
88 } |
|
89 |
|
90 void CT_DataWindow::ConstructL() |
|
91 { |
|
92 } |
|
93 |
|
94 CT_DataWindow::~CT_DataWindow() |
|
95 { |
|
96 DestroyData(); |
|
97 } |
|
98 |
|
99 void CT_DataWindow::SetObjectL(TAny* aAny) |
|
100 { |
|
101 DestroyData(); |
|
102 iWindow = static_cast<RWindow*> (aAny); |
|
103 } |
|
104 |
|
105 void CT_DataWindow::DisownObjectL() |
|
106 { |
|
107 iWindow = NULL; |
|
108 } |
|
109 |
|
110 void CT_DataWindow::DestroyData() |
|
111 { |
|
112 delete iWindow; |
|
113 iWindow=NULL; |
|
114 } |
|
115 |
|
116 RDrawableWindow* CT_DataWindow::GetDrawableWindow() const |
|
117 { |
|
118 return iWindow; |
|
119 } |
|
120 |
|
121 /** |
|
122 * Process a command read from the ini file |
|
123 * |
|
124 * @param aCommand the command to process |
|
125 * @param aSection the entry in the ini file requiring the command to be processed |
|
126 * @param aAsyncErrorIndex index of command. used for async calls |
|
127 * |
|
128 * @return ETrue if the command is processed |
|
129 */ |
|
130 TBool CT_DataWindow::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection, const TInt aAsyncErrorIndex) |
|
131 { |
|
132 TBool ret = ETrue; |
|
133 |
|
134 if ( aCommand==KCmdDestructor ) |
|
135 { |
|
136 DestroyData(); |
|
137 } |
|
138 else if ( aCommand==KCmdnew || aCommand==KDataClassname ) |
|
139 { |
|
140 DoCmdnewL(aSection); |
|
141 } |
|
142 else if ( aCommand==KCmdConstruct ) |
|
143 { |
|
144 DoCmdConstructL(aSection); |
|
145 } |
|
146 else if ( aCommand==KCmdBeginRedraw ) |
|
147 { |
|
148 DoCmdBeginRedraw(aSection); |
|
149 } |
|
150 else if ( aCommand==KCmdEndRedraw ) |
|
151 { |
|
152 DoCmdEndRedraw(); |
|
153 } |
|
154 else if ( aCommand==KCmdInvalidate ) |
|
155 { |
|
156 DoCmdInvalidate(aSection); |
|
157 } |
|
158 else if ( aCommand==KCmdGetInvalidRegion ) |
|
159 { |
|
160 DoCmdGetInvalidRegionL(aSection); |
|
161 } |
|
162 else if ( aCommand==KCmdSetBackgroundColor ) |
|
163 { |
|
164 DoCmdSetBackgroundColor(aSection); |
|
165 } |
|
166 else if ( aCommand==KCmdSetSize ) |
|
167 { |
|
168 DoCmdSetSize(aSection); |
|
169 } |
|
170 else if ( aCommand==KCmdSetExtent ) |
|
171 { |
|
172 DoCmdSetExtent(aSection); |
|
173 } |
|
174 else if ( aCommand==KCmdHandleTransparencyUpdate ) |
|
175 { |
|
176 DoCmdHandleTransparencyUpdate(); |
|
177 } |
|
178 else if ( aCommand==KCmdSetTransparencyFactor ) |
|
179 { |
|
180 DoCmdSetTransparencyFactor(aSection); |
|
181 } |
|
182 else if ( aCommand==KCmdSetTransparencyBitmap ) |
|
183 { |
|
184 DoCmdSetTransparencyBitmapL(aSection); |
|
185 } |
|
186 else if ( aCommand==KCmdSetTransparencyWsBitmap ) |
|
187 { |
|
188 DoCmdSetTransparencyWsBitmapL(aSection); |
|
189 } |
|
190 else if ( aCommand==KCmdSetNonTransparent ) |
|
191 { |
|
192 DoCmdSetNonTransparent(); |
|
193 } |
|
194 else if ( aCommand==KCmdEnableRedrawStore ) |
|
195 { |
|
196 DoCmdEnableRedrawStore(aSection); |
|
197 } |
|
198 else if ( aCommand==KCmdSetTransparencyAlphaChannel ) |
|
199 { |
|
200 DoCmdSetTransparencyAlphaChannel(); |
|
201 } |
|
202 else if ( aCommand==KCmdSetTransparentRegion ) |
|
203 { |
|
204 DoCmdSetTransparentRegionL(aSection); |
|
205 } |
|
206 else if ( aCommand==KCmdSetTransparencyPolicy ) |
|
207 { |
|
208 DoCmdSetTransparencyPolicy(aSection); |
|
209 } |
|
210 else if ( aCommand==KCmdIsRedrawStoreEnabled ) |
|
211 { |
|
212 DoCmdIsRedrawStoreEnabled(aSection); |
|
213 } |
|
214 else if ( aCommand==KCmdEnableOSB ) |
|
215 { |
|
216 DoCmdEnableOSB(aSection); |
|
217 } |
|
218 else |
|
219 { |
|
220 ret=CT_DataDrawableWindow::DoCommandL(aCommand, aSection, aAsyncErrorIndex); |
|
221 } |
|
222 |
|
223 return ret; |
|
224 } |
|
225 |
|
226 |
|
227 void CT_DataWindow::DoCmdnewL(const TDesC& aSection) |
|
228 { |
|
229 DestroyData(); |
|
230 |
|
231 // Get test data for command input parameter(s) |
|
232 TPtrC wsName; |
|
233 RWsSession* ws=NULL; |
|
234 if ( GetStringFromConfig(aSection, KFldWs, wsName) ) |
|
235 { |
|
236 ws = static_cast<RWsSession*>(GetDataObjectL(wsName)); |
|
237 } |
|
238 |
|
239 TInt err=KErrNone; |
|
240 if ( ws!=NULL ) |
|
241 { |
|
242 // Execute command and log parameters |
|
243 INFO_PRINTF1(_L("execute new RWindow(RWsSession)")); |
|
244 TRAP( err, iWindow = new (ELeave) RWindow(*ws)); |
|
245 } |
|
246 else |
|
247 { |
|
248 // Execute command and log parameters |
|
249 INFO_PRINTF1(_L("execute new RWindow()")); |
|
250 TRAP( err, iWindow = new (ELeave) RWindow()); |
|
251 } |
|
252 |
|
253 if ( err!=KErrNone ) |
|
254 { |
|
255 ERR_PRINTF2(KLogError, err); |
|
256 SetError(err); |
|
257 } |
|
258 } |
|
259 |
|
260 |
|
261 void CT_DataWindow::DoCmdConstructL(const TDesC& aSection) |
|
262 { |
|
263 TBool dataOk=ETrue; |
|
264 |
|
265 // Get test data for command input parameter(s) |
|
266 TPtrC parentName; |
|
267 RWindowTreeNode* parent=NULL; |
|
268 if ( GetStringFromConfig(aSection, KFldParent, parentName) ) |
|
269 { |
|
270 parent = static_cast<RWindowTreeNode*>(GetDataObjectL(parentName)); |
|
271 } |
|
272 if ( parent==NULL ) |
|
273 { |
|
274 dataOk=EFalse; |
|
275 ERR_PRINTF2(KLogMissingParameter, &KFldParent); |
|
276 SetBlockResult(EFail); |
|
277 } |
|
278 |
|
279 TInt datHandle; |
|
280 if ( !GetIntFromConfig(aSection, KFldHandle, datHandle) ) |
|
281 { |
|
282 dataOk=EFalse; |
|
283 ERR_PRINTF2(KLogMissingParameter, &KFldHandle); |
|
284 SetBlockResult(EFail); |
|
285 } |
|
286 |
|
287 if ( dataOk ) |
|
288 { |
|
289 // Execute command and log parameters |
|
290 INFO_PRINTF1(_L("execute Construct(RWindowTreeNode, TUint32)")); |
|
291 TInt returnCode = iWindow->Construct(*parent, datHandle); |
|
292 |
|
293 // Check the command return code, if !=KErrNone then stop this command |
|
294 if ( returnCode!=KErrNone ) |
|
295 { |
|
296 ERR_PRINTF2(KLogError, returnCode); |
|
297 SetError(returnCode); |
|
298 } |
|
299 |
|
300 // No command output parameter to display and check |
|
301 } |
|
302 } |
|
303 |
|
304 |
|
305 void CT_DataWindow::DoCmdBeginRedraw(const TDesC& aSection) |
|
306 { |
|
307 // Get test data for command input parameter(s) |
|
308 TRect datRect; |
|
309 |
|
310 if ( GetRectFromConfig(aSection, KFldRect, datRect) ) |
|
311 { |
|
312 // Execute command and log parameters |
|
313 INFO_PRINTF1(_L("execute BeginRedraw(TRect)")); |
|
314 iWindow->BeginRedraw(datRect); |
|
315 } |
|
316 else |
|
317 { |
|
318 // Execute command and log parameters |
|
319 INFO_PRINTF1(_L("execute BeginRedraw()")); |
|
320 iWindow->BeginRedraw(); |
|
321 } |
|
322 |
|
323 // No command return value and output parameter to display and check |
|
324 } |
|
325 |
|
326 |
|
327 void CT_DataWindow::DoCmdEndRedraw() |
|
328 { |
|
329 // No command input parameter to process |
|
330 |
|
331 // Execute command and log parameters |
|
332 INFO_PRINTF1(_L("execute EndRedraw()")); |
|
333 iWindow->EndRedraw(); |
|
334 |
|
335 // No command return value and output parameter to display and check |
|
336 } |
|
337 |
|
338 |
|
339 void CT_DataWindow::DoCmdInvalidate(const TDesC& aSection) |
|
340 { |
|
341 // Get test data for command input parameter(s) |
|
342 TRect datRect; |
|
343 |
|
344 if ( GetRectFromConfig(aSection, KFldRect, datRect) ) |
|
345 { |
|
346 // Execute command and log parameters |
|
347 INFO_PRINTF1(_L("execute Invalidate(TRect)")); |
|
348 iWindow->Invalidate(datRect); |
|
349 } |
|
350 else |
|
351 { |
|
352 // Execute command and log parameters |
|
353 INFO_PRINTF1(_L("execute Invalidate()")); |
|
354 iWindow->Invalidate(); |
|
355 } |
|
356 |
|
357 // No command return value and output parameter to display and check |
|
358 } |
|
359 |
|
360 |
|
361 void CT_DataWindow::DoCmdGetInvalidRegionL(const TDesC& aSection) |
|
362 { |
|
363 RRegion region(1); |
|
364 CleanupClosePushL(region); |
|
365 |
|
366 // No command input parameter to process |
|
367 |
|
368 // Execute command and log parameters |
|
369 INFO_PRINTF1(_L("execute GetInvalidRegion(RRegion)")); |
|
370 iWindow->GetInvalidRegion(region); |
|
371 |
|
372 // Diaplay command return value, check if it matches the expected value |
|
373 LogRegion(_L("GetInvalidRegion()"), region); |
|
374 |
|
375 RRegion expectedRegion(1); |
|
376 CleanupClosePushL(expectedRegion); |
|
377 if ( GetRegionFromConfig(aSection, KFldExpected, expectedRegion) ) |
|
378 { |
|
379 region.SubRegion(expectedRegion); |
|
380 if ( !region.IsEmpty() ) |
|
381 { |
|
382 ERR_PRINTF1(_L("Region not as expected")); |
|
383 LogRegion(_L("Region mismatch"), region); |
|
384 SetBlockResult(EFail); |
|
385 } |
|
386 } |
|
387 |
|
388 CleanupStack::PopAndDestroy(2, ®ion); |
|
389 } |
|
390 |
|
391 |
|
392 void CT_DataWindow::DoCmdSetBackgroundColor(const TDesC& aSection) |
|
393 { |
|
394 // Get test data for command input parameter(s) |
|
395 TRgb datColor; |
|
396 |
|
397 if ( GetRgbFromConfig(aSection, KFldColor, datColor) ) |
|
398 { |
|
399 // Execute command and log parameters |
|
400 INFO_PRINTF1(_L("execute SetBackgroundColor(TRgb)")); |
|
401 iWindow->SetBackgroundColor(datColor); |
|
402 } |
|
403 else |
|
404 { |
|
405 // Execute command and log parameters |
|
406 INFO_PRINTF1(_L("execute SetBackgroundColor()")); |
|
407 iWindow->SetBackgroundColor(); |
|
408 } |
|
409 |
|
410 // No command return value and output parameter to display and check |
|
411 } |
|
412 |
|
413 |
|
414 void CT_DataWindow::DoCmdSetSize(const TDesC& aSection) |
|
415 { |
|
416 // Get test data for command input parameter(s) |
|
417 TSize datSize; |
|
418 if ( !GetSizeFromConfig(aSection, KFldSize, datSize) ) |
|
419 { |
|
420 ERR_PRINTF2(KLogMissingParameter, &KFldSize); |
|
421 SetBlockResult(EFail); |
|
422 } |
|
423 else |
|
424 { |
|
425 // Execute command and log parameters |
|
426 INFO_PRINTF1(_L("execute SetSize(TSize)")); |
|
427 iWindow->SetSize(datSize); |
|
428 |
|
429 // No command return value and output parameter to display and check |
|
430 } |
|
431 } |
|
432 |
|
433 |
|
434 void CT_DataWindow::DoCmdSetExtent(const TDesC& aSection) |
|
435 { |
|
436 TBool dataOk=ETrue; |
|
437 |
|
438 // Get test data for command input parameter(s) |
|
439 TPoint datPoint; |
|
440 if ( !GetPointFromConfig(aSection, KFldPoint, datPoint) ) |
|
441 { |
|
442 dataOk=EFalse; |
|
443 ERR_PRINTF2(KLogMissingParameter, &KFldPoint); |
|
444 SetBlockResult(EFail); |
|
445 } |
|
446 |
|
447 TSize datSize; |
|
448 if ( !GetSizeFromConfig(aSection, KFldSize, datSize) ) |
|
449 { |
|
450 dataOk=EFalse; |
|
451 ERR_PRINTF2(KLogMissingParameter, &KFldSize); |
|
452 SetBlockResult(EFail); |
|
453 } |
|
454 |
|
455 if ( dataOk ) |
|
456 { |
|
457 // Execute command and log parameters |
|
458 INFO_PRINTF1(_L("execute SetExtent(TPoint, TSize)")); |
|
459 iWindow->SetExtent(datPoint, datSize); |
|
460 |
|
461 // No command return value and output parameter to display and check |
|
462 } |
|
463 } |
|
464 |
|
465 |
|
466 void CT_DataWindow::DoCmdHandleTransparencyUpdate() |
|
467 { |
|
468 // No command input parameter to process |
|
469 |
|
470 // Execute command and log parameters |
|
471 INFO_PRINTF1(_L("execute HandleTransparencyUpdate()")); |
|
472 iWindow->HandleTransparencyUpdate(); |
|
473 |
|
474 // No command return value and output parameter to display and check |
|
475 } |
|
476 |
|
477 |
|
478 void CT_DataWindow::DoCmdSetTransparencyFactor(const TDesC& aSection) |
|
479 { |
|
480 // Get test data for command input parameter(s) |
|
481 TRgb datTransparencyFactor; |
|
482 |
|
483 if ( !GetRgbFromConfig(aSection, KFldTransparencyFactor, datTransparencyFactor) ) |
|
484 { |
|
485 ERR_PRINTF2(KLogMissingParameter, &KFldTransparencyFactor); |
|
486 SetBlockResult(EFail); |
|
487 } |
|
488 else |
|
489 { |
|
490 // Execute command and log parameters |
|
491 INFO_PRINTF1(_L("execute SetTransparencyFactor(TRgb)")); |
|
492 TInt returnCode = iWindow->SetTransparencyFactor(datTransparencyFactor); |
|
493 |
|
494 // Check the command return code, if !=KErrNone then stop this command |
|
495 if ( returnCode!=KErrNone ) |
|
496 { |
|
497 ERR_PRINTF2(KLogError, returnCode); |
|
498 SetError(returnCode); |
|
499 } |
|
500 |
|
501 // No command output parameter to display and check |
|
502 } |
|
503 } |
|
504 |
|
505 |
|
506 void CT_DataWindow::DoCmdSetTransparencyBitmapL(const TDesC& aSection) |
|
507 { |
|
508 // Get test data for command input parameter(s) |
|
509 CFbsBitmap* transparencyBitmap = NULL; |
|
510 |
|
511 if ( !CT_GraphicsUtil::GetFbsBitmapL(*this, aSection, KFldTransparencyBitmap, transparencyBitmap) ) |
|
512 { |
|
513 ERR_PRINTF2(KLogMissingParameter, &KFldTransparencyBitmap); |
|
514 SetBlockResult(EFail); |
|
515 } |
|
516 else |
|
517 { |
|
518 // Execute command and log parameters |
|
519 INFO_PRINTF1(_L("execute SetTransparencyBitmap(CFbsBitmap)")); |
|
520 TInt returnCode = iWindow->SetTransparencyBitmap(*transparencyBitmap); |
|
521 |
|
522 // Check the command return code, if !=KErrNone then stop this command |
|
523 if ( returnCode!=KErrNone ) |
|
524 { |
|
525 ERR_PRINTF2(KLogError, returnCode); |
|
526 SetError(returnCode); |
|
527 } |
|
528 |
|
529 // No command output parameter to display and check |
|
530 } |
|
531 } |
|
532 |
|
533 |
|
534 void CT_DataWindow::DoCmdSetTransparencyWsBitmapL(const TDesC& aSection) |
|
535 { |
|
536 // Get test data for command input parameter(s) |
|
537 CWsBitmap* transparencyBitmap = NULL; |
|
538 |
|
539 if ( !CT_GraphicsUtil::GetWsBitmapL(*this, aSection, KFldTransparencyBitmap, transparencyBitmap) ) |
|
540 { |
|
541 ERR_PRINTF2(KLogMissingParameter, &KFldTransparencyBitmap); |
|
542 SetBlockResult(EFail); |
|
543 } |
|
544 else |
|
545 { |
|
546 // Execute command and log parameters |
|
547 INFO_PRINTF1(_L("execute SetTransparencyWsBitmap(CWsBitmap)")); |
|
548 TInt returnCode = iWindow->SetTransparencyWsBitmap(*transparencyBitmap); |
|
549 |
|
550 // Check the command return code, if !=KErrNone then stop this command |
|
551 if ( returnCode!=KErrNone ) |
|
552 { |
|
553 ERR_PRINTF2(KLogError, returnCode); |
|
554 SetError(returnCode); |
|
555 } |
|
556 |
|
557 // No command output parameter to display and check |
|
558 } |
|
559 } |
|
560 |
|
561 |
|
562 void CT_DataWindow::DoCmdSetNonTransparent() |
|
563 { |
|
564 // No command input parameter to process |
|
565 |
|
566 // Execute command and log parameters |
|
567 INFO_PRINTF1(_L("execute SetNonTransparent()")); |
|
568 iWindow->SetNonTransparent(); |
|
569 |
|
570 // No command return value and output parameter to display and check |
|
571 } |
|
572 |
|
573 |
|
574 void CT_DataWindow::DoCmdEnableRedrawStore(const TDesC& aSection) |
|
575 { |
|
576 // Get test data for command input parameter(s) |
|
577 TBool datEnabled; |
|
578 |
|
579 if ( !GetBoolFromConfig(aSection, KFldEnabled, datEnabled) ) |
|
580 { |
|
581 ERR_PRINTF2(KLogMissingParameter, &KFldEnabled); |
|
582 SetBlockResult(EFail); |
|
583 } |
|
584 else |
|
585 { |
|
586 // Execute command and log parameters |
|
587 INFO_PRINTF1(_L("execute EnableRedrawStore(TBool)")); |
|
588 iWindow->EnableRedrawStore(datEnabled); |
|
589 |
|
590 // No command return value and output parameter to display and check |
|
591 } |
|
592 } |
|
593 |
|
594 |
|
595 void CT_DataWindow::DoCmdSetTransparencyAlphaChannel() |
|
596 { |
|
597 // No command input parameter to process |
|
598 |
|
599 // Execute command and log parameters |
|
600 INFO_PRINTF1(_L("execute SetTransparencyAlphaChannel()")); |
|
601 TInt returnCode = iWindow->SetTransparencyAlphaChannel(); |
|
602 |
|
603 // Check the command return code, if !=KErrNone then stop this command |
|
604 if ( returnCode!=KErrNone ) |
|
605 { |
|
606 ERR_PRINTF2(KLogError, returnCode); |
|
607 SetError(returnCode); |
|
608 } |
|
609 |
|
610 // No command output parameter to display and check |
|
611 } |
|
612 |
|
613 |
|
614 void CT_DataWindow::DoCmdSetTransparentRegionL(const TDesC& aSection) |
|
615 { |
|
616 // Get test data for command input parameter(s) |
|
617 RRegion region(1); |
|
618 CleanupClosePushL(region); |
|
619 |
|
620 if ( !GetRegionFromConfig(aSection, KFldRegion, region) ) |
|
621 { |
|
622 ERR_PRINTF2(KLogMissingParameter, &KFldRegion); |
|
623 SetBlockResult(EFail); |
|
624 } |
|
625 else |
|
626 { |
|
627 // Execute command and log parameters |
|
628 INFO_PRINTF1(_L("execute SetTransparentRegion(TRegion)")); |
|
629 TInt returnCode = iWindow->SetTransparentRegion(region); |
|
630 |
|
631 // Check the command return code, if !=KErrNone then stop this command |
|
632 if ( returnCode!=KErrNone ) |
|
633 { |
|
634 ERR_PRINTF2(KLogError, returnCode); |
|
635 SetError(returnCode); |
|
636 } |
|
637 |
|
638 // No command output parameter to display and check |
|
639 } |
|
640 |
|
641 CleanupStack::PopAndDestroy(®ion); |
|
642 } |
|
643 |
|
644 |
|
645 void CT_DataWindow::DoCmdSetTransparencyPolicy(const TDesC& aSection) |
|
646 { |
|
647 // Get test data for command input parameter(s) |
|
648 TWsTransparencyPolicy datPolicy; |
|
649 |
|
650 if ( !CT_GraphicsUtil::ReadWsTransparencyPolicy(*this, aSection, KFldPolicy, datPolicy) ) |
|
651 { |
|
652 ERR_PRINTF2(KLogMissingParameter, &KFldPolicy); |
|
653 SetBlockResult(EFail); |
|
654 } |
|
655 else |
|
656 { |
|
657 // Execute command and log parameters |
|
658 INFO_PRINTF1(_L("execute SetTransparencyPolicy(TWsTransparencyPolicy)")); |
|
659 TInt returnCode = iWindow->SetTransparencyPolicy(datPolicy); |
|
660 |
|
661 // Check the command return code, if !=KErrNone then stop this command |
|
662 if ( returnCode!=KErrNone ) |
|
663 { |
|
664 ERR_PRINTF2(KLogError, returnCode); |
|
665 SetError(returnCode); |
|
666 } |
|
667 |
|
668 // No command output parameter to display and check |
|
669 } |
|
670 } |
|
671 |
|
672 |
|
673 void CT_DataWindow::DoCmdIsRedrawStoreEnabled(const TDesC& aSection) |
|
674 { |
|
675 // No command input parameter to process |
|
676 |
|
677 // Execute command and log parameters |
|
678 INFO_PRINTF1(_L("execute IsRedrawStoreEnabled()")); |
|
679 TBool actualResult = iWindow->IsRedrawStoreEnabled(); |
|
680 |
|
681 // Diaplay command return value, check if it matches the expected value |
|
682 TBool expectResult; |
|
683 if ( !GetBoolFromConfig(aSection, KFldExpected, expectResult) ) |
|
684 { |
|
685 ERR_PRINTF2(KLogMissingExpectedValue, &KFldExpected()); |
|
686 SetBlockResult(EFail); |
|
687 } |
|
688 else if ( actualResult != expectResult ) |
|
689 { |
|
690 ERR_PRINTF4(KLogNotExpectedValueInt, &KFldExpected, expectResult, actualResult); |
|
691 SetBlockResult(EFail); |
|
692 } |
|
693 |
|
694 // No command output parameter to display and check |
|
695 } |
|
696 |
|
697 |
|
698 void CT_DataWindow::DoCmdEnableOSB(const TDesC& aSection) |
|
699 { |
|
700 // Get test data for command input parameter(s) |
|
701 TBool datFlag; |
|
702 |
|
703 if ( !GetBoolFromConfig(aSection, KFldFlag, datFlag) ) |
|
704 { |
|
705 ERR_PRINTF2(KLogMissingParameter, &KFldFlag); |
|
706 SetBlockResult(EFail); |
|
707 } |
|
708 else |
|
709 { |
|
710 // Execute command and log parameters |
|
711 INFO_PRINTF1(_L("execute EnableOSB(TBool)")); |
|
712 iWindow->EnableOSB(datFlag); |
|
713 |
|
714 // No command return value and output parameter to display and check |
|
715 } |
|
716 } |