|
1 /* |
|
2 * Copyright (c) 2008-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: View Base implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #include "glxviewbase.h" |
|
22 |
|
23 #include <aknViewAppUi.h> |
|
24 #include <avkon.rsg> |
|
25 #include <data_caging_path_literals.hrh> |
|
26 |
|
27 #include <alf/alfcontrolgroup.h> |
|
28 #include <alf/alfdisplay.h> |
|
29 #include <alf/alfenv.h> |
|
30 #include <alf/alfroster.h> |
|
31 #include <StringLoader.h> |
|
32 #include <akntoolbar.h> |
|
33 #include <glxcommandhandlers.hrh> |
|
34 #include <glxuiutility.h> |
|
35 #include <glxtracer.h> |
|
36 #include <glxlog.h> |
|
37 #include <glxpanic.h> |
|
38 #include <glxresourceutilities.h> // for CGlxResourceUtilities |
|
39 #include <glxuistd.h> |
|
40 #include <glxuiutilities.rsg> |
|
41 #include <mglxanimation.h> |
|
42 #include "glxcommandhandler.h" |
|
43 |
|
44 _LIT(KGlxViewBaseResource, "glxviewbase.rsc"); |
|
45 |
|
46 /// Length of time a view-switch animation should take |
|
47 const TInt KGlxViewSwitchAnimationDuration = 1000 * KGlxAnimationSlowDownFactor; |
|
48 |
|
49 // ----------------------------------------------------------------------------- |
|
50 // Constructor |
|
51 // ----------------------------------------------------------------------------- |
|
52 // |
|
53 EXPORT_C CGlxViewBase::CGlxViewBase(TBool aSyncActivation) : |
|
54 iViewAnimationTime(KGlxViewSwitchAnimationDuration), |
|
55 iViewAnimationInProgress(EGlxViewAnimationNone), |
|
56 iSyncActivation(aSyncActivation) |
|
57 { |
|
58 TRACER( "CGlxViewBase::CGlxViewBase()" ); |
|
59 } |
|
60 |
|
61 // ----------------------------------------------------------------------------- |
|
62 // Destructor |
|
63 // ----------------------------------------------------------------------------- |
|
64 // |
|
65 EXPORT_C CGlxViewBase::~CGlxViewBase() |
|
66 { |
|
67 TRACER( "CGlxViewBase::~CGlxViewBase" ); |
|
68 iCommandHandlerList.ResetAndDestroy(); |
|
69 |
|
70 if ( iUiUtility ) |
|
71 { |
|
72 iUiUtility->Close(); |
|
73 iUiUtility = NULL; |
|
74 } |
|
75 |
|
76 if ( iViewBaseResourceOffset ) |
|
77 { |
|
78 iCoeEnv->DeleteResourceFile( iViewBaseResourceOffset ); |
|
79 } |
|
80 |
|
81 if ( iUiUtilitiesResourceOffset ) |
|
82 { |
|
83 iCoeEnv->DeleteResourceFile( iUiUtilitiesResourceOffset ); |
|
84 } |
|
85 |
|
86 if ( iViewActivateCallback ) |
|
87 { |
|
88 iViewActivateCallback->Cancel(); |
|
89 delete iViewActivateCallback; |
|
90 } |
|
91 |
|
92 delete iCustomMessage; |
|
93 } |
|
94 |
|
95 // ----------------------------------------------------------------------------- |
|
96 // ViewBaseConstructL |
|
97 // ----------------------------------------------------------------------------- |
|
98 // |
|
99 EXPORT_C void CGlxViewBase::ViewBaseConstructL() |
|
100 { |
|
101 TRACER( "CGlxViewBase::ViewBaseConstructL" ); |
|
102 // Load resources |
|
103 TFileName resourceFile(KDC_APP_RESOURCE_DIR); |
|
104 resourceFile.Append(KGlxViewBaseResource); |
|
105 CGlxResourceUtilities::GetResourceFilenameL(resourceFile, |
|
106 iCoeEnv->FsSession()); |
|
107 iViewBaseResourceOffset = iCoeEnv->AddResourceFileL(resourceFile); |
|
108 |
|
109 // Load UiUtilities resources, for wait dialog |
|
110 TFileName uiUtilsResourceFile( KDC_APP_RESOURCE_DIR ); |
|
111 uiUtilsResourceFile.Append( KGlxUiUtilitiesResource ); |
|
112 CGlxResourceUtilities::GetResourceFilenameL(uiUtilsResourceFile, |
|
113 iCoeEnv->FsSession()); |
|
114 iUiUtilitiesResourceOffset = iCoeEnv->AddResourceFileL(uiUtilsResourceFile); |
|
115 |
|
116 iUiUtility = CGlxUiUtility::UtilityL(); |
|
117 |
|
118 iViewActivateCallback = new (ELeave) CAsyncCallBack ( TCallBack ( ViewActivateCallbackL, this ), |
|
119 CActive::EPriorityStandard); |
|
120 iCustomMessage = HBufC8::NewL(0); |
|
121 } |
|
122 |
|
123 // ----------------------------------------------------------------------------- |
|
124 // AddCommandHandlerL |
|
125 // ----------------------------------------------------------------------------- |
|
126 // |
|
127 EXPORT_C void CGlxViewBase::AddCommandHandlerL(CGlxCommandHandler* aCommandHandler) |
|
128 { |
|
129 TRACER( "CGlxViewBase::AddCommandHandlerL" ); |
|
130 if ( aCommandHandler ) |
|
131 { |
|
132 CleanupDeletePushL( aCommandHandler ); |
|
133 if ( KErrNotFound == iCommandHandlerList.Find( aCommandHandler )) |
|
134 { |
|
135 iCommandHandlerList.AppendL(aCommandHandler); |
|
136 DoPrepareCommandHandlerL(aCommandHandler); |
|
137 } |
|
138 CleanupStack::Pop( aCommandHandler ); |
|
139 } |
|
140 else |
|
141 { |
|
142 User::Leave(KErrArgument); |
|
143 } |
|
144 } |
|
145 |
|
146 // ----------------------------------------------------------------------------- |
|
147 // HandleCommandL |
|
148 // ----------------------------------------------------------------------------- |
|
149 // |
|
150 EXPORT_C void CGlxViewBase::HandleCommandL(TInt aCommand) |
|
151 { |
|
152 TRACER( "CGlxViewBase::HandleCommandL" ); |
|
153 if(iViewActivated) // Act on this Command if view is Activated or Pass to AppUi |
|
154 { |
|
155 if ( EAknSoftkeyBack == aCommand ) |
|
156 { |
|
157 iUiUtility->SetViewNavigationDirection(EGlxNavigationBackwards); |
|
158 } |
|
159 else if ( EAknCmdOpen == aCommand ) |
|
160 { |
|
161 iUiUtility->SetViewNavigationDirection(EGlxNavigationForwards); |
|
162 } |
|
163 |
|
164 if ( EGlxCmdOptions == aCommand ) |
|
165 { |
|
166 FetchAttributesL(); |
|
167 // Open the options menu properly |
|
168 ProcessCommandL(EAknSoftkeyOptions); |
|
169 } |
|
170 else |
|
171 { |
|
172 // Fetch the attributes required to execute the command provided it is not one of |
|
173 // the state changing commands (EGlxCmdStateView and EGlxCmdStateBrowse) |
|
174 if (aCommand != EGlxCmdStateView && aCommand != EGlxCmdStateBrowse) |
|
175 { |
|
176 FetchAttributesForCommandL(aCommand); |
|
177 } |
|
178 |
|
179 TBool handled = EFalse; |
|
180 |
|
181 // Pass the command to the command handlers |
|
182 TInt count = iCommandHandlerList.Count(); |
|
183 TInt i = count - 1; |
|
184 |
|
185 // Iterating backwards to give last-added handlers chance to override |
|
186 while ( i >= 0 && !handled ) |
|
187 { |
|
188 handled = iCommandHandlerList[i]->ExecuteL( aCommand ); |
|
189 i--; |
|
190 } |
|
191 |
|
192 if ( !handled ) |
|
193 { |
|
194 // Give the implemented view chance at handling the command |
|
195 handled = DoHandleCommandL(aCommand); |
|
196 } |
|
197 |
|
198 if ( !handled ) |
|
199 { |
|
200 // None of the command handlers have handled it, pass it on to the AppUi |
|
201 AppUi()->HandleCommandL(aCommand); |
|
202 } |
|
203 } |
|
204 } |
|
205 else |
|
206 { |
|
207 // Command Not Handled |
|
208 AppUi()->HandleCommandL(aCommand); |
|
209 } |
|
210 } |
|
211 |
|
212 // ----------------------------------------------------------------------------- |
|
213 // DynInitMenuPaneL |
|
214 // ----------------------------------------------------------------------------- |
|
215 // |
|
216 EXPORT_C void CGlxViewBase::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane) |
|
217 { |
|
218 TRACER( "CGlxViewBase::DynInitMenuPaneL" ); |
|
219 TInt count = iCommandHandlerList.Count(); |
|
220 |
|
221 // NB Member variable used for loop counter, so if the user interrupts (e.g. Cancels the wait |
|
222 // dialog), we know which command handler we need to stop (see DialogDismissedL) |
|
223 for (TInt i = 0; i < count; i++ ) |
|
224 { |
|
225 iCommandHandlerList[i]->PreDynInitMenuPaneL( aResourceId ); |
|
226 } |
|
227 |
|
228 // Allow implementing view to filter menu first |
|
229 ViewDynInitMenuPaneL(aResourceId, aMenuPane); |
|
230 |
|
231 for (TInt i = 0; i < count; i++ ) |
|
232 { |
|
233 iCommandHandlerList[i]->DynInitMenuPaneL( aResourceId, aMenuPane ); |
|
234 } |
|
235 } |
|
236 |
|
237 |
|
238 // ----------------------------------------------------------------------------- |
|
239 // SetTitleL |
|
240 // ----------------------------------------------------------------------------- |
|
241 // |
|
242 EXPORT_C void CGlxViewBase::SetTitleL(const TDesC& aTitleText) |
|
243 { |
|
244 TRACER( "CGlxViewBase::SetTitleL" ); |
|
245 iTitlePane = GetTitlePaneL(); |
|
246 if(iTitlePane) |
|
247 { |
|
248 iTitlePane->SetTextL(aTitleText); |
|
249 } |
|
250 //StatusPane()->MakeVisible(ETrue); |
|
251 } |
|
252 |
|
253 // ----------------------------------------------------------------------------- |
|
254 // DisableTitleL |
|
255 // ----------------------------------------------------------------------------- |
|
256 // |
|
257 EXPORT_C void CGlxViewBase::DisableTitle() |
|
258 { |
|
259 TRACER( "CGlxViewBase::DisableTitle" ); |
|
260 //StatusPane()->MakeVisible(EFalse); |
|
261 } |
|
262 |
|
263 // DoActivateL |
|
264 // ----------------------------------------------------------------------------- |
|
265 // |
|
266 EXPORT_C void CGlxViewBase::DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage) |
|
267 { |
|
268 TRACER( "CGlxViewBase::DoActivateL" ); |
|
269 // Store view activate values |
|
270 iPrevViewId = aPrevViewId; |
|
271 iCustomMessageId = aCustomMessageId; |
|
272 |
|
273 delete iCustomMessage; |
|
274 iCustomMessage = NULL; |
|
275 iCustomMessage = HBufC8::NewL( aCustomMessage.Length() ); |
|
276 |
|
277 TPtr8 customMessagePtr = iCustomMessage->Des(); |
|
278 customMessagePtr.Copy( aCustomMessage ); |
|
279 |
|
280 // show the view specific toolbar |
|
281 CAknToolbar* toolbar = Toolbar(); |
|
282 |
|
283 // Get the pointer to the application toolbar |
|
284 // (when there isn't a view specific toolbar) to set it visible |
|
285 if ( !toolbar ) |
|
286 { |
|
287 toolbar = AppUi()->PopupToolbar(); |
|
288 } |
|
289 else |
|
290 { |
|
291 // Deactivate the toolbar untill the view gets activated properly. |
|
292 toolbar->SetDimmed(ETrue); |
|
293 toolbar->DrawNow(); |
|
294 } |
|
295 toolbar->SetToolbarVisibility(ETrue); |
|
296 |
|
297 // View should be activated asynchronously, since there can be a lot of processing |
|
298 // that may result in the view being in an indeterminate state if it leaves |
|
299 |
|
300 // HOWEVER, making the view asynchronous breaks the assumptions of the slideshow design |
|
301 // and results in slideshow not functioning correctly |
|
302 // Therefore, we have used the following nasty workaround to make this work, |
|
303 // otherwise, either view activation or slideshow would require considerable refactoring |
|
304 // TODO: This should be refactored whenever the opportunity arises |
|
305 // |
|
306 // The workaround is to have a flag to determine if the view should be activated |
|
307 // synchronously or asynchronously. |
|
308 if ( iSyncActivation ) |
|
309 { |
|
310 ViewActivateL(); |
|
311 } |
|
312 else |
|
313 { |
|
314 if ( !iViewActivateCallback->IsActive() ) |
|
315 { |
|
316 iViewActivateCallback->CallBack(); |
|
317 } |
|
318 } |
|
319 } |
|
320 |
|
321 // ----------------------------------------------------------------------------- |
|
322 // DoDeactivate |
|
323 // ----------------------------------------------------------------------------- |
|
324 // |
|
325 EXPORT_C void CGlxViewBase::DoDeactivate() |
|
326 { |
|
327 TRACER( "CGlxViewBase::DoDeactivate" ); |
|
328 // hide the view specific toolbar |
|
329 CAknToolbar* toolbar = Toolbar(); |
|
330 |
|
331 // Get the pointer to the application toolbar |
|
332 // (when there isn't a view specific toolbar) to hide it properly |
|
333 if ( !toolbar ) |
|
334 { |
|
335 toolbar = AppUi()->PopupToolbar(); |
|
336 } |
|
337 toolbar->SetToolbarVisibility(EFalse); |
|
338 // Clear the toolbar background as well |
|
339 toolbar->MakeVisible(EFalse); |
|
340 |
|
341 if ( iViewActivateCallback->IsActive() ) |
|
342 { |
|
343 iViewActivateCallback->Cancel(); |
|
344 } |
|
345 |
|
346 CancelViewAnimation(); |
|
347 |
|
348 // Deactivate command handlers |
|
349 TInt count = iCommandHandlerList.Count(); |
|
350 TInt i = 0; |
|
351 |
|
352 while ( i < count ) |
|
353 { |
|
354 iCommandHandlerList[i]->Deactivate(); |
|
355 i++; |
|
356 } |
|
357 |
|
358 TRAP_IGNORE(InitAnimationL(EGlxViewAnimationExit)); |
|
359 } |
|
360 |
|
361 |
|
362 // ----------------------------------------------------------------------------- |
|
363 // CGlxViewBase::FetchAttributesL |
|
364 // ----------------------------------------------------------------------------- |
|
365 // |
|
366 EXPORT_C void CGlxViewBase::FetchAttributesL() |
|
367 { |
|
368 TRACER( "CGlxViewBase::FetchAttributesL" ); |
|
369 // No implementation required |
|
370 } |
|
371 |
|
372 // ----------------------------------------------------------------------------- |
|
373 // CGlxViewBase::FetchAttributesForCommandL |
|
374 // ----------------------------------------------------------------------------- |
|
375 // |
|
376 EXPORT_C void CGlxViewBase::FetchAttributesForCommandL(TInt /*aCommand*/) |
|
377 { |
|
378 TRACER( "CGlxViewBase::FetchAttributesForCommandL" ); |
|
379 // No implementation required |
|
380 } |
|
381 |
|
382 // ----------------------------------------------------------------------------- |
|
383 // Handles a view activation event from viewserv. |
|
384 // ----------------------------------------------------------------------------- |
|
385 // |
|
386 EXPORT_C void CGlxViewBase::ViewActivatedL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, const TDesC8& aCustomMessage ) |
|
387 { |
|
388 TRACER("CGlxViewBase::ViewActivatedL()"); |
|
389 if ( dynamic_cast<CAknViewAppUi*>( iEikonEnv->EikAppUi() ) ) |
|
390 { |
|
391 CAknView::ViewActivatedL(aPrevViewId, aCustomMessageId, aCustomMessage); |
|
392 } |
|
393 else |
|
394 { |
|
395 GLX_LOG_INFO("Not in CAknViewAppUi -> CAknView::AknViewActivatedL()"); |
|
396 AknViewActivatedL( aPrevViewId, aCustomMessageId, aCustomMessage ); |
|
397 } |
|
398 } |
|
399 |
|
400 // ----------------------------------------------------------------------------- |
|
401 // Handles a view deactivation event from viewserv. |
|
402 // ----------------------------------------------------------------------------- |
|
403 // |
|
404 EXPORT_C void CGlxViewBase::ViewDeactivated() |
|
405 { |
|
406 TRACER("CGlxViewBase::ViewDeactivated()"); |
|
407 if ( dynamic_cast<CAknViewAppUi*>( iEikonEnv->EikAppUi() ) ) |
|
408 { |
|
409 CAknView::ViewDeactivated(); |
|
410 } |
|
411 else |
|
412 { |
|
413 GLX_LOG_INFO("Not in CAknViewAppUi -> DoDeactivate()"); |
|
414 DoDeactivate(); |
|
415 } |
|
416 } |
|
417 |
|
418 |
|
419 // ----------------------------------------------------------------------------- |
|
420 // HandleViewCommandL |
|
421 // ----------------------------------------------------------------------------- |
|
422 // |
|
423 EXPORT_C TBool CGlxViewBase::HandleViewCommandL(TInt /*aCommand*/) |
|
424 { |
|
425 TRACER( "CGlxViewBase::HandleViewCommandL" ); |
|
426 return EFalse; |
|
427 } |
|
428 |
|
429 // ----------------------------------------------------------------------------- |
|
430 // ViewDynInitMenuPaneL |
|
431 // ----------------------------------------------------------------------------- |
|
432 // |
|
433 EXPORT_C void CGlxViewBase::ViewDynInitMenuPaneL(TInt /*aResourceId*/, CEikMenuPane* /*aMenuPane*/) |
|
434 { |
|
435 TRACER( "CGlxViewBase::ViewDynInitMenuPaneL" ); |
|
436 // No implementation - derived classes may override this |
|
437 } |
|
438 |
|
439 // ----------------------------------------------------------------------------- |
|
440 // ViewAnimationSupported |
|
441 // ----------------------------------------------------------------------------- |
|
442 // |
|
443 EXPORT_C TBool CGlxViewBase::ViewAnimationSupported(TGlxViewswitchAnimation /*aType*/) |
|
444 { |
|
445 TRACER( "CGlxViewBase::ViewAnimationSupported" ); |
|
446 // Default implementation - may be overridden |
|
447 return EFalse; |
|
448 } |
|
449 |
|
450 // ----------------------------------------------------------------------------- |
|
451 // DoViewAnimationL |
|
452 // ----------------------------------------------------------------------------- |
|
453 // |
|
454 EXPORT_C void CGlxViewBase::DoViewAnimationL(TGlxViewswitchAnimation /*aType*/, TGlxNavigationDirection /*aDirection*/) |
|
455 { |
|
456 TRACER( "CGlxViewBase::DoViewAnimationL" ); |
|
457 // Do nothing by default |
|
458 } |
|
459 |
|
460 // ----------------------------------------------------------------------------- |
|
461 // SetToolbarStateL |
|
462 // ----------------------------------------------------------------------------- |
|
463 // |
|
464 EXPORT_C void CGlxViewBase::SetToolbarStateL() |
|
465 { |
|
466 TRACER( "CGlxViewBase::SetToolbarStateL" ); |
|
467 // Derived MediaListViewBase has the implementation. |
|
468 } |
|
469 |
|
470 // ----------------------------------------------------------------------------- |
|
471 // InitAnimationL |
|
472 // ----------------------------------------------------------------------------- |
|
473 // |
|
474 void CGlxViewBase::InitAnimationL(TGlxViewswitchAnimation aType) |
|
475 { |
|
476 TRACER( "CGlxViewBase::InitAnimationL" ); |
|
477 if ( ViewAnimationSupported(aType) ) |
|
478 { |
|
479 /*@@ |
|
480 /// @todo : Remove hack when TAlfTimedValue fixed |
|
481 iViewAnimationTimedValue.Now(); // Hack to force reevaluation of internal "interpolating" flag: otherwise |
|
482 // call to RemainingTime() returns a hugely wrong number |
|
483 |
|
484 TInt remainingTime = iViewAnimationTimedValue.RemainingTime(); |
|
485 |
|
486 iViewAnimationTimedValue.Set(1 - iViewAnimationTimedValue.Now()); // In case previous animation is incomplete |
|
487 // Assumes opposite animations happen in sequence: entry - exit - entry etc |
|
488 iViewAnimationTimedValue.Set(1, KGlxViewSwitchAnimationDuration - remainingTime); */ |
|
489 |
|
490 DoViewAnimationL(aType, iUiUtility->ViewNavigationDirection()); |
|
491 iViewAnimationInProgress = aType; |
|
492 } |
|
493 else |
|
494 { |
|
495 // Immediately complete animation |
|
496 ViewAnimationComplete(aType); |
|
497 } |
|
498 } |
|
499 |
|
500 // ----------------------------------------------------------------------------- |
|
501 // AnimationComplete |
|
502 // ----------------------------------------------------------------------------- |
|
503 // |
|
504 EXPORT_C void CGlxViewBase::AnimationComplete(MGlxAnimation* /*aAnimation*/) // From MGlxAnimationObserver |
|
505 { |
|
506 TRACER( "CGlxViewBase::AnimationComplete" ); |
|
507 CancelViewAnimation(); |
|
508 } |
|
509 |
|
510 // ----------------------------------------------------------------------------- |
|
511 // OfferToolbarEventL |
|
512 // ----------------------------------------------------------------------------- |
|
513 // |
|
514 EXPORT_C void CGlxViewBase::OfferToolbarEventL( TInt aCommand ) |
|
515 { |
|
516 TRACER( "CGlxViewBase::OfferToolbarEventL" ); |
|
517 CAknToolbar* toolbar = Toolbar(); |
|
518 if(toolbar) |
|
519 { |
|
520 // Deactivate the toolbar. Don't accept the toolbar input when the command |
|
521 // execution is already in progress. |
|
522 toolbar->SetDimmed(ETrue); |
|
523 toolbar->DrawNow(); |
|
524 |
|
525 // Execute the command recieved. |
|
526 ProcessCommandL(aCommand); |
|
527 |
|
528 // Activate back the toolbar and set it's state properly |
|
529 // after command execution. |
|
530 SetToolbarStateL(); |
|
531 } |
|
532 } |
|
533 |
|
534 // ----------------------------------------------------------------------------- |
|
535 // SetToolbarObserver |
|
536 // ----------------------------------------------------------------------------- |
|
537 // |
|
538 EXPORT_C void CGlxViewBase::SetToolbarObserver(MAknToolbarObserver* aObserver) |
|
539 { |
|
540 TRACER( "CGlxViewBase::SetToolbarObserver" ); |
|
541 //Register the view to recieve toolbar events. ViewBase handles the events |
|
542 if ( Toolbar() ) |
|
543 { |
|
544 Toolbar()->SetToolbarObserver( aObserver ); |
|
545 } |
|
546 } |
|
547 |
|
548 // ----------------------------------------------------------------------------- |
|
549 // CancelViewAnimation |
|
550 // ----------------------------------------------------------------------------- |
|
551 // |
|
552 void CGlxViewBase::CancelViewAnimation() |
|
553 { |
|
554 TRACER( "CGlxViewBase::CancelViewAnimation" ); |
|
555 if ( iViewAnimationInProgress != EGlxViewAnimationNone ) |
|
556 { |
|
557 ViewAnimationComplete(iViewAnimationInProgress); |
|
558 iViewAnimationInProgress = EGlxViewAnimationNone; |
|
559 } |
|
560 } |
|
561 |
|
562 // ----------------------------------------------------------------------------- |
|
563 // ViewAnimationComplete |
|
564 // ----------------------------------------------------------------------------- |
|
565 // |
|
566 void CGlxViewBase::ViewAnimationComplete(TGlxViewswitchAnimation aType) |
|
567 { |
|
568 TRACER( "CGlxViewBase::ViewAnimationComplete" ); |
|
569 if ( aType == EGlxViewAnimationExit ) |
|
570 { |
|
571 // Deactivate view |
|
572 DoViewDeactivate(); |
|
573 iViewActivated = EFalse; // View is DeActivated |
|
574 } |
|
575 } |
|
576 |
|
577 //------------------------------------------------------------------------------ |
|
578 // GetTitlePaneControlL |
|
579 //------------------------------------------------------------------------------ |
|
580 // |
|
581 CAknTitlePane* CGlxViewBase::GetTitlePaneL() |
|
582 { |
|
583 TRACER( "CGlxViewBase::GetTitlePaneL" ); |
|
584 |
|
585 return (( CAknTitlePane* )StatusPane()->ControlL |
|
586 (TUid::Uid( EEikStatusPaneUidTitle ))); |
|
587 } |
|
588 |
|
589 // ----------------------------------------------------------------------------- |
|
590 // DoHandleCommandL |
|
591 // ----------------------------------------------------------------------------- |
|
592 // |
|
593 EXPORT_C TInt CGlxViewBase::DoHandleCommandL(TInt /*aCommand*/) |
|
594 { |
|
595 TRACER( "CGlxViewBase::DoHandleCommandL" ); |
|
596 return EFalse; |
|
597 } |
|
598 |
|
599 // ----------------------------------------------------------------------------- |
|
600 // Callback for view activate |
|
601 // ----------------------------------------------------------------------------- |
|
602 // |
|
603 TBool CGlxViewBase::ViewActivateCallbackL(TAny* aPtr) |
|
604 { |
|
605 TRACER( "CGlxViewBase::ViewActivateCallbackL()" ); |
|
606 __ASSERT_DEBUG( aPtr, Panic( EGlxPanicNullPointer ) ); |
|
607 static_cast<CGlxViewBase*>( aPtr )->ViewActivateL(); |
|
608 return EFalse; |
|
609 } |
|
610 |
|
611 // ----------------------------------------------------------------------------- |
|
612 // Perform view activate |
|
613 // ----------------------------------------------------------------------------- |
|
614 // |
|
615 void CGlxViewBase::ViewActivateL() |
|
616 { |
|
617 TRACER("CGlxViewBase::ViewActivateL()"); |
|
618 CancelViewAnimation(); |
|
619 |
|
620 // View is Activated |
|
621 iViewActivated = ETrue; |
|
622 DoViewActivateL( iPrevViewId, iCustomMessageId, *iCustomMessage ); |
|
623 |
|
624 TInt count = iCommandHandlerList.Count(); |
|
625 TInt i = 0; |
|
626 |
|
627 while ( i < count ) |
|
628 { |
|
629 iCommandHandlerList[i]->ActivateL(Id().iUid); |
|
630 i++; |
|
631 } |
|
632 |
|
633 InitAnimationL(EGlxViewAnimationEntry); |
|
634 } |
|
635 |
|
636 |
|
637 |