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