Revision: 201001 PDK_3.0.f
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 26 Jan 2010 11:45:42 +0200
changeset 3 a4d6f1ea0416
parent 2 5253a20d2a1e
child 4 e7aa27f58ae1
Revision: 201001 Kit: 201004
emailcontacts/remotecontactlookup/engine/src/cpbkxrclvcardsender.cpp
emailservices/emailclientapi/src/emailmessage.cpp
emailservices/emailframework/commonlib/src/CFSMailFolder.cpp
emailservices/emailframework/commonlib/src/CFSMailRequestHandler.cpp
emailservices/emailframework/inc/emailversionnumbers.hrh
emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h
emailservices/emailserver/cmailhandlerplugin/inc/cmailmailboxdetails.h
emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp
emailservices/emailserver/cmailhandlerplugin/src/cmailmailboxdetails.cpp
emailservices/emailserver/cmailhandlerplugin/src/emailsoundhandler.cpp
emailuis/emailui/data/FreestyleEmailUi.rss
emailuis/emailui/group/FreestyleEmailUi.mmp
emailuis/emailui/inc/FSHtmlReloadAO.h
emailuis/emailui/inc/FreestyleEmailUiAknStatusIndicator.h
emailuis/emailui/inc/FreestyleEmailUiAppui.h
emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h
emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h
emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h
emailuis/emailui/inc/FreestyleMessageHeaderHTML.h
emailuis/emailui/inc/OverlayControl.h
emailuis/emailui/inc/ncsheadercontainer.h
emailuis/emailui/loc/freestyleemailui.loc
emailuis/emailui/src/FSHtmlReloadAO.cpp
emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp
emailuis/emailui/src/FreestyleEmailUiAknStatusIndicator.cpp
emailuis/emailui/src/FreestyleEmailUiAppui.cpp
emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp
emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp
emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp
emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiViewBase.cpp
emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp
emailuis/emailui/src/OverlayControl.cpp
emailuis/emailui/src/ncscomposeview.cpp
emailuis/emailui/src/ncscomposeviewcontainer.cpp
emailuis/emailui/src/ncsheadercontainer.cpp
emailuis/uicomponents/inc/fstreelist.h
emailuis/uicomponents/inc/fstreevisualizerbase.h
emailuis/uicomponents/src/fstreelist.cpp
emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp
emailuis/uicomponents/src/fstreevisualizerbase.cpp
ipsservices/ipssosplugin/inc/ipsplgconnectandrefreshfolderlist.h
ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h
ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h
ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp
ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp
ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp
ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp
ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp
ipsservices/ipssossettings/src/ipssetuidialog.cpp
ipsservices/ipssossettings/tsrc/IpsSosTestApp/data/IpsSosTestApp.rss
ipsservices/ipssossettings/tsrc/IpsSosTestApp/data/IpsSosTestApp_reg.rss
ipsservices/ipssossettings/tsrc/IpsSosTestApp/group/bld.inf
ipsservices/ipssossettings/tsrc/IpsSosTestApp/group/ipssostestapp.mmp
ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPApp.h
ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPAppUi.h
ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPContainer.h
ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPDocument.h
ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/ipssostestapp.loc
ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/testapp.hrh
ipsservices/ipssossettings/tsrc/IpsSosTestApp/install/ipssostestapp.pkg
ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPApp.cpp
ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPAppUi.cpp
ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPContainer.cpp
ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPDocument.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdescriptionfield.cpp
--- a/emailcontacts/remotecontactlookup/engine/src/cpbkxrclvcardsender.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailcontacts/remotecontactlookup/engine/src/cpbkxrclvcardsender.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -132,33 +132,26 @@
         }
 
     CMessageData* messageData = CMessageData::NewLC();
-
-    if ( mtmUid == KSenduiMtmSmsUid )
-        {
-        // Sending through SMS
-      
-        // Copy the one and only attachment into a rich text object
-        CRichText* msgBody = CreateRichTextFromFileLC();
-
-        messageData->SetBodyTextL( msgBody );
-
-        // Send the message using Send Ui
-        iSendUi->CreateAndSendMessageL( mtmUid, messageData, KMsgBioUidVCard );
-        
-        CleanupStack::PopAndDestroy( msgBody );
-        }
-    else
-        {
-        // Not sending through SMS, just pass the attachments
-        //<cmail> hardcoded paths removed
-        messageData->AppendAttachmentL(iTempFileName);
-        //</cmail>
-        
-        // Send the message using Send Ui
-        iSendUi->CreateAndSendMessageL( mtmUid, messageData, KMsgBioUidVCard );
-        }
-
+       
+    //<cmail>
+    RFs fs;
+    RFile attachament;
+    
+    User::LeaveIfError( fs.Connect() );
+    CleanupClosePushL( fs );
+    User::LeaveIfError( attachament.Open( fs, iTempFileName, EFileShareAny ) );
+    CleanupClosePushL( attachament );
+    
+    messageData->AppendAttachmentHandleL( attachament );
+    
+    // Send the message using Send Ui
+    iSendUi->CreateAndSendMessageL( mtmUid, messageData, KMsgBioUidVCard );
+    
+    CleanupStack::PopAndDestroy( &attachament );
+    CleanupStack::PopAndDestroy( &fs );
     CleanupStack::PopAndDestroy( messageData );
+    
+    //</cmail>
 
     DestroyTempFileL();
     
@@ -223,11 +216,9 @@
     // Open the file for reading
     RFile file;
     //<cmail> take away double line break
-    User::LeaveIfError( 
-        file.Open(
-            iEikEnv->FsSession(), 
-            iTempFileName, //<cmail>
-            EFileRead | EFileStream | EFileShareReadersOnly ) );
+    User::LeaveIfError( file.Open( iEikEnv->FsSession(), 
+                            iTempFileName, //<cmail>
+                            EFileRead | EFileStream | EFileShareReadersOnly ) );
     //</cmail>
     CleanupClosePushL( file );
     
--- a/emailservices/emailclientapi/src/emailmessage.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailservices/emailclientapi/src/emailmessage.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -371,6 +371,7 @@
     if( count == 0 )
         {
         /* No content, return NULL */
+        CleanupStack::Pop(); // parts
         return NULL;
         }
     CFSMailMessagePart* part = parts[0];
--- a/emailservices/emailframework/commonlib/src/CFSMailFolder.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailFolder.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -111,23 +111,33 @@
     FUNC_LOG;
 	// init asynchronous request
 	CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetFolderId());
-	
     TFSPendingRequest request = 
     	iRequestHandler->InitAsyncRequestL(	GetFolderId().PluginId(), aObserver );
-    	
-   	MFSMailRequestObserver* observer = request.iObserver;
-    TRAPD(err,plugin->FetchMessagesL(	GetMailBoxId(),
-    									GetFolderId(),
-    									aMessageIds,
-    									aDetails,
-    									*observer,
-    									request.iRequestId));
+
+    TInt err = KErrNone;
+    
+    if (plugin)
+        {
+        MFSMailRequestObserver* observer = request.iObserver;
+        TRAP(err,plugin->FetchMessagesL(	GetMailBoxId(),
+                                            GetFolderId(),
+                                            aMessageIds,
+                                            aDetails,
+                                            *observer,
+                                            request.iRequestId));
+        }
+    else 
+        {
+        err = KErrNotFound;        
+        }
+    
     if(err != KErrNone)
-		{
-		iRequestHandler->CompleteRequest(request.iRequestId);
-		User::Leave(err);
-		}
-    return request.iRequestId;	
+        {
+        iRequestHandler->CompleteRequest(request.iRequestId);
+        User::Leave(err);
+        }
+    return request.iRequestId;
+    
 	}
 
 
--- a/emailservices/emailframework/commonlib/src/CFSMailRequestHandler.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailservices/emailframework/commonlib/src/CFSMailRequestHandler.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -2,9 +2,9 @@
 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
+* under the terms of the License "Symbian Foundation License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
@@ -178,8 +178,10 @@
 			iPendingRequests[i].iRequestStatus == TFSPendingRequest::EFSRequestPending)
 			{
 			TFSMailMsgId pluginId(iPendingRequests[i].iPluginId,0);
-			CFSMailPlugin* plugin = GetPluginByUid(pluginId);
-			plugin->CancelL(aRequestId);
+			if(CFSMailPlugin* plugin = GetPluginByUid(pluginId))
+			    {
+			    plugin->CancelL(aRequestId);
+			    }
 			iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestCancelled;
 			break;
 			}
@@ -197,8 +199,10 @@
 			if(iPendingRequests[i].iRequestStatus == TFSPendingRequest::EFSRequestPending)
 				{
 				TFSMailMsgId pluginId(iPendingRequests[i].iPluginId,0);
-				CFSMailPlugin* plugin = GetPluginByUid(pluginId);
-				plugin->CancelL(iPendingRequests[i].iRequestId);
+				if(CFSMailPlugin* plugin = GetPluginByUid(pluginId))
+				    {
+				    plugin->CancelL(iPendingRequests[i].iRequestId);
+				    }
 				iPendingRequests[i].iRequestStatus = TFSPendingRequest::EFSRequestCancelled;
 				}
 		}
--- a/emailservices/emailframework/inc/emailversionnumbers.hrh	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailservices/emailframework/inc/emailversionnumbers.hrh	Tue Jan 26 11:45:42 2010 +0200
@@ -12,7 +12,7 @@
 * Contributors:
 *
 * Description : Common email version number definitions
-* Version     : %version: 10.1.1 %
+* Version     : %version: 10.1.2 %
 *
 */
 
@@ -25,14 +25,14 @@
  *  version number both major and minor version are stored in separate 32 bit
  *  location.
  */
-#define KEmailBinaryVersionNumber 10.2
+#define KEmailBinaryVersionNumber 10.4
 
 /** ECom version number to be used in Cmail related ECom registeration
  *  resource files.
  *  NOTE: Version number in ECom registeration resource file is saved as one
  *  byte, so 255 is the maximum version number.
  */
-#define KEmailEcomVersionNumber 3
+#define KEmailEcomVersionNumber 4
 
 /** Binary paging setting (paged/non-paged)
  */
--- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h	Tue Jan 26 11:45:42 2010 +0200
@@ -220,7 +220,13 @@
      * @param aMailbox mailbox id
      */
     void HandleNewMailboxEventL( const TFSMailMsgId aMailbox );
-    
+
+    /**
+     * Handles mailbox renamed event.
+     * @param aMailbox mailbox id
+     */
+    void HandleMailboxRenamedEventL( const TFSMailMsgId aMailbox );
+
     /**
      * handles mailbox deleted event
      * @param aMailbox mailbox id
--- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailmailboxdetails.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailmailboxdetails.h	Tue Jan 26 11:45:42 2010 +0200
@@ -46,7 +46,12 @@
     * Destructor.
     */
     void SetWidgetInstance( const TDesC& aWidgetInstance );
-    
+
+    /**
+     * Changes the mailbox name.
+     */
+    void SetMailboxName( const TDesC& aMailboxName );
+
 private:
 
     /**
--- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -705,6 +705,11 @@
 //            HandleNewMailboxEventL( aMailbox );
             break;
             }
+        case TFSEventMailboxRenamed:
+            {
+            HandleMailboxRenamedEventL( aMailbox );
+            break;
+            }
         case TFSEventMailboxDeleted:
             {
             HandleMailboxDeletedEventL( aMailbox );
@@ -788,6 +793,28 @@
     }
 
 // ---------------------------------------------------------
+// CMailCpsHandler::HandleMailborRenamedEventL
+// ---------------------------------------------------------
+//
+void CMailCpsHandler::HandleMailboxRenamedEventL( const TFSMailMsgId aMailbox )
+    {
+    for ( TInt ii = iAccountsArray.Count() - 1; ii >= 0; --ii )
+        {
+        if ( iAccountsArray[ii]->iMailboxId.Id() == aMailbox.Id() )
+            {
+            CFSMailBox* mailbox = NULL;
+            mailbox = MailClient().GetMailBoxByUidL( aMailbox );
+            if ( mailbox )
+                {
+                iAccountsArray[ii]->SetMailboxName( mailbox->GetName() );
+                }
+            delete mailbox;
+            break;
+            }
+        }
+    }
+
+// ---------------------------------------------------------
 // CMailCpsHandler::HandleMailboxDeletedEventL
 // ---------------------------------------------------------
 //
--- a/emailservices/emailserver/cmailhandlerplugin/src/cmailmailboxdetails.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailmailboxdetails.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -69,6 +69,20 @@
     }
 
 // ---------------------------------------------------------
+// CMailMailboxDetails::SetMailboxNameL
+// ---------------------------------------------------------
+//
+void CMailMailboxDetails::SetMailboxName( const TDesC& aMailboxName )
+    {
+    HBufC* newMailboxName = aMailboxName.Alloc();
+    if ( newMailboxName )
+        {
+        delete iMailboxName;
+        iMailboxName = newMailboxName;
+        }
+    }
+
+// ---------------------------------------------------------
 // CMailMailboxDetails::ConstructL
 // ---------------------------------------------------------
 //
--- a/emailservices/emailserver/cmailhandlerplugin/src/emailsoundhandler.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailservices/emailserver/cmailhandlerplugin/src/emailsoundhandler.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -226,15 +226,26 @@
     MProfile* profile = iProfileEngine->ActiveProfileL();
     CleanupReleasePushL( *profile );
 
+    TBool vibraEnabled = profile->ProfileTones().ToneSettings().iEmailVibratingAlert;
+
+
+    TInt preference = KAudioPrefNewSMS;
+    if ( !vibraEnabled )
+        {
+        preference = EMdaPriorityPreferenceTimeAndQuality;
+        }
+
     if ( IsBeepOnceSetL( *profile ) )
         {
+        
+        
         // create audio player based on hard coded sequence
         // (Platform does not offer any "play platform-wide beep" service)
         iAudioPlayer = CMdaAudioPlayerUtility::NewDesPlayerReadOnlyL(
             KEmailBeepSequence(),
             *this, 
             KAudioPriorityRecvMsg, 
-            static_cast<TMdaPriorityPreference>( KAudioPrefNewSMS ) );
+            preference );
         }
     else
         {
@@ -272,7 +283,7 @@
                 fileToPlay,
                 *this, 
                 KAudioPriorityRecvMsg, 
-                static_cast<TMdaPriorityPreference>( KAudioPrefNewSMS ) );
+                static_cast<TMdaPriorityPreference>( preference ) );
         }
     CleanupStack::PopAndDestroy( profile );  // profile
     }
--- a/emailuis/emailui/data/FreestyleEmailUi.rss	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/data/FreestyleEmailUi.rss	Tue Jan 26 11:45:42 2010 +0200
@@ -2372,6 +2372,8 @@
 RESOURCE TBUF r_fse_viewer_attachments_list_downloading { buf=qtn_fse_viewer_attachments_downloading; }
 RESOURCE TBUF r_fse_viewer_attachments_list_downloaded_100 { buf=qtn_fse_viewer_attachments_downloaded_100; } 
 RESOURCE TBUF r_fse_viewer_attachments_list_downloading_cancelled { buf=qtn_fse_viewer_attachments_downloading_cancelled; } 
+RESOURCE TBUF r_fse_viewer_attachments_list_download { buf=qtn_fse_viewer_attachments_download_prefix; } 
+RESOURCE TBUF r_fse_viewer_attachments_list_download_cancelled { buf=qtn_fse_viewer_attachments_download_cancelled_prefix; } 
 RESOURCE TBUF r_fse_viewer_attachments_list_manager_link { buf=qtn_fse_viewer_attachments_list_manager_link; }
 RESOURCE TBUF r_fse_viewer_attachments_header_download_manager { buf=qtn_fse_viewer_attachments_header_download_manager; }
 RESOURCE TBUF r_fse_viewer_note_attachment_downloading_progress { buf=qtn_fse_viewer_note_attachment_downloading_progress; }
--- a/emailuis/emailui/group/FreestyleEmailUi.mmp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/group/FreestyleEmailUi.mmp	Tue Jan 26 11:45:42 2010 +0200
@@ -108,7 +108,7 @@
 SOURCE  FreestyleMessageHeaderHTML.cpp
 SOURCE  FreestyleMessageHeaderURLFactory.cpp
 SOURCE  FreestyleMessageHeaderURLEventHandler.cpp
-SOURCE  FreestyleAttachmentDownloadProgressBar.cpp
+SOURCE  FreestyleEmailUiAknStatusIndicator.cpp
 SOURCE  FreestyleEmailUiPropertySubscriber.cpp
 SOURCE  freestyleemailuimailboxdeleter.cpp
 SOURCE  cmailcustomstatuspaneindicators.cpp
--- a/emailuis/emailui/inc/FSHtmlReloadAO.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/inc/FSHtmlReloadAO.h	Tue Jan 26 11:45:42 2010 +0200
@@ -2,9 +2,9 @@
 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/emailui/inc/FreestyleEmailUiAknStatusIndicator.h	Tue Jan 26 11:45:42 2010 +0200
@@ -0,0 +1,101 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*/ 
+
+
+#ifndef __FREESTYLEEMAILUI_AKN_STATUS_INDICATOR_H__
+#define __FREESTYLEEMAILUI_AKN_STATUS_INDICATOR_H__
+
+#include <coecntrl.h>
+
+#include "FreestyleEmailUiUtilities.h"  // FSEmailUiGenericTimer
+
+const TInt KStatusIndicatorAutomaticHidingDuration = 3000;
+const TInt KStatusIndicatorDefaultDuration = -1;
+
+class CFreestyleEmailUiAknStatusIndicator : public CCoeControl,
+                                            protected MFSEmailUiGenericTimerCallback
+    {
+public:
+    IMPORT_C static CFreestyleEmailUiAknStatusIndicator* NewL( const TRect& aRect, const CCoeControl* aParent = NULL );
+    
+    IMPORT_C static CFreestyleEmailUiAknStatusIndicator* NewLC( const TRect& aRect, const CCoeControl* aParent = NULL );
+    
+    ~CFreestyleEmailUiAknStatusIndicator();
+    
+    // The ownships of aBitmap, aMaskBitmap and aText are transferred in.
+    // The status indicator is display for aDuration millisecond if aDuration is not negative;
+    // otherwise, it is diplayed forever until it is manually hidden.
+    void ShowIndicatorL( CFbsBitmap* aBitmap, 
+                         CFbsBitmap* aMaskBitmap,
+                         TDesC* aText,
+                         TInt aDuration );
+
+    void HideIndicator( TInt aDelayBeforeHidingInMs = 0 );
+    
+    // The ownship of aText is transferred in.
+    void SetTextL( TDesC* aText );
+    
+    // CCoeControl
+    CCoeControl* ComponentControl( TInt aIndex ) const;
+    TInt CountComponentControls() const;
+    void Draw( const TRect& aRect ) const;
+    void SizeChanged();
+    
+    inline const CFbsBitmap* Image() const 
+        {
+        return iBitmap;
+        }
+    
+    inline const CFbsBitmap* ImageMask() const 
+        {
+        return iMaskBitmap;
+        }
+    
+    inline const TDesC* Text() const
+        {
+        return iText;
+        }
+    
+protected:    
+    CFreestyleEmailUiAknStatusIndicator();
+    void ConstructL( const TRect& aRect, const CCoeControl* aParent );
+
+    void TimerEventL( CFSEmailUiGenericTimer* aTriggeredTimer );
+
+private:
+    void CalculateLayout( const TRect& aRect ) const;
+    
+    void SetTextFont() const;
+    void CalculateVisualText() const;
+
+    void DrawBoundary( const TRect& aRect ) const;
+    void DrawImage( const TRect& aRect ) const;
+    void DrawText( const TRect& aRect ) const;
+    
+    void SetImage( CFbsBitmap* aBitmap, CFbsBitmap* aMaskBitmap );
+    void ScaleImage() const;
+    
+    void ClearImage();
+    void ClearText();
+    
+private:
+    CFbsBitmap*                 iBitmap; 
+    CFbsBitmap*                 iMaskBitmap;
+    TDesC*                      iText;
+
+    CFSEmailUiGenericTimer*     iTimer;
+    
+    mutable TRect               iImageRect;
+    mutable TRect               iTextRect;
+    
+    mutable HBufC*              iVisualText;
+    mutable CFont*              iTextFont;
+    };
+
+#endif // __FREESTYLEEMAILUI_AKN_STATUS_INDICATOR_H__
--- a/emailuis/emailui/inc/FreestyleEmailUiAppui.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiAppui.h	Tue Jan 26 11:45:42 2010 +0200
@@ -211,6 +211,7 @@
 
 	void SubscribeMailboxL( TFSMailMsgId aActiveMailboxId );
 	void SetActiveMailboxL( TFSMailMsgId aActiveMailboxId, TBool aAutoSync = ETrue );
