emailuis/emailui/src/FreestyleEmailUiDownloadManagerVisualiser.cpp
branchRCL_3
changeset 8 e1b6206813b4
parent 0 8466d47a6819
--- a/emailuis/emailui/src/FreestyleEmailUiDownloadManagerVisualiser.cpp	Tue Feb 02 00:02:40 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiDownloadManagerVisualiser.cpp	Fri Feb 19 22:37:30 2010 +0200
@@ -19,8 +19,8 @@
 
 // SYSTEM INCLUDES
 #include "emailtrace.h"
-#include <FreestyleEmailUi.mbg>
-#include <aknutils.h>
+#include <freestyleemailui.mbg>
+#include <AknUtils.h>
 #include <gulicon.h>
 #include <StringLoader.h>
 #include <FreestyleEmailUi.rsg>
@@ -37,9 +37,9 @@
 #include "fstreeplaintwolineitemdata.h"
 #include "fstreeplaintwolineitemvisualizer.h"
 // </cmail>
-#include <AknListQueryDialog.h>
-#include <caknfileselectiondialog.h>
-#include <caknmemoryselectiondialog.h>
+#include <aknlistquerydialog.h>
+#include <CAknFileSelectionDialog.h>
+#include <CAknMemorySelectionDialog.h>
 #include <pathinfo.h>
 #include <aknnotewrappers.h>
 // <cmail> SF
@@ -50,7 +50,7 @@
 #include "mfsmailbrandmanager.h"
 #include "cfsmailclient.h"
 //</cmail>
-#include <FeatMgr.h>
+#include <featmgr.h>
 //</cmail>
 
 // INTERNAL INCLUDES
@@ -89,32 +89,32 @@
     CleanupStack::PushL( self );
     self->ConstructL();
     return self;
-	}
+    }
 
 void CFSEmailUiDownloadManagerVisualiser::ConstructL()
-	{
+    {
     FUNC_LOG;
 
-	BaseConstructL( R_FSEMAILUI_DOWNLOADMANAGER_VIEW );
+    BaseConstructL( R_FSEMAILUI_DOWNLOADMANAGER_VIEW );
 
-	// Create list screen (list) control
-	iScreenControl = CFreestyleEmailUiDownloadManagerControl::NewL( iEnv, this );
-	
-	// Create attachments list layout and set it to fill the main pane
-  	TRect screenRect;
- 	AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect );	
+    // Create list screen (list) control
+    iScreenControl = CFreestyleEmailUiDownloadManagerControl::NewL( iEnv, this );
+    
+    // Create attachments list layout and set it to fill the main pane
+    TRect screenRect;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, screenRect ); 
     iListLayout = CAlfDeckLayout::AddNewL( *iScreenControl );  
     screenRect.Move(0,0);
     iListLayout->SetRect( screenRect );
   
-   	// Create attachments list tree list component 
+    // Create attachments list tree list component 
     iDownloadManagerTreeListVisualizer = CFsTreeVisualizerBase::NewL(iScreenControl, *iListLayout);
-   	iDownloadManagerTreeListVisualizer->SetItemExpansionDelay( iAppUi.LayoutHandler()->ListItemExpansionDelay() );
-   	
+    iDownloadManagerTreeListVisualizer->SetItemExpansionDelay( iAppUi.LayoutHandler()->ListItemExpansionDelay() );
+    
     iDownloadManagerList = CFsTreeList::NewL(*iDownloadManagerTreeListVisualizer, iEnv);   
     iDownloadManagerList->SetScrollbarVisibilityL( EFsScrollbarAuto );
-  	iDownloadManagerList->SetMarkTypeL( CFsTreeList::EFsTreeListMultiMarkable );
-  	iDownloadManagerList->SetIndentationL( 0 );
+    iDownloadManagerList->SetMarkTypeL( CFsTreeList::EFsTreeListMultiMarkable );
+    iDownloadManagerList->SetIndentationL( 0 );
 
     //<cmail> Compared to S60 3.2.3 in S60 5.0 Alf offers the key events in
     // opposite order.
@@ -125,7 +125,7 @@
     iModel = CFSEmailUiDownloadManagerModel::NewL( iAppUi, *this );
     //<cmail> S60 skin support
     //iDownloadManagerTreeListVisualizer->SetBackgroundTextureL( iAppUi.FsTextureManager()->TextureByIndex( EBackgroundTextureMailList ) );  
-	//</cmail>
+    //</cmail>
     iDownloadManagerTreeListVisualizer->SetMenuIcon( iAppUi.FsTextureManager()->TextureByIndex( EListControlMenuIcon ) );
     iDownloadManagerTreeListVisualizer->SetItemsAlwaysExtendedL( ETrue );
     iDownloadManagerList->AddObserverL( *this );
@@ -136,42 +136,42 @@
     iDownloadManagerTreeListVisualizer->AddCustomPageUpKey( EStdKeyPageUp );
     iDownloadManagerTreeListVisualizer->AddCustomPageDownKey( EStdKeyPageDown );
  
-   	CAlfBrush* selectorBrush = iAppUi.FsTextureManager()->ListSelectorBrushL();
-	iDownloadManagerTreeListVisualizer->SetSelectorPropertiesL( selectorBrush, 1.0, CFsTreeVisualizerBase::EFsSelectorMoveSmoothly );
+    CAlfBrush* selectorBrush = iAppUi.FsTextureManager()->ListSelectorBrushL();
+    iDownloadManagerTreeListVisualizer->SetSelectorPropertiesL( selectorBrush, 1.0, CFsTreeVisualizerBase::EFsSelectorMoveSmoothly );
   
- 	}
+    }
 
 
 CFSEmailUiDownloadManagerVisualiser::CFSEmailUiDownloadManagerVisualiser(
     CAlfEnv& aEnv, CFreestyleEmailUiAppUi* aAppUi, CAlfControlGroup& aControlGroup )
     : CFsEmailUiViewBase( aControlGroup, *aAppUi ), iEnv( aEnv )
-	{
+    {
     FUNC_LOG;
-	}
+    }
 
 CFSEmailUiDownloadManagerVisualiser::~CFSEmailUiDownloadManagerVisualiser()
-	{
+    {
     FUNC_LOG;
-	delete iModel;
-	if ( iDownloadManagerList )
-		{
-		iDownloadManagerList->RemoveObserver( *this );
-		}
-	delete iDownloadManagerList;
-	}
+    delete iModel;
+    if ( iDownloadManagerList )
+        {
+        iDownloadManagerList->RemoveObserver( *this );
+        }
+    delete iDownloadManagerList;
+    }
 
 
 TInt CFSEmailUiDownloadManagerVisualiser::HighlightedIndex()
-	{
+    {
     FUNC_LOG;
-	return 0;
-	}
+    return 0;
+    }
 
 TUid CFSEmailUiDownloadManagerVisualiser::Id() const
-	{
+    {
     FUNC_LOG;
-	return DownloadManagerViewId;
-	}			   
+    return DownloadManagerViewId;
+    }              
 
 // ---------------------------------------------------------------------------
 // CFSEmailUiDownloadManagerVisualiser::ChildDoActivateL
@@ -187,38 +187,38 @@
         TUid /*aCustomMessageId*/,
         const TDesC8& /*aCustomMessage*/ )
 // <cmail> Toolbar
