emailuis/emailui/src/FreestyleEmailUiViewBase.cpp
branchRCL_3
changeset 22 d620048b4810
parent 18 6b8f3b30d0ec
child 23 dcf0eedfc1a3
equal deleted inserted replaced
20:efd4f1afd43e 22:d620048b4810
    66 void CFsEmailUiViewBase::DoActivateL( const TVwsViewId& aPrevViewId,
    66 void CFsEmailUiViewBase::DoActivateL( const TVwsViewId& aPrevViewId,
    67 	                                  TUid aCustomMessageId,
    67 	                                  TUid aCustomMessageId,
    68 	                                  const TDesC8& aCustomMessage )
    68 	                                  const TDesC8& aCustomMessage )
    69     {
    69     {
    70     FUNC_LOG;
    70     FUNC_LOG;
       
    71 
    71     SetViewActive( ETrue );
    72     SetViewActive( ETrue );
       
    73     StatusPane()->MakeVisible( IsStatusPaneVisible() );
    72     SetStatusBarLayout();
    74     SetStatusBarLayout();
    73     iAppUi.StatusPane()->DrawNow();
    75     StatusPane()->DrawNow();
    74     iFocusVisible = iAppUi.IsFocusShown();
    76     iFocusVisible = iAppUi.IsFocusShown();
    75 
    77 
    76     // fix view stack in case of external activation
    78     // fix view stack in case of external activation
    77     if ( aPrevViewId.iAppUid != KFSEmailUiUid )
    79     if ( aPrevViewId.iAppUid != KFSEmailUiUid )
    78         {
    80         {
   100 
   102 
   101     // Clear the flag of long transition effect
   103     // Clear the flag of long transition effect
   102     SetNextTransitionOutLong( EFalse );
   104     SetNextTransitionOutLong( EFalse );
   103 
   105 
   104     // Clear status pane indicators
   106     // Clear status pane indicators
   105     CCustomStatuspaneIndicators* indicators = 
   107     CCustomStatuspaneIndicators* indicators =
   106         iAppUi.GetStatusPaneIndicatorContainer();
   108         iAppUi.GetStatusPaneIndicatorContainer();
   107     if ( indicators )
   109     if ( indicators )
   108         {
   110         {
   109         indicators->ClearStatusPaneFlags();
   111         indicators->ClearStatusPaneFlags();
   110         indicators->HideStatusPaneIndicators();
   112         indicators->HideStatusPaneIndicators();
   112 
   114 
   113     UpdateToolbarL();
   115     UpdateToolbarL();
   114 
   116 
   115     // Make sure Alfred display is of correct size (there is some problems with toolbar)
   117     // Make sure Alfred display is of correct size (there is some problems with toolbar)
   116     iAppUi.AlfEnv().PrimaryDisplay().ForceSetVisibleArea(iAppUi.ClientRect());
   118     iAppUi.AlfEnv().PrimaryDisplay().ForceSetVisibleArea(iAppUi.ClientRect());
   117     
   119 
   118 
   120 
   119     // Finally call child classes activation method
   121     // Finally call child classes activation method
   120     TRAPD( error, ChildDoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage) );
   122     TRAPD( error, ChildDoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage) );
   121     if ( !error )
   123     if ( !error )
   122         {
   124         {
   126         	{
   128         	{
   127         	iAppUi.ReturnFromPluginSettingsView();
   129         	iAppUi.ReturnFromPluginSettingsView();
   128         	}
   130         	}
   129 
   131 
   130         // View activated succesfully
   132         // View activated succesfully
   131         DoTransition( EFalse ); 
   133         DoTransition( EFalse );
   132         if ( !iAppUi.SwitchingToBackground() )
   134         if ( !iAppUi.SwitchingToBackground() )
   133             {
   135             {
   134             // Change visible control group
   136             // Change visible control group
   135             // having here DoTransition caused grid transparency when app left from listview
   137             // having here DoTransition caused grid transparency when app left from listview
   136             ActivateControlGroup();
   138             ActivateControlGroup();
   171                 {
   173                 {
   172                 toolbar->SetItemDimmed(dimmedItems[i], ETrue, EFalse);
   174                 toolbar->SetItemDimmed(dimmedItems[i], ETrue, EFalse);
   173                 }
   175                 }
   174             CleanupStack::PopAndDestroy(); // dimmedItems.Close()
   176             CleanupStack::PopAndDestroy(); // dimmedItems.Close()
   175             toolbar->SetToolbarObserver(this);
   177             toolbar->SetToolbarObserver(this);
       
   178  			if(resourceId == R_FREESTYLE_EMAIL_UI_TOOLBAR_FOLDER_LIST)
       
   179             	{
       
   180             	toolbar->SetToolbarVisibility(EFalse);
       
   181 				}
   176             SetToolbar(toolbar);
   182             SetToolbar(toolbar);
   177             ShowToolbar();
   183             ShowToolbar();
   178             }
   184             }
   179         else
   185         else
   180             {
   186             {
   280 // virtual function to hide or show CAlfVisuals ( used for activation or deactivation )
   286 // virtual function to hide or show CAlfVisuals ( used for activation or deactivation )
   281 //
   287 //
   282 void CFsEmailUiViewBase::FadeOut( TBool /* aDirectionOut */ )
   288 void CFsEmailUiViewBase::FadeOut( TBool /* aDirectionOut */ )
   283 	{
   289 	{
   284 	FUNC_LOG;
   290 	FUNC_LOG;
   285     // should be overriden ( if needed ) to use polymorphism 
   291     // should be overriden ( if needed ) to use polymorphism
   286 	// to hide or show CAlfVisuals used in views
   292 	// to hide or show CAlfVisuals used in views
   287 	}
   293 	}
   288 
   294 
   289 
   295 
   290 // ---------------------------------------------------------------------------
   296 // ---------------------------------------------------------------------------
   291 // Check if transition effects are enabled and run the effect if needed.
   297 // Check if transition effects are enabled and run the effect if needed.
   292 // if not enabled it calls FadeOut virtual methods only 
   298 // if not enabled it calls FadeOut virtual methods only
   293 //
   299 //
   294 void CFsEmailUiViewBase::DoTransition( TBool aDirectionOut )
   300 void CFsEmailUiViewBase::DoTransition( TBool aDirectionOut )
   295     {
   301     {
   296     FUNC_LOG;
   302     FUNC_LOG;
   297     if ( iAppUi.LayoutHandler() && iAppUi.LayoutHandler()->ViewFadeEffectActive() )
   303     if ( iAppUi.LayoutHandler() && iAppUi.LayoutHandler()->ViewFadeEffectActive() )
   298         {
   304         {
   299         DoTransitionEffect( aDirectionOut );
   305         DoTransitionEffect( aDirectionOut );
   300         }
   306         }
   301     else
   307     else
   302         {
   308         {
   303     	// FadeOut method should be overridden and use by polymorphism only when needed 
   309     	// FadeOut method should be overridden and use by polymorphism only when needed
   304     	FadeOut( aDirectionOut ); // used for hide/show visuals without transition time
   310     	FadeOut( aDirectionOut ); // used for hide/show visuals without transition time
   305     	}
   311     	}
   306     }
   312     }
   307 
   313 
   308 // ---------------------------------------------------------------------------
   314 // ---------------------------------------------------------------------------
   478 // ---------------------------------------------------------------------------
   484 // ---------------------------------------------------------------------------
   479 //
   485 //
   480 void CFsEmailUiViewBase::HandleAppForegroundEventL( TBool aForeground )
   486 void CFsEmailUiViewBase::HandleAppForegroundEventL( TBool aForeground )
   481     {
   487     {
   482     FUNC_LOG;
   488     FUNC_LOG;
   483     HandleForegroundEventL(aForeground);    
   489     HandleForegroundEventL(aForeground);
   484     if ( aForeground )
   490     if ( aForeground )
   485         {
   491         {
   486         // Activate control group in case the view was activated when
   492         // Activate control group in case the view was activated when
   487         // application was being sent to background, and the control group
   493         // application was being sent to background, and the control group
   488         // was left inactive.
   494         // was left inactive.
   627         if ( iPreviousAppUid != KFSEmailUiUid && iPreviousAppUid != KNullUid )
   633         if ( iPreviousAppUid != KFSEmailUiUid && iPreviousAppUid != KNullUid )
   628             {
   634             {
   629             // Email app should be hidden once the view gets deactivated. Note that hiding
   635             // Email app should be hidden once the view gets deactivated. Note that hiding
   630             // should not happen before control group switching is over because that
   636             // should not happen before control group switching is over because that
   631             // may cause views of other Alfred apps to get distorted.
   637             // may cause views of other Alfred apps to get distorted.
   632             if( !iAppUi.EmbeddedAppIsPreviousApp() ) // if previous app is embedded app, 
   638             if( !iAppUi.EmbeddedAppIsPreviousApp() ) // if previous app is embedded app,
   633                 //do not need hide FSEmail app when previous app view gets deactivated.
   639                 //do not need hide FSEmail app when previous app view gets deactivated.
   634                 {
   640                 {
   635                 iSendToBackgroundOnDeactivation = ETrue;
   641                 iSendToBackgroundOnDeactivation = ETrue;
   636                 iAppUi.SetSwitchingToBackground( ETrue );
   642                 iAppUi.SetSwitchingToBackground( ETrue );
   637                 }
   643                 }
   671         cba->DrawDeferred();
   677         cba->DrawDeferred();
   672         }
   678         }
   673     }
   679     }
   674 
   680 
   675 // -----------------------------------------------------------------------------
   681 // -----------------------------------------------------------------------------
       
   682 // CFsEmailUiViewBase::IsStatusPaneVisible
       
   683 // -----------------------------------------------------------------------------
       
   684 TBool CFsEmailUiViewBase::IsStatusPaneVisible() const
       
   685     {
       
   686     return ETrue;
       
   687     }
       
   688 
       
   689 // -----------------------------------------------------------------------------
   676 // CFsEmailUiViewBase::HasToolbar
   690 // CFsEmailUiViewBase::HasToolbar
   677 // Method to check whether the view has toolbar defined or not.
   691 // Method to check whether the view has toolbar defined or not.
   678 // -----------------------------------------------------------------------------
   692 // -----------------------------------------------------------------------------
   679 TBool CFsEmailUiViewBase::HasToolbar() const
   693 TBool CFsEmailUiViewBase::HasToolbar() const
   680     {
   694     {