|
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_DataAnimForMClass.h" |
|
19 #include "T_GraphicsUtil.h" |
|
20 #include "T_AnimDef.h" |
|
21 #include "../AnimPlugin/inc/T_AnimDef.h" |
|
22 #include <w32adll.h> |
|
23 #include <e32keys.h> |
|
24 #include "w32std.h" |
|
25 #define KMaxBufSize 250 |
|
26 |
|
27 /*@{*/ |
|
28 _LIT(KDataClassname, "RAnimForMClass"); |
|
29 |
|
30 /// Fields |
|
31 |
|
32 _LIT(KFldWin, "win"); |
|
33 _LIT(KFldWingrp, "wingrp"); |
|
34 _LIT(KFldSprite, "sprite"); |
|
35 _LIT(KFldType, "type"); |
|
36 |
|
37 |
|
38 _LIT(KFldOpcode, "opcode"); |
|
39 |
|
40 |
|
41 _LIT(KFldExpected, "expected"); |
|
42 _LIT(KFldRect, "rect"); |
|
43 _LIT(KFldState, "state"); |
|
44 _LIT(KFldWs, "ws"); |
|
45 _LIT(KFldWingrpId, "windowgroupid"); |
|
46 _LIT(KFldOrdinalPosition, "pos"); |
|
47 _LIT(KFldOrdinalPriority, "ordinalpriority"); |
|
48 _LIT(KFldScreenNumb, "screennumber"); |
|
49 _LIT(KFldFullOrdinPostn, "fullpos"); |
|
50 _LIT(KFldExpectedPoint, "expectedpoint"); |
|
51 _LIT(KFldGetEvent, "getevent"); |
|
52 _LIT(KFldInterface, "interface"); |
|
53 _LIT(KFldPostRawEvent, "rawevent"); |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 _LIT(KFldSyncMode, "animsync"); |
|
59 _LIT(KFldInterval, "interval"); |
|
60 _LIT(KFldNotifications, "notification"); |
|
61 _LIT(KFldMessage, "message"); |
|
62 _LIT(KFldHandleBitmap, "bitmap"); |
|
63 _LIT(KFldHandleFont, "font"); |
|
64 _LIT(KFldMemberIndex, "member_index"); |
|
65 _LIT(KFldIsFullUpdate, "isfullupdate"); |
|
66 _LIT(KFldIsActivate, "isactivate"); |
|
67 _LIT(KFldSetReplyBufHandle1, "slot2"); |
|
68 _LIT(KFldSetReplyBufHandle2, "slot3"); |
|
69 _LIT(KFldPointPosition, "pos"); |
|
70 _LIT(KFldRAnim, "anim"); |
|
71 |
|
72 _LIT(KESyncNone , "ESyncNone"); |
|
73 _LIT(KESyncFlash, "ESyncFlash"); |
|
74 _LIT(KESyncSecond, "ESyncSecond"); |
|
75 _LIT(KESyncMinute, "ESyncMinute"); |
|
76 _LIT(KESyncDay, "ESyncDay"); |
|
77 |
|
78 _LIT(KENone, "ENone"); |
|
79 _LIT(KEPointerMove, "EPointerMove"); |
|
80 _LIT(KEPointerSwitchOn, "EPointerSwitchOn"); |
|
81 _LIT(KEKeyDown, "EKeyDown"); |
|
82 _LIT(KEKeyUp, "EKeyUp"); |
|
83 _LIT(KERedraw, "ERedraw"); |
|
84 _LIT(KESwitchOn, "ESwitchOn"); |
|
85 _LIT(KEActive, "EActive"); |
|
86 _LIT(KEInactive, "EInactive"); |
|
87 _LIT(KEUpdateModifiers, "EUpdateModifiers"); |
|
88 _LIT(KEButton1Down, "EButton1Down"); |
|
89 _LIT(KEButton1Up, "EButton1Up"); |
|
90 _LIT(KEButton2Down, "EButton2Down"); |
|
91 _LIT(KEButton2Up, "EButton2Up"); |
|
92 _LIT(KEButton3Down, "EButton3Down"); |
|
93 _LIT(KEButton3Up, "EButton3Up"); |
|
94 _LIT(KESwitchOff, "ESwitchOff"); |
|
95 _LIT(KEKeyRepeat, "EKeyRepeat"); |
|
96 _LIT(KECaseOpen, "ECaseOpen"); |
|
97 _LIT(KECaseClose, "ECaseClose"); |
|
98 _LIT(KERestartSystem, "ERestartSystem"); |
|
99 |
|
100 |
|
101 |
|
102 /// Commands |
|
103 _LIT(KCmdnew, "new"); |
|
104 _LIT(KCmdDestructorGeneral, "~"); |
|
105 _LIT(KCmdDestructor, "~RAnimForMClass"); |
|
106 _LIT(KCmdConstruct, "Construct"); |
|
107 _LIT(KCmdCommandReply, "CommandReply"); |
|
108 _LIT(KCmdDestroy, "Destroy"); |
|
109 _LIT(KCmdClose, "Close"); |
|
110 |
|
111 /// Logging |
|
112 _LIT(KLogErrMissingPara, "Missing parameter '%S'"); |
|
113 |
|
114 |
|
115 _LIT(KLogErrConstruct, "Construct return err = %d"); |
|
116 _LIT(KLogInfoCmdConstruct1, "execute RAnimForMClass::Construct(const RWindowBase &, TInt, const TDesC8 &)"); |
|
117 |
|
118 _LIT(KLogInfoCmdConstruct3, "execute RAnimForMClass::Construct(const RWsSprite &, TInt, const TDesC8 &)"); |
|
119 |
|
120 _LIT(KLogErrCommandReply, "CommandReply return err = %d"); |
|
121 _LIT(KLogInfoCmdCommandReply1, "execute RAnimForMClass::CommandReply(TInt),opcode=%d"); |
|
122 |
|
123 _LIT(KLogInfoCmdCommandReply3, "execute RAnimForMClass::CommandReply(TInt, const TDesC8 &, const TIpcArgs &),opcode=%d"); |
|
124 |
|
125 _LIT(KLogInfoCmdDestroy, "execute RAnimForMClass::Destroy()"); |
|
126 _LIT(KLogInfoCmdDestructor1, "execute ~RAnimForMClass()"); |
|
127 _LIT(KLogMissingParameter, "Missing parameter '%S'"); |
|
128 _LIT(KlogDateTime, "DateTime"); |
|
129 /*@}*/ |
|
130 |
|
131 CT_DataAnimForMClass* CT_DataAnimForMClass::NewL() |
|
132 { |
|
133 CT_DataAnimForMClass* ret = new (ELeave) CT_DataAnimForMClass(); |
|
134 CleanupStack::PushL(ret); |
|
135 ret->ConstructL(); |
|
136 CleanupStack::Pop(ret); |
|
137 return ret; |
|
138 } |
|
139 |
|
140 CT_DataAnimForMClass::CT_DataAnimForMClass() |
|
141 : iActiveCallback(NULL) |
|
142 ,iAnim(NULL) |
|
143 { |
|
144 } |
|
145 |
|
146 void CT_DataAnimForMClass::ConstructL() |
|
147 { |
|
148 iSendBuf.CreateL(KMaxBufSize); |
|
149 iSendBuf.FillZ(1); |
|
150 |
|
151 for (TInt i=0;i<KIpcArgNum;i++) |
|
152 iIpcBuf[i].CreateL(KMaxBufSize); |
|
153 } |
|
154 |
|
155 CT_DataAnimForMClass::~CT_DataAnimForMClass() |
|
156 { |
|
157 INFO_PRINTF1(KLogInfoCmdDestructor1); |
|
158 DestroyData(); |
|
159 iSendBuf.Close(); |
|
160 |
|
161 for (TInt i=0;i<KIpcArgNum;i++) |
|
162 iIpcBuf[i].Close(); |
|
163 } |
|
164 |
|
165 TAny* CT_DataAnimForMClass::GetObject() |
|
166 { |
|
167 return iAnim; |
|
168 } |
|
169 |
|
170 void CT_DataAnimForMClass::SetObjectL(TAny* aAny) |
|
171 { |
|
172 DestroyData(); |
|
173 iAnim = static_cast<T_RAnimChild*> (aAny); |
|
174 } |
|
175 |
|
176 void CT_DataAnimForMClass::DisownObjectL() |
|
177 { |
|
178 iAnim = NULL; |
|
179 } |
|
180 |
|
181 void CT_DataAnimForMClass::DestroyData() |
|
182 { |
|
183 DoCmdDestroy(); |
|
184 } |
|
185 |
|
186 /** |
|
187 * Process a command read from the ini file |
|
188 * |
|
189 * @param aCommand the command to process |
|
190 * @param aSection the entry in the ini file requiring the command to be processed |
|
191 * @return ETrue if the command is processed |
|
192 */ |
|
193 TBool CT_DataAnimForMClass::DoCommandL(const TTEFFunction& aCommand, const TTEFSectionName& aSection,const TInt) |
|
194 { |
|
195 TBool ret = ETrue; |
|
196 |
|
197 if ( aCommand==KCmdDestructorGeneral || aCommand==KCmdDestructor ) |
|
198 { |
|
199 DoCmdDestructor(); |
|
200 } |
|
201 else if ( aCommand==KCmdnew || aCommand==KDataClassname ) |
|
202 { |
|
203 DoCmdnewL(aSection); |
|
204 } |
|
205 else if ( aCommand==KCmdConstruct ) |
|
206 { |
|
207 DoCmdConstructL(aSection); |
|
208 } |
|
209 else if ( aCommand==KCmdCommandReply ) |
|
210 { |
|
211 DoCmdCommandReplyL(aSection); |
|
212 } |
|
213 else if ( aCommand==KCmdDestroy ) |
|
214 { |
|
215 DoCmdDestroy(); |
|
216 } |
|
217 else if ( aCommand==KCmdClose ) |
|
218 { |
|
219 DoCmdClose(); |
|
220 } |
|
221 else |
|
222 { |
|
223 ret=EFalse; |
|
224 } |
|
225 |
|
226 return ret; |
|
227 } |
|
228 |
|
229 void CT_DataAnimForMClass::DoCmdnewL(const TDesC& aSection) |
|
230 { |
|
231 DestroyData(); |
|
232 TPtrC datRAnimName ; |
|
233 if ( GetStringFromConfig(aSection, KFldRAnim, datRAnimName)) |
|
234 { |
|
235 iAnim = static_cast<T_RAnimChild*>(GetDataObjectL(datRAnimName)); |
|
236 } |
|
237 else |
|
238 ERR_PRINTF2(KLogErrMissingPara, &KFldWin); |
|
239 } |
|
240 |
|
241 void CT_DataAnimForMClass::ResetIpcArg() |
|
242 { |
|
243 for (TInt i=0; i<KIpcArgNum; i++) |
|
244 { |
|
245 iIpcArgs.Set(i, TIpcArgs::ENothing); |
|
246 } |
|
247 } |
|
248 |
|
249 void CT_DataAnimForMClass::DoCmdConstructL(const TDesC& aSection) |
|
250 { |
|
251 TInt err = KErrNone; |
|
252 |
|
253 // Get test data for command input parameter(s) |
|
254 TBool dataOk = ETrue; |
|
255 |
|
256 // Get "const RWindowBase &aDevice" or "const RWsSprite &aDevice" |
|
257 TPtrC datWinName; |
|
258 RWindowBase* win = NULL; |
|
259 TPtrC datSpriteName; |
|
260 RWsSprite* sprite = NULL; |
|
261 if ( GetStringFromConfig(aSection, KFldWin, datWinName)) |
|
262 { |
|
263 win = static_cast<RWindowBase*>(GetDataObjectL(datWinName)); |
|
264 } |
|
265 else if ( GetStringFromConfig(aSection, KFldSprite, datSpriteName)) |
|
266 { |
|
267 sprite = static_cast<RWsSprite*>(GetDataObjectL(datSpriteName)); |
|
268 } |
|
269 if (!win && !sprite ) |
|
270 { |
|
271 dataOk = EFalse; |
|
272 ERR_PRINTF2(KLogErrMissingPara, &KFldWin); |
|
273 ERR_PRINTF2(KLogErrMissingPara, &KFldSprite); |
|
274 } |
|
275 |
|
276 //Get "TInt aType" |
|
277 TInt datType; |
|
278 if ( !CT_GraphicsUtil::ReadAnimType(*this,aSection, KFldType, datType)) |
|
279 { |
|
280 dataOk = EFalse; |
|
281 ERR_PRINTF2(KLogErrMissingPara, &KFldType); |
|
282 } |
|
283 |
|
284 // Get "const TDesC8 &aArgs" |
|
285 TPtrC inputStr; |
|
286 |
|
287 // get "const TIpcArgs &aIpcArgs" |
|
288 |
|
289 |
|
290 if ( !dataOk ) |
|
291 { |
|
292 SetBlockResult(EFail); |
|
293 } |
|
294 else |
|
295 { |
|
296 // Execute command and log parameters |
|
297 if (win) |
|
298 { |
|
299 INFO_PRINTF1(KLogInfoCmdConstruct1); |
|
300 if (iAnim != NULL) |
|
301 err = iAnim->Construct(*win, datType, iSendBuf); |
|
302 } |
|
303 |
|
304 else |
|
305 { |
|
306 INFO_PRINTF1(KLogInfoCmdConstruct3); |
|
307 TInt len=iSendBuf.Length(); |
|
308 if (iAnim != NULL) |
|
309 err = iAnim->Construct(*sprite, datType, iSendBuf); |
|
310 |
|
311 |
|
312 } |
|
313 |
|
314 // Check the command return code |
|
315 if(err != KErrNone) |
|
316 { |
|
317 ERR_PRINTF2(KLogErrConstruct, err); |
|
318 SetError(err); |
|
319 } |
|
320 } |
|
321 } |
|
322 |
|
323 void CT_DataAnimForMClass::DoCmdCommandReplyL(const TDesC& aSection) |
|
324 { |
|
325 |
|
326 // Get test data for command input parameter(s) |
|
327 TBool dataOk = ETrue; |
|
328 |
|
329 // Get "TInt aOpcode" |
|
330 TInt datOpcode; |
|
331 if ( !CT_GraphicsUtil::ReadAnimCommand(*this, aSection, KFldOpcode, |
|
332 datOpcode))//ReadAnimCommand():Convert datOpcode from string type to Int type |
|
333 { |
|
334 dataOk = EFalse; |
|
335 ERR_PRINTF2(KLogErrMissingPara, &KFldOpcode); |
|
336 } |
|
337 |
|
338 if (!dataOk) |
|
339 { |
|
340 _LIT(KFailed, "Can not read the Operation code from the config file. Failed. "); |
|
341 INFO_PRINTF1(KFailed); |
|
342 SetBlockResult(EFail); |
|
343 } |
|
344 switch (datOpcode) |
|
345 { |
|
346 //Util |
|
347 case ECmdRetrieveResult: |
|
348 DoCmdRetrieveResult(aSection, datOpcode); |
|
349 break; |
|
350 case ECmdUtilEatupMemory: |
|
351 DoCmdEatupMemory(datOpcode); |
|
352 break; |
|
353 case ECmdUtilFreeEatenMemory: |
|
354 DoCmdFreeEatenMemory(datOpcode); |
|
355 break; |
|
356 // The MAnimGeneralFunctioins |
|
357 case ECmdGeneralAnimate: |
|
358 DoCmdGeneralAnimate(aSection, datOpcode); |
|
359 break; |
|
360 case ECmdGeneralClient: |
|
361 DoCmdGeneralClient(aSection, datOpcode); |
|
362 break; |
|
363 case ECmdGeneralFlashStateOn: |
|
364 DoCmdGeneralFlashStateOn(aSection, datOpcode); |
|
365 break; |
|
366 case ECmdGeneralPanic: |
|
367 DoCmdGeneralPanic(aSection, datOpcode) ; |
|
368 break; |
|
369 case ECmdGeneralScreenDevice: |
|
370 DoCmdGeneralScreenDevice(aSection, datOpcode) ; |
|
371 break; |
|
372 case ECmdGeneralExtendedInterface: |
|
373 DoCmdGeneralExtendedInterface(aSection, datOpcode) ; |
|
374 break; |
|
375 case ECmdGeneralWindowExtension: |
|
376 DoCmdGeneralWindowExtension(aSection, datOpcode) ; |
|
377 break; |
|
378 case ECmdGeneralNumOfExtInterfaces: |
|
379 DoCmdGeneralNumOfExtInterfaces(aSection, datOpcode) ; |
|
380 break; |
|
381 case ECmdGeneralEventExtension: |
|
382 DoCmdGeneralEventExtension(aSection, datOpcode) ; |
|
383 break; |
|
384 case ECmdGeneralGetRawEvents: |
|
385 DoCmdGeneralGetRawEvents(aSection, datOpcode); |
|
386 break; |
|
387 case ECmdGeneralPostRawEvent: |
|
388 DoCmdGeneralPostRawEvent(aSection, datOpcode); |
|
389 break; |
|
390 case ECmdGeneralPostKeyEvent: |
|
391 DoCmdGeneralPostKeyEventL(aSection, datOpcode); |
|
392 break; |
|
393 case ECmdGeneralSetSync: |
|
394 DoCmdGeneralSetSync(aSection, datOpcode); |
|
395 break; |
|
396 case ECmdGeneralSync: |
|
397 DoCmdGeneralSync(aSection, datOpcode); |
|
398 break; |
|
399 case ECmdGeneralSetInterval: |
|
400 DoCmdGeneralSetInterval(aSection, datOpcode); |
|
401 break; |
|
402 case ECmdGeneralSetNextInterval: |
|
403 DoCmdGeneralSetNextInterval(aSection, datOpcode); |
|
404 break; |
|
405 case ECmdGeneralSystemTime: |
|
406 DoCmdGeneralSystemTime(aSection, datOpcode); |
|
407 break; |
|
408 case ECmdGeneralRegisterForNotis: |
|
409 DoCmdGeneralRegisterForNotis(aSection, datOpcode); |
|
410 break; |
|
411 case ECmdGeneralMessage: |
|
412 DoCmdGeneralMessage(aSection, datOpcode); |
|
413 break; |
|
414 case ECmdGeneralDuplicateBitmapL: |
|
415 DoCmdGeneralDuplicateBitmapL(aSection, datOpcode); |
|
416 break; |
|
417 case ECmdGeneralDuplicateFontL: |
|
418 DoCmdGeneralDuplicateFontL(aSection, datOpcode); |
|
419 break; |
|
420 case ECmdGeneralCloseFont: |
|
421 DoCmdGeneralCloseFontL(aSection, datOpcode); |
|
422 break; |
|
423 case ECmdGeneralReplyBuf8: |
|
424 DoCmdGeneralReplyBuf8(aSection, datOpcode); |
|
425 break; |
|
426 case ECmdGeneralReplyBuf16: |
|
427 DoCmdGeneralReplyBuf16(aSection, datOpcode); |
|
428 break; |
|
429 // the MAnimSpriteFunctioins |
|
430 case ECmdSpriteGetSpriteMember: |
|
431 DoCmdSpriteGetSpriteMember(aSection, datOpcode); |
|
432 break; |
|
433 case ECmdSpriteUpdateMember: |
|
434 DoCmdSpriteUpdateMember(aSection, datOpcode) ; |
|
435 break; |
|
436 case ECmdSpriteActivate: |
|
437 DoCmdSpriteActivate(aSection, datOpcode) ; |
|
438 break; |
|
439 case ECmdSpriteSpriteCanBeSeen: |
|
440 DoCmdSpriteSpriteCanBeSeen(aSection, datOpcode) ; |
|
441 break; |
|
442 case ECmdSpriteSizeChangedL: |
|
443 DoCmdSpriteSizeChangedL(aSection, datOpcode) ; |
|
444 break; |
|
445 case ECmdSpriteSetPosition: |
|
446 DoCmdSpriteSetPosition(aSection, datOpcode) ; |
|
447 break; |
|
448 //MAnimWindowFunctions |
|
449 case ECmdWindowActivateGc: |
|
450 { |
|
451 DoWindowActivateGc(datOpcode); |
|
452 break; |
|
453 } |
|
454 case ECmdWindowSetRect: |
|
455 case ECmdWindowIsStarted: |
|
456 { |
|
457 DoWindowSetRect(datOpcode, aSection); |
|
458 break; |
|
459 } |
|
460 case ECmdWindowWindowSize: |
|
461 { |
|
462 DoWindowWindowSizeL(datOpcode, aSection); |
|
463 break; |
|
464 } |
|
465 case ECmdWindowIsHidden: |
|
466 { |
|
467 DoWindowIsHidden(datOpcode, aSection); |
|
468 break; |
|
469 } |
|
470 case ECmdWindowSetVisible: |
|
471 { |
|
472 DoWindowSetVisible(datOpcode, aSection); |
|
473 break; |
|
474 } |
|
475 case ECmdWindowInvalidate: |
|
476 { |
|
477 DoWindowInvalidate(datOpcode, aSection); |
|
478 break; |
|
479 } |
|
480 case ECmdWindowParameters: |
|
481 { |
|
482 DoWindowParametersL(datOpcode, aSection); |
|
483 break; |
|
484 } |
|
485 case ECmdWindowVisibleRegion: |
|
486 { |
|
487 DoWindowVisibleRegion(datOpcode, aSection); |
|
488 break; |
|
489 |
|
490 } |
|
491 //MAnimGeneralFunctionsWindowExtension |
|
492 case ECmdGfweScreens: |
|
493 { |
|
494 DoGeneralExtScreensL(datOpcode, aSection); |
|
495 break; |
|
496 } |
|
497 case ECmdGfweFocusScreens: |
|
498 { |
|
499 DoGeneralExtFocusScreensL(datOpcode, aSection); |
|
500 break; |
|
501 } |
|
502 case ECmdGfweSetFocusScreen: |
|
503 { |
|
504 DoGeneralExtSetFocusScreen(datOpcode, aSection); |
|
505 break; |
|
506 } |
|
507 case ECmdGfweWindowGroups: |
|
508 { |
|
509 DoGeneralExtWindowGroupsL(datOpcode, aSection); |
|
510 break; |
|
511 } |
|
512 case ECmdGfweWindowGroupInfo: |
|
513 { |
|
514 DoGeneralExtWindowGroupInfoL(datOpcode, aSection); |
|
515 break; |
|
516 } |
|
517 case ECmdGfweWindowGroupName: |
|
518 { |
|
519 DoGeneralExtWindowGroupNameL(datOpcode, aSection); |
|
520 break; |
|
521 } |
|
522 case ECmdGfweSetOrdinalPosition: |
|
523 { |
|
524 DoGeneralExtSetOrdinalPositionL(datOpcode, aSection); |
|
525 break; |
|
526 } |
|
527 case ECmdGfweWindowConfig: |
|
528 { |
|
529 DoGeneralExtWindowConfigL(datOpcode, aSection); |
|
530 break; |
|
531 } |
|
532 //MAnimFreeTimerWindowFunctions |
|
533 case ECmdFreeTimerWinDeactivateGc: |
|
534 { |
|
535 DoFreeTimerWinDeactivateGc(datOpcode); |
|
536 break; |
|
537 } |
|
538 case ECmdFreeTimerWinUpdate: |
|
539 { |
|
540 DoFreeTimerWinUpdate(datOpcode); |
|
541 break; |
|
542 } |
|
543 default: |
|
544 { |
|
545 _LIT(KFailed2, "Unsupported operation code. "); |
|
546 INFO_PRINTF1(KFailed2); |
|
547 break; |
|
548 } |
|
549 } |
|
550 } |
|
551 |
|
552 void CT_DataAnimForMClass::DoCmdClose() |
|
553 { |
|
554 iAnim = NULL ; |
|
555 } |
|
556 |
|
557 void CT_DataAnimForMClass::DoCmdDestroy() |
|
558 { |
|
559 INFO_PRINTF1(KLogInfoCmdDestroy); |
|
560 iAnim = NULL ; |
|
561 } |
|
562 |
|
563 void CT_DataAnimForMClass::DoCmdDestructor() |
|
564 { |
|
565 // Execute command and log parameters |
|
566 INFO_PRINTF1(KLogInfoCmdDestructor1); |
|
567 iAnim = NULL; |
|
568 } |
|
569 |
|
570 //*************************MAnimWindowFunctions verifying******************************** |
|
571 void CT_DataAnimForMClass::DoWindowActivateGc(TInt aOpcode) |
|
572 { |
|
573 INFO_PRINTF2(KLogInfoCmdCommandReply1, aOpcode); |
|
574 TInt err=iAnim->CommandReply(aOpcode); |
|
575 INFO_PRINTF2(KLogErrCommandReply, err); |
|
576 |
|
577 if (err != KErrNone) |
|
578 { |
|
579 ERR_PRINTF2(KLogErrCommandReply, err); |
|
580 SetError(err); |
|
581 } |
|
582 } |
|
583 |
|
584 void CT_DataAnimForMClass::DoWindowSetRect(TInt aOpcode, const TDesC& aSection) |
|
585 { |
|
586 switch (aOpcode) |
|
587 { |
|
588 case ECmdWindowSetRect: |
|
589 { |
|
590 TPtrC8 ptr; |
|
591 TRect sendRect; |
|
592 if (!GetRectFromConfig(aSection, KFldRect, sendRect)) |
|
593 { |
|
594 ERR_PRINTF2(KLogErrMissingPara, &KFldRect()); |
|
595 SetBlockResult(EFail); |
|
596 } |
|
597 TPckgBuf<TRect> sendVal(sendRect); |
|
598 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
599 iIpcArgs.Set(1, &sendVal); |
|
600 |
|
601 INFO_PRINTF2(KLogInfoCmdCommandReply3, aOpcode); |
|
602 TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
603 INFO_PRINTF2(KLogErrCommandReply, err); |
|
604 |
|
605 if (err != KErrNone) |
|
606 { |
|
607 ERR_PRINTF2(KLogErrCommandReply, err); |
|
608 SetError(err); |
|
609 } |
|
610 ResetIpcArg(); |
|
611 break; |
|
612 } |
|
613 case ECmdWindowIsStarted: |
|
614 { |
|
615 INFO_PRINTF2(KLogInfoCmdCommandReply1, aOpcode); |
|
616 TInt err=iAnim->CommandReply(aOpcode); |
|
617 INFO_PRINTF2(KLogErrCommandReply, err); |
|
618 if (err != KErrNone) |
|
619 { |
|
620 ERR_PRINTF2(KLogErrCommandReply, err); |
|
621 SetError(err); |
|
622 } |
|
623 break; |
|
624 } |
|
625 } |
|
626 } |
|
627 |
|
628 void CT_DataAnimForMClass::DoWindowWindowSizeL(TInt aOpcode,const TDesC& aSection) |
|
629 { |
|
630 TPtrC8 ptr; |
|
631 TPtrC datWinName; |
|
632 RWindowBase* win= NULL; |
|
633 if (GetStringFromConfig(aSection, KFldWin, datWinName)) |
|
634 { |
|
635 win = static_cast<RWindowBase*>(GetDataObjectL(datWinName)); |
|
636 } |
|
637 TSize expected=win->Size(); |
|
638 TSize resultBuf; |
|
639 TPckgBuf<TSize> retrndPck(expected); |
|
640 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
641 iIpcArgs.Set(1, &retrndPck); |
|
642 INFO_PRINTF2(KLogInfoCmdCommandReply3, aOpcode); |
|
643 TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
644 INFO_PRINTF2(KLogErrCommandReply, err); |
|
645 |
|
646 resultBuf=retrndPck(); |
|
647 if (expected!=resultBuf) |
|
648 { |
|
649 ERR_PRINTF5(_L("The returned value is not as expected, expected: (%d,%d), actual: (%d,%d)"), expected.iWidth,expected.iHeight, resultBuf.iWidth,resultBuf.iHeight); |
|
650 SetBlockResult(EFail); |
|
651 } |
|
652 ResetIpcArg(); |
|
653 } |
|
654 |
|
655 void CT_DataAnimForMClass::DoWindowIsHidden(TInt aOpcode,const TDesC& aSection) |
|
656 { |
|
657 TBool expectedVal; |
|
658 |
|
659 if (!GetBoolFromConfig(aSection, KFldExpected, expectedVal)) |
|
660 { |
|
661 ERR_PRINTF2(KLogErrMissingPara, &KFldExpected()); |
|
662 SetBlockResult(EFail); |
|
663 } |
|
664 else |
|
665 { |
|
666 INFO_PRINTF2(KLogInfoCmdCommandReply1, aOpcode); |
|
667 TInt actual=iAnim->CommandReply(aOpcode); |
|
668 INFO_PRINTF2(KLogErrCommandReply, actual); |
|
669 if (actual!=expectedVal) |
|
670 { |
|
671 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, actual); |
|
672 SetBlockResult(EFail); |
|
673 } |
|
674 } |
|
675 } |
|
676 |
|
677 void CT_DataAnimForMClass::DoWindowSetVisible(TInt aOpcode,const TDesC& aSection) |
|
678 { |
|
679 TBool setVisible; |
|
680 TPtrC8 ptr; |
|
681 |
|
682 if (!GetBoolFromConfig(aSection, KFldState, setVisible)) |
|
683 { |
|
684 ERR_PRINTF2(KLogErrMissingPara, &KFldState()); |
|
685 SetBlockResult(EFail); |
|
686 } |
|
687 |
|
688 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
689 TPckgBuf<TBool> setVisiblePck(setVisible); |
|
690 iIpcArgs.Set(1, &setVisiblePck); |
|
691 INFO_PRINTF2(KLogInfoCmdCommandReply3, aOpcode); |
|
692 TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
693 INFO_PRINTF2(KLogErrCommandReply, err); |
|
694 if (err != KErrNone) |
|
695 { |
|
696 ERR_PRINTF2(KLogErrCommandReply, err); |
|
697 SetError(err); |
|
698 } |
|
699 ResetIpcArg(); |
|
700 } |
|
701 |
|
702 void CT_DataAnimForMClass::DoWindowInvalidate(TInt aOpcode,const TDesC& aSection) |
|
703 { |
|
704 |
|
705 TPtrC datWinName; |
|
706 TPtrC8 ptr; |
|
707 TRect rectVal; |
|
708 if (!GetRectFromConfig(aSection, KFldRect, rectVal)) |
|
709 { |
|
710 ERR_PRINTF2(KLogErrMissingPara, &KFldRect()); |
|
711 SetBlockResult(EFail); |
|
712 } |
|
713 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
714 TPckgBuf<TRect> rectValPck(rectVal); |
|
715 iIpcArgs.Set(1, &rectValPck); |
|
716 INFO_PRINTF2(KLogInfoCmdCommandReply3, aOpcode); |
|
717 TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
718 INFO_PRINTF2(KLogErrCommandReply, err); |
|
719 if (err != KErrNone) |
|
720 { |
|
721 ERR_PRINTF2(KLogErrCommandReply, err); |
|
722 SetError(err); |
|
723 } |
|
724 ResetIpcArg(); |
|
725 } |
|
726 |
|
727 void CT_DataAnimForMClass::DoWindowParametersL(TInt aOpcode,const TDesC& aSection) |
|
728 { |
|
729 RWindowBase* win= NULL; |
|
730 TSize expectedSize; |
|
731 TInt expectedDisplyMd; |
|
732 TPtrC val; |
|
733 TPtrC8 ptr; |
|
734 TPtrC datWinName; |
|
735 TPckgBuf<TRect> retrndWindowPostn; |
|
736 TPckgBuf<TInt> retrndDisplyMd; |
|
737 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
738 iIpcArgs.Set(1, &retrndWindowPostn); |
|
739 iIpcArgs.Set(2, &retrndDisplyMd); |
|
740 |
|
741 //Send command to server |
|
742 TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
743 INFO_PRINTF2(KLogErrCommandReply, err); |
|
744 if (err != KErrNone) |
|
745 { |
|
746 ERR_PRINTF2(KLogErrCommandReply, err); |
|
747 SetError(err); |
|
748 } |
|
749 else |
|
750 { |
|
751 //Get the window's Size and Displaymode |
|
752 if (GetStringFromConfig(aSection, KFldWin, datWinName)) |
|
753 { |
|
754 win = static_cast<RWindowBase*>(GetDataObjectL(datWinName)); |
|
755 } |
|
756 expectedSize=win->Size(); |
|
757 expectedDisplyMd=win->DisplayMode(); |
|
758 |
|
759 TRect retrndWinInf=retrndWindowPostn(); |
|
760 TSize retrndSize=retrndWinInf.Size(); |
|
761 TInt retrndDisplyM=retrndDisplyMd(); |
|
762 |
|
763 if (retrndSize!=expectedSize) |
|
764 { |
|
765 ERR_PRINTF5(_L("The value is not as expected! expected: (%d,%d), actual: (%d,%d)"), expectedSize.iWidth,expectedSize.iHeight, retrndSize.iWidth,retrndSize.iHeight); |
|
766 SetBlockResult(EFail); |
|
767 } |
|
768 if (retrndDisplyM!=expectedDisplyMd) |
|
769 { |
|
770 ERR_PRINTF3(_L("The value is not as expected! expected: %d, actual: %d"), expectedDisplyMd, retrndDisplyM); |
|
771 SetBlockResult(EFail); |
|
772 } |
|
773 } |
|
774 ResetIpcArg(); |
|
775 } |
|
776 |
|
777 void CT_DataAnimForMClass::DoWindowVisibleRegion(TInt aOpcode,const TDesC& aSection) |
|
778 { |
|
779 TInt expecteValue; |
|
780 TInt actual; |
|
781 |
|
782 if (!GetIntFromConfig(aSection, KFldExpected, expecteValue)) |
|
783 { |
|
784 ERR_PRINTF2(KLogErrMissingPara, &KFldExpected()); |
|
785 SetBlockResult(EFail); |
|
786 } |
|
787 else |
|
788 { |
|
789 actual=iAnim->CommandReply(aOpcode); |
|
790 INFO_PRINTF2(KLogErrCommandReply, actual); |
|
791 if (actual!=expecteValue) |
|
792 { |
|
793 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expecteValue, actual); |
|
794 SetBlockResult(EFail); |
|
795 } |
|
796 } |
|
797 } |
|
798 |
|
799 //****************MAnimGeneralFunctionsWindowExtension verifying******************************* |
|
800 |
|
801 void CT_DataAnimForMClass::DoGeneralExtScreensL(TInt aOpcode,const TDesC& aSection) |
|
802 { |
|
803 RWsSession* ws; |
|
804 TPtrC datWsName; |
|
805 if (GetStringFromConfig(aSection, KFldWs, datWsName)) |
|
806 { |
|
807 ws = static_cast<RWsSession*>(GetDataObjectL(datWsName)); |
|
808 } |
|
809 TInt expectedScreenNumb=ws->NumberOfScreens(); |
|
810 //Send Command, no data to server, check the returned value from Server by comparing with RWsSession::NumberOfScreens |
|
811 TInt actualScreenNumb=iAnim->CommandReply(aOpcode); |
|
812 INFO_PRINTF2(KLogErrCommandReply, actualScreenNumb); |
|
813 if (actualScreenNumb!=expectedScreenNumb) |
|
814 { |
|
815 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedScreenNumb, actualScreenNumb); |
|
816 SetBlockResult(EFail); |
|
817 } |
|
818 } |
|
819 |
|
820 void CT_DataAnimForMClass::DoGeneralExtFocusScreensL(TInt aOpcode,const TDesC& aSection) |
|
821 { |
|
822 RWsSession* ws; |
|
823 TPtrC datWsName; |
|
824 TInt expectedVal; |
|
825 |
|
826 TInt actual=iAnim->CommandReply(aOpcode); |
|
827 INFO_PRINTF2(_L("FocuseScreens is %d"),actual); |
|
828 |
|
829 //If there is no expected value set in ini file, get the focus screen; |
|
830 if (!GetIntFromConfig(aSection, KFldExpected, expectedVal)) |
|
831 { |
|
832 if (GetStringFromConfig(aSection, KFldWs, datWsName)) |
|
833 { |
|
834 ws = static_cast<RWsSession*>(GetDataObjectL(datWsName)); |
|
835 } |
|
836 |
|
837 expectedVal=ws->GetFocusScreen(); |
|
838 } |
|
839 |
|
840 if (actual!=expectedVal) |
|
841 { |
|
842 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, actual); |
|
843 SetBlockResult(EFail); |
|
844 } |
|
845 } |
|
846 |
|
847 void CT_DataAnimForMClass::DoGeneralExtSetFocusScreen(TInt aOpcode,const TDesC& aSection) |
|
848 { |
|
849 TInt screenNo; |
|
850 TPtrC8 ptr; |
|
851 TPtrC datWsName; |
|
852 |
|
853 if (!GetIntFromConfig(aSection, KFldScreenNumb, screenNo)) |
|
854 { |
|
855 ERR_PRINTF2(KLogMissingParameter, &KFldScreenNumb()); |
|
856 SetBlockResult(EFail); |
|
857 } |
|
858 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
859 TPckgBuf<TInt> screenNoPck(screenNo); |
|
860 iIpcArgs.Set(1, &screenNoPck); |
|
861 TInt actual=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
862 INFO_PRINTF2(KLogErrCommandReply, actual); |
|
863 |
|
864 ResetIpcArg(); |
|
865 } |
|
866 |
|
867 void CT_DataAnimForMClass::DoGeneralExtWindowGroupsL(TInt aOpcode,const TDesC& aSection) |
|
868 { |
|
869 TPtrC8 ptr; |
|
870 TInt screenNo; |
|
871 TPtrC datWsName; |
|
872 RWsSession* ws; |
|
873 if (!GetIntFromConfig(aSection, KFldScreenNumb, screenNo)) |
|
874 { |
|
875 ERR_PRINTF2(KLogErrMissingPara, &KFldScreenNumb()); |
|
876 SetBlockResult(EFail); |
|
877 } |
|
878 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
879 TPckgBuf<TInt> screenNoPck(screenNo); |
|
880 iIpcArgs.Set(1, &screenNoPck); |
|
881 TInt actual=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
882 INFO_PRINTF2(KLogErrCommandReply, actual); |
|
883 |
|
884 if (!GetStringFromConfig(aSection, KFldWs, datWsName)) |
|
885 { |
|
886 ERR_PRINTF2(KLogErrMissingPara, &KFldWs()); |
|
887 SetBlockResult(EFail); |
|
888 } |
|
889 ws = static_cast<RWsSession*>(GetDataObjectL(datWsName)); |
|
890 TInt expectedVal=ws->NumWindowGroups(); |
|
891 |
|
892 if (actual!=expectedVal) |
|
893 { |
|
894 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, actual); |
|
895 SetBlockResult(EFail); |
|
896 } |
|
897 ResetIpcArg(); |
|
898 } |
|
899 |
|
900 void CT_DataAnimForMClass::DoGeneralExtWindowGroupInfoL(TInt aOpcode,const TDesC& aSection) |
|
901 { |
|
902 TInt screenNo; |
|
903 TPtrC8 ptr; |
|
904 TPtrC datWingrpName; |
|
905 TInt retrnPck; |
|
906 TInt expectedGrpInfo; |
|
907 RWindowGroup* wingrp; |
|
908 //Get window group object in order to verify the window group's name's existance. |
|
909 if (!GetStringFromConfig(aSection, KFldWingrp, datWingrpName)) |
|
910 { |
|
911 ERR_PRINTF2(KLogErrMissingPara, &KFldWingrp()); |
|
912 SetBlockResult(EFail); |
|
913 } |
|
914 wingrp = static_cast<RWindowGroup*>(GetDataObjectL(datWingrpName)); |
|
915 |
|
916 //Get screen number from ini file and set to IPC slot 1. |
|
917 if (!GetIntFromConfig(aSection, KFldScreenNumb, screenNo)) |
|
918 { |
|
919 ERR_PRINTF2(KLogErrMissingPara, &KFldScreenNumb()); |
|
920 SetBlockResult(EFail); |
|
921 } |
|
922 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
923 TPckgBuf<TInt> screenNoPck(screenNo); |
|
924 iIpcArgs.Set(1, &screenNoPck); |
|
925 |
|
926 //Get fullOrdipostion from ini or by using FullOrdinalPosition method and set to IPC slot 2. |
|
927 TInt fullOrdiPostion; |
|
928 if (!GetIntFromConfig(aSection, KFldFullOrdinPostn, fullOrdiPostion)) |
|
929 { |
|
930 fullOrdiPostion=wingrp->FullOrdinalPosition(); |
|
931 } |
|
932 TPckgBuf<TInt> fullOrdiPostionPck(fullOrdiPostion); |
|
933 iIpcArgs.Set(2, &fullOrdiPostionPck); |
|
934 |
|
935 //Set IPC slot 3 to receive ID of the TWindowGroupInfo. |
|
936 TPckgBuf<TInt> retrnWinGrpInfo; |
|
937 iIpcArgs.Set(3, &retrnWinGrpInfo); |
|
938 |
|
939 TInt actual=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
940 INFO_PRINTF2(KLogErrCommandReply, actual); |
|
941 TBool expectedVal; |
|
942 if (!GetBoolFromConfig(aSection, KFldExpected, expectedVal)) |
|
943 { |
|
944 ERR_PRINTF2(KLogMissingParameter, &KFldExpected); |
|
945 SetBlockResult(EFail); |
|
946 } |
|
947 if (actual!=expectedVal) |
|
948 { |
|
949 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, actual); |
|
950 SetBlockResult(EFail); |
|
951 } |
|
952 if (actual!=EFalse) |
|
953 { |
|
954 retrnPck=retrnWinGrpInfo();//Get returned window group ID |
|
955 |
|
956 expectedGrpInfo=wingrp->WindowGroupId(); |
|
957 if (retrnPck!=expectedGrpInfo) |
|
958 { |
|
959 ERR_PRINTF3( |
|
960 _L("The returned value is not as expected, expected: %d, actual: %d"), |
|
961 expectedGrpInfo, retrnPck); |
|
962 SetBlockResult(EFail); |
|
963 } |
|
964 } |
|
965 ResetIpcArg(); |
|
966 } |
|
967 |
|
968 void CT_DataAnimForMClass::DoGeneralExtWindowGroupNameL(TInt aOpcode,const TDesC& aSection) |
|
969 { |
|
970 TBuf<32> getWindowName; |
|
971 TBool expectedVal; |
|
972 TInt screenNo; |
|
973 TInt fullOrdiPostion; |
|
974 //Get Screen number from ini and set to IPC slot 1. |
|
975 if (!GetIntFromConfig(aSection, KFldScreenNumb, screenNo)) |
|
976 { |
|
977 ERR_PRINTF2(KLogErrMissingPara, &KFldScreenNumb); |
|
978 SetBlockResult(EFail); |
|
979 } |
|
980 TPtrC8 ptr; |
|
981 TPckgBuf<TInt> screenNoPck(screenNo); |
|
982 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
983 iIpcArgs.Set(1, &screenNoPck); |
|
984 |
|
985 TPtrC datWingrpName; |
|
986 RWindowGroup* wingrp; |
|
987 //Get window group object |
|
988 if (!GetStringFromConfig(aSection, KFldWingrp, datWingrpName)) |
|
989 { |
|
990 ERR_PRINTF2(KLogErrMissingPara, &KFldWingrp()); |
|
991 SetBlockResult(EFail); |
|
992 } |
|
993 wingrp = static_cast<RWindowGroup*>(GetDataObjectL(datWingrpName)); |
|
994 //Get fullOrdinary position and set to IPC slot 2. |
|
995 if (!GetIntFromConfig(aSection, KFldFullOrdinPostn, fullOrdiPostion)) |
|
996 { |
|
997 fullOrdiPostion=wingrp->FullOrdinalPosition(); |
|
998 } |
|
999 |
|
1000 TPckgBuf<TInt> fullOrdiPostionPck(fullOrdiPostion); |
|
1001 iIpcArgs.Set(2, &fullOrdiPostionPck); |
|
1002 //Set IPC slot 3 to receive the window name returned from server side. |
|
1003 TBuf<32> retrnWindowName; |
|
1004 iIpcArgs.Set(3, &retrnWindowName); |
|
1005 |
|
1006 TInt actual=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
1007 INFO_PRINTF2(KLogErrCommandReply, actual); |
|
1008 if (!GetBoolFromConfig(aSection, KFldExpected, expectedVal)) |
|
1009 { |
|
1010 ERR_PRINTF2(KLogMissingParameter, &KFldExpected); |
|
1011 SetBlockResult(EFail); |
|
1012 } |
|
1013 if (actual!=expectedVal) |
|
1014 { |
|
1015 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, actual); |
|
1016 SetBlockResult(EFail); |
|
1017 } |
|
1018 //If commandreply returns ETrue then check the window group's name. |
|
1019 if (actual) |
|
1020 { |
|
1021 TInt result=wingrp->Name(getWindowName); |
|
1022 if (result!=KErrNone) |
|
1023 { |
|
1024 ERR_PRINTF1(_L("Failed to get the window group's name!")); |
|
1025 SetError(result); |
|
1026 } |
|
1027 INFO_PRINTF3(_L("Check the group name is expected. expected: %d,actual: %d"),&getWindowName,&retrnWindowName); |
|
1028 if (getWindowName!=retrnWindowName) |
|
1029 { |
|
1030 ERR_PRINTF1(_L("The returned window group name is not expected")); |
|
1031 SetBlockResult(EFail); |
|
1032 } |
|
1033 } |
|
1034 ResetIpcArg(); |
|
1035 } |
|
1036 |
|
1037 void CT_DataAnimForMClass::DoGeneralExtSetOrdinalPositionL(TInt aOpcode,const TDesC& aSection) |
|
1038 { |
|
1039 TInt expectedVal; |
|
1040 TPtrC8 ptr; |
|
1041 TInt wingrpid; |
|
1042 TInt newOrdinPrio; |
|
1043 TInt newOrdinaPostn; |
|
1044 TPtrC datWingrpName; |
|
1045 RWindowGroup* wingrp; |
|
1046 if (GetStringFromConfig(aSection, KFldWingrp, datWingrpName)) |
|
1047 { |
|
1048 wingrp = static_cast<RWindowGroup*>(GetDataObjectL(datWingrpName)); |
|
1049 } |
|
1050 //Before sending command, get window group ID from wrapper or ini as arg(IPC slot 1) |
|
1051 if (!GetIntFromConfig(aSection, KFldWingrpId, wingrpid)) |
|
1052 { |
|
1053 wingrpid=wingrp->WindowGroupId(); |
|
1054 INFO_PRINTF2(_L("RWindowTreeNode::WindowGroupId = %d"), wingrpid); |
|
1055 } |
|
1056 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
1057 TPckgBuf<TInt> wingrpidPck(wingrpid); |
|
1058 iIpcArgs.Set(1, &wingrpidPck); |
|
1059 |
|
1060 //Get Group Id from wrapper or ini and send to server as IPC slot2 |
|
1061 if (!GetIntFromConfig(aSection, KFldOrdinalPosition, newOrdinaPostn)) |
|
1062 { |
|
1063 newOrdinaPostn = wingrp->OrdinalPosition(); |
|
1064 INFO_PRINTF2(_L("RWindowTreeNode::FullOrdinalPosition = %d"), newOrdinaPostn); |
|
1065 } |
|
1066 TPckgBuf<TInt> newOrdinaPostnPck(newOrdinaPostn); |
|
1067 iIpcArgs.Set(2, &newOrdinaPostnPck); |
|
1068 |
|
1069 //Get new ordinal priority of the window as arg(IPC slot 3) from ini file; |
|
1070 if (!GetIntFromConfig(aSection, KFldOrdinalPriority, newOrdinPrio)) |
|
1071 { |
|
1072 newOrdinPrio = wingrp->OrdinalPriority(); |
|
1073 INFO_PRINTF2(_L("RWindowTreeNode::FullOrdinalPriority = %d"), newOrdinPrio); |
|
1074 } |
|
1075 TPckgBuf<TInt> newOrdinPrioPck(newOrdinPrio); |
|
1076 iIpcArgs.Set(3, &newOrdinPrioPck); |
|
1077 |
|
1078 TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
1079 if (!GetIntFromConfig(aSection, KFldExpected, expectedVal)) |
|
1080 { |
|
1081 ERR_PRINTF2(KLogMissingParameter, &KFldExpected); |
|
1082 SetBlockResult(EFail); |
|
1083 } |
|
1084 |
|
1085 if (err!=expectedVal) |
|
1086 { |
|
1087 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, err); |
|
1088 SetBlockResult(EFail); |
|
1089 } |
|
1090 //Get the new OrdinalPostion and Priority using window group methods; |
|
1091 if (err!=KErrNotFound) |
|
1092 { |
|
1093 TInt retrnOrdinPostn=wingrp->OrdinalPosition(); |
|
1094 TInt retrnOrdinPrio=wingrp->OrdinalPriority(); |
|
1095 |
|
1096 if (retrnOrdinPostn!=newOrdinaPostn) |
|
1097 { |
|
1098 ERR_PRINTF3( |
|
1099 _L("The returned ordinalposition is not as expected, expected: %d, actual: %d"), |
|
1100 newOrdinaPostn, retrnOrdinPostn); |
|
1101 SetBlockResult(EFail); |
|
1102 } |
|
1103 |
|
1104 if (retrnOrdinPrio!=newOrdinPrio) |
|
1105 { |
|
1106 ERR_PRINTF3( |
|
1107 _L("The returned ordinalpriority is not as expected, expected: %d, actual: %d"), |
|
1108 newOrdinPrio, retrnOrdinPrio); |
|
1109 SetBlockResult(EFail); |
|
1110 } |
|
1111 } |
|
1112 ResetIpcArg(); |
|
1113 } |
|
1114 |
|
1115 void CT_DataAnimForMClass::DoGeneralExtIsFocusableL(TInt aOpcode, const TDesC& aSection) |
|
1116 { |
|
1117 TInt screenNub; |
|
1118 TBool expectedVal; |
|
1119 TInt sendFullOrdinPstn; |
|
1120 if (!GetIntFromConfig(aSection, KFldScreenNumb, screenNub)) |
|
1121 { |
|
1122 ERR_PRINTF2(KLogErrMissingPara, &KFldScreenNumb); |
|
1123 } |
|
1124 TPtrC8 ptr; |
|
1125 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
1126 TPckgBuf<TInt> screenNubPck(screenNub); |
|
1127 iIpcArgs.Set(1, &screenNubPck); |
|
1128 |
|
1129 TPtrC datWingrpName; |
|
1130 RWindowGroup* wingrp; |
|
1131 if (GetStringFromConfig(aSection, KFldWingrp, datWingrpName)) |
|
1132 { |
|
1133 wingrp = static_cast<RWindowGroup*>(GetDataObjectL(datWingrpName)); |
|
1134 } |
|
1135 |
|
1136 //Get animation window's FullOrdinalPosition as arg(IPC slot 2) |
|
1137 |
|
1138 sendFullOrdinPstn = wingrp->FullOrdinalPosition(); |
|
1139 INFO_PRINTF2(_L("RWindowTreeNode::FullOrdinalPosition = %d"), sendFullOrdinPstn); |
|
1140 TPckgBuf<TInt> sendFullOrdinPstnPck(sendFullOrdinPstn); |
|
1141 iIpcArgs.Set(2, &sendFullOrdinPstnPck); |
|
1142 |
|
1143 //Check the CommandReply return value |
|
1144 TInt err=iAnim->CommandReply(aOpcode, ptr, iIpcArgs); |
|
1145 if (!GetBoolFromConfig(aSection, KFldExpected, expectedVal)) |
|
1146 { |
|
1147 ERR_PRINTF2(KLogMissingParameter, &KFldExpected); |
|
1148 SetBlockResult(EFail); |
|
1149 } |
|
1150 |
|
1151 if (err!=expectedVal) |
|
1152 { |
|
1153 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, err); |
|
1154 SetBlockResult(EFail); |
|
1155 } |
|
1156 ResetIpcArg(); |
|
1157 } |
|
1158 |
|
1159 void CT_DataAnimForMClass::DoGeneralExtWindowConfigL(TInt aOpcode, const TDesC& aSection) |
|
1160 { |
|
1161 TBool expectedVal; |
|
1162 if (!GetBoolFromConfig(aSection, KFldExpected, expectedVal)) |
|
1163 { |
|
1164 ERR_PRINTF2(KLogMissingParameter, &KFldExpected); |
|
1165 SetBlockResult(EFail); |
|
1166 } |
|
1167 else |
|
1168 { |
|
1169 TPtrC8 ptr; |
|
1170 TInt ret = iAnim->CommandReply(aOpcode, ptr); |
|
1171 if (ret != expectedVal) |
|
1172 { |
|
1173 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectedVal, ret); |
|
1174 SetBlockResult(EFail); |
|
1175 } |
|
1176 } |
|
1177 } |
|
1178 |
|
1179 //*******************MAnimFreeTimerWindowFunction verifying******************************* |
|
1180 void CT_DataAnimForMClass::DoFreeTimerWinDeactivateGc(TInt aOpcode) |
|
1181 { |
|
1182 INFO_PRINTF2(_L("Excute %d"), aOpcode); |
|
1183 TPtrC8 ptr; |
|
1184 TInt err=iAnim->CommandReply(aOpcode, ptr); |
|
1185 if (err != KErrNone) |
|
1186 { |
|
1187 ERR_PRINTF2(KLogErrCommandReply, err); |
|
1188 SetError(err); |
|
1189 } |
|
1190 } |
|
1191 |
|
1192 void CT_DataAnimForMClass::DoFreeTimerWinUpdate(TInt aOpcode) |
|
1193 { |
|
1194 INFO_PRINTF1(KLogInfoCmdCommandReply1); |
|
1195 |
|
1196 TInt err=iAnim->CommandReply(aOpcode); |
|
1197 |
|
1198 if(err!=KErrNone) |
|
1199 { |
|
1200 ERR_PRINTF2(_L("CommandReply failed with error %d"), err); |
|
1201 SetError(err); |
|
1202 } |
|
1203 } |
|
1204 |
|
1205 //------------------------------------------------------------------------------------ |
|
1206 void CT_DataAnimForMClass::DoCmdRetrieveResult(const TDesC& aSectName , const TInt& datOpcode) |
|
1207 { |
|
1208 TInt result = iAnim->CommandReply(datOpcode); |
|
1209 TBool expectdVal; |
|
1210 //Get expected value from ini file. |
|
1211 if(!GetBoolFromConfig(aSectName,KFldExpected,expectdVal)) |
|
1212 { |
|
1213 if ( result != KErrNone) |
|
1214 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1215 else // success |
|
1216 { |
|
1217 INFO_PRINTF1(_L("Retrieve Result event return ETrue")); |
|
1218 } |
|
1219 } |
|
1220 if(result!=expectdVal) |
|
1221 { |
|
1222 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expectdVal, result); |
|
1223 SetBlockResult (EFail); |
|
1224 } |
|
1225 else |
|
1226 { |
|
1227 INFO_PRINTF1(_L("Retrieve Result equals to the expected value")); |
|
1228 } |
|
1229 } |
|
1230 |
|
1231 void CT_DataAnimForMClass::DoCmdGeneralAnimate(const TDesC& aSectName, const TInt& datOpcode ) |
|
1232 { |
|
1233 //Get the datetime from the ini file |
|
1234 TDateTime dateTime ; |
|
1235 if(!GetDateTimeFromConfig(aSectName, dateTime)) |
|
1236 { |
|
1237 ERR_PRINTF2(KLogMissingParameter , &KlogDateTime); |
|
1238 SetBlockResult(EFail); |
|
1239 } |
|
1240 TPckgBuf<TDateTime> sendPckg(dateTime); |
|
1241 iIpcArgs.Set(0,TIpcArgs::ENothing); |
|
1242 iIpcArgs.Set(1, &sendPckg); |
|
1243 |
|
1244 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1245 // Send the command to notify the server |
|
1246 TInt ret = iAnim->CommandReply(datOpcode, iSendBuf, iIpcArgs); |
|
1247 |
|
1248 // Check the command return code |
|
1249 if(ret == KErrNone) |
|
1250 { |
|
1251 ERR_PRINTF2( KLogErrCommandReply, ret); |
|
1252 SetBlockResult (EFail); |
|
1253 } |
|
1254 else |
|
1255 { |
|
1256 INFO_PRINTF1(_L("General Animate invoked succesffully and return successfully ")); |
|
1257 } |
|
1258 ResetIpcArg(); |
|
1259 } |
|
1260 |
|
1261 |
|
1262 void CT_DataAnimForMClass::DoCmdGeneralClient(const TDesC& /*aSectName*/, const TInt& datOpcode ) |
|
1263 { |
|
1264 // Send the command to notify the server |
|
1265 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1266 TInt ret = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
1267 |
|
1268 // Check the return thread id equals to the client thread or not. |
|
1269 TInt clientThreadId = RThread().Id().Id(); |
|
1270 |
|
1271 if ( ret == clientThreadId ) |
|
1272 { |
|
1273 INFO_PRINTF1(_L("General client invoked succesffully")); |
|
1274 } |
|
1275 else |
|
1276 { |
|
1277 ERR_PRINTF2( KLogErrCommandReply, ret); |
|
1278 SetBlockResult (EFail); |
|
1279 } |
|
1280 } |
|
1281 |
|
1282 |
|
1283 void CT_DataAnimForMClass::DoCmdGeneralFlashStateOn(const TDesC& aSectName, const TInt& datOpcode ) |
|
1284 { |
|
1285 // Send the command to notify the server. |
|
1286 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1287 TBool expected(EFalse); |
|
1288 TInt ret = -1 ; |
|
1289 |
|
1290 if ( !GetBoolFromConfig(aSectName,KFldExpected, expected) ) |
|
1291 { |
|
1292 ERR_PRINTF2(KLogMissingParameter , &KFldExpected); |
|
1293 SetBlockResult(EFail); |
|
1294 } |
|
1295 |
|
1296 ret = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
1297 //If ret return -1, the result value can not be trusted(Please refer to the code in AnimPlugin::WinAnim). |
|
1298 //So it need another calling untill the ret return a ETrue or EFalse. |
|
1299 while(ret == -1) |
|
1300 { |
|
1301 User::After(100000); |
|
1302 ret = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
1303 } |
|
1304 |
|
1305 |
|
1306 // Check if the return is ETrue (1) or EFalse(0) |
|
1307 if ( ret == static_cast<TInt>(expected) ) |
|
1308 { |
|
1309 INFO_PRINTF1(_L("GeneralFlashStateOn invoked succesffully. Return code equals to expected vaule ")); |
|
1310 } |
|
1311 else |
|
1312 { |
|
1313 ERR_PRINTF2( KLogErrCommandReply, ret); |
|
1314 SetBlockResult (EFail); |
|
1315 } |
|
1316 } |
|
1317 |
|
1318 void CT_DataAnimForMClass::DoCmdGeneralPanic(const TDesC& /*aSectName*/ , const TInt& datOpcode) |
|
1319 { |
|
1320 //Send the command to notify the server. |
|
1321 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1322 TInt err = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1323 |
|
1324 //The client will be paniced by the server |
|
1325 INFO_PRINTF1(_L("GeneralPanic invoked successfully")); |
|
1326 } |
|
1327 |
|
1328 void CT_DataAnimForMClass::DoCmdGeneralScreenDevice(const TDesC& /*aSectName*/ , const TInt& datOpcode ) |
|
1329 { |
|
1330 //Send the command to notify the server . |
|
1331 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1332 TInt ret = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1333 |
|
1334 //Check if the return code is 0(Success) or not. |
|
1335 if ( ret == KErrNone ) |
|
1336 { |
|
1337 INFO_PRINTF1(_L("GeneralScreenDevice invoked succesffully.")); |
|
1338 } |
|
1339 else |
|
1340 { |
|
1341 ERR_PRINTF2( KLogErrCommandReply, ret); |
|
1342 SetBlockResult (EFail); |
|
1343 } |
|
1344 } |
|
1345 |
|
1346 void CT_DataAnimForMClass::DoCmdGeneralWindowExtension(const TDesC& /*aSectName*/, const TInt& datOpcode) |
|
1347 { |
|
1348 // Send the command to notify the server . |
|
1349 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1350 TInt ret = iAnim->CommandReply(datOpcode, iSendBuf, iIpcArgs); |
|
1351 |
|
1352 // Check if the return code is 0(Success) or not. |
|
1353 if (ret == KErrNone) |
|
1354 { |
|
1355 INFO_PRINTF1(_L("GeneralWindowExtension invoked succesffully.")); |
|
1356 } |
|
1357 else |
|
1358 { |
|
1359 ERR_PRINTF2( KLogErrCommandReply, ret); |
|
1360 SetBlockResult(EFail); |
|
1361 } |
|
1362 } |
|
1363 |
|
1364 void CT_DataAnimForMClass::DoCmdGeneralEventExtension( const TDesC& /*aSectName*/,const TInt& datOpcode) |
|
1365 { |
|
1366 // Send the command to notify the server . |
|
1367 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1368 TInt ret = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1369 |
|
1370 // Check if the return code is 0(Success) or not. |
|
1371 if ( ret == KErrNone ) |
|
1372 { |
|
1373 INFO_PRINTF1(_L("GeneralEventExtension invoked succesffully.")); |
|
1374 } |
|
1375 else |
|
1376 { |
|
1377 ERR_PRINTF2( KLogErrCommandReply, ret); |
|
1378 SetBlockResult (EFail); |
|
1379 } |
|
1380 } |
|
1381 |
|
1382 void CT_DataAnimForMClass::DoCmdGeneralExtendedInterface(const TDesC& aSectName , const TInt& datOpcode ) |
|
1383 { |
|
1384 TInt interface ; |
|
1385 //Get interface from ini file and set it as IpcArgs 1. |
|
1386 if ( !GetIntFromConfig(aSectName,KFldInterface, interface) ) |
|
1387 { |
|
1388 ERR_PRINTF2(KLogMissingParameter , &KFldInterface); |
|
1389 SetBlockResult (EFail); |
|
1390 } |
|
1391 TPckgBuf<TInt> sendPckg(interface); |
|
1392 iIpcArgs.Set(0,TIpcArgs::ENothing); |
|
1393 iIpcArgs.Set(1, &sendPckg); |
|
1394 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1395 //Send the command to notify the server . |
|
1396 TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1397 |
|
1398 // Check the command return code |
|
1399 if ( interface == 0 ) |
|
1400 { |
|
1401 TInt expected ; |
|
1402 |
|
1403 if ( !GetIntFromConfig(aSectName,KFldExpected, expected) ) |
|
1404 { |
|
1405 ERR_PRINTF2(KLogMissingParameter , &KFldInterface); |
|
1406 SetBlockResult (EFail); |
|
1407 } |
|
1408 if ( result != expected ) /*so far, the expected value is 2.*/ |
|
1409 { |
|
1410 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1411 SetBlockResult (EFail); |
|
1412 } |
|
1413 else |
|
1414 { |
|
1415 INFO_PRINTF1(_L("extended interface return is okay when the input paramter is 0")); |
|
1416 } |
|
1417 } |
|
1418 else if( interface == 1 ) |
|
1419 { |
|
1420 if ( result == 0) // server return 0 stands for okay. |
|
1421 { |
|
1422 INFO_PRINTF1(_L("extended interface return is okay when the input paramter is 1")); |
|
1423 } |
|
1424 else |
|
1425 { |
|
1426 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1427 SetBlockResult (EFail); |
|
1428 } |
|
1429 } |
|
1430 else if( interface == 2 ) |
|
1431 { |
|
1432 if ( result == 0) // server return 0 stands for okay. |
|
1433 { |
|
1434 INFO_PRINTF1(_L("extended interface return is okay when the input paramter is 2")); |
|
1435 } |
|
1436 else |
|
1437 { |
|
1438 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1439 SetBlockResult (EFail); |
|
1440 } |
|
1441 } |
|
1442 else |
|
1443 { |
|
1444 if ( result == 0) // server return 0 stands for okay. |
|
1445 { |
|
1446 INFO_PRINTF1(_L("extended interface return is a NULL pointer when the input paramter is OUT of 0~2")); |
|
1447 } |
|
1448 else |
|
1449 { |
|
1450 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1451 SetBlockResult (EFail); |
|
1452 } |
|
1453 } |
|
1454 ResetIpcArg(); |
|
1455 } |
|
1456 |
|
1457 void CT_DataAnimForMClass::DoCmdGeneralNumOfExtInterfaces(const TDesC& aSectName,const TInt& datOpcode) |
|
1458 { |
|
1459 // Send the command to notify the server. |
|
1460 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1461 TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs); |
|
1462 |
|
1463 INFO_PRINTF2(KLogErrCommandReply, result); |
|
1464 |
|
1465 // Check the return code |
|
1466 TInt expected; |
|
1467 if ( !GetIntFromConfig(aSectName,KFldExpected, expected) ) |
|
1468 { |
|
1469 ERR_PRINTF2(KLogMissingParameter , &KFldInterface); |
|
1470 SetBlockResult (EFail); |
|
1471 } |
|
1472 if (result != expected) // so far ,the expected value is 2. |
|
1473 { |
|
1474 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1475 SetBlockResult (EFail); |
|
1476 } |
|
1477 else |
|
1478 { |
|
1479 INFO_PRINTF1(_L("NumberofExtendedInterfaces return is okay when the input paramter is 0")); |
|
1480 } |
|
1481 } |
|
1482 |
|
1483 |
|
1484 void CT_DataAnimForMClass::DoCmdGeneralGetRawEvents(const TDesC& aSectName , const TInt& datOpcode) |
|
1485 { |
|
1486 TBool bGetEvent; |
|
1487 //Get the rawevent parameter from ini file and set it as the IpcArgs 1 . |
|
1488 if ( !GetBoolFromConfig(aSectName,KFldGetEvent ,bGetEvent)) |
|
1489 { |
|
1490 ERR_PRINTF2(KLogMissingParameter , &KFldGetEvent); |
|
1491 SetBlockResult(EFail); |
|
1492 } |
|
1493 iIpcArgs.Set(0,TIpcArgs::ENothing); |
|
1494 TPckgBuf<TBool> sendPckg(bGetEvent); |
|
1495 iIpcArgs.Set(1, &sendPckg); |
|
1496 |
|
1497 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1498 // Send the command to notify the server . |
|
1499 TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1500 |
|
1501 //Check the result is 0(Success) or not. |
|
1502 if (result != KErrNone ) |
|
1503 { |
|
1504 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1505 SetBlockResult (EFail); |
|
1506 } |
|
1507 else |
|
1508 { |
|
1509 INFO_PRINTF1(_L("GetRawEvents return is okay ")); |
|
1510 } |
|
1511 } |
|
1512 |
|
1513 void CT_DataAnimForMClass::DoCmdGeneralPostRawEvent(const TDesC& aSectName , const TInt& datOpcode) |
|
1514 { |
|
1515 TRawEvent rawEvent; |
|
1516 TPtrC str; |
|
1517 //Get the post rawevent parameter from ini file and set it as the IpcArgs 1 . |
|
1518 if (!GetStringFromConfig(aSectName,KFldPostRawEvent,str)) |
|
1519 { |
|
1520 ERR_PRINTF2(KLogMissingParameter , &KFldPostRawEvent); |
|
1521 SetBlockResult(EFail); |
|
1522 } |
|
1523 TRawEvent::TType type; |
|
1524 if ( str == KENone ) |
|
1525 type = TRawEvent::ENone; |
|
1526 else if ( str == KEPointerMove ) |
|
1527 type = TRawEvent::EPointerMove; |
|
1528 else if ( str == KEPointerSwitchOn) |
|
1529 type = TRawEvent::EPointerSwitchOn; |
|
1530 else if ( str == KEKeyDown ) |
|
1531 type = TRawEvent::EKeyDown; |
|
1532 else if ( str == KEKeyUp ) |
|
1533 type = TRawEvent::EKeyUp; |
|
1534 else if ( str == KERedraw) |
|
1535 type = TRawEvent::ERedraw; |
|
1536 else if ( str == KESwitchOn ) |
|
1537 type = TRawEvent::ESwitchOn; |
|
1538 else if ( str == KEActive) |
|
1539 type = TRawEvent::EActive; |
|
1540 else if ( str == KEInactive) |
|
1541 type = TRawEvent::EInactive; |
|
1542 else if ( str == KEUpdateModifiers) |
|
1543 type = TRawEvent::EUpdateModifiers; |
|
1544 else if ( str == KEButton1Down) |
|
1545 type = TRawEvent::EButton1Down; |
|
1546 else if ( str == KEButton1Up) |
|
1547 type = TRawEvent::EButton1Up; |
|
1548 else if ( str == KEButton2Down) |
|
1549 type = TRawEvent::EButton2Down; |
|
1550 else if ( str == KEButton2Up) |
|
1551 type = TRawEvent::EButton2Up; |
|
1552 else if ( str == KEButton3Down) |
|
1553 type = TRawEvent::EButton3Down; |
|
1554 else if ( str == KEButton3Up) |
|
1555 type = TRawEvent::EButton3Up; |
|
1556 else if ( str == KESwitchOff) |
|
1557 type = TRawEvent::ESwitchOff; |
|
1558 else if ( str == KEKeyRepeat) |
|
1559 type = TRawEvent::EKeyRepeat; |
|
1560 else if ( str == KECaseOpen) |
|
1561 type = TRawEvent::ECaseOpen; |
|
1562 else if ( str == KECaseClose) |
|
1563 type = TRawEvent::ECaseClose; |
|
1564 else if ( str == KERestartSystem) |
|
1565 type = TRawEvent::ERestartSystem; |
|
1566 |
|
1567 rawEvent.Set(type); |
|
1568 TPckgBuf<TRawEvent> sendPckg(rawEvent); |
|
1569 |
|
1570 iIpcArgs.Set(0,TIpcArgs::ENothing); |
|
1571 iIpcArgs.Set(1, &sendPckg); |
|
1572 |
|
1573 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1574 //Send the command to notify the server . |
|
1575 TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1576 |
|
1577 //Check the result is 0(Success) or not. |
|
1578 if (result != KErrNone ) |
|
1579 { |
|
1580 ERR_PRINTF2(KLogErrCommandReply, result); |
|
1581 SetBlockResult (EFail); |
|
1582 } |
|
1583 else |
|
1584 { |
|
1585 INFO_PRINTF1(_L("PostRawEvent return is okay ")); |
|
1586 } |
|
1587 } |
|
1588 |
|
1589 |
|
1590 void CT_DataAnimForMClass::DoCmdGeneralPostKeyEventL(const TDesC& aSectName , const TInt& datOpcode) |
|
1591 { |
|
1592 /* |
|
1593 * 1.Use WinAnim plugin dll to post a key event. |
|
1594 * 2.Use an RWindowGroup object to capture the key event. |
|
1595 * */ |
|
1596 |
|
1597 TKeyEvent keyEvent; |
|
1598 TKeyCode aKeyCode; |
|
1599 _LIT( KCode , "Code"); |
|
1600 //Get the keycode from the ini file. |
|
1601 if (!CT_GraphicsUtil::ReadKeyCode(*this, aSectName, KCode , aKeyCode)) |
|
1602 { |
|
1603 ERR_PRINTF2(KLogMissingParameter , &KCode); |
|
1604 SetBlockResult(EFail); |
|
1605 } |
|
1606 // The keyEvent will be set as the IpcArg 1 . |
|
1607 TInt captureKey = aKeyCode; |
|
1608 keyEvent.iCode = aKeyCode; |
|
1609 keyEvent.iScanCode =aKeyCode; |
|
1610 keyEvent.iModifiers = 0; |
|
1611 keyEvent.iRepeats = 0; |
|
1612 |
|
1613 _LIT(KWindowGroup, "windowgroup"); |
|
1614 _LIT(KWsSession, "session"); |
|
1615 RWindowGroup* group = NULL; |
|
1616 RWsSession* session = NULL; |
|
1617 TPtrC datName; |
|
1618 if ( GetStringFromConfig(aSectName, KWindowGroup , datName) ) |
|
1619 { |
|
1620 group = static_cast<RWindowGroup*>(GetDataObjectL(datName)); |
|
1621 } |
|
1622 |
|
1623 if ( GetStringFromConfig(aSectName, KWsSession , datName) ) |
|
1624 { |
|
1625 session = static_cast<RWsSession*>(GetDataObjectL(datName)); |
|
1626 } |
|
1627 group->CaptureKey(captureKey, 0, 0); |
|
1628 TPckgBuf<TKeyEvent> sendPckg(keyEvent); |
|
1629 iIpcArgs.Set(0,TIpcArgs::ENothing); |
|
1630 iIpcArgs.Set(1, &sendPckg); |
|
1631 TInt err = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1632 |
|
1633 //Check the result is 0(Success) or not. |
|
1634 if (err != KErrNone ) |
|
1635 { |
|
1636 ERR_PRINTF2(KLogErrCommandReply, err); |
|
1637 SetBlockResult (EFail); |
|
1638 } |
|
1639 else |
|
1640 { |
|
1641 INFO_PRINTF1(_L("PostKeyEvent return is okay ")); |
|
1642 } |
|
1643 TRequestStatus myStatus; |
|
1644 session->EventReady(&myStatus); |
|
1645 TBool bStop = ETrue; |
|
1646 TWsEvent we; |
|
1647 while(bStop) |
|
1648 { |
|
1649 User::WaitForRequest(myStatus); |
|
1650 session->GetEvent(we); |
|
1651 if(we.Type() == EEventKey) |
|
1652 { |
|
1653 bStop = EFalse; |
|
1654 TInt rst = we.Key()->iCode; |
|
1655 if(rst != captureKey) |
|
1656 { |
|
1657 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), captureKey, rst); |
|
1658 SetBlockResult(EFail); |
|
1659 } |
|
1660 else |
|
1661 { |
|
1662 _LIT(KSuccess, "PostKeyEvent successfully"); |
|
1663 INFO_PRINTF1(KSuccess); |
|
1664 } |
|
1665 } |
|
1666 else |
|
1667 { |
|
1668 session->EventReady(&myStatus); |
|
1669 } |
|
1670 }//end while |
|
1671 } |
|
1672 |
|
1673 void CT_DataAnimForMClass::DoCmdGeneralSetSync(const TDesC& aSectName , const TInt& datOpcode ) |
|
1674 { |
|
1675 MAnimGeneralFunctions::TAnimSync syncmode ; |
|
1676 TPtrC str; |
|
1677 // Get the syncmode to be set from ini file and set it as IpcArg 1. |
|
1678 if ( !GetStringFromConfig(aSectName,KFldSyncMode ,str)) |
|
1679 { |
|
1680 ERR_PRINTF2(KLogMissingParameter , &KFldSyncMode); |
|
1681 SetBlockResult (EFail); |
|
1682 } |
|
1683 if (str == KESyncNone ) |
|
1684 syncmode = MAnimGeneralFunctions::ESyncNone ; |
|
1685 else if ( str == KESyncFlash) |
|
1686 syncmode = MAnimGeneralFunctions::ESyncFlash ; |
|
1687 else if ( str == KESyncSecond) |
|
1688 syncmode = MAnimGeneralFunctions::ESyncSecond ; |
|
1689 else if ( str == KESyncMinute) |
|
1690 syncmode = MAnimGeneralFunctions::ESyncMinute ; |
|
1691 else if ( str == KESyncDay) |
|
1692 syncmode = MAnimGeneralFunctions::ESyncDay ; |
|
1693 iIpcArgs.Set(0,TIpcArgs::ENothing); |
|
1694 TPckgBuf<MAnimGeneralFunctions::TAnimSync> sendPckg(syncmode); |
|
1695 iIpcArgs.Set(1, &sendPckg); |
|
1696 |
|
1697 INFO_PRINTF1(KLogInfoCmdCommandReply3) ; |
|
1698 //Send the command to notify the server . |
|
1699 TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1700 |
|
1701 //Check the result is 0(Success) or not. |
|
1702 if (result != KErrNone ) |
|
1703 { |
|
1704 ERR_PRINTF2(KLogErrCommandReply, result); |
|
1705 SetBlockResult (EFail); |
|
1706 } |
|
1707 else |
|
1708 { |
|
1709 INFO_PRINTF1(_L("SetSync return is okay ")); |
|
1710 } |
|
1711 } |
|
1712 |
|
1713 void CT_DataAnimForMClass::DoCmdGeneralSync(const TDesC& aSectName , const TInt& datOpcode ) |
|
1714 { |
|
1715 TInt expectedsyncmode ; |
|
1716 TPtrC str; |
|
1717 // Get the expected syncmode from ini file. |
|
1718 if ( !GetStringFromConfig(aSectName,KFldExpected ,str)) |
|
1719 { |
|
1720 ERR_PRINTF2(KLogMissingParameter , &KFldExpected); |
|
1721 SetBlockResult(EFail); |
|
1722 } |
|
1723 if (str == KESyncNone ) |
|
1724 expectedsyncmode = MAnimGeneralFunctions::ESyncNone ; |
|
1725 else if ( str == KESyncFlash) |
|
1726 expectedsyncmode = MAnimGeneralFunctions::ESyncFlash ; |
|
1727 else if ( str == KESyncSecond) |
|
1728 expectedsyncmode = MAnimGeneralFunctions::ESyncSecond ; |
|
1729 else if ( str == KESyncMinute) |
|
1730 expectedsyncmode = MAnimGeneralFunctions::ESyncMinute ; |
|
1731 else if ( str == KESyncDay) |
|
1732 expectedsyncmode = MAnimGeneralFunctions::ESyncDay ; |
|
1733 |
|
1734 iIpcArgs.Set( 0, TIpcArgs::ENothing); |
|
1735 INFO_PRINTF1(KLogInfoCmdCommandReply3) ; |
|
1736 //Send the command to notify the server . |
|
1737 TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1738 |
|
1739 //Check the command return code . |
|
1740 if ( result != expectedsyncmode ) |
|
1741 { |
|
1742 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1743 SetBlockResult(EFail); |
|
1744 } |
|
1745 else |
|
1746 { |
|
1747 INFO_PRINTF1(_L("GeneralSync invoked successfully")); |
|
1748 } |
|
1749 } |
|
1750 |
|
1751 void CT_DataAnimForMClass::DoCmdGeneralSetInterval(const TDesC& aSectName , const TInt& datOpcode) |
|
1752 { |
|
1753 // Get the interval from ini file and set it as IpcArg 1. |
|
1754 TInt interval ; |
|
1755 if ( !GetIntFromConfig(aSectName,KFldInterval ,interval)) |
|
1756 { |
|
1757 ERR_PRINTF2(KLogMissingParameter , &KFldInterval); |
|
1758 SetBlockResult(EFail); |
|
1759 } |
|
1760 iIpcArgs.Set(0,TIpcArgs::ENothing); |
|
1761 TPckgBuf<TInt> sendPckg(interval) ; |
|
1762 iIpcArgs.Set(1, &sendPckg ); |
|
1763 INFO_PRINTF1(KLogInfoCmdCommandReply3) ; |
|
1764 //Send the command to notify the server . |
|
1765 TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1766 |
|
1767 //Check the result is 0(Success) or not. |
|
1768 if ( result != KErrNone ) |
|
1769 { |
|
1770 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1771 SetBlockResult(EFail); |
|
1772 } |
|
1773 else |
|
1774 { |
|
1775 INFO_PRINTF1(_L("GeneralSetInterval invoked successfully")); |
|
1776 } |
|
1777 } |
|
1778 |
|
1779 void CT_DataAnimForMClass::DoCmdGeneralSetNextInterval(const TDesC& aSectName , const TInt& datOpcode) |
|
1780 { |
|
1781 //Read the interval from ini file |
|
1782 TInt interval; |
|
1783 if ( !GetIntFromConfig(aSectName,KFldInterval ,interval)) |
|
1784 { |
|
1785 ERR_PRINTF2(KLogMissingParameter , &KFldInterval); |
|
1786 return; |
|
1787 } |
|
1788 TPckgBuf<TInt> sendPckg1(interval); |
|
1789 |
|
1790 TInt nextinterval ; |
|
1791 _LIT( KNextInterval , "nextinterval"); |
|
1792 //Read the next interval from ini file |
|
1793 if ( !GetIntFromConfig(aSectName,KNextInterval ,nextinterval)) |
|
1794 { |
|
1795 ERR_PRINTF2(KLogMissingParameter , &KNextInterval); |
|
1796 SetBlockResult(EFail); |
|
1797 } |
|
1798 TPckgBuf<TInt> sendPckg2(nextinterval) ; |
|
1799 iIpcArgs.Set(0,TIpcArgs::ENothing); |
|
1800 iIpcArgs.Set(1, &sendPckg1); |
|
1801 iIpcArgs.Set(2, &sendPckg2); |
|
1802 INFO_PRINTF1(KLogInfoCmdCommandReply3) ; |
|
1803 //Send the command to notify the server. |
|
1804 TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1805 |
|
1806 //Check the result is 0(Success) or not. |
|
1807 if ( result != KErrNone ) |
|
1808 { |
|
1809 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1810 SetBlockResult(EFail); |
|
1811 } |
|
1812 else |
|
1813 { |
|
1814 INFO_PRINTF1(_L("GeneralSetNextInterval invoked successfully")); |
|
1815 } |
|
1816 } |
|
1817 |
|
1818 |
|
1819 void CT_DataAnimForMClass::DoCmdGeneralSystemTime(const TDesC& aSectName , const TInt& datOpcode) |
|
1820 { |
|
1821 MAnimGeneralFunctions::TAnimSync syncmode; |
|
1822 TPtrC str; |
|
1823 _LIT(KExpected , "expected"); |
|
1824 _LIT( KSyncMode , "animsync"); |
|
1825 // Get the syncmode from ini file and set it as IpcArg 1. |
|
1826 if ( !GetStringFromConfig(aSectName,KSyncMode ,str)) |
|
1827 { |
|
1828 ERR_PRINTF2(KLogMissingParameter , &KSyncMode); |
|
1829 SetBlockResult(EFail); |
|
1830 } |
|
1831 if (str == KESyncNone ) |
|
1832 syncmode = MAnimGeneralFunctions::ESyncNone; |
|
1833 else if ( str == KESyncFlash) |
|
1834 syncmode = MAnimGeneralFunctions::ESyncFlash; |
|
1835 else if ( str == KESyncSecond) |
|
1836 syncmode = MAnimGeneralFunctions::ESyncSecond; |
|
1837 else if ( str == KESyncMinute) |
|
1838 syncmode = MAnimGeneralFunctions::ESyncMinute; |
|
1839 else if ( str == KESyncDay) |
|
1840 syncmode = MAnimGeneralFunctions::ESyncDay; |
|
1841 iIpcArgs.Set(0,TIpcArgs::ENothing); |
|
1842 TPckgBuf<MAnimGeneralFunctions::TAnimSync> sendPckg(syncmode); |
|
1843 iIpcArgs.Set(1, &sendPckg); |
|
1844 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1845 TInt result = iAnim->CommandReply(datOpcode, iSendBuf , iIpcArgs ); |
|
1846 TBool expected; |
|
1847 if ( !GetBoolFromConfig(aSectName,KExpected ,expected)) |
|
1848 { |
|
1849 ERR_PRINTF2(KLogMissingParameter , &KExpected); |
|
1850 return; |
|
1851 } |
|
1852 if(result != static_cast<TInt>(expected)) |
|
1853 { |
|
1854 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expected, result); |
|
1855 SetBlockResult (EFail); |
|
1856 } |
|
1857 else |
|
1858 { |
|
1859 INFO_PRINTF1(_L("GeneralSystemTime invoked is okay.")); |
|
1860 } |
|
1861 } |
|
1862 |
|
1863 void CT_DataAnimForMClass::DoCmdGeneralRegisterForNotis(const TDesC& aSectName , const TInt& datOpcode) |
|
1864 { |
|
1865 TInt notifications; |
|
1866 TEventCode expectedCode; |
|
1867 // Get the notifications value from ini file and set it as IpcArg 1. |
|
1868 if ( !GetIntFromConfig(aSectName,KFldNotifications ,notifications)) |
|
1869 { |
|
1870 ERR_PRINTF2(KLogMissingParameter, &KFldNotifications); |
|
1871 SetBlockResult(EFail); |
|
1872 } |
|
1873 |
|
1874 if(!CT_GraphicsUtil::ReadEventCode(*this, aSectName, KFldExpected, expectedCode)) |
|
1875 { |
|
1876 ERR_PRINTF2(KLogMissingParameter , &KFldExpected); |
|
1877 return; |
|
1878 } |
|
1879 |
|
1880 TPckgBuf<TInt> sendPckg(notifications); |
|
1881 TPckgBuf<TEventCode> sendPckg2(expectedCode); |
|
1882 iIpcArgs.Set(0, TIpcArgs::ENothing ); |
|
1883 iIpcArgs.Set(1, &sendPckg ); |
|
1884 iIpcArgs.Set(2, &sendPckg2); |
|
1885 |
|
1886 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1887 //Send the command to notify the server . |
|
1888 TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
1889 |
|
1890 //Check the result is 0(Success) or not. |
|
1891 if ( result != KErrNone ) |
|
1892 { |
|
1893 ERR_PRINTF2( KLogErrCommandReply, result); |
|
1894 SetBlockResult(EFail); |
|
1895 } |
|
1896 else |
|
1897 { |
|
1898 INFO_PRINTF1(_L("RegisterForNotis invoked successfully")); |
|
1899 } |
|
1900 } |
|
1901 |
|
1902 |
|
1903 void CT_DataAnimForMClass::DoCmdGeneralMessage(const TDesC& aSectName ,const TInt& datOpcode) |
|
1904 { |
|
1905 TPtrC str , expectedStr; |
|
1906 TBuf<100> returnStr; |
|
1907 // Get the sending message value from ini file and set it as IpcArg 1. |
|
1908 if ( !GetStringFromConfig(aSectName,KFldMessage ,str)) |
|
1909 { |
|
1910 ERR_PRINTF2(KLogMissingParameter , &KFldMessage); |
|
1911 SetBlockResult(EFail); |
|
1912 } |
|
1913 // Get the expected message value from ini file . |
|
1914 if ( !GetStringFromConfig(aSectName,KFldExpected ,expectedStr)) |
|
1915 { |
|
1916 ERR_PRINTF2(KLogMissingParameter , &KFldExpected); |
|
1917 SetBlockResult(EFail); |
|
1918 } |
|
1919 iIpcArgs.Set(0, TIpcArgs::ENothing ); |
|
1920 iIpcArgs.Set(1, &str); |
|
1921 iIpcArgs.Set(2, &returnStr); |
|
1922 |
|
1923 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1924 //Send the command to notify the server . |
|
1925 TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
1926 |
|
1927 if(expectedStr.Compare(returnStr)) |
|
1928 { |
|
1929 ERR_PRINTF3(_L("The returned value is not as expected, expected: %S, actual: %S"), &expectedStr, &returnStr); |
|
1930 SetBlockResult (EFail); |
|
1931 } |
|
1932 else |
|
1933 { |
|
1934 INFO_PRINTF1(_L("GeneralMessage invoked successfully")); |
|
1935 } |
|
1936 ResetIpcArg(); |
|
1937 } |
|
1938 |
|
1939 |
|
1940 void CT_DataAnimForMClass::DoCmdGeneralDuplicateBitmapL(const TDesC& aSectName , const TInt& datOpcode) |
|
1941 { |
|
1942 TPtrC str ; |
|
1943 TInt bmHandle; |
|
1944 CFbsBitmap* bmp; |
|
1945 // Get the object name of CFbsBitmap from ini file. |
|
1946 if ( !GetStringFromConfig(aSectName,KFldHandleBitmap,str)) |
|
1947 { |
|
1948 //giving a non-existed value to take the nagative case. |
|
1949 bmHandle = 9999; |
|
1950 } |
|
1951 else |
|
1952 { |
|
1953 bmp = static_cast<CFbsBitmap*>(GetDataObjectL(str)); |
|
1954 bmHandle = bmp->Handle(); |
|
1955 } |
|
1956 |
|
1957 iIpcArgs.Set(0, TIpcArgs::ENothing ); |
|
1958 TPckgBuf<TInt> sendPckg(bmHandle); |
|
1959 iIpcArgs.Set(1, &sendPckg ); |
|
1960 //Send the command to notify the server |
|
1961 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1962 iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
1963 |
|
1964 //Print info |
|
1965 _LIT(KSuccess,"GeneralDuplicateBitmapL invoked successfully"); |
|
1966 INFO_PRINTF1(KSuccess); |
|
1967 ResetIpcArg(); |
|
1968 } |
|
1969 |
|
1970 |
|
1971 void CT_DataAnimForMClass::DoCmdGeneralDuplicateFontL(const TDesC& aSectName , const TInt& datOpcode) |
|
1972 { |
|
1973 TPtrC str; |
|
1974 TInt fntHandle; |
|
1975 CFbsFont* fnt; |
|
1976 TInt typeId; |
|
1977 // Get the object name of CFbsFont from ini file. |
|
1978 if ( !GetStringFromConfig(aSectName,KFldHandleFont,str)) |
|
1979 { |
|
1980 //giving a non-existed value to take the nagative case. |
|
1981 fntHandle = 9999; |
|
1982 } |
|
1983 else |
|
1984 { |
|
1985 fnt = static_cast<CFbsFont*>(GetDataObjectL(str)); |
|
1986 typeId = fnt->TypeUid().iUid; //this is the expected value. |
|
1987 fntHandle = fnt->Handle(); |
|
1988 } |
|
1989 TInt result = 0; |
|
1990 TPckgBuf<TInt> sendPckg(fntHandle); |
|
1991 TPckgBuf<TInt> getPckg(result); |
|
1992 |
|
1993 iIpcArgs.Set(0, TIpcArgs::ENothing ); |
|
1994 iIpcArgs.Set(1, &sendPckg); |
|
1995 iIpcArgs.Set(2, &getPckg); |
|
1996 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
1997 //Send the command to notify the server . |
|
1998 iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
1999 result = getPckg(); |
|
2000 |
|
2001 //Check the result |
|
2002 if(result == typeId) |
|
2003 { |
|
2004 INFO_PRINTF1(_L("GeneralDuplicateFontL invoked successfully")); |
|
2005 } |
|
2006 else |
|
2007 { |
|
2008 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), typeId, result); |
|
2009 SetError(KErrNoMemory); |
|
2010 } |
|
2011 ResetIpcArg(); |
|
2012 } |
|
2013 |
|
2014 |
|
2015 void CT_DataAnimForMClass::DoCmdGeneralCloseFontL(const TDesC& aSectName , const TInt& datOpcode) |
|
2016 { |
|
2017 TPtrC str ; |
|
2018 // Get the object name of CFbsFont from ini file. |
|
2019 if ( !GetStringFromConfig(aSectName,KFldHandleFont,str)) |
|
2020 { |
|
2021 ERR_PRINTF2(KLogMissingParameter , &KFldHandleFont); |
|
2022 SetBlockResult(EFail); |
|
2023 } |
|
2024 CFbsFont* fnt = static_cast<CFbsFont*>(GetDataObjectL(str)); |
|
2025 TInt typeId = fnt->TypeUid().iUid; //this is the expected value . |
|
2026 TInt fntHandle = fnt->Handle(); |
|
2027 TInt result = 0; |
|
2028 TPckgBuf<TInt> sendPckg(fntHandle); |
|
2029 TPckgBuf<TInt> getPckg(result); |
|
2030 |
|
2031 iIpcArgs.Set(0, TIpcArgs::ENothing ); |
|
2032 iIpcArgs.Set(1, &sendPckg ); |
|
2033 iIpcArgs.Set(2, &getPckg); |
|
2034 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
2035 iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
2036 result = getPckg(); |
|
2037 if(result == typeId) |
|
2038 { |
|
2039 _LIT(KSuccess,"GeneralDuplicateFontL invoked successfully"); |
|
2040 INFO_PRINTF1(KSuccess); |
|
2041 } |
|
2042 else |
|
2043 { |
|
2044 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), typeId, result); |
|
2045 SetBlockResult (EFail); |
|
2046 } |
|
2047 ResetIpcArg(); |
|
2048 } |
|
2049 |
|
2050 void CT_DataAnimForMClass::DoCmdGeneralReplyBuf8(const TDesC& aSectName, const TInt& datOpcode) |
|
2051 { |
|
2052 TPtrC str2; |
|
2053 |
|
2054 if ( !GetStringFromConfig(aSectName,KFldSetReplyBufHandle1,str2)) |
|
2055 { |
|
2056 ERR_PRINTF2(KLogMissingParameter , &KFldSetReplyBufHandle1); |
|
2057 SetBlockResult(EFail); |
|
2058 } |
|
2059 TBuf8<100> slot2; |
|
2060 slot2.Append(str2); |
|
2061 |
|
2062 TPtrC str3; |
|
2063 |
|
2064 if ( !GetStringFromConfig(aSectName,KFldSetReplyBufHandle2,str3)) |
|
2065 { |
|
2066 ERR_PRINTF2(KLogMissingParameter , &KFldSetReplyBufHandle2); |
|
2067 return ; |
|
2068 } |
|
2069 TBuf8<100> slot3; |
|
2070 slot3.Append(str3); |
|
2071 |
|
2072 TBuf8<100> result; |
|
2073 |
|
2074 iIpcArgs.Set(0, TIpcArgs::ENothing ); |
|
2075 iIpcArgs.Set(1, &result); |
|
2076 iIpcArgs.Set(2, &slot2); |
|
2077 iIpcArgs.Set(3, &slot3); |
|
2078 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
2079 iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
2080 |
|
2081 if(!result.Compare(slot3) && result.Compare(slot2)) |
|
2082 { |
|
2083 _LIT(KSuccess,"GeneralDuplicateFontL invoked successfully"); |
|
2084 INFO_PRINTF1(KSuccess); |
|
2085 } |
|
2086 else |
|
2087 { |
|
2088 ERR_PRINTF2(_L("The returned value is not as expected, result: %S"), &result); |
|
2089 SetBlockResult (EFail); |
|
2090 } |
|
2091 ResetIpcArg(); |
|
2092 } |
|
2093 |
|
2094 void CT_DataAnimForMClass::DoCmdGeneralReplyBuf16(const TDesC& aSectName, const TInt& datOpcode) |
|
2095 { |
|
2096 TPtrC str2; |
|
2097 |
|
2098 if ( !GetStringFromConfig(aSectName,KFldSetReplyBufHandle1,str2)) |
|
2099 { |
|
2100 ERR_PRINTF2(KLogMissingParameter , &KFldSetReplyBufHandle1); |
|
2101 SetBlockResult(EFail); |
|
2102 } |
|
2103 TBuf16<100> slot2(str2); |
|
2104 |
|
2105 TPtrC str3; |
|
2106 |
|
2107 if ( !GetStringFromConfig(aSectName,KFldSetReplyBufHandle2,str3)) |
|
2108 { |
|
2109 ERR_PRINTF2(KLogMissingParameter , &KFldSetReplyBufHandle2); |
|
2110 return ; |
|
2111 } |
|
2112 TBuf16<100> slot3(str3); |
|
2113 |
|
2114 TBuf16<100> result; |
|
2115 |
|
2116 iIpcArgs.Set(0, TIpcArgs::ENothing ); |
|
2117 iIpcArgs.Set(1, &result); |
|
2118 iIpcArgs.Set(2, &slot2); |
|
2119 iIpcArgs.Set(3, &slot3); |
|
2120 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
2121 iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
2122 |
|
2123 if(!result.Compare(slot3) && result.Compare(slot2)) |
|
2124 { |
|
2125 _LIT(KSuccess,"GeneralDuplicateFontL invoked successfully"); |
|
2126 INFO_PRINTF1(KSuccess); |
|
2127 } |
|
2128 else |
|
2129 { |
|
2130 ERR_PRINTF2(_L("The returned value is not as expected, result: %S"), &result); |
|
2131 SetBlockResult (EFail); |
|
2132 } |
|
2133 ResetIpcArg(); |
|
2134 } |
|
2135 //-------------------------------------------------The MAnimSpriteFunctions ---------------------------------------- |
|
2136 void CT_DataAnimForMClass::DoCmdSpriteGetSpriteMember(const TDesC& aSectName , const TInt& datOpcode) |
|
2137 { |
|
2138 TInt memberindex ; |
|
2139 // Get the sprite member index from ini file and set it as IpcArg 1 . |
|
2140 if ( !GetIntFromConfig(aSectName,KFldMemberIndex ,memberindex)) |
|
2141 { |
|
2142 ERR_PRINTF2(KLogMissingParameter , &KFldMemberIndex); |
|
2143 SetBlockResult(EFail); |
|
2144 } |
|
2145 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
2146 TPckgBuf<TInt> pckg(memberindex); |
|
2147 TPckgBuf<TPoint> returnPckg; |
|
2148 iIpcArgs.Set(1,&pckg); |
|
2149 iIpcArgs.Set(2,&returnPckg); |
|
2150 |
|
2151 // Send the command to notify the server . |
|
2152 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
2153 iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
2154 |
|
2155 TPoint result=returnPckg(); |
|
2156 // Verify the result and the expected . |
|
2157 TPtrC spritename; |
|
2158 |
|
2159 TPoint expectedPoint; |
|
2160 // Get the expected point value from ini file. |
|
2161 if ( !GetPointFromConfig(aSectName, KFldExpectedPoint, expectedPoint)) |
|
2162 { |
|
2163 ERR_PRINTF2(KLogMissingParameter, &KFldExpectedPoint); |
|
2164 return; |
|
2165 } |
|
2166 |
|
2167 if ( result != expectedPoint) |
|
2168 { |
|
2169 ERR_PRINTF3(_L("The returned value is not as expected, expected.x: %d, expect.y: %d"), expectedPoint.iX , expectedPoint.iY); |
|
2170 ERR_PRINTF3(_L("The returned value is not as expected, result.x: %d, result.y: %d"), result.iX , result.iY); |
|
2171 SetBlockResult (EFail); |
|
2172 } |
|
2173 else |
|
2174 { |
|
2175 INFO_PRINTF1(_L("Get Sprite Member successfully")); |
|
2176 } |
|
2177 ResetIpcArg(); |
|
2178 } |
|
2179 |
|
2180 void CT_DataAnimForMClass::DoCmdSpriteUpdateMember(const TDesC& aSectName , const TInt& datOpcode) |
|
2181 { |
|
2182 TInt memberindex ; |
|
2183 TRect rect ; |
|
2184 TBool isfullupdate ; |
|
2185 //Get the sprite member index from ini file and set it as IpcArg 1. |
|
2186 if ( ! GetIntFromConfig(aSectName,KFldMemberIndex ,memberindex)) |
|
2187 { |
|
2188 ERR_PRINTF2(KLogMissingParameter , &KFldMemberIndex); |
|
2189 SetBlockResult(EFail); |
|
2190 } |
|
2191 //Get the rect value from ini file and set it as IpcArg 2. |
|
2192 if ( ! GetRectFromConfig(aSectName,KFldRect ,rect)) |
|
2193 { |
|
2194 ERR_PRINTF2(KLogMissingParameter , &KFldRect); |
|
2195 SetBlockResult(EFail); |
|
2196 } |
|
2197 //Get the isfullupdate flag from ini file and set it as IpcArg 3. |
|
2198 if ( ! GetBoolFromConfig(aSectName,KFldIsFullUpdate ,isfullupdate)) |
|
2199 { |
|
2200 ERR_PRINTF2(KLogMissingParameter , &KFldIsFullUpdate); |
|
2201 SetBlockResult(EFail); |
|
2202 } |
|
2203 |
|
2204 TPckgBuf<TInt> memberPckg(memberindex); |
|
2205 TPckgBuf<TRect> rectPckg(rect); |
|
2206 TPckgBuf<TBool> updatePckg(isfullupdate); |
|
2207 |
|
2208 |
|
2209 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
2210 iIpcArgs.Set(1, &memberPckg); |
|
2211 iIpcArgs.Set(2, &rectPckg); |
|
2212 iIpcArgs.Set(3, &updatePckg); |
|
2213 |
|
2214 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
2215 //Send the command to notify the server . |
|
2216 TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
2217 |
|
2218 //Check the result is 0(Success) or not. |
|
2219 if (result != KErrNone ) |
|
2220 { |
|
2221 ERR_PRINTF2(KLogErrCommandReply, result); |
|
2222 SetBlockResult (EFail); |
|
2223 } |
|
2224 else |
|
2225 { |
|
2226 INFO_PRINTF1(_L("UpdateSpriteMember return is okay ")); |
|
2227 } |
|
2228 } |
|
2229 |
|
2230 |
|
2231 void CT_DataAnimForMClass::DoCmdSpriteActivate(const TDesC& aSectName , const TInt& datOpcode) |
|
2232 { |
|
2233 TBool isactive; |
|
2234 // Get the isactive flag from ini file and set as IpcArg 1. |
|
2235 if ( !GetBoolFromConfig(aSectName,KFldIsActivate ,isactive)) |
|
2236 { |
|
2237 ERR_PRINTF2(KLogMissingParameter , &KFldIsActivate); |
|
2238 SetBlockResult(EFail); |
|
2239 } |
|
2240 TPckgBuf<TBool> sendPkg(isactive) ; |
|
2241 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
2242 iIpcArgs.Set(1,&sendPkg); |
|
2243 |
|
2244 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
2245 //Send the command to notify the server . |
|
2246 TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
2247 |
|
2248 //Check the result is 0(Success) or not. |
|
2249 if (result != KErrNone ) |
|
2250 { |
|
2251 ERR_PRINTF2(KLogErrCommandReply, result); |
|
2252 SetBlockResult (EFail); |
|
2253 } |
|
2254 else |
|
2255 { |
|
2256 INFO_PRINTF1(_L("SpriteActive return is okay ")); |
|
2257 } |
|
2258 } |
|
2259 |
|
2260 void CT_DataAnimForMClass::DoCmdSpriteSpriteCanBeSeen(const TDesC& aSectName , const TInt& datOpcode) |
|
2261 { |
|
2262 TBool expected; |
|
2263 // Get the expected boolean value from the ini file. |
|
2264 if ( !GetBoolFromConfig(aSectName, KFldExpected, expected)) |
|
2265 { |
|
2266 ERR_PRINTF2(KLogMissingParameter , &KFldExpected); |
|
2267 SetBlockResult(EFail); |
|
2268 } |
|
2269 TPckgBuf<TBool> resultPkg(EFalse) ; |
|
2270 |
|
2271 |
|
2272 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
2273 iIpcArgs.Set(1,&resultPkg); |
|
2274 |
|
2275 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
2276 //Send the command to notify the server . |
|
2277 iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
2278 |
|
2279 //Verify the result and the expected |
|
2280 TBool result = resultPkg() ; |
|
2281 |
|
2282 if ( result != expected ) |
|
2283 { |
|
2284 ERR_PRINTF3(_L("The returned value is not as expected, expected: %d, actual: %d"), expected, (TInt)result); |
|
2285 SetBlockResult (EFail); |
|
2286 } |
|
2287 else |
|
2288 { |
|
2289 INFO_PRINTF1(_L("SpriteCanBeSeen return is okay ")); |
|
2290 } |
|
2291 ResetIpcArg(); |
|
2292 } |
|
2293 |
|
2294 void CT_DataAnimForMClass::DoCmdSpriteSizeChangedL(const TDesC& /*aSectName*/ , const TInt& datOpcode) |
|
2295 { |
|
2296 //Send the command to notify the server . |
|
2297 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
2298 |
|
2299 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
2300 TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
2301 |
|
2302 //Check the result is 0(Success) or not. |
|
2303 if (result != KErrNone ) |
|
2304 { |
|
2305 ERR_PRINTF2(KLogErrCommandReply, result); |
|
2306 SetBlockResult (EFail); |
|
2307 } |
|
2308 else |
|
2309 { |
|
2310 INFO_PRINTF1(_L("SpriteSizeChangedL return is okay")); |
|
2311 } |
|
2312 } |
|
2313 |
|
2314 void CT_DataAnimForMClass::DoCmdSpriteSetPosition(const TDesC& aSectName , const TInt& datOpcode) |
|
2315 { |
|
2316 // Get the point value from ini file and set as IpcArg 1. |
|
2317 TPoint point ; |
|
2318 if ( !GetPointFromConfig(aSectName, KFldPointPosition, point)) |
|
2319 { |
|
2320 ERR_PRINTF2(KLogMissingParameter , &KFldPointPosition); |
|
2321 SetBlockResult(EFail); |
|
2322 } |
|
2323 TPckgBuf<TPoint> pkg(point) ; |
|
2324 iIpcArgs.Set(0, TIpcArgs::ENothing); |
|
2325 iIpcArgs.Set(1, &pkg) ; |
|
2326 INFO_PRINTF1(KLogInfoCmdCommandReply3); |
|
2327 //Send the command to notify the server . |
|
2328 TInt result = iAnim->CommandReply(datOpcode,iSendBuf,iIpcArgs); |
|
2329 |
|
2330 //Check the result is 0(Success) or not. |
|
2331 if (result != KErrNone ) |
|
2332 { |
|
2333 ERR_PRINTF2(KLogErrCommandReply, result); |
|
2334 SetBlockResult (EFail); |
|
2335 } |
|
2336 else |
|
2337 { |
|
2338 INFO_PRINTF1(_L("SpriteSetPosition return is okay")); |
|
2339 } |
|
2340 } |
|
2341 |
|
2342 void CT_DataAnimForMClass::DoCmdEatupMemory(const TInt& datOpcode) |
|
2343 { |
|
2344 TInt result = iAnim->CommandReply(datOpcode); |
|
2345 if (result != KErrNone ) |
|
2346 { |
|
2347 ERR_PRINTF2(KLogErrCommandReply, result); |
|
2348 SetBlockResult (EFail); |
|
2349 } |
|
2350 else |
|
2351 { |
|
2352 INFO_PRINTF1(_L("EatupMemory return is okay")); |
|
2353 } |
|
2354 } |
|
2355 |
|
2356 void CT_DataAnimForMClass::DoCmdFreeEatenMemory(const TInt& datOpcode) |
|
2357 { |
|
2358 TInt result = iAnim->CommandReply(datOpcode); |
|
2359 if (result != KErrNone ) |
|
2360 { |
|
2361 ERR_PRINTF2(KLogErrCommandReply, result); |
|
2362 SetBlockResult (EFail); |
|
2363 } |
|
2364 else |
|
2365 { |
|
2366 INFO_PRINTF1(_L("FreeEatenMemory return is okay")); |
|
2367 } |
|
2368 } |
|
2369 |