-	{
+    {
     FUNC_LOG;
-	RefreshL();
-	iDownloadManagerList->ShowListL();
-	
-	SetMailboxNameToStatusPaneL();
-	}
+    RefreshL();
+    iDownloadManagerList->ShowListL();
+    
+    SetMailboxNameToStatusPaneL();
+    }
 
 void CFSEmailUiDownloadManagerVisualiser::SetMailboxNameToStatusPaneL()
-	{
+    {
     FUNC_LOG;
-	iAppUi.SetActiveMailboxNameToStatusPaneL();
-	}
+    iAppUi.SetActiveMailboxNameToStatusPaneL();
+    }
 
 // ---------------------------------------------------------------------------
 // CFSEmailUiDownloadManagerVisualiser::ChildDoDeactivate
 // ---------------------------------------------------------------------------
 //
 void CFSEmailUiDownloadManagerVisualiser::ChildDoDeactivate()
-	{
+    {
     FUNC_LOG;
     if ( !iAppUi.AppUiExitOngoing() )
         {
         iDownloadManagerTreeListVisualizer->NotifyControlVisibilityChange( EFalse );
         }
-    }	
-	
+    }   
+    
 CFSEmailUiDownloadManagerModel* CFSEmailUiDownloadManagerVisualiser::Model()
-	{
+    {
     FUNC_LOG;
-	return iModel;	
-	}
+    return iModel;  
+    }
 
 void CFSEmailUiDownloadManagerVisualiser::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
     {
@@ -257,10 +257,10 @@
     else if ( aResourceId == R_FSEMAILUI_DOWNLOADMANAGER_MENUPANE )
         {
         if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) )
-    	   {
-    	   // remove help support in pf5250
-    	   aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue);      
-    	   }        
+           {
+           // remove help support in pf5250
+           aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue);      
+           }        
         
         aMenuPane->SetItemDimmed( EFsEmailUiCmdMailActions,
                 !IsCommandAvailableOnItem(EFsEmailUiCmdMailActions, selectedItem) );
@@ -278,10 +278,10 @@
 
     // Add shortcut hints
     iAppUi.ShortcutBinding().AppendShortcutHintsL( *aMenuPane, 
-            CFSEmailUiShortcutBinding::EContextDownloadManager );	
+            CFSEmailUiShortcutBinding::EContextDownloadManager );   
     }
-	
-	
+    
+    
 // ---------------------------------------------------------------------------
 // HandleMailBoxEventL
 // Mailbox event handler, responds to events sent by the plugin.
@@ -291,10 +291,10 @@
     TFSMailMsgId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
     {
     FUNC_LOG;
-	// Safety, refresh only if this view is active, has model and mail deleted event has been received.  
+    // Safety, refresh only if this view is active, has model and mail deleted event has been received.  
     if ( aEvent == TFSEventMailDeleted && iModel ) 
         {
-		// Remove deleted items from list. Refresh list if this view is active
+        // Remove deleted items from list. Refresh list if this view is active
         // and some item was removed.
         if ( iModel->ClearInvalidItemsL() && 
              iAppUi.CurrentActiveView() == this )
@@ -303,122 +303,122 @@
             SetMskL();
             }
         }
-    }	
-		
-		
+    }   
+        
+        
 void CFSEmailUiDownloadManagerVisualiser::RefreshL()
-	{
+    {
     FUNC_LOG;
-	TRect screenRect;
-	AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
-	iListLayout->SetRect( screenRect );
+    TRect screenRect;
+    AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
+    iListLayout->SetRect( screenRect );
 
-	iDownloadManagerList->RemoveAllL(); 
-	
-	CFsTreePlainTwoLineItemData* twoLineItemData = CFsTreePlainTwoLineItemData::NewL();
-	CleanupStack::PushL( twoLineItemData );
+    iDownloadManagerList->RemoveAllL(); 
+    
+    CFsTreePlainTwoLineItemData* twoLineItemData = CFsTreePlainTwoLineItemData::NewL();
+    CleanupStack::PushL( twoLineItemData );
     CFsTreePlainTwoLineItemVisualizer* twoLineItemVisualizer = 
         CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl() );
     CleanupStack::PushL( twoLineItemVisualizer );
- 	// Set font height
-	twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );		
-	// Set font bolding
-	twoLineItemVisualizer->SetTextBold( ETrue );
+    // Set font height
+    twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );        
+    // Set font bolding
+    twoLineItemVisualizer->SetTextBold( ETrue );
     // Set manual layout and make item non-focusable
-	twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() & ~KFsTreeListItemFocusable );
+    twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() & ~KFsTreeListItemFocusable );
 
-  	// Set correct skin text colors for the list items  
-   	TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
-   	TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
-   	TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor();
+    // Set correct skin text colors for the list items  
+    TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
+    TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
+    TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor();
     TRgb headerBgColor = iAppUi.LayoutHandler()->ListHeaderBackgroundColor();
 
-   	twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
-   	twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
-   	twoLineItemVisualizer->SetBackgroundColor( headerBgColor );
-	
-	const RArray<TMessageData>& modelData = iModel->GetModel();
-	HBufC* resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_DOWNLOAD_MANAGER );
-	twoLineItemData->SetDataL( *resourceString );	
-	CleanupStack::PopAndDestroy( resourceString );
+    twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
+    twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
+    twoLineItemVisualizer->SetBackgroundColor( headerBgColor );
+    
+    const RArray<TMessageData>& modelData = iModel->GetModel();
+    HBufC* resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_DOWNLOAD_MANAGER );
+    twoLineItemData->SetDataL( *resourceString );   
+    CleanupStack::PopAndDestroy( resourceString );
 
-	resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_TOTAL, iModel->AttachmentCount() );
-	twoLineItemData->SetSecondaryDataL( *resourceString );
-	CleanupStack::PopAndDestroy( resourceString );
-	twoLineItemData->SetIcon ( iAppUi.FsTextureManager()->TextureByIndex( EAttachmentIcon ) );
-	CleanupStack::Pop( twoLineItemVisualizer );
-	CleanupStack::Pop( twoLineItemData );
+    resourceString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_HEADER_TOTAL, iModel->AttachmentCount() );
+    twoLineItemData->SetSecondaryDataL( *resourceString );
+    CleanupStack::PopAndDestroy( resourceString );
+    twoLineItemData->SetIcon ( iAppUi.FsTextureManager()->TextureByIndex( EAttachmentIcon ) );
+    CleanupStack::Pop( twoLineItemVisualizer );
+    CleanupStack::Pop( twoLineItemData );
     iHeaderItemId = iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, KFsTreeRootID );
 