+	void StartMonitoringL();
 	CMsvSession* GetMsvSession();
 
 	TFSMailMsgId GetActiveBoxInboxId();
--- a/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerContainer.h	Tue Jan 26 11:45:42 2010 +0200
@@ -31,6 +31,8 @@
 class CFSMailMessage;
 class CFreestyleEmailUiAppUi;
 class CFreestyleMessageHeaderURLEventHandler;
+class CFreestyleEmailUiAknStatusIndicator;
+struct TAttachmentData;
 
 /**
  * Html viewer container.
@@ -110,6 +112,11 @@
      * changed
      */
     void ReloadPageL();
+    
+    void ShowAttacthmentDownloadStatusL( TFSProgress::TFSProgressStatus aProgressStatus, const TAttachmentData& aAttachmentData );
+    TBool AttacthmentDownloadStatusVisible();
+    void HideAttacthmentDownloadStatus();
+    
 private:
 
     // Second phase constructor.
@@ -174,6 +181,7 @@
     CBrCtlInterface* FindWindowL( const TDesC& aTargetName ) const;  
     void HandleWindowCommandL( const TDesC& aTargetName, TBrCtlWindowCommand aCommand ); 
        
+    TRect CalcAttachmentStatusRect();
 
 private: // data
 
@@ -207,6 +215,8 @@
     TInt iScrollPosition;
     COverlayControl* iOverlayControlNext;
     COverlayControl* iOverlayControlPrev;
+
+    CFreestyleEmailUiAknStatusIndicator* iAttachmentStatus;
     };
 
 
--- a/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h	Tue Jan 26 11:45:42 2010 +0200
@@ -36,7 +36,6 @@
 class CFreestyleEmailUiAppUi;
 class CFsEmailUiHtmlViewerContainer;
 class CFreestyleMessageHeaderURL;
-class CFreestyleAttachmentDownloadProgressBar;
 class CAknWaitDialog; //<cmail>
 class CFlagSelectionNoteHandler;
 class CAknGlobalListQuery;
@@ -277,7 +276,6 @@
     CFSMailMessage* iMessage;
     THtmlViewerActivationData iActivationData;
     CFSEmailUiAttachmentsListModel* iAttachmentsListModel;
-    CFreestyleAttachmentDownloadProgressBar* iProgressBar;
 
     // Stack of open messages. Messages are owned by this stack. 
     CStack<CFSMailMessage, ETrue>* iOpenMessages;
--- a/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleEmailUiMailListVisualiser.h	Tue Jan 26 11:45:42 2010 +0200
@@ -2,9 +2,9 @@
 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
@@ -75,11 +75,146 @@
 class CDateChangeTimer;
 class CFsTreePlainTwoLineItemData;
 class CFsTreePlainTwoLineItemVisualizer;
-//<cmail>
 class CEUiEmailListTouchManager;
-//</cmail>
+class MFSMailIterator;
 class CAknStylusPopUpMenu;
 
+/**
+ * CMailListModelUpdater
+ *
+ * Asynchronous mail list updater.
+ *
+ */
+class CMailListModelUpdater : public CActive
+    {
+private:
+
+    // Updater state
+    enum TState
+        {
+        // Idle state. Updater is doing nothing.
+        EIdle,
+        // Initializing state. Get ready for the update.
+        EInitialize,
+        // Fetching state. Fetch the messages for the model.
+        EFetch,
+        // Finalizing state. Model update done.
+        EFinalize
+        };
+
+public:
+
+    // Updater observer
+    class MObserver
+        {
+    public:
+        /**
+         * Called when an error has occured.
+         */
+        virtual void UpdateErrorL(TInt aError) = 0;
+
+        /**
+         * Called when update begins.
+         */
+        virtual void UpdateBeginL() = 0;
+
+        /**
+         * Called when new messages fetched.
+         */
+        virtual void UpdateProgressL(TFsTreeItemId& aParentId, RPointerArray<CFSMailMessage>& aMessages) = 0;
+
+        /**
+         * Called when update is completed.
+         */
+        virtual void UpdateCompleteL() = 0;
+
+        /**
+         * Update cancelled.
+         * @param aForceRefresh If ETrue, model will be fully refreshed on next activation.
+         */
+        virtual void UpdateCancelled(const TBool aForceRefresh) = 0;
+        };
+
+public:
+
+    /**
+     * Constructor
+     */
+    CMailListModelUpdater();
+
+    /**
+     * Destructor
+     */
+    ~CMailListModelUpdater();
+
+public:
+
+    /**
+     * Reference to sorting criteria array.
+     */
+    RArray<TFSMailSortCriteria>& Sorting();
+
+    /**
+     * Update model.
+     */
+    void UpdateModelL(MObserver& aObserver, MFSMailIterator* aIterator);
+
+    /**
+     * Returns ETrue if updating.
+     */
+    TBool IsUpdating() const;
+
+public: // from CActive
+
+    /**
+     * @see CActive::RunL
+     */
+    void RunL();
+
+    /**
+     * @see CActive::DoCancel
+     */
+    void DoCancel();
+
+private:
+
+    /**
+     * Signal self with given error code and set a new state.
+     */
+    void Signal(TState aState, TInt aError = KErrNone);
+
+    /**
+     * Initialize update.
+     */
+    void InitializeL();
+
+    /**
+     * Fetch one step.
+     */
+    void FetchL();
+
+    /**
+     * Finalize update.
+     */
+    void FinalizeL();
+
+    /**
+     * Reset to uninitialized state.
+     */
+    void Reset();
+
+private:
+
+    RArray<TFSMailSortCriteria> iSorting;
+    TFSMailMsgId iId;
+    TState iState;
+    TInt iItemsFetched;
+    MObserver* iObserver;
+    MFSMailIterator* iIterator;
+    TFsTreeItemId iParentId;
+    TInt iBlockSize;
+    };
+
 struct SMailListItem
 	{
 	TFsTreeItemId iListItemId;
@@ -122,7 +257,8 @@
 									 public MFSEmailUiFolderListCallback,
 									 public MFSEmailUiSortListCallback,
 									 public MFsTreeListObserver,
-									 public MFSEmailUiContactHandlerObserver
+									 public MFSEmailUiContactHandlerObserver,
+									 public CMailListModelUpdater::MObserver
 // </cmail>
 	{
 friend class CMailListUpdater;
@@ -310,6 +446,8 @@
     void InsertNewMessageL( CFSMailMessage* aNewMessage, const TBool aAllowRefresh ); // ownership is transferred
 
     void RefreshListItemsL();
+    void RefreshListItemsL(TFsTreeItemId& aLatestNodeId,
+        const TInt aStartIndex, const TInt aEndIndex);
     // Refresh the list order only
     void RefreshOrderL();
 
@@ -325,7 +463,35 @@
     // Omitting the argument aChildIdx causes the new item to be appended as last child of the node.
     TFsTreeItemId InsertListItemL( TInt aModelIndex, TFsTreeItemId aParentNodeId, TInt aChildIdx = KErrNotFound, TBool aAllowRefresh = ETrue );
 
+    // from CMailListModelUpdater::MObserver
+
+    /**
+     * @see CMailListModelUpdater::MObserver::UpdateErrorL
+     */
+    void UpdateErrorL(TInt aError);
+
+    /**
+     * @see CMailListModelUpdater::MObserver::UpdateBeginL
+     */
+    void UpdateBeginL();
+
+    /**
+     * @see CMailListModelUpdater::MObserver::UpdateProgressL
+     */
+    void UpdateProgressL(TFsTreeItemId& aParentId, RPointerArray<CFSMailMessage>& aMessages);
+
+    /**
+     * @see CMailListModelUpdater::MObserver::UpdateCompleteL
+     */
+    void UpdateCompleteL();
+
+    /**
+     * @see CMailListModelUpdater::MObserver::UpdateCancelled
+     */
+    void UpdateCancelled(const TBool aForceRefresh);
+
 	// Mail model update
+    void UpdateMailListModelAsyncL();
 	void UpdateMailListModelL();
 	void CreateModelItemsL( RPointerArray<CFSMailMessage>& aMessages );
 
@@ -616,7 +782,9 @@
     // Was focus visible in the ListView.
     TBool iLastFocus;
     //used to prevent Call application execution (on keyup of call button) when call to contact required
-    TBool iConsumeStdKeyYes_KeyUp; 
+    TBool iConsumeStdKeyYes_KeyUp;
+    CMailListModelUpdater* iMailListModelUpdater;
+    TBool iForceRefresh;
   	};
 
 
@@ -668,12 +836,14 @@
     ~CDateChangeTimer();
     void Start();
     void RunL();
-
+    TInt DayCount();
+    
 protected:
     CDateChangeTimer( CFSEmailUiMailListVisualiser& aMailListVisualiser );
 
 private:
     CFSEmailUiMailListVisualiser& iMailListVisualiser;
+    TInt iDayCount;
     };
 
 #endif
--- a/emailuis/emailui/inc/FreestyleMessageHeaderHTML.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/inc/FreestyleMessageHeaderHTML.h	Tue Jan 26 11:45:42 2010 +0200
@@ -2,9 +2,9 @@
 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
--- a/emailuis/emailui/inc/OverlayControl.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/inc/OverlayControl.h	Tue Jan 26 11:45:42 2010 +0200
@@ -2,9 +2,9 @@
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
--- a/emailuis/emailui/inc/ncsheadercontainer.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/inc/ncsheadercontainer.h	Tue Jan 26 11:45:42 2010 +0200
@@ -342,6 +342,13 @@
     TBool IsAddressInputField( const CCoeControl* aControl ) const;
 
     TBool IsRemoteSearchInprogress() const;
+    
+    /**
+     * Shows/hides cursor.
+     * 
+     * @param aShow ETrue - shows, EFalse - hides cursor.
+     */
+    void ShowCursor( TBool aShow );
 private: // Function members
 
 	void FocusChanged(TDrawNow aDrawNow);
@@ -430,6 +437,9 @@
     
     TBool iLongTapEventConsumed;
     TBool iRALInProgress;
+    
+    // Currently focused control
+    CCoeControl* iFocused;
     };
 
 
--- a/emailuis/emailui/loc/freestyleemailui.loc	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/loc/freestyleemailui.loc	Tue Jan 26 11:45:42 2010 +0200
@@ -1916,6 +1916,36 @@
 //
 #define qtn_fse_viewer_note_attachment_restart_downloading "Downloading cancelled. Restart downloading?"
 
+// d:Download status item in the html email viewer
+// l:list_single_cmail_header_detail_pane_t1
+// d:%0U stands for the name of the attachment
+// d:%1U stands for the percent of attachment file which has been downloaded.
+// r:TB9.1
+//
+#define qtn_fse_viewer_attachments_download "%0U %1N%"
+
+// d:Download status item in the html email viewer
+// l:list_single_cmail_header_detail_pane_t1
+// d:%0U stands for the percent of attachment file which has been downloaded.
+// d:%1U stands for the name of the attachment
+// r:TB9.1
+//
+#define qtn_fse_viewer_attachments_download_prefix "%0N% %1U"
+
+// d:Download status item in the html email viewer when download is cancelled
+// l:list_single_cmail_header_detail_pane_t1
+// d:%0U stands for the name of the attachment
+// r:TB9.1
+//
+#define qtn_fse_viewer_attachments_download_cancelled "%0U cancelled"
+
+// d:Download status item in the html email viewer when download is cancelled
+// l:list_single_cmail_header_detail_pane_t1
+// d:%0U stands for the name of the attachment
+// r:TB9.1
+//
+#define qtn_fse_viewer_attachments_download_cancelled_prefix "cancelled %0U"
+
 // d:Menu component in attachment list which opens the download manager
 // l:list_single_cmail_header_detail_pane_t1
 // r:TB9.1
