photosgallery/viewframework/views/viewbase/src/glxviewbase.cpp
branchRCL_3
changeset 24 ea65f74e6de4
parent 15 191387a8b767
equal deleted inserted replaced
23:b023a8d2866a 24:ea65f74e6de4
    41 #include <mglxanimation.h>
    41 #include <mglxanimation.h>
    42 #include "glxcommandhandler.h"
    42 #include "glxcommandhandler.h"
    43 
    43 
    44 #include <aknbutton.h>                      // for getting the button state
    44 #include <aknbutton.h>                      // for getting the button state
    45 
    45 
       
    46 // For transition effects                           
       
    47 #include <gfxtranseffect/gfxtranseffect.h>
       
    48 
    46 _LIT(KGlxViewBaseResource, "glxviewbase.rsc");
    49 _LIT(KGlxViewBaseResource, "glxviewbase.rsc");
    47 
    50 
    48 /// Length of time a view-switch animation should take
    51 /// Length of time a view-switch animation should take
    49 const TInt KGlxViewSwitchAnimationDuration = 1000 * KGlxAnimationSlowDownFactor;
    52 const TInt KGlxViewSwitchAnimationDuration = 1000 * KGlxAnimationSlowDownFactor;
    50 
    53 
    52 // Constructor
    55 // Constructor
    53 // -----------------------------------------------------------------------------
    56 // -----------------------------------------------------------------------------
    54 //	
    57 //	
    55 EXPORT_C CGlxViewBase::CGlxViewBase(TBool aSyncActivation) :
    58 EXPORT_C CGlxViewBase::CGlxViewBase(TBool aSyncActivation) :
    56     iViewAnimationTime(KGlxViewSwitchAnimationDuration),
    59     iViewAnimationTime(KGlxViewSwitchAnimationDuration),
       
    60     iIsTransEffectStarted(EFalse),
    57     iViewAnimationInProgress(EGlxViewAnimationNone),
    61     iViewAnimationInProgress(EGlxViewAnimationNone),
    58     iSyncActivation(aSyncActivation)
    62     iSyncActivation(aSyncActivation)
    59     {
    63     {
    60     TRACER( "CGlxViewBase::CGlxViewBase()" );
    64     TRACER( "CGlxViewBase::CGlxViewBase()" );
    61     }
    65     }
   154 	TRACER( "CGlxViewBase::HandleCommandL" );
   158 	TRACER( "CGlxViewBase::HandleCommandL" );
   155     if(iViewActivated)  // Act on this Command if view is Activated or Pass to AppUi
   159     if(iViewActivated)  // Act on this Command if view is Activated or Pass to AppUi
   156         {
   160         {
   157     if ( EAknSoftkeyBack == aCommand ) 
   161     if ( EAknSoftkeyBack == aCommand ) 
   158         {
   162         {
       
   163 		// Pass it to view
       
   164         DoHandleCommandL(aCommand);
   159         iUiUtility->SetViewNavigationDirection(EGlxNavigationBackwards);
   165         iUiUtility->SetViewNavigationDirection(EGlxNavigationBackwards);
   160         }
   166         }
   161     else if ( EAknCmdOpen == aCommand ) 
   167     else if ( EAknCmdOpen == aCommand ) 
   162         {
   168         {
   163         iUiUtility->SetViewNavigationDirection(EGlxNavigationForwards); 
   169         iUiUtility->SetViewNavigationDirection(EGlxNavigationForwards); 
   706     while ( i < count )
   712     while ( i < count )
   707         {
   713         {
   708         iCommandHandlerList[i]->ActivateL(Id().iUid);
   714         iCommandHandlerList[i]->ActivateL(Id().iUid);
   709         i++;
   715         i++;
   710         }
   716         }
       
   717     
       
   718     //Check if transition effect is already started.
       
   719     //Calling the 'EndFullScreen()' actually starts the FS transition effect.
       
   720     if(iIsTransEffectStarted)
       
   721 		{
       
   722 		GfxTransEffect::EndFullScreen();
       
   723 		iIsTransEffectStarted = EFalse;
       
   724 		}
   711 
   725 
   712     InitAnimationL(EGlxViewAnimationEntry); 
   726     InitAnimationL(EGlxViewAnimationEntry); 
   713     }
   727     }
   714 
   728 
   715 // ----------------------------------------------------------------------------
   729 // ----------------------------------------------------------------------------