-	TFsTreeItemId parentNode;
-	for ( TInt i=0 ; i<modelData.Count() ; i++ )
-		{
-		CFsTreePlainOneLineNodeData* separatorData = CFsTreePlainOneLineNodeData::NewL();
-		CleanupStack::PushL( separatorData );
-	    CFsTreePlainOneLineNodeVisualizer* separatorVisualiser = 
+    TFsTreeItemId parentNode;
+    for ( TInt i=0 ; i<modelData.Count() ; i++ )
+        {
+        CFsTreePlainOneLineNodeData* separatorData = CFsTreePlainOneLineNodeData::NewL();
+        CleanupStack::PushL( separatorData );
+        CFsTreePlainOneLineNodeVisualizer* separatorVisualiser = 
             CFsTreePlainOneLineNodeVisualizer::NewL( *iDownloadManagerList->TreeControl() );
-	    CleanupStack::PushL( separatorVisualiser );
-	    separatorData->SetDataL( *modelData[i].mailSubject );
- 		// Set font height
-		separatorVisualiser->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );		
-		// Set font bolding
-		separatorVisualiser->SetTextBold( ETrue );
-	  	// Set correct skin text colors for the list items  
-		separatorVisualiser->SetFocusedStateTextColor( focusedColor );
-		separatorVisualiser->SetNormalStateTextColor( normalNodeColor );
-		separatorVisualiser->SetBackgroundColor( iAppUi.LayoutHandler()->ListNodeBackgroundColor() );
-		
-	    separatorVisualiser->SetExtendable( EFalse );
-		separatorData->SetIconExpanded( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeExpanded ) );
-		separatorData->SetIconCollapsed( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeCollapsed ) );
-		CleanupStack::Pop( separatorVisualiser );
-		CleanupStack::Pop( separatorData );
-	    parentNode = iDownloadManagerList->InsertNodeL(*separatorData, *separatorVisualiser, KFsTreeRootID);  
-		iModel->SetNodeIdL( i, parentNode );
-		for (TInt j=0; j<modelData[i].mailAttachments.Count(); j++)
-			{
-		    twoLineItemData = CFsTreePlainTwoLineItemData::NewL();
-			CleanupStack::PushL( twoLineItemData );
-		    twoLineItemData->SetDataL( modelData[i].mailAttachments[j].fileName );
-	    
+        CleanupStack::PushL( separatorVisualiser );
+        separatorData->SetDataL( *modelData[i].mailSubject );
+        // Set font height
+        separatorVisualiser->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );      
+        // Set font bolding
+        separatorVisualiser->SetTextBold( ETrue );
+        // Set correct skin text colors for the list items  
+        separatorVisualiser->SetFocusedStateTextColor( focusedColor );
+        separatorVisualiser->SetNormalStateTextColor( normalNodeColor );
+        separatorVisualiser->SetBackgroundColor( iAppUi.LayoutHandler()->ListNodeBackgroundColor() );
+        
+        separatorVisualiser->SetExtendable( EFalse );
+        separatorData->SetIconExpanded( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeExpanded ) );
+        separatorData->SetIconCollapsed( iAppUi.FsTextureManager()->TextureByIndex( EListTextureNodeCollapsed ) );
+        CleanupStack::Pop( separatorVisualiser );
+        CleanupStack::Pop( separatorData );
+        parentNode = iDownloadManagerList->InsertNodeL(*separatorData, *separatorVisualiser, KFsTreeRootID);  
+        iModel->SetNodeIdL( i, parentNode );
+        for (TInt j=0; j<modelData[i].mailAttachments.Count(); j++)
+            {
+            twoLineItemData = CFsTreePlainTwoLineItemData::NewL();
+            CleanupStack::PushL( twoLineItemData );
+            twoLineItemData->SetDataL( modelData[i].mailAttachments[j].fileName );
+        
             HBufC* secondLine = CreateSecondLineTextLC( modelData[i].mailAttachments[j] );
-    		twoLineItemData->SetSecondaryDataL( *secondLine );
-    		CleanupStack::PopAndDestroy( secondLine );		
-					
-    		CAlfTexture& itemTexture = TFsEmailUiUtility::GetAttachmentIcon( modelData[i].mailAttachments[j].fileType, 
-    		                                                                 *iAppUi.FsTextureManager() );
-       		twoLineItemData->SetIcon( itemTexture );
+            twoLineItemData->SetSecondaryDataL( *secondLine );
+            CleanupStack::PopAndDestroy( secondLine );      
+                    
+            CAlfTexture& itemTexture = TFsEmailUiUtility::GetAttachmentIcon( modelData[i].mailAttachments[j].fileType, 
+                                                                             *iAppUi.FsTextureManager() );
+            twoLineItemData->SetIcon( itemTexture );
 
 
-	 	    twoLineItemVisualizer = CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl());
-		    CleanupStack::PushL( twoLineItemVisualizer );
-	 		twoLineItemVisualizer->SetExtendable(ETrue);
-			twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu );
-			
-			CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall );
-			twoLineItemVisualizer->SetTextStyleId( textStyle->Id() );
+            twoLineItemVisualizer = CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl());
+            CleanupStack::PushL( twoLineItemVisualizer );
+            twoLineItemVisualizer->SetExtendable(ETrue);
+            twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu );
+            
+            CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall );
+            twoLineItemVisualizer->SetTextStyleId( textStyle->Id() );
 
-	 		// Set font height
-			twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );		
-			// Set font bolding
-			twoLineItemVisualizer->SetTextBold( EFalse );
-		  	// Set correct skin text colors for the list items  
-		   	twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
-		   	twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
+            // Set font height
+            twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );        
+            // Set font bolding
+            twoLineItemVisualizer->SetTextBold( EFalse );
+            // Set correct skin text colors for the list items  
+            twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
+            twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
 
-		
-		    TFsTreeItemId treeItemId = iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, parentNode);
-			CleanupStack::Pop( twoLineItemVisualizer );
-			CleanupStack::Pop( twoLineItemData );
-		    
-			iModel->SetItemIdL( i, j, treeItemId );
-			}
-	   	}
-	}
-	
-	
+        
+            TFsTreeItemId treeItemId = iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, parentNode);
+            CleanupStack::Pop( twoLineItemVisualizer );
+            CleanupStack::Pop( twoLineItemData );
+            
+            iModel->SetItemIdL( i, j, treeItemId );
+            }
+        }
+    }
+    
+    
 void CFSEmailUiDownloadManagerVisualiser::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType )
-	{
+    {
     FUNC_LOG;
     iDownloadManagerList->HideListL();
     if ( aType ==  CFsEmailUiViewBase::ESkinChanged )
@@ -426,12 +426,12 @@
         ResetColorsL();
         iDownloadManagerList->ShowListL();
         }
-  	else if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged )
-  	    {
-    	ReScaleUiL();
-        iDownloadManagerList->ShowListL();	
-  	    }
-	}
+    else if ( aType == CFsEmailUiViewBase::EScreenLayoutChanged )
+        {
+        ReScaleUiL();
+        iDownloadManagerList->ShowListL();  
+        }
+    }
 
 void CFSEmailUiDownloadManagerVisualiser::HandleDynamicVariantSwitchOnBackgroundL( CFsEmailUiViewBase::TDynamicSwitchType aType )
     {
@@ -453,67 +453,67 @@
     TFsTreeItemId focusedId = iDownloadManagerList->FocusedItem();
     
     switch(aCommand)
-  		{
-  		case EFsEmailUiCmdEmpty: // used when focused item is being downloaded
+        {
+        case EFsEmailUiCmdEmpty: // used when focused item is being downloaded
         case EAknSoftkeyOpen:
-  		case EFsEmailUiCmdOpen:
-  		    {
-  		    TryToOpenItemL( focusedId );
-			}
-			break;
-  		case EFsEmailUiCmdDownload:
-  		    {
-  		    iModel->StartDownloadL(focusedId);
-  		    }
-  		    break;
-  		case EFsEmailUiCmdDownloadAll:
-  			{
-  			iModel->DownloadAllAttachmentsL();
-  			}
-  			break;
-   		case EFsEmailUiCmdCancelDownload:
-   		    {
-   		    TInt reallyCancel = 
-   		        TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOAD_QUERY );
-			if ( reallyCancel )
-				{
-				iModel->CancelDownloadL( focusedId );
-				}
-   		    }
-   		    break;
-  		case EFsEmailUiCmdCancelAllDownloads:
-  		    {
-   		    TInt reallyCancel = 
-   		        TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOADS_QUERY );
-			if ( reallyCancel )
-				{
-   				iModel->CancelAllDownloadsL();
-				}
-  		    }
-  		    break;
-  		case EFsEmailUiCmdSave:
-  			{
-  		    TFileName fileName;
-  		    TInt savedCount( 0 );
-  		    if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) )
-  				{
-				iModel->SaveAttachmentL( focusedId, fileName, savedCount );
-  				}
-  		    if ( savedCount )
-  		        {
-  		        TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( savedCount );        
-  		        }
-  			}
-  			break;
-  		case EFsEmailUiCmdSaveAll:
-  		    {
-  		    TFileName fileName;
-  			if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) )
-  				{
-  				iModel->SaveAllAttachmentsL( fileName );
-  				}
-  		    }
-  			break;
+        case EFsEmailUiCmdOpen:
+            {
+            TryToOpenItemL( focusedId );
+            }
+            break;
+        case EFsEmailUiCmdDownload:
+            {
+            iModel->StartDownloadL(focusedId);
+            }
+            break;
+        case EFsEmailUiCmdDownloadAll:
+            {
+            iModel->DownloadAllAttachmentsL();
+            }
+            break;
+        case EFsEmailUiCmdCancelDownload:
+            {
+            TInt reallyCancel = 
+                TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOAD_QUERY );
+            if ( reallyCancel )
+                {
+                iModel->CancelDownloadL( focusedId );
+                }
+            }
+            break;
+        case EFsEmailUiCmdCancelAllDownloads:
+            {
+            TInt reallyCancel = 
+                TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_CANCEL_DOWNLOADS_QUERY );
+            if ( reallyCancel )
+                {
+                iModel->CancelAllDownloadsL();
+                }
+            }
+            break;
+        case EFsEmailUiCmdSave:
+            {
+            TFileName fileName;
+            TInt savedCount( 0 );
+            if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) )
+                {
+                iModel->SaveAttachmentL( focusedId, fileName, savedCount );
+                }
+            if ( savedCount )
+                {
+                TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( savedCount );        
+                }
+            }
+            break;
+        case EFsEmailUiCmdSaveAll:
+            {
+            TFileName fileName;
+            if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) )
+                {
+                iModel->SaveAllAttachmentsL( fileName );
+                }
+            }
+            break;
         case EFsEmailUiCmdClearFetchedAttachment:
         case EFsEmailUiCmdRemoveAttachment:
         case EFsEmailUiCmdActionsDelete: // from shortcut key
@@ -521,7 +521,7 @@
             RemoveAttachmentL( focusedId );
             }
             break;
-  		case EFsEmailUiCmdMsgDetails:
+        case EFsEmailUiCmdMsgDetails:
             {
             TPartData messageData = iModel->GetMessageL( focusedId );
             
@@ -530,11 +530,11 @@
             msgDetailsData.iFolderId = messageData.iFolderId;
             msgDetailsData.iMessageId = messageData.iMessageId;
 
-            const TPckgBuf<TMsgDetailsActivationData> pkgOut( msgDetailsData );	
+            const TPckgBuf<TMsgDetailsActivationData> pkgOut( msgDetailsData ); 
             iAppUi.EnterFsEmailViewL( MsgDetailsViewId, KStartMsgDetailsToBeginning, pkgOut );
             }
             break;
-  		case EFSEmailUICmdViewMessage:
+        case EFSEmailUICmdViewMessage:
             {
             TPartData messageData = iModel->GetMessageL( focusedId );
             
@@ -543,7 +543,7 @@
             msgViewerData.iFolderId = messageData.iFolderId;
             msgViewerData.iMessageId = messageData.iMessageId;
             msgViewerData.iDetails = EFSMsgDataStructure;
-            const TPckgBuf<TMsgViewerActivationData> pkgOut( msgViewerData );	
+            const TPckgBuf<TMsgViewerActivationData> pkgOut( msgViewerData );   
             iAppUi.EnterFsEmailViewL( MailViewerId, KStartViewerWithMsgId, pkgOut );
             }
             break;
@@ -553,14 +553,14 @@
             }
             break;
         case EAknSoftkeyBack:
-     		{
-     		if ( !iAppUi.ViewSwitchingOngoing() )
-     			{
-	  	       	iAppUi.ReturnToPreviousViewL();
-     			}
-     		}   
-        	break;
-        	
+            {
+            if ( !iAppUi.ViewSwitchingOngoing() )
+                {
+                iAppUi.ReturnToPreviousViewL();
+                }
+            }   
+            break;
+            
         case EFsEmailUiCmdCollapse:
             {
             iDownloadManagerList->CollapseNodeL( focusedId );
@@ -601,13 +601,13 @@
             iCoeEnv->SimulateKeyEventL( simEvent, EEventKey );
             }
             break;
-       	case EFsEmailUiCmdHelp:
-  			{
-			TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID );
-  			}
-  			break; 
+        case EFsEmailUiCmdHelp:
+            {
+            TFsEmailUiUtility::LaunchHelpL( KFSE_HLP_LAUNCHER_GRID );
+            }
+            break; 
         default:
-        	break;
+            break;
         }
     }
     
