emailuis/emailui/src/FreestyleEmailUiSettingsListView.cpp
branchRCL_3
changeset 64 3533d4323edc
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2007 - 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:  Freestyle Email source file
       
    15 *
       
    16 */
       
    17 
       
    18 // SYSTEM INCLUDES
       
    19 #include "emailtrace.h"
       
    20 #include <aknViewAppUi.h>
       
    21 #include <eikmenub.h>
       
    22 #include <avkon.hrh>
       
    23 #include <barsread.h>
       
    24 #include <StringLoader.h>
       
    25 #include <aknlists.h>
       
    26 #include <eikenv.h>
       
    27 #include <AknIconArray.h>
       
    28 #include <eikclbd.h>
       
    29 #include <akncontext.h>
       
    30 #include <akntitle.h>
       
    31 #include <FreestyleEmailUi.rsg>
       
    32 #include <featmgr.h>
       
    33 #include <aknstyluspopupmenu.h>
       
    34 
       
    35 #include "cfsmailcommon.h"
       
    36 #include "cfsmailbox.h"
       
    37 #include "esmailsettingsplugin.h"
       
    38 #include "esmailsettingspluginuids.hrh"
       
    39 #include <gsfwviewuids.h> // Uids for general settings activation
       
    40 #include <csxhelp/cmail.hlp.hrh>
       
    41 
       
    42 // LOCAL INCLUDES
       
    43 #include "FreestyleEmailUiUtilities.h"
       
    44 #include "FreestyleEmailUiSettingsListView.h"
       
    45 #include "FreestyleEmailUiSettingsList.h"
       
    46 #include "FreestyleEmailUi.hrh"
       
    47 #include "FreestyleEmailUiSettings.hrh"
       
    48 #include "FreestyleEmailUiConstants.h"
       
    49 #include "FreestyleEmailUiAppui.h"
       
    50 #include "FreestyleEmailUiShortcutBinding.h"
       
    51 #include "FreestyleEmailUiLauncherGridVisualiser.h"
       
    52 
       
    53 
       
    54 // ---------------------------------------------------------------------------
       
    55 // First phase of Symbian two-phase construction. Should not contain any
       
    56 // code that could leave.
       
    57 // ---------------------------------------------------------------------------
       
    58 //
       
    59 CFsEmailSettingsListView::CFsEmailSettingsListView( 
       
    60 	CAlfControlGroup& aControlGroup,
       
    61 	CFreestyleEmailUiAppUi& aAppUi,
       
    62 	CFSMailClient& aMailClient  )
       
    63     : CFsEmailUiViewBase( aControlGroup, aAppUi ),
       
    64       iMailClient( aMailClient ),
       
    65       iMailboxSettings( EFalse )
       
    66 	{
       
    67     FUNC_LOG;
       
    68 	iFsEmailSettingsList = NULL;
       
    69 	}
       
    70 
       
    71 // ---------------------------------------------------------------------------
       
    72 // ~CFsEmailSettingsListView
       
    73 // ---------------------------------------------------------------------------
       
    74 //
       
    75 CFsEmailSettingsListView::~CFsEmailSettingsListView()
       
    76 	{
       
    77     FUNC_LOG;
       
    78 
       
    79    	if ( iAsyncCallback )
       
    80 		{
       
    81 		iAsyncCallback->Cancel();
       
    82 		delete iAsyncCallback;
       
    83 		}
       
    84 
       
    85    	if ( iStylusPopUpMenu )
       
    86    		{
       
    87    		delete iStylusPopUpMenu;
       
    88    		iStylusPopUpMenu = NULL;
       
    89    		}
       
    90    	
       
    91    	delete iCoeControl;
       
    92 	}
       
    93 
       
    94 
       
    95 // ---------------------------------------------------------------------------
       
    96 // Symbian two-phase constructor.
       
    97 // This creates an instance then calls the second-phase constructor
       
    98 // without leaving the instance on the cleanup stack.
       
    99 // @return new instance of CFsEmailSettingsListView
       
   100 // ---------------------------------------------------------------------------
       
   101 //
       
   102 CFsEmailSettingsListView* CFsEmailSettingsListView::NewL( 
       
   103 		CFSMailClient& aMailClient,
       
   104 		CFreestyleEmailUiAppUi* aAppUi, 
       
   105 		CAlfControlGroup& aControlGroup )
       
   106 	{
       
   107     FUNC_LOG;
       
   108 
       
   109 	CFsEmailSettingsListView* self =
       
   110 		CFsEmailSettingsListView::NewLC( aMailClient, aAppUi, aControlGroup );
       
   111 	CleanupStack::Pop( self );
       
   112 
       
   113 	return self;
       
   114 	}
       
   115 
       
   116 // ---------------------------------------------------------------------------
       
   117 // Symbian two-phase constructor.
       
   118 // This creates an instance, pushes it on the cleanup stack,
       
   119 // then calls the second-phase constructor.
       
   120 // @return new instance of CFsEmailSettingsListView
       
   121 // ---------------------------------------------------------------------------
       
   122 //
       
   123 CFsEmailSettingsListView* CFsEmailSettingsListView::NewLC( 
       
   124 		CFSMailClient& aMailClient,
       
   125 		CFreestyleEmailUiAppUi* aAppUi, 
       
   126 		CAlfControlGroup& aControlGroup )
       
   127 	{
       
   128     FUNC_LOG;
       
   129 
       
   130 	CFsEmailSettingsListView* self = 
       
   131 	    new ( ELeave ) CFsEmailSettingsListView(
       
   132 	    	aControlGroup, *aAppUi, aMailClient );
       
   133 	CleanupStack::PushL( self );
       
   134 	self->ConstructL();
       
   135 
       
   136 	return self;
       
   137 	}
       
   138 
       
   139 
       
   140 // ---------------------------------------------------------------------------
       
   141 // Second-phase constructor for view.  
       
   142 // Initialize contents from resource.
       
   143 // ---------------------------------------------------------------------------
       
   144 //
       
   145 void CFsEmailSettingsListView::ConstructL()
       
   146 	{
       
   147     FUNC_LOG;
       
   148 
       
   149 	BaseConstructL( R_FS_EMAIL_SETTINGS_LIST_VIEW );
       
   150 
       
   151 	iAsyncCallback = new (ELeave) CAsyncCallBack( CActive::EPriorityStandard );
       
   152 	iAsyncCallback->Set( TCallBack( DisplayCreateQuery, this ) );
       
   153 	}
       
   154 
       
   155 // -----------------------------------------------------------------------------
       
   156 // CFsEmailSettingsListView::DisplayCreateQuery
       
   157 // -----------------------------------------------------------------------------
       
   158 //
       
   159 void CFsEmailSettingsListView::StartMailboxAsyncQueryL()
       
   160 	{
       
   161     FUNC_LOG;
       
   162 
       
   163 	if ( iAsyncCallback )
       
   164 		{
       
   165 		iAsyncCallback->CallBack();
       
   166 		}
       
   167 	}
       
   168 
       
   169 
       
   170 // -----------------------------------------------------------------------------
       
   171 // CFsEmailSettingsListView::DisplayStylusPopUpMenu()
       
   172 // Displays the pop-up menu.
       
   173 // -----------------------------------------------------------------------------
       
   174 //
       
   175 void CFsEmailSettingsListView::DisplayStylusPopUpMenu( const TPoint& aPosition )
       
   176 	{
       
   177     if ( iStylusPopUpMenu )
       
   178     	{
       
   179     	iStylusPopUpMenu->SetPosition( aPosition, CAknStylusPopUpMenu::EPositionTypeLeftBottom );
       
   180     	iStylusPopUpMenu->ShowMenu();
       
   181     	}
       
   182 	}
       
   183 
       
   184 // -----------------------------------------------------------------------------
       
   185 // CFsEmailSettingsListView::HideStylusPopUpMenu()
       
   186 // Hides the pop-up menu.
       
   187 // -----------------------------------------------------------------------------
       
   188 //
       
   189 void CFsEmailSettingsListView::HideStylusPopUpMenu()
       
   190     {
       
   191     if ( iStylusPopUpMenu )
       
   192         {
       
   193         TRAP_IGNORE( iStylusPopUpMenu->HandleControlEventL( iCoeControl,
       
   194                         MCoeControlObserver::EEventRequestExit ) );
       
   195         }
       
   196     }
       
   197 
       
   198 // -----------------------------------------------------------------------------
       
   199 // CFsEmailSettingsListView::DisplayCreateQuery
       
   200 // -----------------------------------------------------------------------------
       
   201 //
       
   202 TInt CFsEmailSettingsListView::DisplayCreateQuery( TAny* aViewPtr )
       
   203     {
       
   204     FUNC_LOG;
       
   205     CFsEmailSettingsListView* self =
       
   206 		static_cast<CFsEmailSettingsListView*>( aViewPtr ); 
       
   207 	TRAPD( err, self->DisplayCreateMailboxNoteIfNeededL() );
       
   208     return err;
       
   209     }
       
   210 
       
   211 // -----------------------------------------------------------------------------
       
   212 // CFsEmailSettingsListView::DisplayCreateQueryL
       
   213 // -----------------------------------------------------------------------------
       
   214 //
       
   215 void CFsEmailSettingsListView::DisplayCreateMailboxNoteIfNeededL()
       
   216     {
       
   217     FUNC_LOG;
       
   218     User::LeaveIfNull( iFsEmailSettingsList );
       
   219     iFsEmailSettingsList->DisplayCreateMailboxNoteIfNeededL();
       
   220     }
       
   221 
       
   222 // -----------------------------------------------------------------------------
       
   223 // CFsEmailSettingsListView::Id()
       
   224 // From CAknView.
       
   225 // -----------------------------------------------------------------------------
       
   226 //
       
   227 TUid CFsEmailSettingsListView::Id() const
       
   228 	{
       
   229     FUNC_LOG;
       
   230 	return SettingsViewId;
       
   231 	}
       
   232 
       
   233 // -----------------------------------------------------------------------------
       
   234 // CFsEmailSettingsListView::HandleCommandL()
       
   235 // From CAknView.
       
   236 // -----------------------------------------------------------------------------
       
   237 //
       
   238 void CFsEmailSettingsListView::HandleCommandL( TInt aCommand )
       
   239 	{
       
   240     FUNC_LOG;
       
   241 	
       
   242 	switch ( aCommand )
       
   243 		{
       
   244 		case EAknSoftkeyBack:
       
   245 			{
       
   246 			if ( iFsEmailSettingsList->Get2ndLevelListIndicator() 
       
   247 			     && !iMailboxSettings )
       
   248 			    {
       
   249 			    // return from sub view
       
   250 			    iFsEmailSettingsList->CreateAccountListL();
       
   251 			    // when returning to mailboxlist set sublistindex to zero to avoid 
       
   252 			    // wrong indexin when creating the sublistviews
       
   253 			    iFsEmailSettingsList->SetSelectedSubListIndex(0);
       
   254 	            SetupStatusPaneL();
       
   255 			    }
       
   256 			else
       
   257 			    {
       
   258 			    // navigate away from settings
       
   259 	            NavigateBackL();
       
   260 			    }
       
   261 
       
   262 			break;
       
   263 			}
       
   264 		case EAknSoftkeyOpen:	
       
   265 		case EFsEmailUiCmdOpen:
       
   266 			{
       
   267 			iFsEmailSettingsList->HandleUserSelectionsL();
       
   268 			SetupStatusPaneL();
       
   269 			break;
       
   270 			}
       
   271 		case EFsEmailUiCmdSettingsAddAccount:
       
   272 			{
       
   273 			iFsEmailSettingsList->AddAccountL();
       
   274 			break;
       
   275 			}
       
   276 		case EFsEmailUiCmdSettingsRemoveAccount:
       
   277 		case EFsEmailUiCmdDeleteSelectedMailbox: // From the pop-up menu.
       
   278 			{
       
   279 			iFsEmailSettingsList->RemoveAccountL();
       
   280 			iFsEmailSettingsList->ClearFocus();
       
   281 			break;
       
   282 			}
       
   283 		case EFsEmailUiCmdHelp:
       
   284 			{
       
   285 			TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID );
       
   286             break;
       
   287 			}
       
   288 		case EFsEmailUiCmdExit:
       
   289 			{
       
   290 			AppUi()->HandleCommandL( EEikCmdExit );
       
   291 			break;
       
   292 			}
       
   293 		case EFsEmailUiCmdGoToTop:
       
   294 			{
       
   295 		    iFsEmailSettingsList->GoToTop();
       
   296 		    break;
       
   297 			}
       
   298 		case EFsEmailUiCmdGoToBottom:
       
   299 			{
       
   300 		    iFsEmailSettingsList->GoToBottom();
       
   301 		    break;
       
   302 			}
       
   303         case EFsEmailUiCmdPageUp:
       
   304         	{
       
   305             iFsEmailSettingsList->PageUp();
       
   306             break;
       
   307         	}
       
   308         case EFsEmailUiCmdPageDown:
       
   309         	{
       
   310             iFsEmailSettingsList->PageDown();
       
   311             break;
       
   312         	}
       
   313         case KErrCancel:
       
   314         	{
       
   315         	if ( iFsEmailSettingsList )
       
   316         	    {
       
   317                 // The pop-up menu was cancelled.
       
   318                 iFsEmailSettingsList->ClearFocus();
       
   319         	    }
       
   320         	break;
       
   321         	}
       
   322 		default:
       
   323 			{
       
   324 			break;
       
   325 			}
       
   326 		} // switch ( aCommand )
       
   327 	}
       
   328 
       
   329 
       
   330 // -----------------------------------------------------------------------------
       
   331 // CFsEmailSettingsListView::ChildDoActivateL()
       
   332 // From CFsEmailUiViewBase.
       
   333 // -----------------------------------------------------------------------------
       
   334 //
       
   335 void CFsEmailSettingsListView::ChildDoActivateL(
       
   336         const TVwsViewId& aPrevViewId,
       
   337         TUid aCustomMessageId,
       
   338         const TDesC8& aCustomMessage )
       
   339 	{
       
   340     FUNC_LOG;
       
   341     
       
   342     if ( aCustomMessageId.iUid != KMailSettingsReturnToPrevious &&
       
   343          aCustomMessageId.iUid != KMailSettingsReturnFromPluginSettings )
       
   344         {
       
   345         ViewEntered( aPrevViewId );
       
   346         }
       
   347     
       
   348 	// create view control
       
   349 	if ( iFsEmailSettingsList == NULL )
       
   350 		{
       
   351 		TPckgBuf<CESMailSettingsPlugin::TSubViewActivationData> subViewData;
       
   352 		subViewData.Copy( aCustomMessage );
       
   353 		CESMailSettingsPlugin::TSubViewActivationData subView = subViewData();
       
   354 					
       
   355 		iFsEmailSettingsList = CFsEmailSettingsList::NewL( ClientRect(), NULL, iAppUi, iMailClient, *this );
       
   356 		iFsEmailSettingsList->SetMopParent( this );
       
   357 		AppUi()->AddToStackL( *this, iFsEmailSettingsList );
       
   358 		} // no else
       
   359 
       
   360 	if ( iFsEmailSettingsList )
       
   361 		{
       
   362 		
       
   363 		// Opened from launcher grid
       
   364 		if ( aCustomMessageId == TUid::Uid( KMailSettingsOpenMainList ) )
       
   365 			{
       
   366 			iFsEmailSettingsList->CreateAccountListL();
       
   367 			} // no else
       
   368 
       
   369 		// Opened from S60 general settings
       
   370 		if ( aCustomMessageId == TUid::Uid( KOpenMailSettingsFromGS ) )
       
   371 			{
       
   372 			iFsEmailSettingsList->CreateAccountListL();
       
   373 			} // no else
       
   374 
       
   375 		// Returning from global settings
       
   376 		if ( aCustomMessageId == TUid::Uid( KMailSettingsReturnToPrevious ) )
       
   377 			{
       
   378 			iFsEmailSettingsList->CreateAccountListL();
       
   379 			} // no else
       
   380 				
       
   381 		// open specific mailbox settings directly from mail list
       
   382 		if ( aCustomMessageId == TUid::Uid( KMailSettingsOpenMailboxSettings ) )
       
   383 			{
       
   384 			// save previous view
       
   385 			iMailboxSettings = ETrue;
       
   386 
       
   387 			TMailListActivationData mailboxData;
       
   388 			TPckgBuf<TMailListActivationData> mailboxPkgData( mailboxData );
       
   389 			mailboxPkgData.Copy( aCustomMessage );
       
   390 			mailboxData = mailboxPkgData();
       
   391 
       
   392 			CFSMailBox* mailbox = iFsEmailSettingsList->GetMailBoxByIdL( mailboxData.iMailBoxId.Id() );
       
   393 			if ( mailbox )
       
   394 				{
       
   395 				CleanupStack::PushL( mailbox );
       
   396 				TUid settingsPluginId = mailbox->GetSettingsUid();
       
   397 				iFsEmailSettingsList->SetPluginSettingsUid( settingsPluginId );
       
   398 				iFsEmailSettingsList->SetSelectedAccountInfo( mailbox->GetId() );
       
   399 				CleanupStack::PopAndDestroy( mailbox );
       
   400 				iFsEmailSettingsList->ActivateMailSettingsPluginSubViewL( mailboxData.iRequestRefresh );
       
   401 				}
       
   402 			else // Mailbox fetching failed, create account list instead
       
   403 				{
       
   404 				iFsEmailSettingsList->CreateAccountListL();
       
   405 				}
       
   406 			} // no else
       
   407 
       
   408 		// opening specific plugin caption list outside email ui
       
   409 		if ( aCustomMessageId == TUid::Uid( KMailSettingsOpenPluginSettings ) )
       
   410 			{
       
   411 			CESMailSettingsPlugin::TSubViewActivationData subView;
       
   412 			TPckgBuf<CESMailSettingsPlugin::TSubViewActivationData> SubViewData( subView );
       
   413 			SubViewData.Copy( aCustomMessage );
       
   414 			subView = SubViewData();
       
   415 	
       
   416 			CFSMailBox* mailbox = iFsEmailSettingsList->GetMailBoxByIdL( subView.iAccount.Id() );
       
   417 			if ( mailbox )
       
   418 				{
       
   419 				CleanupStack::PushL( mailbox );
       
   420 				iFsEmailSettingsList->SetSelectedAccountInfo( subView.iAccount );
       
   421 				TUid settingsPluginId = mailbox->GetSettingsUid();
       
   422 				CleanupStack::PopAndDestroy( mailbox );
       
   423 				iFsEmailSettingsList->CreatePluginSubviewListL( settingsPluginId );				
       
   424 				}
       
   425 			else // Mailbox fetching failed, create account list instead
       
   426 				{
       
   427 				iFsEmailSettingsList->CreateAccountListL();
       
   428 				}
       
   429 			} // no else
       
   430 		
       
   431 		// coming from plugin settings
       
   432 		if ( aCustomMessageId == TUid::Uid( KMailSettingsReturnFromPluginSettings ) )
       
   433 			{
       
   434 	    	// Better to refresh launcher grid view because mailbox branding might be changed.
       
   435 			iAppUi.LauncherGrid().SetRefreshNeeded();
       
   436 			CESMailSettingsPlugin::TSubViewActivationData subView;
       
   437 			TPckgBuf<CESMailSettingsPlugin::TSubViewActivationData> SubViewData( subView );
       
   438 			SubViewData.Copy( aCustomMessage );
       
   439 			subView = SubViewData();
       
   440 			
       
   441 			// if subview was selected from list then return to subview list
       
   442 			// otherwise return to account list
       
   443 			if ( subView.iSubviewId > -1 )
       
   444 				{
       
   445 				CFSMailBox* mailbox = iFsEmailSettingsList->GetMailBoxByIdL( subView.iAccount.Id() );
       
   446 				if ( mailbox ) // Malbox pointer can be null
       
   447 					{
       
   448 					CleanupStack::PushL( mailbox );
       
   449 					iFsEmailSettingsList->SetSelectedAccountInfo( subView.iAccount );
       
   450 					iFsEmailSettingsList->SetSelectedSubListIndex( subView.iSubviewId );
       
   451 					
       
   452 					TUid settingsPluginId = mailbox->GetSettingsUid();
       
   453 					CleanupStack::PopAndDestroy( mailbox );
       
   454 					if(subView.iPimAccount)
       
   455 						{
       
   456 						iFsEmailSettingsList->CreatePluginPIMListL( settingsPluginId );
       
   457 						iFsEmailSettingsList->SetPimListActivation(ETrue);
       
   458 						}
       
   459 					else
       
   460 						{
       
   461 						iFsEmailSettingsList->CreatePluginSubviewListL( settingsPluginId );
       
   462 						}					
       
   463 					}
       
   464 				// If mailbox id was null after returning from plugin settings
       
   465 				// the only thing left to do is create account list once again
       
   466 				// instead of goinf to subview.
       
   467 				else 
       
   468 	 				{
       
   469 					iFsEmailSettingsList->CreateAccountListL();				
       
   470 					}
       
   471 				}
       
   472 			else
       
   473 				{
       
   474 				iFsEmailSettingsList->CreateAccountListL();
       
   475 				}
       
   476 			} // no else
       
   477 
       
   478 		if ( aCustomMessageId == TUid::Null() )
       
   479 			{
       
   480 			iFsEmailSettingsList->CreateAccountListL();
       
   481 			}
       
   482 		}
       
   483 	// setup status pane title
       
   484     SetupStatusPaneL();
       
   485     
       
   486     if ( !iCoeControl )
       
   487         {
       
   488         // dymmy control for closing stylus pop up menu
       
   489         iCoeControl = new( ELeave )CCoeControl;
       
   490         }
       
   491 
       
   492     if( !iStylusPopUpMenu )
       
   493         {
       
   494         // Construct the long tap pop-up menu.
       
   495         TPoint point( 0, 0 );
       
   496         iStylusPopUpMenu = CAknStylusPopUpMenu::NewL( this , point );
       
   497 		TResourceReader reader;
       
   498 		iCoeEnv->CreateResourceReaderLC( reader,
       
   499 			R_STYLUS_POPUP_MENU_LAUNCHER_GRID_VIEW );
       
   500 		iStylusPopUpMenu->ConstructFromResourceL( reader );
       
   501 		CleanupStack::PopAndDestroy(); // reader
       
   502         }
       
   503 
       
   504 	// Make a deferred call to show the "create mailbox" query if we opened the main settings list
       
   505 	if ( aCustomMessageId.iUid == KMailSettingsOpenMainList ||
       
   506 	        aCustomMessageId.iUid == KOpenMailSettingsFromGS )
       
   507 	    {
       
   508 	    StartMailboxAsyncQueryL();
       
   509 	    }
       
   510 
       
   511 	iAppUi.HideTitlePaneConnectionStatus();
       
   512 	}
       
   513 
       
   514 // ---------------------------------------------------------------------------
       
   515 // ChildDoDeactivate
       
   516 // From CFsEmailUiViewBase
       
   517 // ---------------------------------------------------------------------------
       
   518 //
       
   519 void CFsEmailSettingsListView::ChildDoDeactivate()
       
   520 	{
       
   521     FUNC_LOG;
       
   522 
       
   523 	if ( iFsEmailSettingsList != NULL )
       
   524 		{
       
   525 		AppUi()->RemoveFromViewStack( *this, iFsEmailSettingsList );
       
   526 		delete iFsEmailSettingsList;
       
   527 		iFsEmailSettingsList = NULL;
       
   528 		}
       
   529 
       
   530 	}
       
   531 
       
   532 // ---------------------------------------------------------------------------
       
   533 // SetSelectedMainListIndex
       
   534 // ---------------------------------------------------------------------------
       
   535 //
       
   536 void CFsEmailSettingsListView::SetSelectedMainListIndex( TInt aIndex )
       
   537 	{
       
   538     FUNC_LOG;
       
   539 	iContainerListIndex = aIndex;
       
   540 	}
       
   541 
       
   542 // ---------------------------------------------------------------------------
       
   543 // GetSelectedMainListIndex
       
   544 // ---------------------------------------------------------------------------
       
   545 //
       
   546 TInt CFsEmailSettingsListView::GetSelectedMainListIndex() const
       
   547 	{
       
   548     FUNC_LOG;
       
   549 	return iContainerListIndex;
       
   550 	}
       
   551 
       
   552 // ---------------------------------------------------------------------------
       
   553 // DynInitMenuPaneL
       
   554 // From CAknView.
       
   555 // ---------------------------------------------------------------------------
       
   556 //
       
   557 void CFsEmailSettingsListView::DynInitMenuPaneL( 
       
   558         TInt aResourceId, 
       
   559         CEikMenuPane* aMenuPane )
       
   560     {
       
   561     FUNC_LOG;
       
   562 
       
   563     if ( iFsEmailSettingsList && aResourceId == R_FS_EMAIL_SETTINGS_LIST_MENU_PANE )
       
   564         {
       
   565         aMenuPane->SetItemDimmed( EFsEmailUiCmdSettingsRemoveAccount, ETrue );
       
   566 
       
   567         if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) )
       
   568            {
       
   569            // remove help support in pf5250
       
   570            aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue);      
       
   571            }
       
   572         
       
   573         TInt lastIndex = iFsEmailSettingsList->Count()-1;
       
   574         // Dimm add/remove in 2nd level
       
   575         if ( iFsEmailSettingsList->Get2ndLevelListIndicator() )
       
   576             {
       
   577             aMenuPane->SetItemDimmed(EFsEmailUiCmdSettingsAddAccount, ETrue );
       
   578             }
       
   579         }
       
   580 
       
   581     // Add shortcut hints
       
   582     iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, 
       
   583                                  CFSEmailUiShortcutBinding::EContextSettings );
       
   584     }
       
   585 
       
   586 // ---------------------------------------------------------------------------
       
   587 // SetupStatusPaneL()
       
   588 // 
       
   589 // ---------------------------------------------------------------------------
       
   590 //
       
   591 void CFsEmailSettingsListView::SetupStatusPaneL()
       
   592 	{
       
   593     FUNC_LOG;
       
   594 
       
   595 	// reset the context pane
       
   596 	TUid contextPaneUid = TUid::Uid( EEikStatusPaneUidContext );
       
   597 	CEikStatusPaneBase::TPaneCapabilities subPaneContext = 
       
   598 		StatusPane()->PaneCapabilities( contextPaneUid );
       
   599 	if ( subPaneContext.IsPresent() && subPaneContext.IsAppOwned() )
       
   600 		{
       
   601 		CAknContextPane* context = static_cast< CAknContextPane* > ( 
       
   602 			StatusPane()->ControlL( contextPaneUid ) );
       
   603 		context->SetPictureToDefaultL();
       
   604 		}
       
   605 	
       
   606 	// setup the title pane
       
   607 	HBufC* text = iFsEmailSettingsList->CreateTitlePaneTextLC();
       
   608 	iAppUi.SetTitlePaneTextL( *text );
       
   609 	CleanupStack::PopAndDestroy( text );
       
   610 
       
   611 	}
       
   612 
       
   613 // ---------------------------------------------------------------------------
       
   614 // CleanupStatusPaneL()
       
   615 // Sets application default title when leaving this view
       
   616 // ---------------------------------------------------------------------------
       
   617 //
       
   618 void CFsEmailSettingsListView::CleanupStatusPaneL()
       
   619 	{
       
   620     FUNC_LOG;
       
   621     iAppUi.ResetTitlePaneTextL();
       
   622 	}
       
   623 
       
   624 
       
   625 // ---------------------------------------------------------------------------
       
   626 // HandleStatusPaneSizeChange()
       
   627 // From CAknView.
       
   628 // Handle status pane size change for this view (override).
       
   629 // ---------------------------------------------------------------------------
       
   630 //
       
   631 void CFsEmailSettingsListView::HandleStatusPaneSizeChange()
       
   632 	{
       
   633     FUNC_LOG;
       
   634 	if ( IsForeground() )
       
   635 		{
       
   636 		CAknView::HandleStatusPaneSizeChange();
       
   637 		
       
   638 		// this may fail, but we're not able to propagate exceptions here
       
   639         TRAP_IGNORE( SetupStatusPaneL() ); 
       
   640 		}
       
   641 	}
       
   642 
       
   643 
       
   644 // End of file.