--- a/emailuis/emailui/src/FSHtmlReloadAO.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/FSHtmlReloadAO.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -2,9 +2,9 @@
 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
--- a/emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -233,18 +233,24 @@
 		if ( aEvent.iProgressStatus ==
 			 TFSProgress::EFSStatus_RequestComplete && !aEvent.iError )
 			{
-			// Show "Download completed" if necessary
-			if ( CompletionNotesInUseL() && completedDownloadsToNotify )
-				{
-				LaunchDownloadCompleteNoteL( download.iPartData,
-					completedDownloadsToNotify );
-				}
             // Notification of saved attachments may be given if all downloads of the given message has been completed.
             if ( download.iNotifyComplete && countObject.iDownloadsCompletedCount &&
-                 countObject.iDownloadsCompletedCount == countObject.iDownloadsStartedCount )
+                 countObject.iDownloadsCompletedCount == countObject.iDownloadsStartedCount &&
+                 countObject.iSaveRequestedCount > 0 )
                  {
                  TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( countObject.iSaveRequestedCount );
                  }        
+            // Show "Download completed" if necessary
+            else if ( CompletionNotesInUseL() && completedDownloadsToNotify )
+                {
+                LaunchDownloadCompleteNoteL( download.iPartData,
+                    completedDownloadsToNotify );
+                }
+            else if ( download.iNotifyComplete &&
+                      countObject.iSaveRequestedCount == 0 )
+                {
+                TFsEmailUiUtility::OpenAttachmentL( download.iPartData );
+                }
 			}
 	    // </cmail>
         }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/emailui/src/FreestyleEmailUiAknStatusIndicator.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -0,0 +1,308 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of the License "Symbian Foundation License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+*/ 