@@ -615,41 +615,41 @@
     {
     FUNC_LOG;
     TFsTreeItemId curId = iDownloadManagerList->FocusedItem(); 
-	if ( curId )
-		{
-	    if( iDownloadManagerList->IsNode( curId ) )
-	        {
-	        if (iDownloadManagerList->IsExpanded( curId ) )
-	            {
-	            ChangeMskCommandL( R_FSE_QTN_MSK_COLLAPSE );
-	            } 
-	        else  
-	            {
-	            ChangeMskCommandL( R_FSE_QTN_MSK_EXPAND );
-	            }
-	        }
-	    else // non-node item
-	        { 
-	        TAttachmentData* selectedItem = iModel->GetItem( iDownloadManagerList->FocusedItem());
-	        if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdDownload, selectedItem ) )
-	            {
-	            ChangeMskCommandL( R_FSE_QTN_MSK_DOWNLOAD );
-	            }
-	        else if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdOpen, selectedItem ) )
-	            {
-	            ChangeMskCommandL( R_FSE_QTN_MSK_OPEN );
-	            }
-	        else
-	            {
-	            ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );
-	            }
-	        }		
-		}
-	else
-		{
-        ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );		
-		}	
-    }	
+    if ( curId )
+        {
+        if( iDownloadManagerList->IsNode( curId ) )
+            {
+            if (iDownloadManagerList->IsExpanded( curId ) )
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_COLLAPSE );
+                } 
+            else  
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_EXPAND );
+                }
+            }
+        else // non-node item
+            { 
+            TAttachmentData* selectedItem = iModel->GetItem( iDownloadManagerList->FocusedItem());
+            if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdDownload, selectedItem ) )
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_DOWNLOAD );
+                }
+            else if ( selectedItem && IsCommandAvailableOnItem( EFsEmailUiCmdOpen, selectedItem ) )
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_OPEN );
+                }
+            else
+                {
+                ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );
+                }
+            }       
+        }
+    else
+        {
+        ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY );       
+        }   
+    }   
 
 TBool CFSEmailUiDownloadManagerVisualiser::OfferEventL(const TAlfEvent& aEvent)
     {
@@ -658,19 +658,19 @@
     SetMskL();
     if ( aEvent.IsKeyEvent() && aEvent.Code() == EEventKey )
         {
-	    TInt scanCode = aEvent.KeyEvent().iScanCode;
-	    // Swap right and left controls in mirrored layout
-	    if ( AknLayoutUtils::LayoutMirrored() )
-	        {
-	        if (scanCode == EStdKeyRightArrow) scanCode = EStdKeyLeftArrow;
-	        else if (scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow;
-	        }
-	
-		if ( scanCode == EStdKeyRightArrow )
-			{
-			LaunchActionMenuL();
-			result = ETrue;
-			}
+        TInt scanCode = aEvent.KeyEvent().iScanCode;
+        // Swap right and left controls in mirrored layout
+        if ( AknLayoutUtils::LayoutMirrored() )
+            {
+            if (scanCode == EStdKeyRightArrow) scanCode = EStdKeyLeftArrow;
+            else if (scanCode == EStdKeyLeftArrow ) scanCode = EStdKeyRightArrow;
+            }
+    
+        if ( scanCode == EStdKeyRightArrow )
+            {
+            LaunchActionMenuL();
+            result = ETrue;
+            }
         else
             {
             // Check keyboard shortcuts.
@@ -685,17 +685,17 @@
             }
         }
 
-	/*
+    /*
     if (!result)
         {
         result = iDownloadManagerList->TreeControl()->OfferEventL(aEvent);
         }
-	*/
+    */
     return result;
     }
 
 void CFSEmailUiDownloadManagerVisualiser::ReScaleUiL()
-	{
+    {
     FUNC_LOG;
     TInt fontHeight = iAppUi.LayoutHandler()->ListItemFontHeightInTwips();
     
@@ -720,52 +720,52 @@
             MFsTreeItemVisualizer& attachmentVis = iDownloadManagerList->ItemVisualizer( attachment.treeId );
             attachmentVis.SetFontHeight( fontHeight );
             }
-        }	
+        }   
     }
 
 void CFSEmailUiDownloadManagerVisualiser::ResetColorsL()
     {
     FUNC_LOG;
-   	TRgb normalTextColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
-   	TRgb focusedTextColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
-   	TRgb nodeTextColor = iAppUi.LayoutHandler()->ListNodeTextColor();
-   	TRgb nodeBgColor = iAppUi.LayoutHandler()->ListNodeBackgroundColor();
+    TRgb normalTextColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
+    TRgb focusedTextColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
+    TRgb nodeTextColor = iAppUi.LayoutHandler()->ListNodeTextColor();
+    TRgb nodeBgColor = iAppUi.LayoutHandler()->ListNodeBackgroundColor();
     TRgb headerBgColor = iAppUi.LayoutHandler()->ListHeaderBackgroundColor();
-   	
-   	// Header item
-   	TFsTreeItemId headerId = iDownloadManagerList->Child( KFsTreeRootID, 0 );
-   	MFsTreeItemVisualizer& headerVis = iDownloadManagerList->ItemVisualizer( headerId );
-   	headerVis.SetNormalStateTextColor( normalTextColor );
-   	headerVis.SetFocusedStateTextColor( focusedTextColor );
-   	headerVis.SetBackgroundColor( headerBgColor );
+    
+    // Header item
+    TFsTreeItemId headerId = iDownloadManagerList->Child( KFsTreeRootID, 0 );
+    MFsTreeItemVisualizer& headerVis = iDownloadManagerList->ItemVisualizer( headerId );
+    headerVis.SetNormalStateTextColor( normalTextColor );
+    headerVis.SetFocusedStateTextColor( focusedTextColor );
+    headerVis.SetBackgroundColor( headerBgColor );
 
-   	// Mail nodes and attachment items
-	const RArray<TMessageData>& modelData = iModel->GetModel();
+    // Mail nodes and attachment items
+    const RArray<TMessageData>& modelData = iModel->GetModel();
     for ( TInt i=0 ; i<modelData.Count() ; ++i )
         {
-    	const TMessageData& message = modelData[ i ];
-    	
-       	MFsTreeItemVisualizer& messageVis = iDownloadManagerList->ItemVisualizer( message.treeId );
-       	messageVis.SetNormalStateTextColor( nodeTextColor );
-       	messageVis.SetFocusedStateTextColor( focusedTextColor );
-       	messageVis.SetBackgroundColor( nodeBgColor );
-    	
-    	for ( TInt j=0 ; j<message.mailAttachments.Count() ; j++ )
-    	    {
-    	    const TAttachmentData& attachment = message.mailAttachments[j];
-    	    
-           	MFsTreeItemVisualizer& attachmentVis = iDownloadManagerList->ItemVisualizer( attachment.treeId );
-           	attachmentVis.SetNormalStateTextColor( normalTextColor );
-           	attachmentVis.SetFocusedStateTextColor( focusedTextColor );
-    	    }
+        const TMessageData& message = modelData[ i ];
+        
+        MFsTreeItemVisualizer& messageVis = iDownloadManagerList->ItemVisualizer( message.treeId );
+        messageVis.SetNormalStateTextColor( nodeTextColor );
+        messageVis.SetFocusedStateTextColor( focusedTextColor );
+        messageVis.SetBackgroundColor( nodeBgColor );
+        
+        for ( TInt j=0 ; j<message.mailAttachments.Count() ; j++ )
+            {
+            const TAttachmentData& attachment = message.mailAttachments[j];
+            
+            MFsTreeItemVisualizer& attachmentVis = iDownloadManagerList->ItemVisualizer( attachment.treeId );
+            attachmentVis.SetNormalStateTextColor( normalTextColor );
+            attachmentVis.SetFocusedStateTextColor( focusedTextColor );
+            }
         }
     }
 
 CAlfControl* CFSEmailUiDownloadManagerVisualiser::ViewerControl()
-	{
+    {
     FUNC_LOG;
-	return iScreenControl;
-	}
+    return iScreenControl;
+    }
 
 TBool CFSEmailUiDownloadManagerVisualiser::IsCommandAvailableOnItem( TInt aCommandId, 
                                                                      const TAttachmentData* aFocusedItem ) const
@@ -784,10 +784,10 @@
         //case FsEActionAttachmentClearFetchedContent:
         // </cmail>
             {
-    		if ( aFocusedItem && aFocusedItem->downloadProgress == KComplete )
-    			{
-    			available = ETrue;
-    			}
+            if ( aFocusedItem && aFocusedItem->downloadProgress == KComplete )
+                {
+                available = ETrue;
+                }
             }
             break;
 
@@ -803,33 +803,33 @@
         case EFsEmailUiCmdRemoveAttachment:
         case FsEActionAttachmentRemoveUnfetchedAttachment:
             {
-    		if ( iAppUi.DownloadInfoMediator() && aFocusedItem && aFocusedItem->downloadProgress == KNone && 
-    		     !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
-    			{
-    			available = ETrue;
-    			}
+            if ( iAppUi.DownloadInfoMediator() && aFocusedItem && aFocusedItem->downloadProgress == KNone && 
+                 !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
+                {
+                available = ETrue;
+                }
             }
             break;
 
         case EFsEmailUiCmdCancelDownload:
         case FsEActionAttachmentCancelDownload:
             {
-    		if ( iAppUi.DownloadInfoMediator() && aFocusedItem && 
-    			 iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
-    			{
-    			available = ETrue;
-    			}
+            if ( iAppUi.DownloadInfoMediator() && aFocusedItem && 
+                 iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
+                {
+                available = ETrue;
+                }
             }
             break;
 
         case EFsEmailUiCmdSave:
         case FsEActionAttachmentSave:
             {
-    		if ( iAppUi.DownloadInfoMediator() && aFocusedItem && 
-    			 !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
-    			{
-    			available = ETrue;
-    			}
+            if ( iAppUi.DownloadInfoMediator() && aFocusedItem && 
+                 !iAppUi.DownloadInfoMediator()->IsDownloading( aFocusedItem->partData.iMessagePartId ) )
+                {
+                available = ETrue;
+                }
             }
             break;
 
@@ -841,19 +841,19 @@
             if ( iModel->AttachmentCount() > 1 )
                 {
                 available = ETrue;
-        		for ( TInt i=0; i<model.Count(); i++)
-        			{
-        			const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
-        			for ( TInt j=0 ; j<attachments.Count() ; ++j )
-        			    {
-            			if ( iAppUi.DownloadInfoMediator() && 
-            				 iAppUi.DownloadInfoMediator()->IsDownloading( attachments[j].partData.iMessagePartId ) )
-            				{
-           					available = EFalse;
-           					break;
-            				}
-        			    }
-        			}
+                for ( TInt i=0; i<model.Count(); i++)
+                    {
+                    const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
+                    for ( TInt j=0 ; j<attachments.Count() ; ++j )
+                        {
+                        if ( iAppUi.DownloadInfoMediator() && 
+                             iAppUi.DownloadInfoMediator()->IsDownloading( attachments[j].partData.iMessagePartId ) )
+                            {
+                            available = EFalse;
+                            break;
+                            }
+                        }
+                    }
                 }
             }
             break;
@@ -863,22 +863,22 @@
             {
             // Cancel all is available if there is more than one ongoing download
             TInt downloads = 0;
-    		for ( TInt i=0; i<model.Count(); i++)
-    			{	
-    			const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
-    			for ( TInt j=0 ; j<attachments.Count() ; ++j )
-    			    {
-        			if ( iAppUi.DownloadInfoMediator() && 
-        				 iAppUi.DownloadInfoMediator()->IsDownloading( attachments[j].partData.iMessagePartId ) )
-        				{
-        				downloads++;
-        				}
-    			    }
-    			}
-    		if ( downloads > 1 )
-    		    {
-    		    available = ETrue;
-    		    }
+            for ( TInt i=0; i<model.Count(); i++)
+                {   
+                const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
+                for ( TInt j=0 ; j<attachments.Count() ; ++j )
+                    {
+                    if ( iAppUi.DownloadInfoMediator() && 
+                         iAppUi.DownloadInfoMediator()->IsDownloading( attachments[j].partData.iMessagePartId ) )
+                        {
+                        downloads++;
+                        }
+                    }
+                }
+            if ( downloads > 1 )
+                {
+                available = ETrue;
+                }
             }
             break;
 
@@ -888,21 +888,21 @@
             // Download all is available there is more than one attachments for which
             // "Download" command is available.
             TInt downloadableFiles = 0;
-    		for ( TInt i=0; i<model.Count(); i++)
-    			{
-    			const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
-    			for ( TInt j=0 ; j<attachments.Count() ; ++j )
-    			    {
-        			if ( IsCommandAvailableOnItem( EFsEmailUiCmdDownload, &attachments[j] ) )
-        				{
+            for ( TInt i=0; i<model.Count(); i++)
+                {
+                const RArray<TAttachmentData>& attachments = model[i].mailAttachments;
+                for ( TInt j=0 ; j<attachments.Count() ; ++j )
+                    {
+                    if ( IsCommandAvailableOnItem( EFsEmailUiCmdDownload, &attachments[j] ) )
+                        {
                         downloadableFiles++;
-        				}
-    			    }
-    			}
-    		if ( downloadableFiles > 1 )
-    		    {
-    		    available = ETrue;
-    		    }
+                        }
+                    }
+                }
+            if ( downloadableFiles > 1 )
+                {
+                available = ETrue;
+                }
             }
             break;
 
@@ -934,30 +934,30 @@
     {
     FUNC_LOG;
     // File extension
-	TPtrC extString = TParsePtrC( aAttachment.fileName ).Ext();
-	// It seems to vary if preceeding dot is included in the file extension. Remove it if present.
-	if ( extString.Length() && extString[0] == '.' )
-	    {
-	    extString.Set( extString.Mid(1) );
-	    }
+    TPtrC extString = TParsePtrC( aAttachment.fileName ).Ext();
+    // It seems to vary if preceeding dot is included in the file extension. Remove it if present.
+    if ( extString.Length() && extString[0] == '.' )
+        {
+        extString.Set( extString.Mid(1) );
+        }
 
-    // File size	
-	HBufC* sizeString = iModel->CreateSizeDescLC( aAttachment.fileSize );
+    // File size    
+    HBufC* sizeString = iModel->CreateSizeDescLC( aAttachment.fileSize );
 
     // Download progress
     HBufC* progressString = NULL;
-	if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloading( aAttachment.partData.iMessagePartId ) )
-		{
-		progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING, aAttachment.downloadProgress  );
-		}
-	else if ( aAttachment.downloadProgress == KComplete )
-	    {
-		progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADED_100 );
-	    }
-	else
-	    {
-	    progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING_CANCELLED );
-	    }
+    if ( iAppUi.DownloadInfoMediator() && iAppUi.DownloadInfoMediator()->IsDownloading( aAttachment.partData.iMessagePartId ) )
+        {
+        progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING, aAttachment.downloadProgress  );
+        }
+    else if ( aAttachment.downloadProgress == KComplete )
+        {
+        progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADED_100 );
+        }
+    else
+        {
+        progressString = StringLoader::LoadLC( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOADING_CANCELLED );
+        }
 
     // Combine the accumulated data to one buffer
     HBufC* result = HBufC::NewL( extString.Length() + 
@@ -971,12 +971,12 @@
     resultPtr.Append( *sizeString );
     resultPtr.Append( KSpace );
     resultPtr.Append( *progressString );
-    	
-	CleanupStack::PopAndDestroy( progressString );
-	CleanupStack::PopAndDestroy( sizeString );
-	
-	CleanupStack::PushL( result );
-	return result;
+        
+    CleanupStack::PopAndDestroy( progressString );
+    CleanupStack::PopAndDestroy( sizeString );
+    
+    CleanupStack::PushL( result );
+    return result;
     }
 
 // ---------------------------------------------------------------------------
@@ -992,28 +992,28 @@
     TRAPD( err, attachment = &iModel->GetItemL( aId ) );
     
     if( !err )