+
+#include "FreestyleEmailUiAknStatusIndicator.h"
+
+#include <biditext.h>
+#include <akniconutils.h>
+#include <aknbiditextutils.h>
+
+const TInt KImageMargin = 8;
+const TInt KTextMargin = 4;
+const TInt KRoundBoundaryEllipse = 5;
+const TInt KTuncationCharsWidth = 20;    
+
+
+CFreestyleEmailUiAknStatusIndicator* CFreestyleEmailUiAknStatusIndicator::NewL( const TRect& aRect, const CCoeControl* aParent )
+    {
+    CFreestyleEmailUiAknStatusIndicator* self = CFreestyleEmailUiAknStatusIndicator::NewLC( aRect, aParent );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CFreestyleEmailUiAknStatusIndicator* CFreestyleEmailUiAknStatusIndicator::NewLC( const TRect& aRect, const CCoeControl* aParent )
+    {
+    CFreestyleEmailUiAknStatusIndicator* self = new (ELeave) CFreestyleEmailUiAknStatusIndicator();
+    CleanupStack::PushL( self );
+    self->ConstructL( aRect, aParent );
+    return self;
+    }
+
+CFreestyleEmailUiAknStatusIndicator::~CFreestyleEmailUiAknStatusIndicator()
+    {
+    ClearImage();
+    ClearText();
+    
+    delete iTimer;
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::ShowIndicatorL( CFbsBitmap* aBitmap, 
+                                                          CFbsBitmap* aMaskBitmap,
+                                                          TDesC* aText,
+                                                          TInt aDuration )
+    {
+    iTimer->Stop();
+
+    SetImage( aBitmap, aMaskBitmap );
+    SetTextL( aText );
+
+    MakeVisible( ETrue );
+    DrawNow();
+    
+    if ( aDuration >= 0 )
+        {
+        HideIndicator( aDuration );
+        }
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::SetTextL( TDesC* aText )
+    {
+    SetTextFont();
+
+    ClearText();    
+    iText = aText; 
+    if ( iText )
+        {
+        iVisualText = HBufC::NewL( iText->Length() + KAknBidiExtraSpacePerLine );
+        CalculateVisualText();
+        }    
+    
+    if ( IsVisible() )
+        {
+        DrawNow();
+        }
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::HideIndicator( TInt aDelayBeforeHidingInMs )
+    {
+    iTimer->Stop();
+    
+    if ( aDelayBeforeHidingInMs == 0 )
+        {
+        MakeVisible( EFalse );
+        }
+    else
+        {
+        iTimer->Start( aDelayBeforeHidingInMs );
+        }
+    }
+
+CCoeControl* CFreestyleEmailUiAknStatusIndicator::CFreestyleEmailUiAknStatusIndicator::ComponentControl( TInt /*aIndex*/ ) const
+    {
+    return NULL;
+    }
+
+TInt CFreestyleEmailUiAknStatusIndicator::CountComponentControls() const
+    {
+    return 0;
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::Draw( const TRect& aRect ) const
+    {
+    CWindowGc& gc = SystemGc();
+    gc.Clear( aRect );
+    
+    DrawBoundary( aRect );
+    DrawImage( iImageRect );
+    DrawText( iTextRect );
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::SizeChanged()
+    {  
+    CalculateLayout( Rect() );
+    ScaleImage();
+    CalculateVisualText();
+    }
+    
+CFreestyleEmailUiAknStatusIndicator::CFreestyleEmailUiAknStatusIndicator()
+    : iBitmap( NULL ),
+    iMaskBitmap( NULL ),
+    iText( NULL ),
+    iVisualText( NULL ),
+    iTextFont( NULL )
+    {    
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::ConstructL( const TRect& aRect, const CCoeControl* aParent )
+    {
+    iTimer = CFSEmailUiGenericTimer::NewL( this ); 
+    
+    if ( !aParent )
+        {
+        CreateWindowL();
+        }
+    else
+        {
+        SetContainerWindowL( *aParent );
+        }
+    
+    SetRect( aRect );
+    ActivateL();
+    
+    MakeVisible( EFalse );
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::TimerEventL( CFSEmailUiGenericTimer* /*aTriggeredTimer*/ )
+    {
+    HideIndicator();
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::CalculateLayout( const TRect& aRect ) const
+    {
+    TSize imageSize = aRect.Size();
+    imageSize.iHeight = imageSize.iHeight - 2 * KImageMargin;
+    imageSize.iWidth = imageSize.iWidth - 2 * KImageMargin;
+    if ( imageSize.iWidth > imageSize.iHeight )
+        {
+        imageSize.iWidth = imageSize.iHeight;
+        }
+    else
+        {
+        imageSize.iHeight = imageSize.iWidth;
+        }
+    
+    TSize textSize = aRect.Size();
+    textSize.iHeight = textSize.iHeight - 2 * KTextMargin;
+    textSize.iWidth = textSize.iWidth - 2 * KTextMargin - 2 * KImageMargin - imageSize.iWidth;
+    
+    TLanguage language = User::Language();
+    TBidiText::TDirectionality  direction = TBidiText::ScriptDirectionality( language );    
+    if ( direction == TBidiText::ELeftToRight )
+        {
+        TPoint imageLeftTop ( aRect.iTl.iX + KImageMargin, aRect.iTl.iY + KImageMargin );
+        iImageRect.SetRect( imageLeftTop, imageSize );    
+        
+        TPoint textLeftTop ( aRect.iTl.iX + 2*KImageMargin + imageSize.iWidth + KTextMargin, aRect.iTl.iY + KTextMargin );
+        iTextRect.SetRect( textLeftTop, textSize );    
+        }
+    else
+        {
+        TPoint imageLeftTop ( aRect.iBr.iX - KImageMargin - imageSize.iWidth, aRect.iTl.iY + KImageMargin );
+        iImageRect.SetRect( imageLeftTop, imageSize );    
+        
+        TPoint textLeftTop ( aRect.iTl.iX + KTextMargin, aRect.iTl.iY + KTextMargin );
+        iTextRect.SetRect( textLeftTop, textSize );    
+        }
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::SetTextFont() const
+    {
+    if ( iTextFont )
+        return;
+    
+    const CFont* font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont );
+    iTextFont = CONST_CAST( CFont*, font );
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::CalculateVisualText() const
+    {
+    if ( iVisualText )
+        {
+        TPtr visualText = iVisualText->Des();
+        visualText.Zero();
+        TInt MaxWidthInPixels = iTextRect.Size().iWidth - KTuncationCharsWidth;
+        TInt MaxClippedWidthInPixels = iTextRect.Size().iWidth;
+        AknBidiTextUtils::ConvertToVisualAndClip( *iText,
+                                                  visualText,
+                                                  *iTextFont,
+                                                  MaxWidthInPixels,
+                                                  MaxClippedWidthInPixels );    
+        }
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::DrawBoundary( const TRect& aRect ) const
+    {
+    CWindowGc& gc = SystemGc();
+    gc.SetPenColor( KRgbCyan );
+    TSize ellipse( KRoundBoundaryEllipse, KRoundBoundaryEllipse );
+    gc.DrawRoundRect( aRect, ellipse);
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::DrawImage( const TRect& aRect ) const
+    {
+    if ( !iBitmap )
+        return;
+    
+    CWindowGc& gc = SystemGc();
+    if ( iMaskBitmap )
+        {
+        TRect bmpPieceRect(TPoint(0,0), aRect.Size() ); 
+        gc.BitBltMasked( aRect.iTl, iBitmap, bmpPieceRect, iMaskBitmap, EFalse );
+        }
+    else
+        {
+        gc.DrawBitmap( aRect, iBitmap );
+        }
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::DrawText( const TRect& aRect ) const
+    {
+    if ( !iVisualText )
+        return;
+    if ( iVisualText->Length() == 0 )
+        return;
+    
+    TLanguage language = User::Language();
+    TBidiText::TDirectionality  direction = TBidiText::ScriptDirectionality( language );
+    
+    CGraphicsContext::TTextAlign alignment = CGraphicsContext::ELeft;
+    if ( direction == TBidiText::ERightToLeft )
+        {
+        alignment = CGraphicsContext::ERight;
+        }
+    
+    CWindowGc& gc = SystemGc();
+    gc.UseFont( iTextFont );
+
+    TInt baseline = aRect.Height() / 2 + iTextFont->FontMaxAscent() / 2; 
+    
+    gc.SetPenColor(KRgbBlack);
+
+    gc.DrawText( *iVisualText, aRect, baseline, alignment, 0);
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::SetImage( CFbsBitmap* aBitmap, CFbsBitmap* aMaskBitmap )
+    {
+    ClearImage();
+    iBitmap = aBitmap;
+    iMaskBitmap = aMaskBitmap;
+    ScaleImage();
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::ScaleImage() const
+    {
+    if ( iBitmap )
+        {
+        AknIconUtils::DisableCompression( iBitmap );
+        AknIconUtils::SetSize( iBitmap, iImageRect.Size(), EAspectRatioPreserved );
+        }
+    if ( iMaskBitmap )
+        {
+        AknIconUtils::DisableCompression( iMaskBitmap );
+        AknIconUtils::SetSize( iMaskBitmap, iImageRect.Size(), EAspectRatioPreserved );
+        }    
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::ClearImage()
+    {
+    delete iBitmap;
+    iBitmap = NULL;
+    delete iMaskBitmap;
+    iMaskBitmap = NULL;
+    }
+
+void CFreestyleEmailUiAknStatusIndicator::ClearText()
+    {
+    delete iText;
+    iText = NULL;
+    
+    delete iVisualText;
+    iVisualText = NULL;
+    }
+
--- a/emailuis/emailui/src/FreestyleEmailUiAppui.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiAppui.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -1539,29 +1539,39 @@
 
 	// Start connect automatically if asked by the caller
 	// Disabled if offline or roaming
-	if ( aAutoSync && !TFsEmailUiUtility::IsOfflineModeL() )
-		{
-		// Create at first auto-connect, autosync monitor will check whether
-		// it is ok to start auto-connect, e.g. phone is not roaming, searching for net, etc
-		if ( !iAutoSyncMonitor )
-			{
-			// TRAP following since failing to create auto sync monitor should not prevent user
-			// from opening mail list, leave only in OOM case.
-			TRAPD( err, iAutoSyncMonitor = CFSEmailUiAutosyncMonitor::NewL( *this ) );
-			if ( err == KErrNoMemory )
-				{
-				User::Leave( err );
-				}
-			}
-		// Request auto sync if allowed in the current network mode and
-		// autosyncmonitor has been succesfully created
-		if ( iAutoSyncMonitor )
-			{
-			iAutoSyncMonitor->StartMonitoring();
-			}
-		}
+    if ( aAutoSync )
+        {
+        StartMonitoringL();
+        }
 	}
 
+void CFreestyleEmailUiAppUi::StartMonitoringL()
+    {
+    FUNC_LOG;
+    // Start connect automatically if asked by the caller
+    // Disabled if offline or roaming
+    if ( !TFsEmailUiUtility::IsOfflineModeL() )
+        {
+        // Create at first auto-connect, autosync monitor will check whether
+        // it is ok to start auto-connect, e.g. phone is not roaming, searching for net, etc
+        if ( !iAutoSyncMonitor )
+            {
+            // TRAP following since failing to create auto sync monitor should not prevent user
+            // from opening mail list, leave only in OOM case.
+            TRAPD( err, iAutoSyncMonitor = CFSEmailUiAutosyncMonitor::NewL( *this ) );
+            if ( err == KErrNoMemory )
+                {
+                User::Leave( err );
+                }
+            }
+        // Request auto sync if allowed in the current network mode and
+        // autosyncmonitor has been succesfully created
+        if ( iAutoSyncMonitor )
+            {
+            iAutoSyncMonitor->StartMonitoring();
+            }
+        }
+    }
 
 void CFreestyleEmailUiAppUi::DoAutoConnectL()
 	{
@@ -2740,10 +2750,7 @@
 void CFSEmailUiAutosyncMonitor::StartMonitoring()
     {
     FUNC_LOG;
-    if ( IsActive() )
-        {
         Cancel();
-        }
 #ifdef __WINS__ // do not try to connect on the emulator
     iRegisterationStatus = RMobilePhone::ERegisteredOnHomeNetwork;
     TRequestStatus* status = &iStatus;
--- a/emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiAttachmentsListModel.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -495,7 +495,13 @@
 			KFsTreeNoneID,
 			partData
 			};
-		attachment.downloadProgress = KComplete;
+		
+		// if not fully fetched than restart download;
+		if (IsCompletelyDownloadedL(attachment))
+			attachment.downloadProgress = KComplete;
+		else
+			attachment.downloadProgress = KNone;
+		
 		iAttachments.Append( attachment );
 		}
 	CleanupStack::PopAndDestroy( &mailParts );
--- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerContainer.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -22,6 +22,10 @@
 #include <commdbconnpref.h>
 #include <bautils.h>
 #include <biditext.h>
+#include <stringloader.h>
+#include <e32base.h>
+#include <badesca.h>
+
 //<cmail>
 #include "CFSMailMessage.h"
 //</cmail>
@@ -29,6 +33,8 @@
 #include <sysutil.h>
 #include <SchemeHandler.h>
 
+#include <FreestyleEmailUi.rsg>
+
 #include "FreestyleEmailUiAppui.h"
 #include "FreestyleEmailUiUtilities.h"
 #include "FreestyleEmailUiHtmlViewerContainer.h"
@@ -37,6 +43,8 @@
 
 #include "FreestyleMessageHeaderHTML.h"
 #include "FreestyleMessageHeaderURLEventHandler.h"
+#include "FreestyleEmailUiAknStatusIndicator.h"
+#include "FreestyleEmailUiAttachmentsListModel.h"
 
 _LIT( KContentIdPrefix, "cid:" );
 _LIT( KCDrive, "c:" );
@@ -72,6 +80,7 @@
 _LIT8( KHtmlAmpersand, "&amp;" );
 _LIT8( KHtmlQuotation, "&quot;" );
 _LIT8( KHtmlLinkTag, "<a href=\"%S\">" );
+_LIT8( KHtmlLinkTagWWW, "<a href=\"%S%S\">" );
 _LIT8( KHtmlLinkEndTag, "</a>" );
 _LIT( KURLTypeBody, "body");
 
@@ -88,8 +97,10 @@
 const TReal KOverlayButtonMarginY = 0.01; // 1%
 const TReal KOverlayButtonSizeP = 0.15; // 15%
 const TReal KOverlayButtonSizeLs = 0.20; // 25%
-const TReal KOverlayButtonPosP = 0.88;
-const TReal KOverlayButtonPosLs = 0.85;
+
+
+const TInt KStatusIndicatorHeight = 50;
+const TInt KStatusIndicatorXMargin = 50;
 
 // ---------------------------------------------------------------------------
 // Two-phased constructor.
@@ -368,7 +379,7 @@
         }
     else
         {
-        CFSMailMessagePart* textBodyPart = iMessage->PlainTextBodyPartL();;
+        CFSMailMessagePart* textBodyPart = iMessage->PlainTextBodyPartL();
 
         if ( textBodyPart )
             {
@@ -444,6 +455,11 @@
             {
             return iBrCtlInterface;
             }
+        case 1:
+            if ( iAttachmentStatus )
+                return iAttachmentStatus;
+            else
+                return NULL;
         default:
             {
             return NULL;
@@ -458,7 +474,14 @@
 TInt CFsEmailUiHtmlViewerContainer::CountComponentControls() const
     {
     FUNC_LOG;
-    return 1;
+    if ( iAttachmentStatus )
+        {
+        return 2;
+        }
+    else 
+        {
+        return 1;
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -510,6 +533,12 @@
             }
     
     UpdateOverlayButtons( IsVisible() );
+    
+    if ( iAttachmentStatus )
+        {
+        TRect rect = CalcAttachmentStatusRect();
+        iAttachmentStatus->SetRect( rect );
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -1354,11 +1383,29 @@
                         if ( url.CompareC( KWww ) != KErrNone ) // if token=www., validate format 
                             {                                   // www.x
                             RBuf8 urlBuf;
-                            urlBuf.CreateL( KHtmlLinkTag().Length() + url.Length() * 2
-                                    + KHtmlLinkEndTag().Length() + KHtmlLineBreak().Length() );
+                            TBool wwwLink( EFalse );
+                            if ( url.Left( KWww().Length() ).CompareF( KWww ) == 0 )
+                                {
+                                wwwLink = ETrue;
+                                //Hyperlinks beginning with www. needs http:// prefix
+                                urlBuf.CreateL( KHtmlLinkTagWWW().Length() + url.Length() * 2
+                                        + KHtmlLinkEndTag().Length() + KHtmlLineBreak().Length() + KHttp().Length() );
+                                }                            
+                            else
+                                {
+                                urlBuf.CreateL( KHtmlLinkTag().Length() + url.Length() * 2
+                                        + KHtmlLinkEndTag().Length() + KHtmlLineBreak().Length() );                                
+                                }
                             urlBuf.CleanupClosePushL();
                             // Format html link
-                            urlBuf.AppendFormat( KHtmlLinkTag, &url );
+                            if ( wwwLink )
+                                {
+                                urlBuf.AppendFormat( KHtmlLinkTagWWW, &KHttp, &url );
+                                }
+                            else
+                                {
+                                urlBuf.AppendFormat( KHtmlLinkTag, &url );
+                                }
                             urlBuf.Append( url );
                             urlBuf.Append( KHtmlLinkEndTag );
                             if ( lineBreakPos != KErrNotFound )
@@ -1444,6 +1491,10 @@
                                   // boundaries, move to next segment
                                 nextPos += nextSegment.Length();
                                 nextSegment.Set( aSource.Ptr( nextPos ) );
+                                if( nextSegment.Length() == 0 )
+                                    {      
+                                    break;
+                                    }
                                 lexNextSegment.Assign( nextSegment );
                                 nextNextToken.Set( lexNextSegment.NextToken() );
                                 if ( firstPass )
@@ -1468,11 +1519,31 @@
                         if ( endOfUrlPos != KErrNotFound )
                             { // Handle hyperlink that is within 2K limit
                             RBuf8 urlBuf;
-                            urlBuf.CreateL( KHtmlLinkTag().Length() + url.Length() * 2
-                                    + KHtmlLinkEndTag().Length() + KHtmlLineBreak().Length() );
+                            TBool wwwLink( EFalse );
+
+                            if ( url.Left( KWww().Length() ).CompareF( KWww ) == 0 )
+                                {
+                                wwwLink = ETrue;
+                                urlBuf.CreateL( KHtmlLinkTagWWW().Length() + url.Length() * 2
+                                        + KHtmlLinkEndTag().Length() + KHtmlLineBreak().Length() + KHttp().Length() );
+                                }
+                            else
+                                {
+                                urlBuf.CreateL( KHtmlLinkTag().Length() + url.Length() * 2
+                                        + KHtmlLinkEndTag().Length() + KHtmlLineBreak().Length() );                                
+                                }
+
                             urlBuf.CleanupClosePushL();
-                            // Format html link
-                            urlBuf.AppendFormat( KHtmlLinkTag, &url );
+                            // Format html link                            
+                            if ( wwwLink )
+                                {
+                                urlBuf.AppendFormat( KHtmlLinkTagWWW, &KHttp, &url );
+                                }
+                            else
+                                {
+                                urlBuf.AppendFormat( KHtmlLinkTag, &url );
+                                }
+                            
                             urlBuf.Append( url );
                             urlBuf.Append( KHtmlLinkEndTag );
                             urlBuf.Append( KHtmlLineBreak );
@@ -1640,6 +1711,127 @@
     SetRect( iAppUi.ClientRect() );
     }
 
+void CFsEmailUiHtmlViewerContainer::ShowAttacthmentDownloadStatusL( 
+        TFSProgress::TFSProgressStatus aProgressStatus, 
+        const TAttachmentData& aAttachmentData )
+    {
+    TBool freshDraw = EFalse;
+    
+    if ( !iAttachmentStatus )
+        {
+        TRect rect = CalcAttachmentStatusRect();
+        iAttachmentStatus = CFreestyleEmailUiAknStatusIndicator::NewL( rect, this );
+        freshDraw = ETrue;
+        }    
+    
+    if ( !iAttachmentStatus->IsVisible() 
+         || ( aAttachmentData.downloadProgress == KNone ) 
+         || ( aProgressStatus == TFSProgress::EFSStatus_RequestCancelled ) )
+        {
+        freshDraw = ETrue;
+        }
+    
+    TInt duration = KStatusIndicatorDefaultDuration;
+    if ( ( aAttachmentData.downloadProgress == TFSProgress::EFSStatus_RequestComplete ) 
+         || ( aProgressStatus == TFSProgress::EFSStatus_RequestCancelled ) 
+         || ( aAttachmentData.downloadProgress == KComplete ) )
+        {
+        duration = KStatusIndicatorAutomaticHidingDuration;
+        }
+
+    HBufC* statusText = NULL;
+    switch ( aProgressStatus )
+        {
+        case TFSProgress::EFSStatus_Status:
+        case TFSProgress::EFSStatus_RequestComplete:
+            {
+            CDesCArray* descArray = new (ELeave) CDesCArrayFlat( 1 );
+            CleanupStack::PushL( descArray );
+            descArray->AppendL( aAttachmentData.fileName );
+            CArrayFix<TInt>* intArray = new (ELeave) CArrayFixFlat<TInt>( 1 );
+            CleanupStack::PushL( intArray );
+            intArray->AppendL( aAttachmentData.downloadProgress );
+            
+            statusText = StringLoader::LoadL( R_FSE_VIEWER_ATTACHMENTS_LIST_DOWNLOAD,
+                                              *descArray, 
+                                              *intArray );
+            CleanupStack::PopAndDestroy( intArray );
+            CleanupStack::PopAndDestroy( descArray );
+            CleanupStack::PushL( statusText );
+            }
+        break;
+        
+        case TFSProgress::EFSStatus_RequestCancelled:
+            {
+            statusText = aAttachmentData.fileName.AllocLC();
+            }
+        break;
+        
+        default:
+            statusText = KNullDesC().AllocLC();
+            break;
+        }
+
+    if ( statusText->Length() > 0 )
+        {
+        if ( freshDraw )
+            {
+            CFbsBitmap* image = NULL;
+            CFbsBitmap* imageMask = NULL;
+            if ( aProgressStatus == TFSProgress::EFSStatus_RequestCancelled )
+                {
+                iAppUi.FsTextureManager()->ProvideBitmapL(EAttachmentsCancelDownload, image, imageMask );
+                }
+            else
+                {
+                iAppUi.FsTextureManager()->ProvideBitmapL(EAttachmentsDownload, image, imageMask );
+                }
+            iAttachmentStatus->ShowIndicatorL( image, imageMask, statusText, duration );
+            }
+        else
+            {
+            iAttachmentStatus->SetTextL( statusText );
+            if ( duration > -1 )
+                {
+                iAttachmentStatus->HideIndicator( duration );
+                }
+            }
+        }
+    
+    CleanupStack::Pop( statusText );
+    }
+
+TBool CFsEmailUiHtmlViewerContainer::AttacthmentDownloadStatusVisible()
+    {
+    if ( iAttachmentStatus )
+        {
+        return iAttachmentStatus->IsVisible();
+        }
+    else
+        {
+        return EFalse;
+        }
+    }
+
+void CFsEmailUiHtmlViewerContainer::HideAttacthmentDownloadStatus()
+    {
+    if ( iAttachmentStatus )
+        {
+        iAttachmentStatus->MakeVisible( EFalse );
+        }
+    }
+
+TRect CFsEmailUiHtmlViewerContainer::CalcAttachmentStatusRect()
+    {
+    TRect rect = Rect();
+    TPoint topLeft = rect.iTl;
+    TPoint bottomRight = rect.iBr;
+    
+    TPoint statusTopLeft( topLeft.iX + KStatusIndicatorXMargin, bottomRight.iY - KStatusIndicatorHeight + 1 );
+    TPoint statusBottomRight( bottomRight.iX - KStatusIndicatorXMargin, bottomRight.iY );
+    return TRect( statusTopLeft, statusBottomRight );
+    }
+
 /**
  * The body fetch link is cmail://body/fetch. Look for the URL separator
  * and the presence of cmail and body on the url.
--- a/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -56,7 +56,6 @@
 #include "FreestyleEmailCenRepHandler.h"
 #include "FreestyleEmailUiAttachmentsListModel.h"
 #include "FreestyleEmailUiConstants.h"
-#include "FreestyleAttachmentDownloadProgressBar.h"
 #include "FSEmail.pan"
 #include "CFSMailCommon.h"
 
@@ -114,7 +113,6 @@
         }
     delete iContainer;
     delete iAttachmentsListModel;
-    delete iProgressBar;
 
     delete iOpenMessages;
     iOpenMessages = NULL;
@@ -125,9 +123,6 @@
     delete iMailBox; 
     iMailBox = NULL;
     delete iAsyncCallback;
-
-
-   
     }
 
 void CFsEmailUiHtmlViewerView::ConstructL()
@@ -451,6 +446,7 @@
 
     if ( iContainer )
         {
+        iContainer->HideAttacthmentDownloadStatus();
         iContainer->MakeVisible( EFalse );
         iAppUi.RemoveFromStack( iContainer );
         }
@@ -1655,6 +1651,10 @@
     else if ( aAttachment.downloadProgress != KComplete )
         {
         DownloadAttachmentL( aAttachment );
+        if ( iContainer && !iContainer->AttacthmentDownloadStatusVisible() )
+            {
+            iContainer->ShowAttacthmentDownloadStatusL( TFSProgress::EFSStatus_Status, aAttachment );
+            }
         }
     else
         {
@@ -1669,6 +1669,11 @@
         {
         TInt savedCount( 0 );
         TBool downloadRequired = iAttachmentsListModel->SaveAttachmentL( aAttachment, fileName, savedCount );
+        if ( downloadRequired && iContainer && !iContainer->AttacthmentDownloadStatusVisible() )
+            {
+            iContainer->ShowAttacthmentDownloadStatusL( TFSProgress::EFSStatus_Status, aAttachment );
+            }
+        
         if ( savedCount )
             {
             TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( savedCount );        
@@ -1682,6 +1687,18 @@
     if ( TFsEmailUiUtility::ShowSaveFolderDialogL( fileName ) )
         {
         TBool downloadRequired = iAttachmentsListModel->SaveAllAttachmentsL( fileName );
+        if ( downloadRequired && iContainer && !iContainer->AttacthmentDownloadStatusVisible() )
+            {
+            for ( TInt i = 0; i < iAttachmentsListModel->GetModel().Count(); i++ )
+                {
+                const TAttachmentData& attachment = iAttachmentsListModel->GetModel()[i];
+                if ( attachment.downloadProgress < KComplete )
+                    {
+                    iContainer->ShowAttacthmentDownloadStatusL( TFSProgress::EFSStatus_Status, attachment );
+                    break;
+                    }
+                }
+            }
         }
     }
 
@@ -1717,61 +1734,48 @@
     {
     FUNC_LOG;
     
-    if ( iMessage )
+    if ( !iMessage || !iContainer || ( aEvent.iError != KErrNone ) )
+        return;
+    
+    TAttachmentData* attachment = NULL;
+    const RArray<TAttachmentData>& attachments = iAttachmentsListModel->GetModel();
+    for ( TInt i=0; i < attachments.Count(); i++ )
         {
-        if ( !iProgressBar )
+        if ( attachments[i].partData == aPart )
             {
-            iProgressBar = CFreestyleAttachmentDownloadProgressBar::NewL();
+            attachment = CONST_CAST( TAttachmentData*, &iAttachmentsListModel->GetModel()[i] );
+            break;
             }
-        
-        for ( TInt i=0; i < iAttachmentsListModel->GetModel().Count(); i++ )
+        }
+    
+    if ( attachment )
+        {
+        switch ( aEvent.iProgressStatus )
             {
-            if ( iAttachmentsListModel->GetModel()[i].partData == aPart )
+            case TFSProgress::EFSStatus_Status:
                 {
-                TAttachmentData& attachment = CONST_CAST( TAttachmentData&, iAttachmentsListModel->GetModel()[i] );
-                
-                if ( aEvent.iError )
+                if ( aEvent.iMaxCount > 0 && aEvent.iCounter > 0 )
                     {
-                    iProgressBar->HideL();
+                    attachment->downloadProgress = KComplete * aEvent.iCounter / aEvent.iMaxCount;
                     }
                 else
                     {
-                    switch ( aEvent.iProgressStatus )
-                        {
-                        case TFSProgress::EFSStatus_Status:
-                            {
-                            if ( aEvent.iMaxCount > 0 && aEvent.iCounter > 0 )
-                                {
-                                attachment.downloadProgress = KComplete * aEvent.iCounter / aEvent.iMaxCount;
-                                }
-                            else
-                                {
-                                attachment.downloadProgress = KNone;
-                                }
-                            iProgressBar->UpdateL( attachment );
-                            }
-                        break;
-                        
-                        case TFSProgress::EFSStatus_RequestComplete:
-                            {
-                            attachment.downloadProgress = KComplete;
-                            iProgressBar->UpdateL( attachment );
-                            }
-                        break;
-                        
-                        case TFSProgress::EFSStatus_RequestCancelled:
-                            {
-                            iProgressBar->HideL();
-                            }
-                        break;
-                        
-                        default:                            
-                            break;
-                        }
+                    attachment->downloadProgress = KNone;
                     }
-                break;
+                }
+            break;
+            
+            case TFSProgress::EFSStatus_RequestComplete:
+                {
+                attachment->downloadProgress = KComplete;
                 }
+            break;
+            
+            default:
+                break;
             }
+        
+        iContainer->ShowAttacthmentDownloadStatusL( aEvent.iProgressStatus, *attachment );
         }
     }
 
--- a/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -2,9 +2,9 @@
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
@@ -97,7 +97,192 @@
 _LIT( KMissingPreviewDataMarker, "..." );
 
 static const TInt KMaxItemsFethed = 1000;
-static const TInt KCMsgBlock = 100;
+static const TInt KCMsgBlock = 15;
+static const TInt KCMsgMaxBlock = 120;
+
+// ---------------------------------------------------------------------------
+// Generic method for deleting a pointer and setting it NULL.
+// ---------------------------------------------------------------------------
+//
+template <class T> void SafeDelete(T*& ptr)
+    {
+    delete ptr;
+    ptr = NULL;
+    }
+
+// CMailListModelUpdater
+
+// ---------------------------------------------------------------------------
+// Constructor
+// ---------------------------------------------------------------------------
+//
+CMailListModelUpdater::CMailListModelUpdater() : CActive(EPriorityStandard)
+    {
+    CActiveScheduler::Add(this);
+    }
+
+// ---------------------------------------------------------------------------
+// Destructor
+// ---------------------------------------------------------------------------
+//
+CMailListModelUpdater::~CMailListModelUpdater()
+    {
+    iObserver = NULL;
+    Cancel();
+    iSorting.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Returns arrays for sorting parameters. Updater owns the arrays because
+// it has to stay alive as long as the iterator is being used.
+// ---------------------------------------------------------------------------
+//
+RArray<TFSMailSortCriteria>& CMailListModelUpdater::Sorting()
+    {
+    iSorting.Reset();
+    return iSorting;
+    }
+
+// ---------------------------------------------------------------------------
+// Update the mail list model from given iterator. Update progress will be
+// informed to the observer.
+// ---------------------------------------------------------------------------
+//
+void CMailListModelUpdater::UpdateModelL(MObserver& aObserver, MFSMailIterator* aIterator)
+    {
+    Cancel();
+    iObserver = &aObserver;
+    iIterator = aIterator;
+    Signal(EInitialize);
+    }
+
+// ---------------------------------------------------------------------------
+// Internal method. Sets new state and signals itself.
+// ---------------------------------------------------------------------------
+//
+void CMailListModelUpdater::Signal(TState aState, TInt aError)
+    {
+    iState = aState;
+    iStatus = KRequestPending;
+    SetActive();
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete(status, aError);
+    }
+
+// ---------------------------------------------------------------------------
+// Initialization state. Reset update and call UpdateBeginL() for the observer.
+// ---------------------------------------------------------------------------
+//
+void CMailListModelUpdater::InitializeL()
+    {
+    iBlockSize = KCMsgBlock;
+    iParentId = KFsTreeRootID;
+    iId = TFSMailMsgId();
+    iItemsFetched = 0;
+    iObserver->UpdateBeginL();
+    Signal(EFetch);
+    }
+
+// ---------------------------------------------------------------------------
+// Fetch state. Fetch next messages and if there is more messages signal
+// fetch state again OR proceed to finalizing state.
+// ---------------------------------------------------------------------------
+//
+void CMailListModelUpdater::FetchL()
+    {
+    RPointerArray<CFSMailMessage> messages(iBlockSize);
+    CleanupClosePushL(messages);
+    const TBool moreMessages(iIterator->NextL(iId, iBlockSize, messages));
+    iBlockSize = Min(KCMsgMaxBlock, iBlockSize * 2);
+    if (messages.Count() > 0)
+        {
+        iItemsFetched += messages.Count();
+        iId = messages[messages.Count() - 1]->GetMessageId();
+        iObserver->UpdateProgressL(iParentId, messages);
+        }
+    CleanupStack::PopAndDestroy(); // messages.Close()
+    if (moreMessages && iItemsFetched < KMaxItemsFethed)
+        {
+        Signal(EFetch);
+        }
+    else
+        {
+        Signal(EFinalize);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Finalizing state. Notify observer that model update has been done and
+// free the resources.
+// ---------------------------------------------------------------------------
+//
+void CMailListModelUpdater::FinalizeL()
+    {
+    iObserver->UpdateCompleteL();
+    Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// If the state is anything but EIdle, returns ETrue.
+// ---------------------------------------------------------------------------
+//
+TBool CMailListModelUpdater::IsUpdating() const
+    {
+    return iState > EIdle;
+    }
+
+// ---------------------------------------------------------------------------
+// Reset the state to EIdle and free resources.
+// ---------------------------------------------------------------------------
+//
+void CMailListModelUpdater::Reset()
+    {
+    iSorting.Reset();
+    SafeDelete(iIterator);
+    iState = EIdle;
+    }
+
+// ---------------------------------------------------------------------------
+// Active objects RunL()
+// ---------------------------------------------------------------------------
+//
+void CMailListModelUpdater::RunL()
+    {
+    const TInt error(iStatus.Int());
+    if (!error)
+        {
+        switch (iState)
+            {
+            case EInitialize:
+                InitializeL();
+                break;
+            case EFetch:
+                FetchL();
+                break;
+            case EFinalize:
+            default:
+                FinalizeL();
+                break;
+            }
+        }
+    else
+        {
+        iObserver->UpdateErrorL(error);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// Update has been cancelled. Inform the observer and free resources.
+// ---------------------------------------------------------------------------
+//
+void CMailListModelUpdater::DoCancel()
+    {
+    if (iObserver)
+        {
+        iObserver->UpdateCancelled(IsUpdating());
+        }
+    Reset();
+    }
 
 // ---------------------------------------------------------------------------
 // Static constructor.
@@ -139,6 +324,8 @@
 
 	BaseConstructL( R_FSEMAILUI_MAIL_LIST_VIEW );
 
+	iMailListModelUpdater = new (ELeave) CMailListModelUpdater();
+
 	// Don't construct this anywhere else than here.
 	// Don't delete this until in the destructor to avoid NULL checks.
     iModel = CFSEmailUiMailListModel::NewL( &iAppUi );
@@ -282,8 +469,8 @@
     : CFsEmailUiViewBase( aMailListControlGroup, *aAppUi ),
     iEnv( aEnv ),
     iListMarkItemsState( ETrue ), //Initlly list has no markings
-    iConsumeStdKeyYes_KeyUp( EFalse ), // use to prevent Call application execution if call for contact processed
-    iMoveToFolderOngoing( EFalse )
+    iMoveToFolderOngoing( EFalse ),
+    iConsumeStdKeyYes_KeyUp( EFalse ) // use to prevent Call application execution if call for contact processed
 	{
     FUNC_LOG;
 	}
@@ -295,12 +482,8 @@
 CFSEmailUiMailListVisualiser::~CFSEmailUiMailListVisualiser()
     {
     FUNC_LOG;
-    if ( iMailFolder )
-        {
-        delete iMailFolder;
-        iMailFolder = NULL;
-        }
-
+    SafeDelete(iMailListModelUpdater);
+    SafeDelete(iMailFolder);
     delete iTouchManager;
     delete iStylusPopUpMenu;
     delete iMailList;
@@ -314,35 +497,31 @@
 void CFSEmailUiMailListVisualiser::PrepareForExit()
     {
     FUNC_LOG;
+    iMailListModelUpdater->Cancel();
     if ( iMsgNoteTimer )
         {
         iMsgNoteTimer->Cancel();
-        delete iMsgNoteTimer;
-        iMsgNoteTimer = NULL;
+        SafeDelete(iMsgNoteTimer);
         }
     if ( iDateChangeTimer )
         {
         iDateChangeTimer->Cancel();
-        delete iDateChangeTimer;
-        iDateChangeTimer = NULL;
+        SafeDelete(iDateChangeTimer);
         }
     if ( iMailListUpdater )
         {
         iMailListUpdater->Stop();
-        delete iMailListUpdater;
-        iMailListUpdater = NULL;
+        SafeDelete(iMailListUpdater);
         }
     if ( iAsyncRedrawer )
         {
         iAsyncRedrawer->Cancel();
-        delete iAsyncRedrawer;
-        iAsyncRedrawer = NULL;
+        SafeDelete(iAsyncRedrawer);
         }
     if ( iAsyncCallback )
         {
         iAsyncCallback->Cancel();
-        delete iAsyncCallback;
-        iAsyncCallback = NULL;
+        SafeDelete(iAsyncCallback);
         }
     if ( iMailList )
         {
@@ -352,16 +531,10 @@
         {
         iControlBarControl->RemoveObserver( *this );
         }
-    // <cmail>
+    SafeDelete(iMailFolder);
     iTreeItemArray.Reset();
-    if ( iMailFolder )
-        {
-        delete iMailFolder;
-        iMailFolder = NULL;
-        }
 	// Reset, not delete to avoid NULL checks.
     iModel->Reset();
-    // </cmail>
     }
 
 // ---------------------------------------------------------------------------
@@ -375,6 +548,101 @@
 	}
 
 // ---------------------------------------------------------------------------
+// @see CMailListModelUpdater::MObserver::UpdateErrorL
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMailListVisualiser::UpdateErrorL(TInt aError)
+    {
+    FUNC_LOG;
+    User::Leave(aError);
+    }
+
+// ---------------------------------------------------------------------------
+// @see CMailListModelUpdater::MObserver::UpdateBeginL
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMailListVisualiser::UpdateBeginL()
+    {
+    FUNC_LOG;
+    iModel->Reset();
+    iTreeItemArray.Reset();
+    }
+
+// ---------------------------------------------------------------------------
+// @see CMailListModelUpdater::MObserver::UpdateProgressL
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMailListVisualiser::UpdateProgressL(TFsTreeItemId& aParentId, RPointerArray<CFSMailMessage>& aMessages)
+    {
+    FUNC_LOG;
+    const TInt itemsInModel(iModel->Count());
+    CreateModelItemsL(aMessages);
+    RefreshListItemsL(aParentId, itemsInModel, iModel->Count());
+    }
+
+// ---------------------------------------------------------------------------
+// @see CMailListModelUpdater::MObserver::UpdateCompleteL
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMailListVisualiser::UpdateCompleteL()
+    {
+    FUNC_LOG;
+    if ( !iModel->Count() )
+        {
+        iFocusedControl = EControlBarComponent;
+        }
+    else
+        {
+        iFocusedControl = EMailListComponent;
+        if (iMailList->FocusedItem() == KFsTreeNoneID)
+            {
+            iMailList->SetFocusedItemL( iTreeItemArray[0].iListItemId );
+            }
+        }
+    SetListAndCtrlBarFocusL();
+    iAppUi.StartMonitoringL();
+    }
+
+// ---------------------------------------------------------------------------
+// @see CMailListModelUpdater::MObserver::UpdateCancelled
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMailListVisualiser::UpdateCancelled(const TBool aForceRefresh)
+    {
+    FUNC_LOG;
+    iForceRefresh = aForceRefresh;
+    }
+
+// ---------------------------------------------------------------------------
+// Asynchronous mail list model update.
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMailListVisualiser::UpdateMailListModelAsyncL()
+    {
+    FUNC_LOG;
+    if ( iMailFolder )
+        {
+        TFSMailDetails details( EFSMsgDataEnvelope );
+        RArray<TFSMailSortCriteria>& sorting(iMailListModelUpdater->Sorting());
+        sorting.AppendL( iCurrentSortCriteria );
+        if ( iCurrentSortCriteria.iField != EFSMailSortByDate )
+            {
+            // Add date+descending as secondary sort criteria if primary field is something else than date
+            TFSMailSortCriteria secondarySortCriteria;
+            secondarySortCriteria.iField = EFSMailSortByDate;
+            secondarySortCriteria.iOrder = EFSMailDescending;
+            sorting.AppendL( secondarySortCriteria );
+            }
+        // List all or maximum number of messages
+        iMailListModelUpdater->UpdateModelL(*this, iMailFolder->ListMessagesL(details, sorting));
+        }
+    else
+        {
+        UpdateCompleteL();
+        }
+    }
+
+// ---------------------------------------------------------------------------
 //
 //
 // ---------------------------------------------------------------------------
@@ -382,9 +650,10 @@
 void CFSEmailUiMailListVisualiser::UpdateMailListModelL()
     {
     FUNC_LOG;
+    // Make sure asynchronous update is not going on
+    iMailListModelUpdater->Cancel();
     // Reset model with each update
 	iModel->Reset();
-
 	if ( iMailFolder )
 		{
 		// Update folder if provided, otherwise use current folder
@@ -446,15 +715,31 @@
 	{
     FUNC_LOG;
 	// New Items
-	CFSEmailUiMailListModelItem* newItem = NULL;
+	CFSEmailUiMailListModelItem* newItem(NULL);
 
 	// Draw first separator if there are messages.
 	if ( aMessages.Count() && iNodesInUse == EListControlSeparatorEnabled )
 		{
+		if (iModel->Count())
+		    {
+		    CFSMailMessage* nextMessage = aMessages[0];
+		    CFSEmailUiMailListModelItem* previousMessage(static_cast<CFSEmailUiMailListModelItem*>(iModel->Item(iModel->Count() - 1)));
+            TBool needANewDivider =
+                !MessagesBelongUnderSameSeparatorL( previousMessage->MessagePtr(), *nextMessage );
+            if ( needANewDivider )
+                {
+                newItem = CreateSeparatorModelItemLC( *nextMessage );
+                iModel->AppendL( newItem );
+                CleanupStack::Pop( newItem );
+                }
+            }
+		else
+		    {
 	    newItem = CreateSeparatorModelItemLC( *aMessages[0] );
 	    iModel->AppendL( newItem );
 		CleanupStack::Pop( newItem );
 		}
+		}
 
 	// Start appending items
     for (int i = 0; i < aMessages.Count(); i++)
@@ -951,6 +1236,7 @@
         {
         iAppUi.FolderList().HidePopupL();
         }
+    DisableMailList( EFalse );
 
 	// inform baseView if view entered with forward navigation
 	TBool forwardNavigation = EFalse;
@@ -1116,19 +1402,24 @@
     // CHECK IF MODEL NEEDS TO BE UPDATED
     if ( activationData.iMailBoxId != prevMailBoxId ||
          activationData.iFolderId != prevFolderId ||
-         activationData.iRequestRefresh )
+         activationData.iRequestRefresh ||
+         iForceRefresh )
          {
+         iForceRefresh = EFalse;
          // Set initial sort criteria when folder is changed
          iCurrentSortCriteria.iField = EFSMailSortByDate;
          iCurrentSortCriteria.iOrder = EFSMailDescending;
          SetSortButtonTextAndIconL();
 
-         delete iMailFolder;
-         iMailFolder = NULL;
+         SafeDelete(iMailFolder);
          TRAP_IGNORE( iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL(
                  activationData.iMailBoxId, activationData.iFolderId ) );
          if ( !iMailFolder )
              {
+             if ( forwardNavigation )
+                 {
+                 iAppUi.StartMonitoringL();
+                 }
              // Safety, try to revert back to standard folder inbox
              TFSMailMsgId inboxId = iAppUi.GetActiveMailbox()->GetStandardFolderId( EFSInbox );
              iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( activationData.iMailBoxId, inboxId );
@@ -1150,9 +1441,6 @@
     // Check sync icon timer and sync status
     ConnectionIconHandling();
 
-    iMailList->HideListL();
-    iMailList->ShowListL();
-
     // REBUILD TREE LIST IF NECESSARY
     if ( refreshNeeded )
         {
@@ -1161,25 +1449,38 @@
         TFSMailMsgId focused = MsgIdFromListId( iMailList->FocusedItem() );
 
         // Clear any previous items from the screen and then make the view visible
+        iMailList->BeginUpdate();
         iMailList->RemoveAllL();
         iTreeItemArray.Reset();
-        UpdateMailListModelL();
-        RefreshDeferred( &focused );
+        iModel->Reset();
+        iMailList->EndUpdateL();
+        iMailList->ShowListL();
+
+        // If coming from wizard use synchronous list updating
+        if (activationData.iReturnAfterWizard)
+            {
+            UpdateMailListModelL();
+            }
+        else
+            {
+            UpdateMailListModelAsyncL();
+            }
         }
-
     // THE CORRECT FOLDER IS ALREADY OPEN. CHECK IF SOME PARTIAL UPDATE IS NEEDED.
     else
         {
-        // hide & show list to force it to adept to changed screen size
+        iMailList->ShowListL();
+        if (forwardNavigation)
+            {
+            iAppUi.StartMonitoringL();
+            }
         SetListAndCtrlBarFocusL(); // ShowListL() makes list focused and this may need to be reverted
         UnmarkAllItemsL();
-
         if ( aCustomMessageId == TUid::Uid(KMailSettingsReturnFromPluginSettings) )
             {
             // Better to refresh launcher grid view because mailbox branding might be changed.
             iAppUi.LauncherGrid().SetRefreshNeeded();
             }
-
         // Check the validity of focused message, it may be deleted or
         // reply/forward, read/unread status might have changed in editor or viewer
         UpdateItemAtIndexL( HighlightedIndex() );
@@ -1240,14 +1541,19 @@
 //
 void CFSEmailUiMailListVisualiser::ChildDoDeactivate()
 	{
-  FUNC_LOG;
+    FUNC_LOG;
+    if (iMailListModelUpdater)
+        {
+        iMailListModelUpdater->Cancel();
+        }
 	if ( !iAppUi.AppUiExitOngoing() )
-  		{
-  	  TRAP_IGNORE( {
+  	    {
+  	    TRAP_IGNORE( {
+            iMailList->HideListL();
             iMailList->SetFocusedL( EFalse );
   	        } );
-  	  iMailTreeListVisualizer->NotifyControlVisibilityChange( EFalse );
-  		}
+  	    iMailTreeListVisualizer->NotifyControlVisibilityChange( EFalse );
+  	    }
 	iThisViewActive = EFalse;
 	}
 
@@ -1761,22 +2067,13 @@
     CFSEmailUiMailListModelItem* item( NULL );
     SetMailListItemsExtendedL();
 
-    TBool allowRefresh(EFalse);
     TInt count(0);
     count = iModel->Count();
     for ( TInt i=0; i < count; i++ )
 		{
 		item = static_cast<CFSEmailUiMailListModelItem*>(iModel->Item(i));
 
-		if ( i == 0 || i == count - 1 )
-            {//first item - show scrollbar
-             //last item - update scrollbar
-            allowRefresh = ETrue;
-            }
-        else
-            {//rest of the messages - insert without updating
-            allowRefresh = EFalse;
-            }
+        const TBool allowRefresh(i == 0 || (i == count - 1));
 
 		// Append separator item text into the list
 		if ( item && item->ModelItemType() == ETypeSeparator )
@@ -1791,6 +2088,39 @@
 		}
 	}
 
+// ---------------------------------------------------------------------------
+//
+//
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiMailListVisualiser::RefreshListItemsL(TFsTreeItemId& aLatestNodeId, const TInt aStartIndex, const TInt aEndIndex)
+    {
+    FUNC_LOG;
+    // IMPLEMENTATION OF FILLING UP THE LIST
+    iMailList->BeginUpdate();
+    CFSEmailUiMailListModelItem* item( NULL );
+    if (aLatestNodeId == KFsTreeRootID && !aStartIndex)
+        {
+        iMailList->RemoveAllL();
+        iTreeItemArray.Reset();
+        SetMailListItemsExtendedL();
+        }
+    for ( TInt i = aStartIndex; i < aEndIndex; i++ )
+        {
+        item = static_cast<CFSEmailUiMailListModelItem*>(iModel->Item(i));
+        // Append separator item text into the list
+        if ( item && item->ModelItemType() == ETypeSeparator )
+            {
+            aLatestNodeId = InsertNodeItemL( i, KErrNotFound, EFalse );
+            }
+        // Append mail item into the list
+        else if ( item && item->ModelItemType() == ETypeMailItem )
+            {
+            InsertListItemL( i, aLatestNodeId, KErrNotFound, EFalse );
+            }
+        }
+    iMailList->EndUpdateL();
+    }
 
 void CFSEmailUiMailListVisualiser::SetMailListItemsExtendedL()
 	{
@@ -3907,10 +4237,10 @@
     // MSK label can now be updated when shift key has been handled
     SetMskL();
     // On KeyUp of EStdKeyYes usually Call application is called - prevent it
-    if ( iConsumeStdKeyYes_KeyUp && (aEvent.Code() == EEventKeyUp )) 
+    if ( iConsumeStdKeyYes_KeyUp && (aEvent.Code() == EEventKeyUp ))
 		{
 		iConsumeStdKeyYes_KeyUp = EFalse; // in case call button was consumed elsewhere first key up enables calling Call application
-		if ( EStdKeyYes == scanCode) 
+		if ( EStdKeyYes == scanCode)
 			{
 			  result = ETrue; // consume not to switch to Call application when call to contact was processed
 			  return result;
@@ -5673,6 +6003,9 @@
     		{
     		CFSEmailUiMailListModelItem* item =
                 static_cast<CFSEmailUiMailListModelItem*>( iModel->Item( i ) );
+			// when the item is a separator check whether its MessagePtr is valid (actually it's a reference)    		    		
+			if( &(item->MessagePtr()) != NULL) 
+				{
     		if ( aMessageId == item->MessagePtr().GetMessageId() )
     			{
     			TModelItemType itemType = item->ModelItemType();
@@ -5692,6 +6025,7 @@
     			}
     		}
         }
+		}
 	return idx;
     }
 
@@ -5844,8 +6178,8 @@
 
 		if ( !iMailFolder || ( iMailFolder && iMailFolder->GetFolderId() != aSelectedFolderId ) )
 		    {
-            delete iMailFolder;
-            iMailFolder = NULL;
+		    iMailListModelUpdater->Cancel();
+		    SafeDelete(iMailFolder);
             iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( iAppUi.GetActiveMailboxId(), aSelectedFolderId );
 
             if ( !iMailFolder )
@@ -5889,8 +6223,8 @@
     //Set touchmanager back to active
     DisableMailList(EFalse);
 	iAppUi.SetActiveMailboxL( aSelectedMailboxId );
-	delete iMailFolder;
-	iMailFolder = NULL;
+	iMailListModelUpdater->Cancel();
+	SafeDelete(iMailFolder);
 	iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( iAppUi.GetActiveMailboxId(), iAppUi.GetActiveBoxInboxId() );
 
 	// Set initial sort criteria when folder has changed
@@ -6305,13 +6639,21 @@
 void CFSEmailUiMailListVisualiser::ReplyL( CFSMailMessage* aMsgPtr )
 	{
     FUNC_LOG;
-    DoReplyForwardL( KEditorCmdReply, aMsgPtr );
+    // Replying not possible from drafts folder
+    if ( iMailFolder && iMailFolder->GetFolderType() != EFSDraftsFolder )
+        {
+        DoReplyForwardL( KEditorCmdReply, aMsgPtr );
+        }
 	}
 
 void CFSEmailUiMailListVisualiser::ReplyAllL(  CFSMailMessage* aMsgPtr )
 	{
     FUNC_LOG;
-	DoReplyForwardL( KEditorCmdReplyAll, aMsgPtr );
+    // Replying all not possible from drafts folder
+    if ( iMailFolder && iMailFolder->GetFolderType() != EFSDraftsFolder )
+        {
+        DoReplyForwardL( KEditorCmdReplyAll, aMsgPtr );
+        }
 	}
 
 void CFSEmailUiMailListVisualiser::ForwardL( CFSMailMessage* aMsgPtr )
@@ -6393,8 +6735,8 @@
 					if ( entryId == currentFolderId )
 						{
 						// Current folder deleted, try to revert back to standard folder inbox.
-						delete iMailFolder;
-						iMailFolder = NULL;
+						iMailListModelUpdater->Cancel();
+						SafeDelete(iMailFolder);
 						TFSMailMsgId inboxId = iAppUi.GetActiveMailbox()->GetStandardFolderId( EFSInbox );
 						if ( !inboxId.IsNullId() )
 						    {
@@ -6433,9 +6775,11 @@
 				if ( parentFolderId && ( *parentFolderId == currentFolderId ) )
 					{
 	 				// Refresh mailfolder to get correct actual data
-                    delete iMailFolder;
-                    iMailFolder = NULL;
+                    /*
+                    iMailListModelUpdater->Cancel();
+					SafeDelete(iMailFolder);
 					iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( aMailboxId, currentFolderId );
+					*/
 					RemoveMsgItemsFromListIfFoundL( *removedEntries );
 					}
 				}
@@ -6447,8 +6791,8 @@
 			if ( FolderId().IsNullId() )
 				{
 				// Refresh mailfolder to standard folder inbox in case of zero id
-				delete iMailFolder;
-				iMailFolder = NULL;
+                iMailListModelUpdater->Cancel();
+				SafeDelete(iMailFolder);
 				TFSMailMsgId inboxId = iAppUi.GetActiveMailbox()->GetStandardFolderId( EFSInbox );
 				if ( !inboxId.IsNullId() )
 				    {
@@ -6493,9 +6837,11 @@
             else if ( fromFolderId && ( currentFolderId == *fromFolderId ) )
                 {
  	 			// Refresh mailfolder to get correct actual data
-				delete iMailFolder;
-				iMailFolder = NULL;
+                /*
+                iMailListModelUpdater->Cancel();
+                SafeDelete(iMailFolder);
 				iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( aMailboxId, currentFolderId );
+				*/
 				RemoveMsgItemsFromListIfFoundL( *entries );
                 }
             else
@@ -6512,14 +6858,16 @@
 			if ( *parentFolderId == currentFolderId )
 				{
  	 			// Refresh mailfolder to get correct actual data
-				delete iMailFolder;
-				iMailFolder = NULL;
+				/*
+                iMailListModelUpdater->Cancel();
+                SafeDelete(iMailFolder);
 				iMailFolder = iAppUi.GetMailClient()->GetFolderByUidL( aMailboxId, currentFolderId );
+				*/
 				for ( TInt i=0 ; i<entries->Count() ; i++ )
 					{
 					TFSMailMsgId msgId = (*entries)[i];
 					TInt idx = ItemIndexFromMessageId( msgId );
-					if ( idx >= 0 )
+					if ( idx != KErrNotFound )
 					    {
 					    UpdateItemAtIndexL( idx );
 					    }
@@ -7268,6 +7616,7 @@
     {
     FUNC_LOG;
     CActiveScheduler::Add( this );
+    iDayCount = DayCount();
     }
 
 // -----------------------------------------------------------------------------
@@ -7315,20 +7664,58 @@
 void CDateChangeTimer::RunL()
     {
     FUNC_LOG;
+    
+    if (iStatus.Int() != KErrNone)
+        {
+        	INFO_1("### CDateChangeTimer::RunL (err=%d) ###", iStatus.Int());
+        }
+
+    
+    TBool dayChanged = EFalse;
+    TInt dayCount = DayCount();
+    if (dayCount != iDayCount)
+        {
+  
+        iDayCount = dayCount;
+        dayChanged = ETrue;
+        }
+
+    
     if ( KErrCancel == iStatus.Int() )
         {
         ;
-        }
-    // System time changed?
-    else if ( KErrAbort == iStatus.Int() )
+        }   
+    else if ( KErrAbort == iStatus.Int() ) // System time changed
         {
+        if (dayChanged)
+            {
+            TRAP_IGNORE( iMailListVisualiser.NotifyDateChangedL() );
+            }
         Start();
         }
-    // Interval is over
-    else
+    else  // interval is over
         {
         // Update mail list and reissue the request for timer event
         TRAP_IGNORE( iMailListVisualiser.NotifyDateChangedL() );
         Start();
         }
+    
     }
+
+
+TInt CDateChangeTimer::DayCount()
+    {
+    TTime now;
+    now.HomeTime();
+    TTime minTime = Time::MinTTime();
+    TTimeIntervalDays days = now.DaysFrom(minTime);
+    return days.Int();
+    }
+
+
+
+
+
+
+
+
--- a/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -103,9 +103,8 @@
     UpdateToolbarL();
 
     // Make sure Alfred display is of correct size (there is some problems with toolbar)
-    TRect metricsRect;
-    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, metricsRect);
-    CAlfEnv::Static()->PrimaryDisplay().ForceSetVisibleArea(metricsRect);
+    iAppUi.AlfEnv().PrimaryDisplay().ForceSetVisibleArea(iAppUi.ClientRect());
+    
 
     // Finally call child classes activation method
     TRAPD( error, ChildDoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage) );
--- a/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/FreestyleMessageHeaderHTML.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -2,9 +2,9 @@
 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
--- a/emailuis/emailui/src/OverlayControl.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/OverlayControl.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -2,9 +2,9 @@
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
--- a/emailuis/emailui/src/ncscomposeview.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/ncscomposeview.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -515,16 +515,7 @@
         SetToolbarItemDimmed( EFsEmailUiTbCmdExpandInsert, dimAllOptions );
         SetToolbarItemDimmed( EFsEmailUiTbCmdSend,
                 iContainer->AreAddressFieldsEmpty() );
-        if ( (iContainer->IsFocusBcc() || 
-              iContainer->IsFocusCc() || 
-              iContainer->IsFocusTo() ) && !dimAllOptions )
-            {
-            SetToolbarItemDimmed( EFsEmailUiTbCmdAddRecipient, EFalse );
-            }
-        else
-            {
-            SetToolbarItemDimmed( EFsEmailUiTbCmdAddRecipient, ETrue );
-            }
+        SetToolbarItemDimmed( EFsEmailUiTbCmdAddRecipient, dimAllOptions );
         }
     }
 
--- a/emailuis/emailui/src/ncscomposeviewcontainer.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/ncscomposeviewcontainer.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -211,7 +211,20 @@
         {
 		iFocused = iHeader;
         }
-	iFocused->SetFocus( ETrue, aDrawNow );
+    if ( iFocused == iHeader )
+        {
+        iHeader->ShowCursor( IsFocused() );
+        iFocused->SetFocus( ETrue, aDrawNow );
+        }
+    else if ( iFocused == iMessageField )
+        {
+        iFocused->SetFocus( IsFocused(), aDrawNow );
+        }
+    else 
+        {
+        iFocused->SetFocus( ETrue, aDrawNow );
+        }
+	
 	iView.HandleContainerChangeRequiringToolbarRefresh();
 
 	if ( aDrawNow )
@@ -311,10 +324,24 @@
                 {
                 if ( iFocused == iHeader )
                     {
+                    // fix for ESLX-7Y4C2V, dissapearing subject 
+                    HBufC* heapBuffer = HBufC::NewL(iHeader->GetSubjectFieldLength());
+                    TPtr ptr(heapBuffer->Des());
+                    ptr.Copy(*GetSubjectLC());
+
                     iFocused = iMessageField;
                     iHeader->SetFocus( EFalse, EDrawNow );
                     iMessageField->SetFocus( ETrue, EDrawNow );
+                    
+                    if ( iHeader->GetSubjectFieldLength() != heapBuffer->Length() )
+                    	{
+                    		iHeader->SetSubjectL( const_cast<HBufC&>(*heapBuffer));
+                    	}
+
+                    iHeader->SetFocus( ETrue, EDrawNow );
+                    iHeader->SetFocus( EFalse, EDrawNow );
                     iView.HandleContainerChangeRequiringToolbarRefresh();
+                    CleanupStack::PopAndDestroy(); //from GetSubjectLC()
                     }
                 else if ( iFocused == iReadOnlyQuoteField )
                     {
@@ -1519,7 +1546,7 @@
 void CNcsComposeViewContainer::AppendToFieldAddressesL( RPointerArray<CNcsEmailAddressObject>& aAddresses )
     {
     FUNC_LOG;
-
+    FixSemicolonL();
     iHeader->AppendToFieldAddressesL(aAddresses);
 
     }
@@ -1532,7 +1559,7 @@
 void CNcsComposeViewContainer::AppendCcFieldAddressesL( RPointerArray<CNcsEmailAddressObject>& aAddress )
     {
     FUNC_LOG;
-
+    FixSemicolonL();
     iHeader->AppendCcFieldAddressesL( aAddress );
 
     }
@@ -1545,7 +1572,7 @@
 void CNcsComposeViewContainer::AppendBccFieldAddressesL( RPointerArray<CNcsEmailAddressObject>& aAddress )
     {
     FUNC_LOG;
-
+    FixSemicolonL();
     iHeader->AppendBccFieldAddressesL( aAddress );
 
     }
--- a/emailuis/emailui/src/ncsheadercontainer.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/emailui/src/ncsheadercontainer.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -199,7 +199,14 @@
 	{
     FUNC_LOG;
     
-    CCoeControl* focused = FindFocused();
+    CCoeControl* focused = iFocused;
+    
+    if ( !focused )
+        {
+        focused = FindFocused();
+        iFocused = focused;
+        }
+    
     if ( !IsFocused() )
         {
         if ( focused )
@@ -213,7 +220,7 @@
         // Remove MSK label when header loses focus
         TRAP_IGNORE( SetMskL() );
 		}
-	else if ( IsFocused() && !focused && !iRALInProgress )
+	else if ( IsFocused() && !focused )
 		{
 		// We're gaining focus from the message body
 		// Set the focus to the last control in the control array
@@ -224,6 +231,20 @@
 		}
 	}
 
+// ---------------------------------------------------------------------------
+// CNcsHeaderContainer::ShowCursor
+// ---------------------------------------------------------------------------
+//
+void CNcsHeaderContainer::ShowCursor( TBool aShow )
+    {
+    CCoeControl* focused = FindFocused();
+    if ( focused )
+        {
+        iFocused = focused;
+        }
+    iFocused->SetFocus( aShow, EDrawNow );
+    }
+
 // -----------------------------------------------------------------------------
 // CNcsHeaderContainer::Draw() const
 // Draws the display
@@ -503,8 +524,9 @@
 		         ( aKeyEvent.iCode == EKeyEnter || 
 		           aKeyEvent.iScanCode == EStdKeyEnter) )
 		        {
-		        ret = FindFocused()->OfferKeyEventL( aKeyEvent, aType );
-		        return EKeyWasConsumed;
+		        FindFocused()->OfferKeyEventL( aKeyEvent, aType );
+		        ret = EKeyWasConsumed;
+		        doScroll = ETrue;
 		        }
 		    }
     	}
@@ -1309,13 +1331,9 @@
     		addressField = static_cast<CNcsAddressInputField*>( focused );
     		HBufC* lookupText = addressField->GetLookupTextLC();
     		CPbkxRemoteContactLookupServiceUiContext::TResult::TExitReason ex;
-    		// set focus to false for header - the focus should be on popup
-    		focused->SetFocus( EFalse, ENoDrawNow );
             CNcsEmailAddressObject* address = ExecuteRemoteSearchL(
                 ex, *lookupText );
             iRALInProgress = EFalse;
-            // set focus back to on
-            focused->SetFocus( ETrue, ENoDrawNow );
             if ( address )
                 {
                 CleanupStack::PushL( address );
--- a/emailuis/uicomponents/inc/fstreelist.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/uicomponents/inc/fstreelist.h	Tue Jan 26 11:45:42 2010 +0200
@@ -53,7 +53,26 @@
 typedef RPointerArray<MFsTreeListObserver> RFsTreeListObservers;
 
 /**
- * CFsTreeList is a component for creating and displaying hierarchical list
+ * Batch updates for the tree.
+ */
+class MFsTreeBatchProcessing
+    {
+public:
+    /**
+     * Begin batch update. During batch update changes to the world
+     * will not be updated on screen until the EndUpdateL is called.
+     */
+    virtual void BeginUpdate() = 0;
+    
+    /**
+     * End batch update. All changes done between BeginUpdate and EndUpdateL
+     * will be shown on screen.
+     */
+    virtual void EndUpdateL() = 0;
+    };
+
+/**
+ * CFsTreeList is a component for creating and displaying hierarchical list 
  * using tree data structure.
  *
  * @code
@@ -62,8 +81,20 @@
  *
  * @lib
  */
-class CFsTreeList  : public CBase, MFsTreeVisualizerObserver
+class CFsTreeList  : public CBase, MFsTreeVisualizerObserver, MFsTreeBatchProcessing
     {
+public: // from MFsTreeBatchProcessing
+    
+    /**
+     * @see MFsTreeBatchProcessing::BeginUpdate
+     */
+    void BeginUpdate();
+
+    /**
+     * @see MFsTreeBatchProcessing::EndUpdateL
+     */
+    void EndUpdateL();
+    
 public: // Construction
 
 
--- a/emailuis/uicomponents/inc/fstreevisualizerbase.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/uicomponents/inc/fstreevisualizerbase.h	Tue Jan 26 11:45:42 2010 +0200
@@ -73,6 +73,13 @@
  * Contains the visual structure of the list.
  *
  */
+
+enum TUpdatedByPhysic{
+	ENotUpdatedByPhisic = 0,
+	EUpdatedByPhisic,
+	EUpdatedByPhisicEnd
+	};
+
 NONSHARABLE_CLASS( TWorld )
     {
 
@@ -333,7 +340,7 @@
         /**
          * This method is called when the viewport changes.
          */
-        virtual void ViewPortUpdatedL( TViewPort& aViewPort ) = 0;
+        virtual void ViewPortUpdatedL( TViewPort& aViewPort, TUpdatedByPhysic aUpdateByPhysic = ENotUpdatedByPhisic ) = 0;
 
         };
 
@@ -354,7 +361,7 @@
      * Center viewport around position aPosition. If aInformUpdate is set to ETrue, observer
      * will be signalled.
      */
-    void SetCenterPositionL( const TPoint& aPosition, TBool aInformUpdate = ETrue );
+    void SetCenterPositionL( const TPoint& aPosition, TBool aInformUpdate = ETrue, TUpdatedByPhysic aUpdateByPhysic = ENotUpdatedByPhisic );
 
     /**
      * Returns viewport position (i.e. topleft corner).
@@ -382,6 +389,11 @@
     void GetVisibleItemsL( RArray<TFsTreeItemId>& aItemsToBeRemoved, RArray<TFsTreeItemId>& aItemsToBeAdded, TInt& aOffset, TBool& aFullUpdate  );
 
     /**
+      * Get items visible in viewport's area.
+      */
+    void GetVisibleItemsL(RArray<TFsTreeItemId>& aVisible, TInt& aOffset);
+    
+    /**
      * Returns ETrue if the world is higher than viewport.
      */
     TBool IsScrollBarNeeded() const;
@@ -455,7 +467,9 @@
     /**
      * Called when viewport is updated.
      */
-    void UpdatedL();
+    void UpdatedL(TUpdatedByPhysic aUpdateByPhysic = ENotUpdatedByPhisic);
+    
+   
 
 private: // from TWorld::MObserver
 
@@ -1905,7 +1919,7 @@
 
 private: // from TViewPort::MObserver
 
-    virtual void ViewPortUpdatedL( TViewPort& aViewPort );
+    virtual void ViewPortUpdatedL( TViewPort& aViewPort, TUpdatedByPhysic aUpdateByPhysic = ENotUpdatedByPhisic);
 
 // TREE OPTIMIZATIONS
 
--- a/emailuis/uicomponents/src/fstreelist.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/uicomponents/src/fstreelist.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -111,6 +111,16 @@
     return iTreeControl;
     }
 
+void CFsTreeList::BeginUpdate()
+    {
+    iTreeVisualizer->SetAutoRefreshAtInsert( EFalse );    
+    }
+
+void CFsTreeList::EndUpdateL()
+    {
+    iTreeVisualizer->SetAutoRefreshAtInsert( ETrue );        
+    }
+
 // ---------------------------------------------------------------------------
 // Inserts new item as a child of parent given by Id with the given position.
 // ---------------------------------------------------------------------------
--- a/emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -629,12 +629,11 @@
     FUNC_LOG;
     TInt marqueeSize(0), textWidth(0);
 
-    if ( aMarqueeType == EFsTextMarqueeNone )
+    if ( aMarqueeType == EFsTextMarqueeNone || !iTextVisual )
         {
         return;
         }
 
-
     iTextVisual->SetWrapping(CAlfTextVisual::ELineWrapManual);
 
     textWidth = iTextVisual->SubstringExtents(0, iTextVisual->Text().Length()).Width();
--- a/emailuis/uicomponents/src/fstreevisualizerbase.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/emailuis/uicomponents/src/fstreevisualizerbase.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -362,38 +362,22 @@
         }
     else if (aY > 0)
         {
-        TInt top(0);
-        TInt bottom(iItems.Count() - 1);
-        while (top <= bottom)
+        TInt min(0);
+        TInt max(iItems.Count() - 1);
+        while (min <= max)
             {
-            TInt middle(top + (bottom - top) / 2);
-            TInt topCoord(iItems[middle].Top());
-            TInt bottomCoord(iItems[middle].Bottom());
-            if (aY < topCoord)
+            const TInt middle(min + (max - min) / 2);
+            if (aY < iItems[middle].Top())
                 {
-                if (bottom == middle)
-                    {
-                    bottom--;
-                    }
-                else
-                    {
-                    bottom = middle;
-                    }
+                max = middle - 1;
                 }
-            else if (aY > bottomCoord)
+            else if (aY > iItems[middle].Bottom())
                 {
-                if (top == middle)
-                    {
-                    top++;
-                    }
-                else
-                    {
-                    top = middle;
-                    }
+                min = middle + 1;
                 }
             else
                 {
-                aOffset = aY - topCoord;
+                aOffset = aY - iItems[middle].Top();
                 aHeight += aOffset;
                 i = middle;
                 break;
@@ -542,14 +526,14 @@
 // TViewPort::SetCenterPositionL
 // ---------------------------------------------------------------------------
 void TViewPort::SetCenterPositionL(const TPoint& aPosition,
-        TBool aInformUpdate)
+        TBool aInformUpdate, TUpdatedByPhysic aUpdateByPhysic)
     {
     iPosition = TPoint(aPosition.iX - iSize.iWidth / 2, aPosition.iY
             - iSize.iHeight / 2);
     // Do validation!
     if (aInformUpdate)
         {
-        UpdatedL();
+        UpdatedL(aUpdateByPhysic);
         }
     }
 
@@ -607,6 +591,14 @@
     }
 
 // ---------------------------------------------------------------------------
+// TViewPort::GetVisibleItemsL
+// ---------------------------------------------------------------------------
+void TViewPort::GetVisibleItemsL(RArray<TFsTreeItemId>& aVisible, TInt& aOffset)
+	{
+	iWorld.GetItemsL(aVisible, iPosition.iY, iSize.iHeight, aOffset);
+	}
+
+// ---------------------------------------------------------------------------
 // TViewPort::IsScrollBarNeeded
 // ---------------------------------------------------------------------------
 TBool TViewPort::IsScrollBarNeeded() const
@@ -617,9 +609,9 @@
 // ---------------------------------------------------------------------------
 // TViewPort::UpdatedL
 // ---------------------------------------------------------------------------
-void TViewPort::UpdatedL()
-    {
-    iObserver.ViewPortUpdatedL(*this);
+void TViewPort::UpdatedL(TUpdatedByPhysic aUpdateByPhysic)
+    {
+    iObserver.ViewPortUpdatedL(*this, aUpdateByPhysic);
     }
 
 // ---------------------------------------------------------------------------
@@ -1695,8 +1687,7 @@
 
     if ( visualizer )
         {
-        TBool focused = IsFocusShown();
-        visualizer->UpdateL( iTreeData->ItemData( iFocusedItem ), focused,
+        visualizer->UpdateL( iTreeData->ItemData( iFocusedItem ), IsFocusShown(),
                 iTreeData->Level( iFocusedItem ), iMarkIcon, iMenuIcon, 0 );
         }
 
@@ -1792,7 +1783,7 @@
         const TBool aSlideIn)
     {
     FUNC_LOG;
-    UpdateViewPortL();
+    iVisualizationState = EFsTreeVisible;
     if (iTreeData->Count() == 0)
         {
         iRootVisualizer->ShowL(*iRootLayout);
@@ -1800,29 +1791,28 @@
         }
     else
         {
-        TBool showFocus = IsFocusShown();
+        const TBool showFocus = IsFocusShown();
         for (TUint i = 0; i < iVisibleItems.Count(); ++i)
             {
             TFsTreeItemId itemId(iVisibleItems[i]);
             MFsTreeItemVisualizer* visualizer = iTreeData->ItemVisualizer(
                     itemId);
 
-            TBool itemFocused( EFalse );
-            if( showFocus )
-                {
-                itemFocused = IsItemFocused(itemId);
-                }
-            visualizer->UpdateL(iTreeData->ItemData(itemId), itemFocused,
-                    iTreeData->Level(itemId), iMarkIcon, iMenuIcon,
-                    0);
+            TBool itemFocused( showFocus && IsItemFocused(itemId) );
+			if ( visualizer )
+				{
+	        	visualizer->UpdateL(iTreeData->ItemData(itemId), itemFocused,
+	                iTreeData->Level(itemId), iMarkIcon, iMenuIcon,
+	                0);
+				}
             }
         }
+    UpdateViewPortL();
 
     TInt fadeInTime(KZero), slideInTime(KZero);
     CFsSlideEffect::TSlideEffectDirection slideInDir(
             CFsSlideEffect::ESlideNone);
 
-    iVisualizationState = EFsTreeVisible;
 
     if (aFadeIn)
         {
@@ -2517,7 +2507,11 @@
             ApplyListSpecificValuesToItem(itemviz);
             }
         }
-    iWorld.BeginUpdate();
+        const TBool isUpdating(iWorld.IsUpdating());
+    if (!isUpdating)
+        {
+        iWorld.BeginUpdate();
+        }
     iWorld.RemoveAllL();
     treeIter = iTreeData->Iterator(KFsTreeRootID, KFsTreeRootID,
             KFsTreeIteratorSkipCollapsedFlag);
@@ -2532,7 +2526,10 @@
         }
     iViewPort.SetPositionL(TPoint(), EFalse);
     iViewPort.ClearCache();
-    iWorld.EndUpdateL();
+    if (!isUpdating)
+        {
+        iWorld.EndUpdateL();
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -2788,10 +2785,13 @@
             break;
         case EFsTreeRemovedAll:
             {
-            iRootVisualizer->ShowL(*iRootLayout);
-            iRootVisualizer->UpdateL(*iRootData, EFalse, 0, iMarkIcon,
-                    iMenuIcon);
-            //iListLayout->RemoveAndDestroyAllD();
+            if (!iWorld.IsUpdating())
+                {
+                iRootVisualizer->ShowL(*iRootLayout);
+                iRootVisualizer->UpdateL(*iRootData, EFalse, 0, iMarkIcon,
+                        iMenuIcon);
+                }
+            iVisibleItems.Reset();
             iWorld.RemoveAllL();
             iFocusedItem = KFsTreeNoneID;
             }
@@ -3514,38 +3514,42 @@
     {
     FUNC_LOG;
     TInt listItemsHeight = 0;
-    MFsTreeItemVisualizer* vis = 0;
+    MFsTreeItemVisualizer* visualizer = 0;
     TFsTreeItemId itemId;
     TInt itemCount = iVisibleItems.Count();
 
     for (TInt index = 0; index < itemCount; ++index)
         {
         itemId = iVisibleItems[index];
-        vis = iTreeData->ItemVisualizer(itemId);
-
-        if (itemId == iFocusedItem)
+        visualizer = iTreeData->ItemVisualizer(itemId);
+
+
+        if (visualizer)
             {
-            if (vis->IsExtendable())
+            if (itemId == iFocusedItem)
                 {
-                listItemsHeight += vis->ExtendedSize().iHeight;
+                if (visualizer->IsExtendable())
+                    {
+                    listItemsHeight += visualizer->ExtendedSize().iHeight;
+                    }
+                else
+                    {
+                    listItemsHeight += visualizer->Size().iHeight;
+                    }
+                }
+            else if (itemId == aPrevious && iFocusedItem != aPrevious)
+                {
+                listItemsHeight += visualizer->Size().iHeight;
+                }
+            else if (visualizer->IsExtended() && visualizer->IsExtendable())
+                {
+                listItemsHeight += visualizer->ExtendedSize().iHeight;
                 }
             else
                 {
-                listItemsHeight += vis->Size().iHeight;
+                listItemsHeight += visualizer->Size().iHeight;
                 }
             }
-        else if (itemId == aPrevious && iFocusedItem != aPrevious)
-            {
-            listItemsHeight += vis->Size().iHeight;
-            }
-        else if (vis->IsExtended() && vis->IsExtendable())
-            {
-            listItemsHeight += vis->ExtendedSize().iHeight;
-            }
-        else
-            {
-            listItemsHeight += vis->Size().iHeight;
-            }
         }
 
     return listItemsHeight;
@@ -3702,10 +3706,13 @@
         for (TUint i = 0; i < iVisibleItems.Count(); ++i)
             {
             TFsTreeItemId itemId(iVisibleItems[i]);
-            MFsTreeItemVisualizer* viz = iTreeData->ItemVisualizer(itemId);
-            viz->UpdateL(iTreeData->ItemData(itemId),
-                    IsItemFocused(itemId) && IsFocusShown(),
+            MFsTreeItemVisualizer* visualizer = iTreeData->ItemVisualizer(itemId);
+            if (visualizer)
+                {
+                visualizer->UpdateL(iTreeData->ItemData(itemId),
+					IsItemFocused(itemId) && IsFocusShown(),
                     iTreeData->Level(itemId), iMarkIcon, iMenuIcon, 0, EFalse);
+                }
             }
         UpdateSelectorVisualL();
         }
@@ -4826,9 +4833,16 @@
 // ViewPort updated
 // ---------------------------------------------------------------------------
 //
-void CFsTreeVisualizerBase::ViewPortUpdatedL(TViewPort& aViewPort)
+void CFsTreeVisualizerBase::ViewPortUpdatedL(TViewPort& aViewPort, TUpdatedByPhysic aUpdateByPhysic)
     {
     FUNC_LOG;
+
+    // Only upadte view if the list is visible
+    if (iVisualizationState != EFsTreeVisible)
+        {
+        return;
+        }
+
     RArray<TFsTreeItemId> visibleItems;
     RArray<TFsTreeItemId> removableItems;
     TInt scrollOffset;
@@ -4841,6 +4855,30 @@
     rm = CAlfStatic::Env().RefreshMode();
     CAlfStatic::Env().SetRefreshMode(EAlfRefreshModeManual);
     iListLayout->SetFlag(EAlfVisualFlagFreezeLayout);
+    
+	if(aUpdateByPhysic == EUpdatedByPhisicEnd)
+		{
+    	RArray<TFsTreeItemId> myVisibleItems;
+    	TInt myOffset;
+    	CleanupClosePushL(myVisibleItems);
+    	aViewPort.GetVisibleItemsL(myVisibleItems, myOffset);
+    			
+    	for (TInt i = 0; i < myVisibleItems.Count(); i++)
+    		{
+    		const TFsTreeItemId itemId(myVisibleItems[i]);
+    		if (itemId != KFsTreeNoneID)
+    			{
+    			MFsTreeItemVisualizer* visualizer = iTreeData->ItemVisualizer(
+    											itemId);
+    			visualizer->UpdateL(iTreeData->ItemData(itemId), 
+    							IsItemFocused(itemId) && IsFocusShown(),
+    							iTreeData->Level(itemId), iMarkIcon, iMenuIcon,
+    							0);
+    			}
+    		}
+    	CleanupStack::PopAndDestroy();
+    	}
+
     // clear list
     TInt removed(0);
     if (fullUpdate)
@@ -4856,14 +4894,21 @@
         {
         for (TInt i = 0; i < removableItems.Count(); i++)
             {
-            CAlfVisual* visual(
-                    &iTreeData->ItemVisualizer(removableItems[i])->Layout());
-            if (iListLayout->FindVisual(visual) != KErrNotFound)
+            MFsTreeItemVisualizer* itemVisualizer(iTreeData->ItemVisualizer(removableItems[i]));
+            if (itemVisualizer)
                 {
-                removed++;
+                CAlfVisual* visual(&itemVisualizer->Layout());
+                if (iListLayout->FindVisual(visual) != KErrNotFound)
+                    {
+                    removed++;
+                    }
+                itemVisualizer->Hide();
+                const TInt index(iVisibleItems.Find(removableItems[i]));
+                if (index != KErrNotFound)
+                    {
+                    iVisibleItems.Remove(index);
+                    }
                 }
-            iTreeData->ItemVisualizer(removableItems[i])->Hide();
-            iVisibleItems.Remove(iVisibleItems.Find(removableItems[i]));
             }
         }
 
@@ -4885,10 +4930,15 @@
             CAlfLayout& visualizerLayout(visualizer->Layout());
             visualizerLayout.SetSize(tpItemSize);
             visualizerLayout.PropertySetIntegerL(KPropertyItemId(), itemId);
-            visualizer->UpdateL(iTreeData->ItemData(itemId),
+            
+            if(aUpdateByPhysic != EUpdatedByPhisic)
+            	{
+            	visualizer->UpdateL(iTreeData->ItemData(itemId),
                     IsItemFocused(itemId) && IsFocusShown(),
                     iTreeData->Level(itemId), iMarkIcon, iMenuIcon,
                     0);
+            	}
+            
             visualizerLayout.Brushes()->AppendL(iBorderBrush,
                     EAlfDoesNotHaveOwnership);
             CAlfBrush* bgBrush(NULL);
@@ -4978,7 +5028,7 @@
     {
     FUNC_LOG;
     TInt error(KErrNone);
-    TRAP( error, iViewPort.SetCenterPositionL(aNewPosition) );
+    TRAP( error, iViewPort.SetCenterPositionL(aNewPosition, ETrue, EUpdatedByPhisic) );
     ERROR_1( error, "iViewPort.SetCenterPositionL failed with error: %d", error );
     }
 
@@ -4989,6 +5039,9 @@
 void CFsTreeVisualizerBase::PhysicEmulationEnded()
     {
     FUNC_LOG;
+    
+    TRAP_IGNORE( iViewPort.SetCenterPositionL(iViewPort.CenterPosition(), ETrue, EUpdatedByPhisicEnd));
+    
     iFlags.Clear(EPhysicsOn);
     if (iFlags.IsSet(EUpdatePhysicsAfterSimulationFinished))
         {
--- a/ipsservices/ipssosplugin/inc/ipsplgconnectandrefreshfolderlist.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgconnectandrefreshfolderlist.h	Tue Jan 26 11:45:42 2010 +0200
@@ -123,6 +123,8 @@
     */
     void ConstructL( CMsvEntrySelection& aMsvEntry );
 
+    void DisplayLoginFailedDialogL();
+
     //data
 private:
     
--- a/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h	Tue Jan 26 11:45:42 2010 +0200
@@ -217,6 +217,8 @@
         CIpsPlgEventHandler*                iEventHandler;
         TBool                               iIsSyncStartedSignaled;
 
+        // set to true if connection is already exists
+        TBool 								iAlreadyConnected;
     };
 
 #endif
--- a/ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h	Tue Jan 26 11:45:42 2010 +0200
@@ -175,6 +175,8 @@
         CMsvEntrySelection*                             iSelection;
         // not owned
         CIpsPlgEventHandler*                            iEventHandler;
+        // set to true if connection is already exists
+        TBool iAlreadyConnected;
     };
 
 #endif
--- a/ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgconnectandrefreshfolderlist.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -17,10 +17,13 @@
 */
 
 
+#include <AknMessageQueryDialog.h>
+
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
 #include <ipssossettings.rsg>
+#include <fsmailserver.rsg>     // For R_FS_MSERVER_*
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
@@ -170,38 +173,41 @@
     {
     FUNC_LOG;
     MFSMailRequestObserver* observer = NULL;
+    int err = iStatus.Int();
     
-    if( iStatus.Int() != KErrNone )
+    if ( err != KErrNone )
         {
         iState = ECompleted;
-        CompleteObserver();
+        if( err == KErrImapBadLogon )
+            {
+            DisplayLoginFailedDialogL();
+            RunError(err);
+            }
+        else
+            {
+            CompleteObserver();
+            }
         return;
-        }
+        }   
     
-    switch(iState)
+    TBuf8<1> dummyParam;
+    switch( iState )
         {
         case EStartConnect:
             delete iOperation;
             iOperation = NULL;
-            iOperation = CIpsPlgImap4ConnectOp::NewL(
-                            iSession,
-                            CActive::EPriorityStandard,
-                            iStatus,
-                            iService,
-                            *iTimer,
-                            iMailboxId,
-                            *observer,
-                            NULL, //FSRequestId
-                            NULL, // Event handler
-                            ETrue, // Plain connect
-                            EFalse ); // No signalling needed )
+            InvokeClientMtmAsyncFunctionL( 
+							KIMAP4MTMConnect, 
+							*iMsvEntry,
+            	            iService,
+            	            dummyParam );
             iState = EConnecting;
             SetActive();
             break;
 	    case EConnecting:
 	        {
 	        //  We have successfully completed connecting
-	        TBuf8<1> dummyParam;
+	        
 	        delete iOperation;
 	        iOperation = NULL;
 	        InvokeClientMtmAsyncFunctionL( 
@@ -253,5 +259,33 @@
     iState = ECompleted;
     }
 
+// ----------------------------------------------------------------------------
+// CIpsPlgConnectAndRefreshFolderList::DisplayLoginFailedDialogL()
+// ----------------------------------------------------------------------------
+//
+void CIpsPlgConnectAndRefreshFolderList::DisplayLoginFailedDialogL()
+    {
+    // Get the TMsvEntry for the mailbox, which we use to get its name.
+    TMsvId serviceId;
+    TMsvEntry mailboxServiceEntry;
+    User::LeaveIfError( iSession.GetEntry( iMailboxId.Id(), serviceId, mailboxServiceEntry ) );
+
+    // Load/construct the strings for the dialog.
+    HBufC* headerText( NULL );
+    headerText = StringLoader::LoadLC( R_FS_MSERVER_MAILBOX_NAME, mailboxServiceEntry.iDetails );
+    HBufC* text( NULL );
+    text = StringLoader::LoadLC( R_FS_MSERVER_TEXT_LOGIN_FAILED );
+
+    // Create and display the dialog.
+    CAknMessageQueryDialog *dlg = new (ELeave) CAknMessageQueryDialog;
+    dlg->PrepareLC( R_FS_MSERVER_DIALOG_MESSAGE_QUERY );
+    dlg->SetHeaderTextL( headerText->Des() );
+    dlg->SetMessageTextL( text->Des() );
+    dlg->RunLD();
+
+    CleanupStack::PopAndDestroy( text );
+    CleanupStack::PopAndDestroy( headerText );
+    }
+
 // End of File
 
--- a/ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -88,7 +88,8 @@
     	aSignallingAllowed ),
     iDoPlainConnect( aDoPlainConnect ),
     iEventHandler( aEventHandler ),
-    iIsSyncStartedSignaled( EFalse )
+    iIsSyncStartedSignaled( EFalse ),
+    iAlreadyConnected( EFalse )
     {
     FUNC_LOG;
     iService = aService;
@@ -125,10 +126,20 @@
         User::Panic( KIpsPlgIpsConnPanic, KErrNotSupported );
         }
     
-	iState = EStateStartConnect;
-    iStatus = KRequestPending;    
-    SetActive();
-    CompleteThis();
+    if ( tentry.Connected() )
+        {      
+        iState = EStateCompleted; 
+        iAlreadyConnected = ETrue;
+        SetActive();
+        CompleteThis();
+        }
+    else
+        {
+        iState = EStateStartConnect;
+        iStatus = KRequestPending;    
+        SetActive();
+       CompleteThis();
+        }    
     }
 
 // ----------------------------------------------------------------------------
@@ -521,6 +532,13 @@
 //     
 /*TInt CIpsPlgImap4ConnectOp::GetOperationErrorCodeL( )
     {
+    if ( iAlreadyConnected )
+        {
+        // Connected state was set in CIpsPlgPop3ConnectOp::ConstructL()
+        // so iOperation is null
+        return KErrNone;
+        }
+        
     if ( !iOperation )
         {
         return KErrNotFound;
--- a/ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -122,7 +122,10 @@
 
     fsMsg->SetFolderId(
         TFSMailMsgId( iPlugin.PluginId(), aEntry.Entry().Parent() ) );
-
+    // ERLN-7YUEX3
+    fsMsg->SetMailBoxId(TFSMailMsgId( iPlugin.PluginId(), aEntry.Entry().iServiceId ));
+    // End ERLN-7YUEX3
+    
     CMsvStore* store( NULL );
 
     if ( aEntry.HasStoreL() )
--- a/ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -237,7 +237,7 @@
         // Initialize the progress data
         // it would be better to get fs progress from inherited class
         // by calling FSProgressL method??
-        if ( prog.iError == KErrCancel )
+        if ( prog.iError == KErrCancel || prog.iError == KErrImapBadLogon )
             {
             prog.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled;
             }
--- a/ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -285,7 +285,8 @@
     iPopulateLimit( KIpsPlgPop3PopulateLimitInitValue ),
     iForcePopulate( aForcePopulate ),
     iSelection( NULL ),
-    iEventHandler( aEventHandler )
+    iEventHandler( aEventHandler ),
+    iAlreadyConnected( EFalse )
     {
     iService = aServiceId; 
     }
@@ -339,6 +340,7 @@
     if ( tentry.Connected() )
         {      
         iState = EConnected; 
+        iAlreadyConnected = ETrue;
         SetActive();
         CompleteThis();
         }
@@ -443,6 +445,14 @@
 TInt CIpsPlgPop3ConnectOp::GetOperationErrorCodeL( )
     {
     FUNC_LOG;
+    
+    if ( iAlreadyConnected )
+        {
+        // Connected state was set in CIpsPlgPop3ConnectOp::ConstructL()
+        // so iOperation is null
+        return KErrNone;
+        }
+        
     if ( !iOperation )
         {
         return KErrNotFound;
--- a/ipsservices/ipssossettings/src/ipssetuidialog.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/src/ipssetuidialog.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -29,6 +29,8 @@
 #include <AknQueryDialog.h>
 #include <layoutmetadata.cdl.h>
 
+#include <miut_err.h>
+
 #include <featmgr.h>
 //</cmail>
 
@@ -894,7 +896,14 @@
     	CleanupStack::PushL(op);
 
     	wait->StartAndShowWaitDialogL();
+        TInt status = wait->iStatus.Int();
     	CleanupStack::PopAndDestroy(3, mySelection); // op, wait, myselection
+
+        // Don't open the folder subscription list if we couldn't log on.
+        if ( status == KErrImapBadLogon )
+            {
+            return EIpsSetUiPageEventResultCancel;
+            }
     	}
     iDialog.SetIgnoreOneBackKey(EFalse); //<cmail>
     // </cmail>
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/data/IpsSosTestApp.rss	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/data/IpsSosTestApp.rss	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : ipssostestapp.rss
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/data/IpsSosTestApp_reg.rss	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/data/IpsSosTestApp_reg.rss	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 
 #include <appinfo.rh>
 #include <ipssostestapp.rsg>
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/group/bld.inf	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/group/bld.inf	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : bld.inf
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/group/ipssostestapp.mmp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/group/ipssostestapp.mmp	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : ipssostestapp.mmp
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPApp.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPApp.h	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : CTestAppApp from TestAppApp.h
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPAppUi.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPAppUi.h	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : CTestAppAppUi from TestAppAppUi.h
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPContainer.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPContainer.h	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : CTestAppContainer from TestAppContainer.h
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPDocument.h	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/TESTAPPDocument.h	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : CTestAppDocument from TestAppDocument.h
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/ipssostestapp.loc	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/ipssostestapp.loc	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : ipssostestapp.loc
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/testapp.hrh	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/inc/testapp.hrh	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : TestApp resource header file TestApp.hrh
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/install/ipssostestapp.pkg	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/install/ipssostestapp.pkg	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,18 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description: 
+;
 ;
 ; Installation file for TestApp application
 ;
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPApp.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPApp.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : CTestAppApp from TestAppApp.cpp
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPAppUi.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPAppUi.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : CTestAppAppUi from TestAppAppUi.cpp
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPContainer.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPContainer.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -1,15 +1,21 @@
 /*
-* ============================================================================
-*  Name     : CTestAppContainer from TestAppContainer.h
-*  Part of  : TestApp
-*  Created  : 08.10.2004 by Jalemine
-*  Implementation notes:
-*     Initial content was generated by Series 60 AppWizard.
-*  Version  :
-*  Copyright: Digia
-* ============================================================================
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
 */
 
+
 // INCLUDE FILES
 #include "TestAppContainer.h"
 #include <aknlists.h>
--- a/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPDocument.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/ipsservices/ipssossettings/tsrc/IpsSosTestApp/src/TESTAPPDocument.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -1,3 +1,19 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
 /*
 * ============================================================================
 *  Name     : CTestAppDocument from TestAppDocument.h
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdescriptionfield.cpp	Mon Jan 18 20:08:26 2010 +0200
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerdescriptionfield.cpp	Tue Jan 26 11:45:42 2010 +0200
@@ -2,9 +2,9 @@
 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
-* under the terms of the License "Symbian Foundation License v1.0"
+* under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
-* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.