-    	{
-	    if ( attachment )
-	        {
-	        if ( iModel->IsDownloading( *attachment ) )
-	            {
-	            TFsEmailUiUtility::ShowInfoNoteL( R_FSE_VIEWER_NOTE_ATTACHMENT_DOWNLOADING_PROGRESS );
-	            }
-	        else if ( attachment->downloadProgress != KComplete )
-	            {
-	            TInt restartDownload = 
-	                TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_NOTE_ATTACHMENT_RESTART_DOWNLOADING );
-	            if ( restartDownload )
-	                {
-	                HandleCommandL( EFsEmailUiCmdDownload );
-	                }
-	            }
-	        else
-	            {
-	            TFsEmailUiUtility::OpenAttachmentL( attachment->partData );
-	            }
-	        }
-	    }
+        {
+        if ( attachment )
+            {
+            if ( iModel->IsDownloading( *attachment ) )
+                {
+                TFsEmailUiUtility::ShowInfoNoteL( R_FSE_VIEWER_NOTE_ATTACHMENT_DOWNLOADING_PROGRESS );
+                }
+            else if ( attachment->downloadProgress != KComplete )
+                {
+                TInt restartDownload = 
+                    TFsEmailUiUtility::ShowConfirmationQueryL( R_FSE_VIEWER_NOTE_ATTACHMENT_RESTART_DOWNLOADING );
+                if ( restartDownload )
+                    {
+                    HandleCommandL( EFsEmailUiCmdDownload );
+                    }
+                }
+            else
+                {
+                TFsEmailUiUtility::OpenAttachmentL( attachment->partData );
+                }
+            }
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -1071,22 +1071,22 @@
     }
 
 void CFSEmailUiDownloadManagerVisualiser::DownloadStatusChangedL( TInt aIndex )
-	{
+    {
     FUNC_LOG;
-	if ( iAppUi.CurrentActiveView() == this &&
-	     aIndex < iModel->GetModel().Count() &&
-	     !iAppUi.AppUiExitOngoing() )
-	    {
-      	TRect screenRect;
-     	AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );	
+    if ( iAppUi.CurrentActiveView() == this &&
+         aIndex < iModel->GetModel().Count() &&
+         !iAppUi.AppUiExitOngoing() )
+        {
+        TRect screenRect;
+        AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );   
     
-       	TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
-       	TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
-       	TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor();
+        TRgb focusedColor = iAppUi.LayoutHandler()->ListFocusedStateTextSkinColor();
+        TRgb normalItemColor = iAppUi.LayoutHandler()->ListNormalStateTextSkinColor();
+        TRgb normalNodeColor = iAppUi.LayoutHandler()->ListNodeTextColor();
     
-    	const RArray<TMessageData>& modelData = iModel->GetModel();
-    	const TMessageData& message = modelData[ aIndex ];
-    	
+        const RArray<TMessageData>& modelData = iModel->GetModel();
+        const TMessageData& message = modelData[ aIndex ];
+        
         // Insert the message node if it's not yet present
         if ( message.treeId == KFsTreeNoneID )
             {
@@ -1114,33 +1114,33 @@
 
         // Insert or update the attachment items 
         for ( TInt j = 0 ; j < message.mailAttachments.Count() ; j++ )
-    		{
+            {
             HBufC* secondLine = CreateSecondLineTextLC( message.mailAttachments[j] );
     
-    		//is the item already drawn
-       		TFsTreeItemId itemId = message.mailAttachments[j].treeId;
-    		if ( itemId != KFsTreeNoneID )
-    			{
-    			// Item is already present. Update the existing item but only if the second line data
-    			// is actually changed. 
-    		    CFsTreePlainTwoLineItemData& itemData = 
-    		            static_cast<CFsTreePlainTwoLineItemData&>( iDownloadManagerList->ItemData( itemId ) );
+            //is the item already drawn
+            TFsTreeItemId itemId = message.mailAttachments[j].treeId;
+            if ( itemId != KFsTreeNoneID )
+                {
+                // Item is already present. Update the existing item but only if the second line data
+                // is actually changed. 
+                CFsTreePlainTwoLineItemData& itemData = 
+                        static_cast<CFsTreePlainTwoLineItemData&>( iDownloadManagerList->ItemData( itemId ) );
 
-    		    if ( itemData.SecondaryData() != *secondLine )
-    		        {
-    		        itemData.SetSecondaryDataL( *secondLine );
-        		    iDownloadManagerTreeListVisualizer->UpdateItemL( itemId );
-        			
-        	        // Update the MSK label if the updated item happens to be the focused item
-        			if ( itemId == iDownloadManagerList->FocusedItem() )
-        			    {
+                if ( itemData.SecondaryData() != *secondLine )
+                    {
+                    itemData.SetSecondaryDataL( *secondLine );
+                    iDownloadManagerTreeListVisualizer->UpdateItemL( itemId );
+                    
+                    // Update the MSK label if the updated item happens to be the focused item
+                    if ( itemId == iDownloadManagerList->FocusedItem() )
+                        {
                         SetMskL();
-        			    }
-    		        }
-    			}
-    		else 
-    			{
-    			//create and draw new item
+                        }
+                    }
+                }
+            else 
+                {
+                //create and draw new item
                 CFsTreePlainTwoLineItemData* twoLineItemData = CFsTreePlainTwoLineItemData::NewL();
                 CleanupStack::PushL( twoLineItemData );
         
@@ -1151,94 +1151,94 @@
                                                                                  *iAppUi.FsTextureManager() );
                 twoLineItemData->SetIcon( itemTexture );
         
-    	 	    CFsTreePlainTwoLineItemVisualizer* twoLineItemVisualizer = 
-    	 	        CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl() );
-    	 	    CleanupStack::PushL( twoLineItemVisualizer );
-    			twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu );
-    	 		twoLineItemVisualizer->SetExtendable( ETrue );
-				CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall );
-    			twoLineItemVisualizer->SetTextStyleId( textStyle->Id() );
-    	 		// Set font height
-    			twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );		
-    			// Set font bolding
-    			twoLineItemVisualizer->SetTextBold( EFalse );
-    		  	// Set correct skin text colors for the list items  
-    		   	twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
-    		   	twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
-    			TFsTreeItemId treeItemId = 
-    			    iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, message.treeId, j );
-    			CleanupStack::Pop( twoLineItemVisualizer );  // ownership transferred to TreeList
-    			CleanupStack::Pop( twoLineItemData );        // ownership transferred to TreeList
-    			iModel->SetItemIdL( aIndex, j, treeItemId );
-    			}
+                CFsTreePlainTwoLineItemVisualizer* twoLineItemVisualizer = 
+                    CFsTreePlainTwoLineItemVisualizer::NewL( *iDownloadManagerList->TreeControl() );
+                CleanupStack::PushL( twoLineItemVisualizer );
+                twoLineItemVisualizer->SetFlags( twoLineItemVisualizer->Flags() | KFsTreeListItemHasMenu );
+                twoLineItemVisualizer->SetExtendable( ETrue );
+                CAlfTextStyle* textStyle = iAppUi.LayoutHandler()->FSTextStyleFromIdL( EFSFontTypeSmall );
+                twoLineItemVisualizer->SetTextStyleId( textStyle->Id() );
+                // Set font height
+                twoLineItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips() );        
+                // Set font bolding
+                twoLineItemVisualizer->SetTextBold( EFalse );
+                // Set correct skin text colors for the list items  
+                twoLineItemVisualizer->SetFocusedStateTextColor( focusedColor );
+                twoLineItemVisualizer->SetNormalStateTextColor( normalItemColor );
+                TFsTreeItemId treeItemId = 
+                    iDownloadManagerList->InsertItemL( *twoLineItemData, *twoLineItemVisualizer, message.treeId, j );
+                CleanupStack::Pop( twoLineItemVisualizer );  // ownership transferred to TreeList
+                CleanupStack::Pop( twoLineItemData );        // ownership transferred to TreeList
+                iModel->SetItemIdL( aIndex, j, treeItemId );
+                }
 
-    		CleanupStack::PopAndDestroy( secondLine );      
-    		}
-	    }
-	}
+            CleanupStack::PopAndDestroy( secondLine );      
+            }
+        }
+    }
 
 // <cmail> Touch
 void CFSEmailUiDownloadManagerVisualiser::TreeListEventL(
-	const TFsTreeListEvent aEvent, const TFsTreeItemId aId )
+    const TFsTreeListEvent aEvent, const TFsTreeItemId aId )
 // </cmail>
-	{
+    {
     FUNC_LOG;
-	if ( aEvent == EFsTreeItemSelected )
-		{
-		TRAPD( err, TryToOpenItemL( aId ) );
-		if ( err != KErrNone )
-			{
-			}
-		}
-	}
+    if ( aEvent == EFsTreeItemSelected )
+        {
+        TRAPD( err, TryToOpenItemL( aId ) );
+        if ( err != KErrNone )
+            {
+            }
+        }
+    }
 
 void CFSEmailUiDownloadManagerVisualiser::LaunchActionMenuL()
-	{
+    {
     FUNC_LOG;
-  	
-	TAttachmentData* selectedItem = NULL;
-	
-	TRAPD( err, selectedItem = &iModel->GetItemL( iDownloadManagerList->FocusedItem() ) );
-	
-	if ( !err )
-		{
-		// Remove old items from action menu
-	    CFSEmailUiActionMenu::RemoveAllL();
-		
-		// Construct item list
-	    RFsEActionMenuIdList itemList;
+    
+    TAttachmentData* selectedItem = NULL;
+    
+    TRAPD( err, selectedItem = &iModel->GetItemL( iDownloadManagerList->FocusedItem() ) );
+    
+    if ( !err )
+        {
+        // Remove old items from action menu
+        CFSEmailUiActionMenu::RemoveAllL();
+        
+        // Construct item list
+        RFsEActionMenuIdList itemList;
         CleanupClosePushL( itemList );
 
-		if ( IsCommandAvailableOnItem( FsEActionAttachmentOpen, selectedItem ) )
-			{
-			itemList.AppendL( FsEActionAttachmentOpen );
-			}
+        if ( IsCommandAvailableOnItem( FsEActionAttachmentOpen, selectedItem ) )
+            {
+            itemList.AppendL( FsEActionAttachmentOpen );
+            }
 
-		if ( IsCommandAvailableOnItem( FsEActionAttachmentDownload, selectedItem ) )
-			{
-			itemList.AppendL( FsEActionAttachmentDownload );
-			}
+        if ( IsCommandAvailableOnItem( FsEActionAttachmentDownload, selectedItem ) )
+            {
+            itemList.AppendL( FsEActionAttachmentDownload );
+            }
 
         if ( IsCommandAvailableOnItem( FsEActionAttachmentDownloadAll, selectedItem ) )
             {
             itemList.AppendL( FsEActionAttachmentDownloadAll );
             }
 
-		if ( IsCommandAvailableOnItem( FsEActionAttachmentCancelDownload, selectedItem ) )
-			{
-			itemList.AppendL( FsEActionAttachmentCancelDownload );
-			}
+        if ( IsCommandAvailableOnItem( FsEActionAttachmentCancelDownload, selectedItem ) )
+            {
+            itemList.AppendL( FsEActionAttachmentCancelDownload );
+            }
 
         if ( IsCommandAvailableOnItem( FsEActionAttachmentCancelAllDownloads, selectedItem ) )
             {
             itemList.AppendL( FsEActionAttachmentCancelAllDownloads );
             }
             
-		if ( IsCommandAvailableOnItem( FsEActionAttachmentSave, selectedItem ) )
-			{
-			itemList.AppendL( FsEActionAttachmentSave );
-			}
-		
+        if ( IsCommandAvailableOnItem( FsEActionAttachmentSave, selectedItem ) )
+            {
+            itemList.AppendL( FsEActionAttachmentSave );
+            }
+        
         if ( IsCommandAvailableOnItem( FsEActionAttachmentSaveAll, selectedItem ) )
             {
             itemList.AppendL( FsEActionAttachmentSaveAll );
@@ -1254,25 +1254,25 @@
             itemList.AppendL( FsEActionAttachmentRemoveUnfetchedAttachment );
             }
         
-		// Execute action list and handle the menu command
-	   	TActionMenuCustomItemId itemId = CFSEmailUiActionMenu::ExecuteL( itemList );
-	   	
-	   	CleanupStack::PopAndDestroy( &itemList );
-	   	
-	  	switch( itemId )
-	  		{
-			case FsEActionAttachmentOpen:
-			    HandleCommandL( EFsEmailUiCmdOpen );
-			    break;
-			case FsEActionAttachmentDownload:
-			    HandleCommandL( EFsEmailUiCmdDownload );
-			    break;
-			case FsEActionAttachmentCancelDownload:
+        // Execute action list and handle the menu command
+        TActionMenuCustomItemId itemId = CFSEmailUiActionMenu::ExecuteL( itemList );
+        
+        CleanupStack::PopAndDestroy( &itemList );
+        
+        switch( itemId )
+            {
+            case FsEActionAttachmentOpen:
+                HandleCommandL( EFsEmailUiCmdOpen );
+                break;
+            case FsEActionAttachmentDownload:
+                HandleCommandL( EFsEmailUiCmdDownload );
+                break;
+            case FsEActionAttachmentCancelDownload:
                 HandleCommandL( EFsEmailUiCmdCancelDownload );
-				break;
-			case FsEActionAttachmentSave:
-			    HandleCommandL( EFsEmailUiCmdSave );
-			    break;
+                break;
+            case FsEActionAttachmentSave:
+                HandleCommandL( EFsEmailUiCmdSave );
+                break;
             case FsEActionAttachmentDownloadAll:
                 HandleCommandL( EFsEmailUiCmdDownloadAll );
                 break;
@@ -1288,11 +1288,11 @@
             case FsEActionAttachmentRemoveUnfetchedAttachment:
                 HandleCommandL( EFsEmailUiCmdRemoveAttachment );
                 break;
-			default:
-				break;
-	  		}
-  		}
-	}
+            default:
+                break;
+            }
+        }
+    }
 
 // ---------------------------------------------------------------------------
 // If there is one or more expanded nodes, collapses all nodes.
@@ -1312,7 +1312,7 @@
             {
             collapseAllNodes = ETrue;
             break;
-            }	
+            }   
         }
 
     if ( collapseAllNodes )
@@ -1321,9 +1321,9 @@
         }
     else
         {
-       	TFsTreeItemId prevId = iDownloadManagerList->FocusedItem(); // the focus may fall out of the screen unless manually reset
+        TFsTreeItemId prevId = iDownloadManagerList->FocusedItem(); // the focus may fall out of the screen unless manually reset
         iDownloadManagerTreeListVisualizer->ExpandAllL();
-    	iDownloadManagerTreeListVisualizer->SetFocusedItemL( prevId );    
+        iDownloadManagerTreeListVisualizer->SetFocusedItemL( prevId );    
         }
     }
 
@@ -1367,4 +1367,4 @@
         }
     }
 
-	
+