Revision: 201021 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 09 Jun 2010 09:22:57 +0300
branchRCL_3
changeset 18 6b8f3b30d0ec
parent 17 67369d1b217f
child 20 efd4f1afd43e
Revision: 201021 Kit: 2010123
emailcontacts/contactactionmenu/src/cfsccontactactionmenulist.cpp
emailservices/emailclientapi/src/emailfolder.cpp
emailservices/emailframework/commonlib/group/bld.inf
emailservices/emailframework/commonlib/inc/CFSMailRequestHandler.h
emailservices/emailframework/commonlib/inc/cconnectionstatusqueryext.h
emailservices/emailframework/commonlib/src/CFSMailBox.cpp
emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h
emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp
emailservices/emailstore/message_store/server/inc/ContainerStore.h
emailservices/emailstore/message_store/server/inc/ContainerStoreContainersTable.h
emailservices/emailstore/message_store/server/inc/ContainerStoreDefs.h
emailservices/emailstore/message_store/server/inc/ContainerStoreDeleteHandler.h
emailservices/emailstore/message_store/server/inc/ContainerStoreSortingTable.h
emailservices/emailstore/message_store/server/src/ContainerStore.cpp
emailservices/emailstore/message_store/server/src/ContainerStoreContainersTable.cpp
emailservices/emailstore/message_store/server/src/ContainerStoreDeleteHandler.cpp
emailservices/emailstore/message_store/server/src/ContainerStoreSortingTable.cpp
emailservices/psmruadapter/src/CPsMruAdapter.cpp
emailuis/emailui/conf/freestyleemailui.confml
emailuis/emailui/conf/freestyleemailui_2001E277.crml
emailuis/emailui/data/FreestyleEmailUi.rss
emailuis/emailui/inc/FSAsyncTextFormatter.h
emailuis/emailui/inc/FreestyleEmailCenRepKeys.h
emailuis/emailui/inc/FreestyleEmailUiAppui.h
emailuis/emailui/inc/FreestyleEmailUiConstants.h
emailuis/emailui/inc/FreestyleEmailUiFolderListVisualiser.h
emailuis/emailui/inc/FreestyleEmailUiLayoutHandler.h
emailuis/emailui/inc/FreestyleEmailUiUtilities.h
emailuis/emailui/src/FSAsyncTextFormatter.cpp
emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp
emailuis/emailui/src/FreestyleEmailUiAppui.cpp
emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp
emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp
emailuis/emailui/src/FreestyleEmailUiUtilities.cpp
emailuis/emailui/src/FreestyleEmailUiViewBase.cpp
emailuis/emailui/src/ncsaddressinputfield.cpp
emailuis/emailui/src/ncsaifeditor.cpp
emailuis/emailui/src/ncscomposeview.cpp
emailuis/emailui/src/ncspopuplistbox.cpp
emailuis/uicomponents/inc/fsmultilineitemvisualizer.h
emailuis/uicomponents/inc/fsseparatorvisualizer.h
emailuis/uicomponents/inc/fstreeitemvisualizer.h
emailuis/uicomponents/inc/fstreeplainonelineitemvisualizer.h
emailuis/uicomponents/inc/fstreeplainonelinenodevisualizer.h
emailuis/uicomponents/inc/fstreeplainrootvisualizer.h
emailuis/uicomponents/inc/fstreerichitemvisualizer.h
emailuis/uicomponents/src/fsmultilineitemvisualizer.cpp
emailuis/uicomponents/src/fsseparatorvisualizer.cpp
emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp
emailuis/uicomponents/src/fstreeplainonelinenodevisualizer.cpp
emailuis/uicomponents/src/fstreeplainrootvisualizer.cpp
emailuis/uicomponents/src/fstreerichitemvisualizer.cpp
ipsservices/ipssosaoplugin/inc/IpsSosAOMboxLogic.h
ipsservices/ipssosaoplugin/src/IpsSosAOSchedulerUtils.cpp
ipsservices/ipssosplugin/inc/ipsplgheaders.h
ipsservices/ipssosplugin/inc/ipsplgmsgiterator.h
ipsservices/ipssosplugin/src/ipsplgmsgiterator.cpp
ipsservices/ipssossettings/group/bld.inf
ipsservices/ipssossettings/inc/ipssetutilsconsts.h
ipsservices/ipssossettings/src/ipssetdata.cpp
ipsservices/ipssossettings/src/ipssetgwizardadapter.cpp
ipsservices/ipssossettings/src/ipssetuidialog.cpp
layers.sysdef.xml
meetingrequest/mrgui/loc/mrui.loc
meetingrequest/mrgui/mrfieldbuildercommon/src/cesmreditor.cpp
meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrfield.cpp
meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrrichtextviewer.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/group/esmrfieldbuilderplugin.mmp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrcheckbox.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrlocationfield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrpriorityfield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrrecurencefield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmdatefield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmfield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmtimefield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralldayeventfield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerlocationfield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerpriorityfield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencedatefield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencefield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstartdatefield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstopdatefield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewersyncfield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewertimefield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cmralarmonofffield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentsfield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrmulticalenfield.cpp
meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrunifiededitorfield.cpp
meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp
meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncseditor.cpp
meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp
meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattendeesfield.cpp
meetingrequest/mrgui/src/cesmrview.cpp
meetingrequest/mrgui/src/cmrlistpane.cpp
meetingrequest/mrservices/src/cesmrconflictchecker.cpp
--- a/emailcontacts/contactactionmenu/src/cfsccontactactionmenulist.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailcontacts/contactactionmenu/src/cfsccontactactionmenulist.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -30,7 +30,7 @@
 #include <AknBidiTextUtils.h> 
 #include <AknLayoutFont.h> 
 #include <AknLayout2ScalableDataDef.h>
-#include <aknlayout2scalabledef.h>
+#include <AknLayout2ScalableDef.h>
 #include <layoutmetadata.cdl.h>
 #include <CdlEngine.h>
 #include <coemain.h>
--- a/emailservices/emailclientapi/src/emailfolder.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailclientapi/src/emailfolder.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -195,16 +195,15 @@
         const RSortCriteriaArray& aCriteria )
     {
     RArray<TFSMailSortCriteria> sortCriterias;
-    CleanupClosePushL( sortCriterias );
     CEmailFolder::ToFsSortCriteriaL( aCriteria, sortCriterias );
     
     MFSMailIterator* fsIter = iFolder->ListMessagesL(EFSMsgDataEnvelope, sortCriterias);
     TUint count = iFolder->GetMessageCount();
     
-    CleanupStack::PopAndDestroy(); // sortCriterias
     CMessageIterator* iter = CMessageIterator::NewL( 
         fsIter, iPluginData, count );
     
+    sortCriterias.Reset();
     return iter;
     }        
 
--- a/emailservices/emailframework/commonlib/group/bld.inf	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailframework/commonlib/group/bld.inf	Wed Jun 09 09:22:57 2010 +0300
@@ -32,6 +32,7 @@
 ../inc/cmrcalendarinfo.h |../../../../inc/cmrcalendarinfo.h
 ../inc/cmailmessageext.h |../../../../inc/cmailmessageext.h
 ../inc/cmailboxstateext.h |../../../../inc/cmailboxstateext.h
+../inc/cconnectionstatusqueryext.h |../../../../inc/cconnectionstatusqueryext.h
 
 ../inc/mmrattachment.h |../../../../inc/mmrattachment.h
 ../inc/mmrattendee.h |../../../../inc/mmrattendee.h
--- a/emailservices/emailframework/commonlib/inc/CFSMailRequestHandler.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailframework/commonlib/inc/CFSMailRequestHandler.h	Wed Jun 09 09:22:57 2010 +0300
@@ -74,7 +74,7 @@
     /**
      * destructor.
      */
-     IMPORT_C ~CFSMailRequestHandler();
+     IMPORT_C virtual ~CFSMailRequestHandler();
 
     /**
      * two based constructor
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailframework/commonlib/inc/cconnectionstatusqueryext.h	Wed Jun 09 09:22:57 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* 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:  Message extension interface
+*
+*/
+
+#ifndef CCONNECTIONSTATUSQUERY_H
+#define CCONNECTIONSTATUSQUERY_H
+
+#include "cemailextensionbase.h"
+#include "cfsmailcommon.h"
+#include "FreestyleEmailUiConstants.h"
+
+// interface UID value passed to CFSMailMessageBase::ExtensionL
+const TUid KEmailConnectionStatusQueryExtensionUid = { 0x2002EA82 };
+
+/**
+ * Extension interface for querying connection status directly from plugin
+ */
+class CConnectionStatusQueryExtension : public CEmailExtension
+    {
+
+public:
+    enum TConnectionStatus
+        {
+        // Reserve 0 for undefined status
+        EUndefined,
+        // Mailbox is disconnected
+        EDisconnected,
+        // Mailbox is connected
+        EConnected,
+        // Mailbox is synchronizing
+        ESynchronizing
+        };
+
+public:
+
+    virtual TConnectionStatus ConnectionStatus(
+            const TFSMailMsgId& aMailboxId,
+            TForcedStatus aForcedStatus) const = 0;
+
+protected:
+
+    inline CConnectionStatusQueryExtension();
+
+    };
+
+inline CConnectionStatusQueryExtension::CConnectionStatusQueryExtension() :
+    CEmailExtension( KEmailConnectionStatusQueryExtensionUid )
+    {
+    }
+
+#endif // CCONNECTIONSTATUSQUERY_H
--- a/emailservices/emailframework/commonlib/src/CFSMailBox.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailframework/commonlib/src/CFSMailBox.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -27,6 +27,7 @@
 #include "cfsmailrequestobserver.h"
 
 #include "cmailboxstateext.h"
+#include "cconnectionstatusqueryext.h" 
 
 const TInt KMaxMruEntries( 150 );
 
@@ -79,7 +80,7 @@
         // Release extension needs to be called twice because, previous
         // CExtendableEmail::ExtensionL( KMailboxExtMrCalInfo ) call increased
         // reference counter with one, so there is need to relase this one also.
-        CExtendableEmail::ReleaseExtension( extension );
+        while( extension->DecRef() > 1 ) {}
         CExtendableEmail::ReleaseExtension( extension );
         }
     iFolders.ResetAndDestroy();
@@ -845,7 +846,8 @@
     // exists. It is released in desctrucor
     if( aExtension->Uid() != KMailboxExtMrCalInfo )
         {
-        if( aExtension->Uid() == KEmailSettingExtensionUid )
+        if( aExtension->Uid() == KEmailSettingExtensionUid ||
+		    aExtension->Uid() == KEmailConnectionStatusQueryExtensionUid )
             {
             // check that plugin supports requested extension.
             if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
@@ -888,7 +890,8 @@
             }
         }    
     else if ( aInterfaceUid == KEmailMailboxStateExtensionUid ||
-              aInterfaceUid == KEmailSettingExtensionUid )
+              aInterfaceUid == KEmailSettingExtensionUid || 
+			  aInterfaceUid == KEmailConnectionStatusQueryExtensionUid )
         {
         if ( !extension )
             {
--- a/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailserver/cmailhandlerplugin/inc/cmailcpshandler.h	Wed Jun 09 09:22:57 2010 +0300
@@ -37,6 +37,7 @@
 class CMailExternalAccount;
 class CMailPluginProxy;
 class CEmailObserverPlugin;
+class CMailCpsUpdateHelper;
 
 /**
  * CMail ContentPublishingService Handler class
@@ -77,6 +78,12 @@
      * Wraps all "Update*" methods
      */
     void UpdateFullL();    
+
+    /**
+     * Method that actually does the full update.
+     * Used by CMailCpsUpdateHelper.
+     */
+    void DoUpdateFullL();    
 	
     /**
      *
@@ -453,6 +460,45 @@
     TFSMailMsgId                       iWaitingForNewWidget;
     //
     CAknGlobalNote*                    iQuery;
+    // Helper for limiting rate of updates to Homescreen widget
+    CMailCpsUpdateHelper*              iUpdateHelper;
     };
 
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+// Helper class for limiting rate of updates to Homescreen widget
+
+// Don't make widget updates more often than this delay (milliseconds)
+#define KMailCpsHandlerUpdateDelay 1000
+
+class CMailCpsUpdateHelper : public CTimer
+    {
+    public:
+        static CMailCpsUpdateHelper* NewLC( CMailCpsHandler *aHandler );
+        static CMailCpsUpdateHelper* NewL( CMailCpsHandler *aHandler );
+
+        virtual ~CMailCpsUpdateHelper();
+
+        // Notify that Homescreen widget(s) should be updated
+        void UpdateL();	
+
+    protected:
+        void ConstructL();
+        virtual void RunL();
+        TInt RunError( TInt aError );
+
+    private:
+        CMailCpsUpdateHelper( CMailCpsHandler *aHandler );
+
+        // Performs the update, resets the timer, etc.
+        void DoUpdateL();
+
+        // Handler to use to do updates (not owned)
+        CMailCpsHandler *iCpsHandler;
+        // Whether or not an update is pending
+        TBool iPending;
+    };
+
+
 #endif  //__CMAILCPSHANDLER_H__
--- a/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailserver/cmailhandlerplugin/src/cmailcpshandler.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -54,7 +54,8 @@
 CMailCpsHandler::CMailCpsHandler( MFSNotificationHandlerMgr& aOwner ): 
     CFSNotificationHandlerBase( aOwner ),
     iWaitingForNewMailbox( NULL ),
-    iWaitingForNewWidget()
+    iWaitingForNewWidget(),
+    iUpdateHelper( NULL )
     {
     FUNC_LOG;
     iWaitingForNewWidget.SetPluginId( KNullUid );
@@ -108,6 +109,7 @@
 CMailCpsHandler::~CMailCpsHandler()
     {
     FUNC_LOG;
+    delete iUpdateHelper;
     delete iLiwIf;
     delete iSettings;
     iAccountsArray.ResetAndDestroy();
@@ -350,6 +352,20 @@
 void CMailCpsHandler::UpdateFullL()
     {
     FUNC_LOG;
+    if ( !iUpdateHelper )
+        {
+        iUpdateHelper = CMailCpsUpdateHelper::NewL( this );
+        }
+    iUpdateHelper->UpdateL();
+    }
+
+// ---------------------------------------------------------
+// CMailCpsHandler::DoUpdateFullL
+// ---------------------------------------------------------
+//
+void CMailCpsHandler::DoUpdateFullL()
+    {
+    FUNC_LOG;
     for (TInt instance = 0; instance < iLiwIf->GetWidgetInstanceCount(); instance++)
         {
         if ( iLiwIf->AllowedToPublish(instance) )
@@ -981,13 +997,6 @@
         User::Leave( KErrArgument );
         }
 
-    // Find mailbox instance from array
-    CMailMailboxDetails* mailbox = FindMailboxDetails( aMailbox );
-    if ( !mailbox )
-        {
-        return;
-        }
-
     // typecast param2
     TFSMailMsgId* parentFolder = static_cast<TFSMailMsgId*>( aParam2 );
 
@@ -1018,6 +1027,7 @@
     // Loop through message array
     TFSMailMsgId msgId;
     CFSMailMessage* msg( NULL );
+    CMailMailboxDetails* mailbox;
     for ( TInt ii = 0; ii < iiMax; ii++ )
         {
         msgId = (*newEntries)[ii];
@@ -1038,6 +1048,15 @@
             continue;
             }
 
+        // Find mailbox instance from array
+        mailbox = FindMailboxDetails( aMailbox );
+        if ( !mailbox )
+            {
+            CleanupStack::PopAndDestroy( msg );
+            CleanupStack::PopAndDestroy( newEntries );
+            return;
+            }
+
         // Check if message is duplicate
         if ( IsDuplicate( *mailbox, msgId ) )
             {
@@ -1992,3 +2011,103 @@
         }
     return backupOrRestore;
     }
+
+// ----------------------------------------------------------------------------
+// class CMailCpsUpdateHelper : public CTimer
+// Used to limit the rate of updates to Homescreen widget
+// ----------------------------------------------------------------------------
+//
+
+CMailCpsUpdateHelper::CMailCpsUpdateHelper(
+    CMailCpsHandler *aHandler )
+    : CTimer( EPriorityStandard )  // Could be EPriorityLow
+    , iCpsHandler( aHandler )
+    , iPending( EFalse )
+    {
+    FUNC_LOG;
+    }
+
+CMailCpsUpdateHelper* CMailCpsUpdateHelper::NewLC( CMailCpsHandler* aHandler )
+    {
+    FUNC_LOG;
+    CMailCpsUpdateHelper* self = new ( ELeave ) CMailCpsUpdateHelper( aHandler );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+CMailCpsUpdateHelper* CMailCpsUpdateHelper::NewL( CMailCpsHandler *aHandler )
+    {
+    FUNC_LOG;
+    CMailCpsUpdateHelper* self = CMailCpsUpdateHelper::NewLC( aHandler );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+void CMailCpsUpdateHelper::ConstructL()
+    {
+    FUNC_LOG;
+    CTimer::ConstructL();
+    CActiveScheduler::Add( this );
+    }
+
+CMailCpsUpdateHelper::~CMailCpsUpdateHelper()
+    {
+    FUNC_LOG;
+    iCpsHandler = NULL; // Not owned
+    Cancel();   // Stop any pending request
+    Deque();    // Remove from CActiveScheduler
+    }
+
+// Notification that Homescreen widget(s) should be updated
+void CMailCpsUpdateHelper::UpdateL()
+    {
+    FUNC_LOG;
+    if ( IsActive() )
+        {
+        // Timer is running, so just flag that an update should be sent when
+        // the timer expires.
+        iPending = ETrue;
+        }
+    else
+        {
+        // Timer is not running, so perform an update and set the timer
+        // running.
+        DoUpdateL();
+        }
+    }
+
+// Actually perform an update of the Homescreen widget.  Also sets the timer
+// running and clears the pending flag.
+void CMailCpsUpdateHelper::DoUpdateL()
+    {
+    FUNC_LOG;
+    // Set the timer running.
+    After( KMailCpsHandlerUpdateDelay );
+    // Clear the pending flag.
+    iPending = EFalse;
+    // Do the update.
+    iCpsHandler->DoUpdateFullL();
+    }
+
+void CMailCpsUpdateHelper::RunL()
+    {
+    FUNC_LOG;
+    if ( iPending )
+        {
+        // There was an update request since the last update, so do another
+        // update (and set the timer running again, etc.).
+        DoUpdateL();
+        }
+    }
+
+TInt CMailCpsUpdateHelper::RunError( TInt aError )
+    {
+    FUNC_LOG;
+    if ( KErrNone != aError )
+        {
+        Cancel();   // Stop any pending request
+        }
+    return KErrNone;    // Don't panic the thread
+    }
+
--- a/emailservices/emailstore/message_store/server/inc/ContainerStore.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStore.h	Wed Jun 09 09:22:57 2010 +0300
@@ -428,6 +428,7 @@
         void CommitDatabaseTransactionL();
         
         const TDesC& PrivatePath();
+        TBool DeleteFromSortingTable();
         
 #ifdef _DEBUG                      
         
@@ -489,7 +490,6 @@
         // DELETE HANDLER SUPPORT FUNCTIONS
 		
         friend class CDeleteHandler; 
-
 		void FirstChildL( TContainerId  aId, 
 		                  TContainerId& aChildId, 
 		                  TDbBookmark&  aBookmark );
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreContainersTable.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreContainersTable.h	Wed Jun 09 09:22:57 2010 +0300
@@ -157,6 +157,8 @@
         
         TBool IsEncrypted();
         
+        TContainerId FirstChildForDeleteL( TContainerId aId, TDbBookmark& aBookmark );
+        
 	private:
 	
 	    // ===============
@@ -189,7 +191,7 @@
         void WriteUnencryptedPropertiesColumnL( const TDesC8& aProperties );
         
         void SetEncryptedL( TBool aIsEncrypted );
-
+        TContainerId GetFirstChildForDeleteL( TContainerId aId, TDbBookmark& aBookmark );
 	    // ==================
 	    // PRIVATE ATTRIBUTES
 	    // ==================
@@ -211,4 +213,4 @@
     		
 	}; // end class CContainerStoreContainersTable
 
-#endif
\ No newline at end of file
+#endif
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreDefs.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreDefs.h	Wed Jun 09 09:22:57 2010 +0300
@@ -65,6 +65,7 @@
 _LIT( KContainersTableCountsCol,		  "C008" );
 _LIT( KContainersTableIsRowEncryptedCol,  "C009" );
 _LIT( KContainersTableIdIndex,            "C00A" );
+_LIT( KContainersTableParentIdIndex,      "C00B" );
 
 // Sorting table
 _LIT( KSortingTableName,                  "D001" );
@@ -113,6 +114,10 @@
 _LIT( KMruAddressTableMruNumIndex,        "F007" );
 _LIT( KMruAddressTableMailboxIdIndex,     "F008" );
 
+_LIT(KMarkedForDeleteTableName,                 "H001");
+_LIT(KMarkedForDeleteTableIDCol,                "H002");
+
+
 
 /** Defines the states of encryption/decryption operation 
  *  This state needs to be persisted in the db, so that if
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreDeleteHandler.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreDeleteHandler.h	Wed Jun 09 09:22:57 2010 +0300
@@ -46,7 +46,8 @@
         enum TState
             {
             ERetryDelete,
-            EDelete
+            EDelete,
+            EDeleteFromSortingTable
             };
         // ==============
         // PUBLIC METHODS
--- a/emailservices/emailstore/message_store/server/inc/ContainerStoreSortingTable.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailstore/message_store/server/inc/ContainerStoreSortingTable.h	Wed Jun 09 09:22:57 2010 +0300
@@ -113,6 +113,7 @@
         
         TBool DecryptFirstL( TDbBookmark& aNextRow );
         TBool DecryptNextL( TDbBookmark& aNextRow );
+        TBool DeleteNextContainerMarkedForDeletionL();
         
 	private:
 
@@ -159,8 +160,11 @@
         
         TBool IsEncrypted( RDbRowSet& aRowSet );
         void SetEncryptedL( TBool aIsEncrypted );
-        
-
+        void CreateMarkedForDeletionTableL();
+        void CreateOrOpenMarkedForDeletionTableL();
+        void MarkIdForDeletionL( TContainerId aId);
+        TBool DeleteNextMessageL( TContainerId aId );
+        TBool DeleteFromMarkedForDeletionTableL();
     private:
     
         // ==================
@@ -186,7 +190,8 @@
         TInt                  iIsEncryptedColNum;
         
         TUint                 iFieldsChanged;
-	    
+        RDbTable              iMarkedForDeleteTable;
+        TInt                  iMarkedForDeleteIdColNum;
 	    __LOG_DECLARATION
     		
 	}; // end class CContainerStoreSortingTable
--- a/emailservices/emailstore/message_store/server/src/ContainerStore.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailstore/message_store/server/src/ContainerStore.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -1735,15 +1735,10 @@
 // ==========================================================================
 void CContainerStore::FirstChildL( TContainerId aId, TContainerId& aFirstChildId, TDbBookmark& aBookmark )
     {
-    aFirstChildId = FirstChildL( aId );
-    
-    if( aFirstChildId != KContainerInvalidId )
-        {
-        aBookmark = iContainersTable->Bookmark();
-        } // end if
-        
-     } // end FirstChildL
-		
+    //Used to by the deletehandler to traverse the table for the lowest level child
+    aFirstChildId = iContainersTable->FirstChildForDeleteL( aId, aBookmark );       
+    } 
+
 // ==========================================================================
 // FUNCTION: SearchL
 // ==========================================================================
@@ -1773,6 +1768,7 @@
 
 // ==========================================================================
 // FUNCTION: StartSortingL
+// Will leave with KErrNotFound if the container is marked for deletion.
 // ==========================================================================
 TContainerId CContainerStore::StartSortingL( TMsgStoreSortCriteria& aSortCriteria, 
                                              RPointerArray<HBufC8>& aPropertyNames,
@@ -1781,6 +1777,13 @@
     __LOG_ENTER_SUPPRESS( "StartSortingL" )
     __LOG_WRITE_FORMAT4_INFO( "folder=%x sortField=%d order=%d, aInMemorySort=%d", aSortCriteria.iFolderId, aSortCriteria.iSortBy, aSortCriteria.iSortOrder, aInMemorySort )
 
+    //Seek to make sure the container is not markd for deletion, if the container is marked for deletion
+    //this will leave with KerrNotFound
+    TRAPD(err, iContainersTable->SeekL( aSortCriteria.iFolderId, iHierarchy )); 
+    if (err != KErrNone)
+        {
+        User::LeaveIfError(KErrNotFound);
+        }
     CMsgStoreSortResultRowSet* resultRowSet = iSortingTable->SortL( aSortCriteria, aInMemorySort );
     CleanupStack::PushL( resultRowSet );
     
@@ -2488,6 +2491,15 @@
     iUtils->CommitDatabaseTransactionL();
     }
 
+/*
+ * Check to see there are mailboxes/folder IDs marked for deletion.
+ */
+TBool CContainerStore::DeleteFromSortingTable()
+    {
+    TBool moreToDelete = EFalse;
+    TRAP_IGNORE(moreToDelete = iSortingTable->DeleteNextContainerMarkedForDeletionL());
+    return moreToDelete;   
+    }
 /**
  * 
  */
--- a/emailservices/emailstore/message_store/server/src/ContainerStoreContainersTable.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailstore/message_store/server/src/ContainerStoreContainersTable.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -347,7 +347,7 @@
 	
 	// Create table index.
     CreateIndexL( KContainersTableName, KContainersTableIdIndex, KContainersTableIdCol );
-	
+    CreateIndexL( KContainersTableName, KContainersTableParentIdIndex, KContainersTableParentIdCol );
 	OpenTableL();
 	
 	__LOG_EXIT	
@@ -1208,4 +1208,69 @@
     iTable.SetColL( iIsRowEncryptedColNum, static_cast<TUint8>(aIsEncrypted) );
     }
 
+/*
+ * Search based on the parent ID. This will set the index if one exists and use the find if the index does not
+ * exists which could happen for a existing DB(IAD case)
+ */
+TContainerId CContainerStoreContainersTable::FirstChildForDeleteL( TContainerId aId, TDbBookmark& aBookmark )
+    {
+    __LOG_ENTER( "FirstChildForDeleteL" )
+    __LOG_WRITE8_FORMAT1_INFO( "id=%x", aId )
+    
+    TContainerId returnValue = KContainerInvalidId;
+    
+    TInt rc = iTable.SetIndex( KContainersTableParentIdIndex );
+    if ( rc == KErrNone )
+        {
+        TRAP_IGNORE(returnValue = GetFirstChildForDeleteL(aId, aBookmark));       
+        //remember to set the index back
+        iTable.SetIndex( KContainersTableIdIndex );
+        }
+    else
+        {
+        //older version of the db does not have the index on parent id, so do the slow Find instead
+        const TUint bufSize = 60;
+        TBuf<bufSize> queryString;
+        
+        _LIT( KEquals, "=" );
+        
+        queryString.Copy( KContainersTableParentIdCol );
+        queryString.Append( KEquals );
+        queryString.AppendNum( aId );
+    
+        returnValue = FindL( queryString );
+        if ( returnValue != KContainerInvalidId )
+            {
+            aBookmark = Bookmark();
+            }
+        }
+    
+    __LOG_EXIT
+    return returnValue;   
+    }
 
+/*
+ * Search based on the parent ID. 
+ */
+TContainerId CContainerStoreContainersTable::GetFirstChildForDeleteL( TContainerId aId, TDbBookmark& aBookmark )
+    {
+    __LOG_ENTER( "FirstChildForDeleteL" )
+    __LOG_WRITE8_FORMAT1_INFO( "id=%x", aId )
+    
+    TContainerId returnValue = KContainerInvalidId;
+    //Index on parent id, so we can Seek, faster than Find
+    if ( !iTable.SeekL( aId ) )
+        {
+        __LOG_WRITE_INFO( "No match found" )
+        returnValue = KContainerInvalidId;
+        }
+    else
+        {
+        iTable.GetL();
+        returnValue = iTable.ColUint32( iIdColNum );
+        aBookmark = Bookmark();
+        __LOG_WRITE8_FORMAT1_INFO( "found id=%x", returnValue )
+        }        
+    __LOG_EXIT
+    return returnValue;   
+    }
--- a/emailservices/emailstore/message_store/server/src/ContainerStoreDeleteHandler.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailstore/message_store/server/src/ContainerStoreDeleteHandler.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -115,7 +115,7 @@
 // ==========================================================================
 void CDeleteHandler::FindContainerToDeleteL()
     {
-    TBool done = EFalse;
+    TBool done(EFalse);
     
     TContainerId containerId = KToBeDeletedContainers;
     if ( iState == ERetryDelete )
@@ -163,7 +163,7 @@
     // Delete the lowest node in the hierarchy.        
     TRAPD( result, FindContainerToDeleteL() );
 
-    TBool more = EFalse;    
+    TBool more ( EFalse );    
         
     if( result == KErrNone )
         {        
@@ -201,7 +201,18 @@
         {   
         if ( iState == ERetryDelete )
             {
-            iState = EDelete;
+            //next state
+            iState = EDeleteFromSortingTable;
+            more = ETrue;
+            }
+        else if(iState == EDeleteFromSortingTable)
+            {
+            //check sorting table for containers that have been marked for deletion
+            if(!iContainerStore.DeleteFromSortingTable())
+                {
+                //if nor more then set to next state
+                iState = EDelete;
+                }
             more = ETrue;
             }
         else
@@ -214,21 +225,3 @@
     return more;
     
     } // end DoNextDelete
-
-// ==========================================================================
-// FUNCTION: FinishDeletes
-// ==========================================================================
-void CDeleteHandler::FinishDeletes()
-    {
-    if( IsActive() )
-        {
-        Cancel();
-        
-        // Loop until all deletes are done.
-        while( DoNextDelete() )
-            {
-            }        
-        
-        } // end if
-    
-    } // end FinishDeletes
--- a/emailservices/emailstore/message_store/server/src/ContainerStoreSortingTable.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/emailstore/message_store/server/src/ContainerStoreSortingTable.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -113,6 +113,7 @@
 CContainerStoreSortingTable::~CContainerStoreSortingTable()
 	{
 	iUtils.CloseTable( iTable );
+    iUtils.CloseTable (iMarkedForDeleteTable);
     iEncryptedBuffer.Close();
 	__LOG_DESTRUCT	
 	} // end destructor
@@ -148,7 +149,7 @@
 	
 	// Set the table's index to the ID index.
 	User::LeaveIfError( iTable.SetIndex( KSortingTableMessageIdIndex ) );
-
+	CreateOrOpenMarkedForDeletionTableL();
 	__LOG_EXIT	
 	}
 		
@@ -206,7 +207,6 @@
 	
 	CleanupStack::PopAndDestroy( colSet );
 	
-	// Create index for every column except for mailBoxId
 	CreateIndexL( KSortingTableName, KSortingTableMessageIdIndex,      KSortingTableMessageIdCol    );
 	CreateIndexL( KSortingTableName, KSortingTableFolderIdIndex,       KSortingTableFolderIdCol     );
     CreateIndexL( KSortingTableName, KSortingTableMailBoxIdIndex,      KSortingTableMailBoxIdCol    );
@@ -284,21 +284,9 @@
 void CContainerStoreSortingTable::DeleteMessagesByFolderIdL( TContainerId aFolderId )
 	{
 	__LOG_ENTER_SUPPRESS( "DeleteMessagesByFolderIdL" )
-	__LOG_WRITE8_FORMAT1_DEBUG3( "aFolderId=%x", aFolderId )
-	
-	TBuf<KQuerryBufSize> queryString;
-	queryString.Copy( KDelete );
-	queryString.Append( KFrom );
-	queryString.Append( KSortingTableName );
-	queryString.Append( KWhere );
-	queryString.Append( KSortingTableFolderIdCol );
-	queryString.Append( KEquals );
-	queryString.AppendNum( aFolderId );
-	
-	iUtils.Execute( queryString );
-    
-    //Notify the observer
-    iObserver.FolderDeleted( aFolderId );
+	__LOG_WRITE8_FORMAT1_DEBUG3( "aFolderId=%x", aFolderId )	
+	//Add the folder ID into the MarkedForDeleteTable to be processed in the background.
+	MarkIdForDeletionL(aFolderId);
 	}
 
 // ==========================================================================
@@ -308,20 +296,8 @@
     {
     __LOG_ENTER_SUPPRESS( "DeleteMessagesByMailBoxIdL" )
     __LOG_WRITE8_FORMAT1_DEBUG3( "aMailBoxId=%x", aMailBoxId )
-    
-    TBuf<KQuerryBufSize> queryString;
-    queryString.Copy( KDelete );
-    queryString.Append( KFrom );
-    queryString.Append( KSortingTableName );
-    queryString.Append( KWhere );
-    queryString.Append( KSortingTableMailBoxIdCol );
-    queryString.Append( KEquals );
-    queryString.AppendNum( aMailBoxId );
-    
-    iUtils.Execute( queryString );
-    
-    //Notify the observer
-    iObserver.MailBoxDeleted( aMailBoxId );
+     //Add the mailbox ID into the MarkedForDeleteTable to be processed in the background. 
+    MarkIdForDeletionL( aMailBoxId);   
     }
 
 // ==========================================================================
@@ -1245,3 +1221,142 @@
     iTable.SetColL( iIsEncryptedColNum, static_cast<TUint8>(aIsEncrypted) );
     }
 
+// ==========================================================================
+// FUNCTION: CreateMarkedForDeletionTableL
+// ==========================================================================
+void CContainerStoreSortingTable::CreateMarkedForDeletionTableL()
+    {
+    __LOG_ENTER( "CreateMarkedForDeletionTableL" )
+    
+    // Create table columns
+    CDbColSet* colSet = CDbColSet::NewLC();
+    TDbCol mailboxIdCol( KMarkedForDeleteTableIDCol, EDbColUint32 );
+    colSet->AddL( mailboxIdCol );      
+    // Create table.
+    iUtils.CreateTableL( KMarkedForDeleteTableName, *colSet );   
+    CleanupStack::PopAndDestroy( colSet );             
+    __LOG_EXIT
+    }
+
+// ==========================================================================
+// FUNCTION: CreateOrOpenMarkedForDeletionTableL
+// try to open the Table - create if not found (IAD case) and then open
+// ==========================================================================
+void CContainerStoreSortingTable::CreateOrOpenMarkedForDeletionTableL()
+    {
+    __LOG_ENTER( "OpenMarkedForDeletionTableL" )
+            
+    TRAPD(err, iUtils.OpenTableL( iMarkedForDeleteTable, KMarkedForDeleteTableName ));
+    if(err != KErrNone)
+        {
+        CreateMarkedForDeletionTableL();
+        iUtils.OpenTableL( iMarkedForDeleteTable, KMarkedForDeleteTableName );
+        }
+    CDbColSet* colSet = iMarkedForDeleteTable.ColSetL();
+    CleanupStack::PushL( colSet );
+    //Get the column number
+    iMarkedForDeleteIdColNum = colSet->ColNo( KMarkedForDeleteTableIDCol ); 
+    CleanupStack::PopAndDestroy( colSet );
+    __LOG_EXIT  
+    }
+
+// ==========================================================================
+// FUNCTION: MarkIdForDeletionL
+// Add the ID into the marked for DeletionTable.
+// ==========================================================================
+void CContainerStoreSortingTable::MarkIdForDeletionL( TContainerId aId)
+    {
+    __LOG_ENTER( "MarkIdForDeletionL" )
+    
+    __LOG_WRITE8_FORMAT1_DEBUG3( "Id=%x",aId )
+    iMarkedForDeleteTable.LastL();
+    iMarkedForDeleteTable.InsertL();   
+    iMarkedForDeleteTable.SetColL( iMarkedForDeleteIdColNum, aId );   
+    iMarkedForDeleteTable.PutL();
+    __LOG_EXIT 
+    }
+
+// ==========================================================================
+// FUNCTION: DeleteNextContainerMarkedForDeletionL
+// Use the ID in the MarkedForDeletionTable to delete items from the sorting table .
+// ==========================================================================
+TBool CContainerStoreSortingTable::DeleteNextContainerMarkedForDeletionL()
+    {
+    __LOG_ENTER( " DeleteNextContainerMarkedForDeletionL" )
+    TBool more = EFalse;
+    //set the index to mailboxID to help with seek
+    // Set the table's index to the ID index.
+    if(!iMarkedForDeleteTable.IsEmptyL())
+        {
+        iMarkedForDeleteTable.FirstL();
+        iMarkedForDeleteTable.GetL();
+        TInt deletionID =  iMarkedForDeleteTable.ColUint32(iMarkedForDeleteIdColNum);
+        //check if the ID refers to a folder or is a mailbox and set the index for the table accordingly.
+        if ( ( deletionID & EMsgStoreContainerMask ) == EMsgStoreMailBoxBits)
+            {
+            iTable.SetIndex( KSortingTableMailBoxIdIndex );
+            }
+        else if ( ( deletionID & EMsgStoreContainerMask ) == EMsgStoreFolderBits)
+            {
+            iTable.SetIndex( KSortingTableFolderIdIndex );
+            }
+        //Delete next message from the mailbox/folder
+        TRAPD(err, more = DeleteNextMessageL(deletionID));
+        if (err == KErrNone)
+            {
+            if (!more)
+                {
+                TRAP_IGNORE(more = DeleteFromMarkedForDeletionTableL());
+                }
+            }
+        //reset to the original index 
+        iTable.SetIndex( KSortingTableMessageIdIndex );
+        }
+    __LOG_EXIT
+    return more;
+    }
+
+// ==========================================================================
+// FUNCTION: DeleteNextContainerMarkedForDeletionL
+// Use the ID in the MarkedForDeletionTable to delete items from the sorting table .
+// ==========================================================================
+TBool CContainerStoreSortingTable::DeleteFromMarkedForDeletionTableL()
+    {
+    __LOG_ENTER( " DeleteFromMarkedForDeletionTableL" )
+    TBool more(EFalse);
+    // removed the row once all the messages for that ID have been deleted.
+    iMarkedForDeleteTable.DeleteL();
+    //check if there is another entry
+    if(iMarkedForDeleteTable.NextL())
+        {
+        more = ETrue;
+        }
+    __LOG_EXIT
+    return more;
+    }
+
+// ==========================================================================
+// FUNCTION: DeleteNextMessageL
+// Deletes one row where ID = aId. 
+// @ return Etrue if seek successful
+//          EFalse if seek failed which mean no more messages for the 
+//          given container ID
+// ==========================================================================
+TBool CContainerStoreSortingTable::DeleteNextMessageL( TContainerId aId )
+    {
+    __LOG_ENTER( "DeleteNextMessageL" )
+    __LOG_WRITE8_FORMAT1_DEBUG3( "aId=%x", aId )
+       
+    //Find first matching row
+    TRAPD(err, SeekL( aId ));
+    TBool more(EFalse);
+    if (err ==KErrNone)
+        {
+        iTable.GetL();   
+        iTable.DeleteL();
+        more =  ETrue;
+        }
+    __LOG_EXIT
+    return more;
+    }
+
--- a/emailservices/psmruadapter/src/CPsMruAdapter.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailservices/psmruadapter/src/CPsMruAdapter.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -287,13 +287,14 @@
 // function has trap in  Event() -case> TFSEventNewMailbox and in DeleayedMailboxCreationEventL()
 // should not leave when new mailbox only when new mail address
     CFSMailBox *mailBox = iMailClient->GetMailBoxByUidL(aId);
-    if (mailBox)
+    if ( mailBox )
         {
+        CleanupStack::PushL( mailBox );
         AddMailboxObserverL( aId );
         
         // Get MRU list for this mailbox
         MDesCArray* mruList = mailBox->ListMrusL();
-        mailBox = NULL;
+        CleanupStack::PopAndDestroy( mailBox );
         
         // update the caching status as InProgress
         iDataStoreObserver->UpdateCachingStatus( aDataStoreURI,
Binary file emailuis/emailui/conf/freestyleemailui.confml has changed
Binary file emailuis/emailui/conf/freestyleemailui_2001E277.crml has changed
--- a/emailuis/emailui/data/FreestyleEmailUi.rss	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/data/FreestyleEmailUi.rss	Wed Jun 09 09:22:57 2010 +0300
@@ -617,12 +617,12 @@
             id = EFsEmailUiTbCmdActions;
             control = AVKON_TOOLBAR_EXTENSION
                 {
-                helptxt = qtn_fse_tb_actions;
+                helptxt = qtn_fse_tb_reply;
                 bmpFile = EMAILUI_ICON_FILE;
-                bmpId = EMbmFreestyleemailuiQgn_indi_tb_email_extend;
-                bmpMask = EMbmFreestyleemailuiQgn_indi_tb_email_extend_mask;
+                bmpId = EMbmFreestyleemailuiQgn_indi_tb_email_reply_all;
+                bmpMask = EMbmFreestyleemailuiQgn_indi_tb_email_reply_all_mask;
                 bmpSkinIdMajor = EAknsMajorGeneric;
-                bmpSkinIdMinor = EAknsMinorGenericQgnIndiTbEmailExtend;
+                bmpSkinIdMinor = EAknsMinorGenericQgnIndiTbEmailReplyAll;
                 items =
                     {
                     TBAR_CTRL
--- a/emailuis/emailui/inc/FSAsyncTextFormatter.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/inc/FSAsyncTextFormatter.h	Wed Jun 09 09:22:57 2010 +0300
@@ -2,9 +2,9 @@
 * Copyright (c) 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/FreestyleEmailCenRepKeys.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/inc/FreestyleEmailCenRepKeys.h	Wed Jun 09 09:22:57 2010 +0300
@@ -25,24 +25,24 @@
 //
 
 // <cmail> S60 UID update
-const TUid KFreestyleEmailCenRep					= {0x2001E277};
+const TUid KFreestyleEmailCenRep                    = {0x2001E277};
 // </cmail> S60 UID update
 
 // Global settings values
 
-const TUint32 KFreestyleEmailMessageListLayout	 	= {0x00000001};
+const TUint32 KFreestyleEmailMessageListLayout      = {0x00000001};
 const TInt KFreestyleEmailMessageListLayoutDefault  = 2;
-	
-const TUint32 KFreestyleEmailBodyPreview 			= {0x00000002};
+    
+const TUint32 KFreestyleEmailBodyPreview            = {0x00000002};
 const TInt KFreestyleEmailBodyPreviewDefault = 0;
-	
-const TUint32 KFreestyleEmailTitleDividers 			= {0x00000003};
+    
+const TUint32 KFreestyleEmailTitleDividers          = {0x00000003};
 const TInt KFreestyleEmailTitleDividersDefault = 1;
-	
-const TUint32 KFreestyleEmailDownloadNotification 	= {0x00000004};
+    
+const TUint32 KFreestyleEmailDownloadNotification   = {0x00000004};
 const TInt KFreestyleEmailDownloadNotificationDefault = 1;
-	
-const TUint32 KFreestyleEmailActiveIdle				= {0x00000005};
+    
+const TUint32 KFreestyleEmailActiveIdle             = {0x00000005};
 const TInt KFreestyleEmailActiveIdleDefault = 1;
 
 const TUint32 KFreestyleEmailWarnBeforeDelete       = {0x00000006};
@@ -53,10 +53,10 @@
 
 // Other CR values for FS Email application internal use
 
-const TUint32 KFreestyleEmailEditorCCVisible	 	= {0x00000080};
+const TUint32 KFreestyleEmailEditorCCVisible        = {0x00000080};
 const TInt KFreestyleEmailEditorCCVisibleDefault = 1;
 
-const TUint32 KFreestyleEmailEditorBCVisible	 	= {0x00000081};
+const TUint32 KFreestyleEmailEditorBCVisible        = {0x00000081};
 const TInt KFreestyleEmailEditorBCVisibleDefault = 0;
 
 // Used by Integration MTM
@@ -73,25 +73,40 @@
 const TUint32 KNumberOfMailboxesWithNewEmails                = {0x00001000};
 
 
+// These keys define limits on how much data is allowed to load by plugins 
+/* The setting allows to limit max body size in MfE protocol plugin, KB */
+const TUint32 KFreestyleMfeMaxBodySize                   = 0x00002000;
+/* The setting allows to limit max body size for Ozone protocol plugin, KB */
+const TUint32 KFreestyleOzoneMaxBodySize                 = 0x00002001;
+/* The setting allows to limit max body size in POP/IMAP protocol plugin, KB */
+const TUint32 KFreestyleIPSMaxBodySize                   = 0x00002002;
+/* The setting allows to limit max body size in e-mail viewer, KB */
+const TUint32 KFreestyleViewerMaxBodySize                = 0x00002003;
+/* The setting allows to limit max body size in editor for reply/forward, KB. */
+const TUint32 KFreestyleEditorMaxBodySize                = 0x00002004;
+/* The setting allows to limit max size of mail attachments shown in mail viewer, KB */
+const TUint32 KFreestyleViewerMaxAttachmentSize          = 0x00002005;
+
+
 //
 // Email local variation flags. Flags are defined in emailvariant.hrh
-const TUint32 KEmailLocalVariationFlags	    	= {0x0000FFFE};
+const TUint32 KEmailLocalVariationFlags         = {0x0000FFFE};
 
 // FS 2.05 variation.
 // Values: 1 = hide, 0 = show.
-const TUint32 KEmailHideFS205UIFeature	    	= {0x0000FFFF};
+const TUint32 KEmailHideFS205UIFeature          = {0x0000FFFF};
 const TUint32 KEmailHideFSHiLightUIFeature          = {0x0000FFFF};
 
 //
 // TP Wizard repository in the central repository
 // - used for parameter passing (for creating a new mailbox)
 //
-const TUid KSetupWizardCenRep				        = {0x2000B112};
+const TUid KSetupWizardCenRep                       = {0x2000B112};
 
 // New mailbox parameter values
 
-const TUint32 KSetupWizardAccountType    	    	= {0x00000001};
-	
-const TUint32 KSetupWizardCentrepStartKey	    	= {0x00000002};
+const TUint32 KSetupWizardAccountType               = {0x00000001};
+    
+const TUint32 KSetupWizardCentrepStartKey           = {0x00000002};
                                                                    
 #endif
--- a/emailuis/emailui/inc/FreestyleEmailUiAppui.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/inc/FreestyleEmailUiAppui.h	Wed Jun 09 09:22:57 2010 +0300
@@ -45,17 +45,10 @@
 #include "cmailcustomstatuspaneindicators.h"
 
 // INTERNAL INCLUDES
+#include "cconnectionstatusqueryext.h"
 #include "FreestyleEmailUiPropertySubscriber.h"
 #include "FreestyleEmailUiConstants.h"
 
-enum TForcedStatus
-	{
-    ENoForce = 0,
-    EForceToSync,
-    EForceToConnected,
-    EForceToDisconnected
-    };
-
 // FORWARD DECLARATIONS
 class CFreestyleEmailUiView;
 class CFSEmailUiViewerControl;
@@ -120,17 +113,17 @@
 
 /**
  * TDisplayImagesCache
- * 
+ *
  * Non-persistant cache for display images per message. When user allows images to be downloaded
- * for a message, that message's id will be stored into the cache. Later if the message is re-opened 
- * and it is found in cache, images are allowed to be downloaded no matter what the global setting 
+ * for a message, that message's id will be stored into the cache. Later if the message is re-opened
+ * and it is found in cache, images are allowed to be downloaded no matter what the global setting
  * is. Message is added to cache only when the user presses the button, it will be removed from cache
  * if the mailbox or the message itself is deleted.
  */
 class TDisplayImagesCache
     {
 public:
-    
+
     /**
      * Destructor
      */
@@ -140,29 +133,29 @@
      * Add message to cache.
      */
     void AddMessageL( const CFSMailMessageBase& aMsg );
-    
+
     /**
      * Remove message from cache.
      */
     void RemoveMessage( const CFSMailMessageBase& aMsg );
-    
+
     /**
      * Check if the message is in cache. Returns ETrue if the message is found.
      */
-    TBool Contains( const CFSMailMessageBase& aMsg ) const;    
-    
+    TBool Contains( const CFSMailMessageBase& aMsg ) const;
+
     /**
      * Removes message from cache.
      */
     void RemoveMessage( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId );
-    
+
     /**
      * Removes mailbox from cache.
      */
     void RemoveMailbox( const TFSMailMsgId& aBoxId );
 
 private: // internal methods
-    
+
     /**
      * Adds message to cache.
      */
@@ -171,37 +164,37 @@
     /**
      * Check if the message is in cache. Returns ETrue if the message is found.
      */
-    TBool Contains( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId ) const;    
+    TBool Contains( const TFSMailMsgId& aBoxId, const TFSMailMsgId& aMsgId ) const;
 
     /**
      * Returns index for given mailbox in cache or KErrNotFound if the mailbox cannot
      * be found.
      */
     TInt MailBoxIndex( const TFSMailMsgId& aBoxId ) const;
-    
+
     /**
      * Adds new mailbox and returns index in cache.
      */
     void AddMailBoxL( const TFSMailMsgId& aBoxId, TInt& aCacheIndex );
 
-private:    
-    
+private:
+
     /**
      * Cache item.
      */
-    class TItem  
+    class TItem
         {
     public:
         /**
          * Constructor
-         */        
+         */
         TItem( const TFSMailMsgId& aBoxId );
-        
+
         /**
          * Destructor
          */
         ~TItem();
-        
+
         /**
          * Returns ETrue if given message Id is found in this box.
          */
@@ -216,35 +209,35 @@
          * Removes message from box.
          */
         void RemoveMessage( const TFSMailMsgId& aMsgId );
-    
+
         /**
          * Comparator for TLinearOrder, compares two items
          */
         static TInt CompareItem( const TItem& aItem1, const TItem& aItem2 );
-    
-    private:       
+
+    private:
 
         /**
          * Comparator for TLinearOrder, compares two message Ids
          */
         static TInt CompareMsgId( const TFSMailMsgId& aId1, const TFSMailMsgId& aId2 );
-        
+
         /**
          * Returns index of the message in box or KErrNotFound.
          */
         TInt MessageIndex( const TFSMailMsgId& aMsgId ) const;
-    
+
     private:
-        
-        // Mailbox Id        
+
+        // Mailbox Id
         TFSMailMsgId iMailBoxId;
-        
+
         // Message Ids
-        RArray<TFSMailMsgId> iMessageIds; 
+        RArray<TFSMailMsgId> iMessageIds;
         };
-    
+
     // Cache
-    RArray<TItem> iCache;    
+    RArray<TItem> iCache;
     };
 
 
@@ -416,6 +409,7 @@
     void ShowTitlePaneConnectionStatus();
     // Set connection status icon of title pane to hided
     void HideTitlePaneConnectionStatus();
+    void GetConnectionStatusL( CConnectionStatusQueryExtension::TConnectionStatus& aConnStatus );
     // Draw connection status icon into title pane if set as visible.
     // It is also possible to force connection indicator to wanted value
     // to achieve better user experience.
@@ -468,9 +462,9 @@
     TDisplayMode DisplayMode() const;
     // </cmail>
 
-    
-	
-	
+
+
+
 	/**
      * Returns the current flip status.
      * @return True if the flip is open, false otherwise.
@@ -481,30 +475,30 @@
 
     // Set flag for judging if there is a embedded app in FSEmail.
     void SetEmbeddedApp( TBool aEmbeddedApp );
-    
+
     // Return embedded app.
     TBool EmbeddedApp() const;
-    
+
     // Set flag for judging if previous app is embedded.
     void SetEmbeddedAppToPreviousApp( TBool aEmbeddedApp );
-    
+
     // if previous app is embedded.
     TBool EmbeddedAppIsPreviousApp() const;
-    
+
     // Set flag for judging if email editor started from embedded app.
     void SetEditorStartedFromEmbeddedApp( TBool aEmbeddedApp );
-    
+
     // if email editor started from embedded app.
     TBool EditorStartedFromEmbeddedApp() const;
 
     // returns last seen pointer position
     const TPoint& LastSeenPointerPosition() const;
-    
+
     // Runs fake sync animation (needed for better user experience as
     // otherwise in some connection/sync states pressing "send & receive"
     // wouldn't have any visible effect.
     void RunFakeSyncAnimL();
-    
+
 public: //from MFSMailEventObserver
     /**
      * Framework event message.
@@ -820,7 +814,7 @@
     // Set true, when application is going to be switched to backgound
     // after the view deactivation.
     TBool iSwitchingToBackground;
-    
+
     TDisplayImagesCache iDisplayImagesCache;
 
     // For handling the flip state.
@@ -833,13 +827,13 @@
 
     // Embedded app flag.
     TBool iHasEmbeddedApp;
-    
+
     // Flag for judging if previous app is embedded app.
     TBool iPreviousAppEmbedded;
-    
+
     // Flag for judging if email editor started from embedded app.
     TBool iEditorStartedFromEmbeddedApp;
-    
+
     TPoint iLastPointerPosition;
     };
 
--- a/emailuis/emailui/inc/FreestyleEmailUiConstants.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/inc/FreestyleEmailUiConstants.h	Wed Jun 09 09:22:57 2010 +0300
@@ -84,6 +84,14 @@
 const TInt KTlsHandleDownloadInfo = 0xCECECE;
 const TInt KTlsHandleMailListModel = 0xCECEDE;
 
+enum TForcedStatus 
+    {
+    ENoForce = 0,
+    EForceToSync,
+    EForceToConnected,
+    EForceToDisconnected
+    };
+
 /**
 * Action menu custom item ids
 */
--- a/emailuis/emailui/inc/FreestyleEmailUiFolderListVisualiser.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/inc/FreestyleEmailUiFolderListVisualiser.h	Wed Jun 09 09:22:57 2010 +0300
@@ -105,6 +105,7 @@
     void ChildDoDeactivate();
     void DoTransitionEffect( TBool aDirectionOut );
     void GetParentLayoutsL( RPointerArray<CAlfVisual>& aLayoutArray ) const;
+	void FadeOut( TBool aDirectionOut );
 
 public: // Own public functions
 
--- a/emailuis/emailui/inc/FreestyleEmailUiLayoutHandler.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/inc/FreestyleEmailUiLayoutHandler.h	Wed Jun 09 09:22:57 2010 +0300
@@ -24,7 +24,7 @@
 #include <e32hashtab.h>
 #include <alf/alfenv.h>
 #include <alf/alftextstyle.h>
-#include <aknlayout2scalabledef.h>
+#include <AknLayout2ScalableDef.h>
 #include <AknUtils.h>
 // INTERNAL INCLUDES
 #include "FreestyleEmailUiLayoutData.h"
--- a/emailuis/emailui/inc/FreestyleEmailUiUtilities.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/inc/FreestyleEmailUiUtilities.h	Wed Jun 09 09:22:57 2010 +0300
@@ -282,6 +282,11 @@
     // Creates a displayname of firstname, lastname, emailfield components
     static HBufC* CreateDisplayNameLC( const TDesC& aFirstname, const TDesC& aLastname, const TDesC& aEmailField );
     
+    /**
+     * Determines if the descriptor is a Chinese word
+     */
+    static TBool IsChineseWord( const TDesC& aWord );
+    
     // Get the icon file name including the drive letter and full path
     static void GetFullIconFileNameL( TDes& aFileName );
     
--- a/emailuis/emailui/src/FSAsyncTextFormatter.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/FSAsyncTextFormatter.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -2,9 +2,9 @@
 * Copyright (c) 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.
@@ -17,7 +17,7 @@
 
 #include "emailtrace.h"
 #include "FSAsyncTextFormatter.h"
-#include <FRMTLAY.H>
+#include <frmtlay.h>
 #include <e32base.h>
 
 const TUint KCharsFormattedPerRun = 2000;
--- a/emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -99,12 +99,28 @@
 void CFSEmailDownloadInfoMediator::AddObserver( MFSEmailDownloadInformationObserver* aObserver, TFSMailMsgId aMessageId )
 	{
     FUNC_LOG;
-	TRequestObserver newObserver = {aObserver, aMessageId };
+	TRequestObserver newObserver = { aObserver, aMessageId };
+	//To avoid adding duplicate observers 
+	for ( TInt i=0; i<iObserverArray.Count(); i++ )
+	    {
+	    if ( newObserver.iObserver == iObserverArray[i].iObserver && newObserver.iMessageId == iObserverArray[i].iMessageId )
+	        {
+	        return;
+	        }
+	    }
 	iObserverArray.Append( newObserver );
 	}
 
 void CFSEmailDownloadInfoMediator::AddObserver( MFSEmailDownloadInformationObserver* aObserver )
 	{
+    //To avoid adding duplicate observers 
+    for ( TInt i=0; i<iAllObserverArray.Count(); i++ )
+        {
+        if ( aObserver == iAllObserverArray[i] )
+            {
+            return;
+            }
+        }
 	iAllObserverArray.Append(aObserver);
 	}
 
--- a/emailuis/emailui/src/FreestyleEmailUiAppui.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/FreestyleEmailUiAppui.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -878,6 +878,12 @@
         return;
         }
 
+    if ( iActiveMailbox ) 
+        {
+        StartMonitoringL(); // start connect automatically
+        SyncActiveMailBoxL(); // start sync
+        }
+
     // Do nothing if the externally activated view was already active
     if ( iCurrentActiveView->Id() != aViewId )
         {
@@ -1327,6 +1333,14 @@
 	    {
 	    return; //"consume" event
 	    }
+    
+    // to disable deleting message shortcut (bakspace) when fowarding/replying
+    if ( EStdKeyBackspace == key && aEvent.Type() == EEventKeyDown 
+         && iCurrentActiveView == iComposeView )
+        {
+        return; // consume event
+        }
+    
 	//</cmail>
 	if ( EStdKeyNo == key && aEvent.Type() == EEventKeyDown )
 		{
@@ -1412,7 +1426,16 @@
             }
         }
 
-    CAknAppUi::HandleWsEventL(aEvent, aDestination);
+    if ( aEvent.Key()->iCode == EKeyEscape && 
+         iCurrentActiveView == iComposeView &&
+         iComposeView->IsOpeningWaitNoteVisible() )
+        {
+        return;
+        }
+    else
+        {
+        CAknAppUi::HandleWsEventL(aEvent, aDestination);
+        }
 	}
 
 CAlfDisplay& CFreestyleEmailUiAppUi::Display()
@@ -2520,7 +2543,59 @@
 		titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconBitmap && iConnectionIconMask);
 		}
 	iConnectionStatusIconAnimTimer->Stop();
-	iFakeSyncAnimStopTimer->Stop();
+    }
+
+void CFreestyleEmailUiAppUi::GetConnectionStatusL( 
+        CConnectionStatusQueryExtension::TConnectionStatus& aConnStatus )
+    {
+    aConnStatus = CConnectionStatusQueryExtension::EDisconnected;
+    CFSMailBox* mailbox = GetActiveMailbox();
+    if ( mailbox )
+        {
+        CConnectionStatusQueryExtension* extension( NULL );
+        TRAPD( error, extension = static_cast<CConnectionStatusQueryExtension*>( 
+                mailbox->ExtensionL( KEmailConnectionStatusQueryExtensionUid ) ) );
+        
+        if ( error && error != KErrNotSupported )
+            {
+            User::Leave( error );
+            }
+        
+        if ( extension )
+            {
+            // Query from extension - the new way
+            aConnStatus = extension->ConnectionStatus(
+                                mailbox->GetId(), iForcedConnectionStatus);
+            mailbox->ReleaseExtension( extension );
+            }
+        else
+            {
+            // Retain the old way        
+            TFSMailBoxStatus boxStatus( mailbox->GetMailBoxStatus() );
+            TSSMailSyncState syncState( mailbox->CurrentSyncState() );
+
+            if ( ( boxStatus == EFSMailBoxOnline && iForcedConnectionStatus != EForceToDisconnected ) ||
+                    (iForcedConnectionStatus == EForceToConnected || iForcedConnectionStatus == EForceToSync) )
+                {
+                if (syncState == EmailSyncing || syncState == InboxSyncing ||
+                        syncState == OutboxSyncing || syncState == SentItemsSyncing ||
+                        syncState == DraftsSyncing || syncState == CalendarSyncing ||
+                        syncState == ContactsSyncing || syncState == TasksSyncing ||
+                        syncState == FilesSyncing || iForcedConnectionStatus == EForceToSync )
+                    {
+                    aConnStatus = CConnectionStatusQueryExtension::ESynchronizing;
+                    }
+                else
+                    {
+                    aConnStatus = CConnectionStatusQueryExtension::EConnected;
+                    }
+                }
+            else // EFSMailBoxOffline
+                {
+                aConnStatus = CConnectionStatusQueryExtension::EDisconnected;
+                }            
+            }
+        }
     }
 
 void CFreestyleEmailUiAppUi::UpdateTitlePaneConnectionStatus(
@@ -2531,20 +2606,9 @@
 
     if ( iConnectionStatusVisible )
     	{
-
-    	// Get connection status of the current mailbox
-    	TFSMailBoxStatus connectionStatus = EFSMailBoxOffline;
-    	TSSMailSyncState syncState = Idle;
-		CFSMailBox* mb = GetActiveMailbox();
-		if ( mb )
-			{
-			connectionStatus = mb->GetMailBoxStatus();
-			syncState = mb->CurrentSyncState();
-			}
-
 		TUid titlePaneUid = TUid::Uid( EEikStatusPaneUidTitle );
 		CEikStatusPaneBase::TPaneCapabilities subPaneTitle =
-            StatusPane()->PaneCapabilities( titlePaneUid );
+			StatusPane()->PaneCapabilities( titlePaneUid );
 
 		if ( subPaneTitle.IsPresent() && subPaneTitle.IsAppOwned() )
 			{
@@ -2554,44 +2618,42 @@
 
 			// Set connection icon
 			iConnectionStatusIconAnimTimer->Stop();
-			iFakeSyncAnimStopTimer->Stop();
 			iConnectionIconBitmap = 0;
 			iConnectionIconMask = 0;
-			TSize iconSize = LayoutHandler()->statusPaneIconSize();
-			TBool startTimer = EFalse;
-			if ( ( connectionStatus == EFSMailBoxOnline && iForcedConnectionStatus != EForceToDisconnected ) ||
-					(iForcedConnectionStatus == EForceToConnected || iForcedConnectionStatus == EForceToSync) )
-				{
-				if (syncState == EmailSyncing || syncState == InboxSyncing ||
-				        syncState == OutboxSyncing || syncState == SentItemsSyncing ||
-				        syncState == DraftsSyncing || syncState == CalendarSyncing ||
-				        syncState == ContactsSyncing || syncState == TasksSyncing ||
-				        syncState == FilesSyncing || iForcedConnectionStatus == EForceToSync )
-				    {
-				    TRAP_IGNORE( FsTextureManager()->ProvideBitmapL(
+			TBool startTimer = EFalse;			
+
+            // Get connection status of the current mailbox
+            CConnectionStatusQueryExtension::TConnectionStatus connectionStatus;       
+            TRAP_IGNORE( GetConnectionStatusL( connectionStatus ) );
+
+            switch ( connectionStatus )
+			    {
+                case CConnectionStatusQueryExtension::EConnected:
+                    TRAP_IGNORE( FsTextureManager()->ProvideBitmapL(
+                        EStatusTextureConnected, iConnectionIconBitmap, iConnectionIconMask ) );
+                    break;
+                case CConnectionStatusQueryExtension::EDisconnected:
+                    TRAP_IGNORE( FsTextureManager()->ProvideBitmapL(
+                            EStatusTextureDisconnectedGeneral, iConnectionIconBitmap, iConnectionIconMask ) );
+                    break;
+                case CConnectionStatusQueryExtension::ESynchronizing:
+                    TRAP_IGNORE( FsTextureManager()->ProvideBitmapL(
                         EStatusTextureSynchronising, iConnectionIconBitmap, iConnectionIconMask ) );
-				    startTimer = ETrue;
-				    }
-				else
-				    {
-				    TRAP_IGNORE( FsTextureManager()->ProvideBitmapL(
-                        EStatusTextureConnected, iConnectionIconBitmap, iConnectionIconMask ) );
-				    }
-				}
-			else // EFSMailBoxOffline
-				{
-				TRAP_IGNORE( FsTextureManager()->ProvideBitmapL(
-						EStatusTextureDisconnectedGeneral, iConnectionIconBitmap, iConnectionIconMask ) );
-				}
+                    startTimer = ETrue;
+                    break;
+                default:
+                    break;
+			    }
 
 			if ( iConnectionIconBitmap )
 				{
+                TSize iconSize( LayoutHandler()->statusPaneIconSize() );
 				AknIconUtils::SetSize( iConnectionIconBitmap, iconSize, EAspectRatioNotPreserved );
 				}
 			titlePane->SetSmallPicture( iConnectionIconBitmap, iConnectionIconMask, iConnectionIconMask && iConnectionIconBitmap );
 			if (startTimer)
 			    {
-			    iConnectionStatusIconAnimTimer->Start(KConnectionStatusIconRotationInterval);
+			    iConnectionStatusIconAnimTimer->Start( KConnectionStatusIconRotationInterval );
 			    }
             titlePane->DrawNow();
 			}
--- a/emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/FreestyleEmailUiCLSListsHandler.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -32,7 +32,6 @@
 #include "FreestyleEmailUiUtilities.h"
 #include "FreestyleEmailUiCLSItem.h"
 
-
 // ================= MEMBER FUNCTIONS ==========================================
 // -----------------------------------------------------------------------------
 // CFSEmailUiClsListsHandler::NewL
@@ -335,13 +334,23 @@
     searchSettings->SetDisplayFieldsL(displayFields);
     CleanupStack::Pop(&displayFields);
     displayFields.Close();
-
    
     // Set the new sort order of data fields
     RArray<TInt> sortOrder;
     CleanupClosePushL(sortOrder);
-    sortOrder.AppendL(R_VPBK_FIELD_TYPE_FIRSTNAME);
-    sortOrder.AppendL(R_VPBK_FIELD_TYPE_LASTNAME);
+    
+    // change sorting order for Chinese to LNFN
+    if ( User::Language() == ELangPrcChinese )
+        {
+        sortOrder.AppendL( R_VPBK_FIELD_TYPE_LASTNAME );
+        sortOrder.AppendL( R_VPBK_FIELD_TYPE_FIRSTNAME );
+        }
+    else // default sorting order FN LN
+        {
+        sortOrder.AppendL( R_VPBK_FIELD_TYPE_FIRSTNAME );
+        sortOrder.AppendL( R_VPBK_FIELD_TYPE_LASTNAME );
+        }
+    
     sortOrder.AppendL(R_VPBK_FIELD_TYPE_EMAILGEN);
     sortOrder.AppendL(R_VPBK_FIELD_TYPE_EMAILHOME);
     sortOrder.AppendL(R_VPBK_FIELD_TYPE_EMAILWORK);
--- a/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/FreestyleEmailUiFolderListVisualiser.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -294,7 +294,7 @@
     iListLayout = CAlfDeckLayout::AddNewL( *iControl, iParentLayout );
     iListLayout->SetFlags(EAlfVisualFlagLayoutUpdateNotification|EAlfVisualFlagAutomaticLocaleMirroringEnabled);
 
-    iTreeVisualizer = CFsTreeVisualizerBase::NewL(iControl, *iListLayout, !iFullScreen);
+    iTreeVisualizer = CFsTreeVisualizerBase::NewL( iControl, *iListLayout );
     iTreeVisualizer->SetItemExpansionDelay( iAppUi.LayoutHandler()->ListItemExpansionDelay() );
     iTreeVisualizer->SetScrollTime( iAppUi.LayoutHandler()->ListScrollingTime() );
     iTreeVisualizer->SetFadeInEffectTime( iAppUi.LayoutHandler()->CtrlBarListFadeEffectTime() );
@@ -421,6 +421,10 @@
 
         iTreeVisualizer->RefreshListViewL();
         }
+    
+    ResizeListIcons();
+    ResizeListItemsL();
+    
 	}
 
 // ---------------------------------------------------------------------------
@@ -677,6 +681,10 @@
     iCustomMessageId = KFolderListSelectFolder;
     iCurrentFolderId = aFolderId;
     DoShowInPopupL( aButton, aCallback, NULL );
+    
+    ResizeListIcons();
+    ResizeListItemsL();
+    
     }
 
 // ---------------------------------------------------------------------------
@@ -1155,7 +1163,7 @@
             }
         else 
         	{
-        	eventHandled = iTreeList->TreeControl()->OfferEventL(aEvent);
+        	eventHandled = ETrue;
         	}
         }
     return eventHandled;
@@ -1316,6 +1324,19 @@
     }
 
 // ---------------------------------------------------------------------------
+// Hide or show CAlfVisuals ( used for activation or deactivation )
+// ---------------------------------------------------------------------------
+//
+void CFSEmailUiFolderListVisualiser::FadeOut( TBool aDirectionOut )
+	{
+    FUNC_LOG;
+    if ( aDirectionOut && iTreeVisualizer != NULL )
+        {
+        iTreeVisualizer->HideList();
+        }
+	}
+
+// ---------------------------------------------------------------------------
 // Handle commands
 // ---------------------------------------------------------------------------
 //
@@ -2463,6 +2484,8 @@
     aItemVisualizer->SetFontHeight( iAppUi.LayoutHandler()->ListItemFontHeightInTwips( !iFullScreen ) );
 	// Set node bolded
 	aItemVisualizer->SetTextBold( EFalse );
+	aItemVisualizer->MarqueeL( EFsTextMarqueeForth, 30, 1000, 500, 1 ); // same values as in CFsTreeVisualizerBase constructor
+	aItemVisualizer->OffWrapping();
 	}
 
 // ---------------------------------------------------------------------------
--- a/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/FreestyleEmailUiMailListVisualiser.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -5616,16 +5616,18 @@
   	iControlBarControl->SetRectL( iAppUi.LayoutHandler()->GetControlBarRect() );
 
     const TRect newEmailButtonRect( iAppUi.LayoutHandler()->GetControlBarNewEmailButtonRect() );
+	//Add comments by luo gen(e0645320)
+	//The position of button should be set according to the size of button, so set size first
+    iNewEmailButton->SetSize( newEmailButtonRect.Size() );
     iNewEmailButton->SetPos( newEmailButtonRect.iTl );
-    iNewEmailButton->SetSize( newEmailButtonRect.Size() );
 
     const TRect folderButtonRect( iAppUi.LayoutHandler()->GetControlBarFolderListButtonRect() );
+    iFolderListButton->SetSize( folderButtonRect.Size() );
   	iFolderListButton->SetPos( folderButtonRect.iTl );
-  	iFolderListButton->SetSize( folderButtonRect.Size() );
 
     const TRect sortButtonRect( iAppUi.LayoutHandler()->GetControlBarSortButtonRect() );
+    iSortButton->SetSize( sortButtonRect.Size() );
    	iSortButton->SetPos( sortButtonRect.iTl );
-    iSortButton->SetSize( sortButtonRect.Size() );
 
 	TInt var = Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0;
 	TAknLayoutText textLayout;
--- a/emailuis/emailui/src/FreestyleEmailUiUtilities.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/FreestyleEmailUiUtilities.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -3058,18 +3058,55 @@
 
 	else
 		{
-		//Displayname = "firstname lastname"
-		displayname = HBufC::NewLC( aFirstname.Length() +
-									KSpace().Length() +
-									aLastname.Length() );
-		displayname->Des().Copy( aFirstname );
-		displayname->Des().Append( KSpace );
-		displayname->Des().Append( aLastname );
-		}
+		//Displayname="firstname lastname" or "LastnameFirstname" for Chinese
+
+        if( TFsEmailUiUtility::IsChineseWord( aFirstname ) 
+            || TFsEmailUiUtility::IsChineseWord( aLastname ) )
+            {
+            TInt length = aFirstname.Length() + aLastname.Length();
+            displayname = HBufC::NewLC( length );
+            displayname->Des().Copy( aLastname );
+            displayname->Des().Append( aFirstname );
+            }
+        else
+            {
+            TInt length = aFirstname.Length() + KSpace().Length() 
+            		+ aLastname.Length();
+            displayname = HBufC::NewLC( length );
+	    displayname->Des().Copy( aFirstname );
+	    displayname->Des().Append( KSpace );
+	    displayname->Des().Append( aLastname );
+	    }
+        }
 
 	return displayname;
 	}
 
+
+// ---------------------------------------------------------
+// Find if text is including Chinese word  
+// ---------------------------------------------------------
+//
+TBool TFsEmailUiUtility::IsChineseWord( const TDesC& aWord )
+    {
+    TBool isChineseSearchStr = EFalse;
+    const TUint KChineseUnicodeSpanBegin = 0x3400;
+    const TUint KChineseUnicodeSpanEnd = 0x9fff;
+    const TInt len = aWord.Length();
+
+    for ( TInt ii = 0; ii < len; ii++ )
+        {
+        if ( (TInt) aWord[ii] >= KChineseUnicodeSpanBegin 
+             && (TInt) aWord[ii] <= KChineseUnicodeSpanEnd )
+            {
+            isChineseSearchStr = ETrue;
+            break;
+            }
+        }
+    return isChineseSearchStr;
+    }
+
+
 // -----------------------------------------------------------------------------
 // TFsEmailUiUtility::GetFullIconFileNameL
 // -----------------------------------------------------------------------------
--- a/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -202,9 +202,7 @@
         CAknToolbar* toolbar(Toolbar());
         if (toolbar)
             {
-            //toolbar->SetToolbarVisibility(EFalse);
-            // Call MakeVisible directly because SetToolbarVisibility never
-            // actually hides fixed toolbar.
+            // toolbar->SetToolbarVisibility(EFalse);
             toolbar->MakeVisible(EFalse);
             }
         }
@@ -220,7 +218,8 @@
         CAknToolbar* toolbar(Toolbar());
         if (toolbar)
             {
-            toolbar->SetToolbarVisibility(ETrue);
+            // toolbar->SetToolbarVisibility(ETrue);
+            toolbar->MakeVisible(ETrue);
             }
         }
     }
--- a/emailuis/emailui/src/ncsaddressinputfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/ncsaddressinputfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -32,7 +32,7 @@
 #include <sysutil.h>
 #include <AknUtils.h>
 #include <FreestyleEmailUi.rsg>
-#include <AknPhysics.h>
+#include <aknphysics.h>
 
 #include "FreestyleEmailUiAppui.h"
 #include "FreestyleEmailUiLayoutData.h"
--- a/emailuis/emailui/src/ncsaifeditor.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/ncsaifeditor.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -39,6 +39,7 @@
 const TChar KCharAddressDelimeterSemiColon = ';';
 const TChar KCharAddressDelimeterComma = ',';
 const TChar KCharSpace = ' ';
+const TChar KCharAt = '@';
 
 // ---------------------------------------------------------------------------
 // CNcsAifEntry::NewL
@@ -349,6 +350,11 @@
         iTextSelection = Selection();        
         ret = CNcsEditor::OfferKeyEventL( aKeyEvent, aType );
         }
+    
+    if( ret == EKeyWasNotConsumed  && aType == EEventKeyDown )
+        {
+        HandleTextUpdateDeferred(); // update for lang that don't support CPS
+        }
     return ret;
     }
 
@@ -1362,21 +1368,40 @@
     // start looking for entries separated with semicolon
     TInt start( 0 );
     TInt end( ptr.Length() );
+    TInt lastSentinel = KErrNotFound;
     
     for ( TInt ii = 0; ii < end; ++ii )
         {
         TChar character = ptr[ii];
+        TBool addAddress = EFalse;
         
         if ( IsSentinel( character ) )
             {
-            if ( character == KCharAddressDelimeterComma )
+            if ( character == KCharSpace )
+                {
+                if ( ptr.Mid( start, ii-start ).Locate( KCharAt ) 
+                        != KErrNotFound )
+                    {
+                    ptr[ii] = KCharAddressDelimeterSemiColon;
+                    lastSentinel = ii;
+                    addAddress = ETrue;
+                    }
+                }
+            else if ( character == KCharAddressDelimeterComma )
                 {
                 // Replace comma with semicolon
                 ptr[ii] = KCharAddressDelimeterSemiColon;
+                lastSentinel = ii;
+                addAddress = ETrue;
+                }
+            else if ( character == KCharAddressDelimeterSemiColon )
+                {
+                lastSentinel = ii;
+                addAddress = ETrue;
                 }
 
             // Create new entry.
-            if ( start < end )
+            if ( addAddress && start < end )
                 {
                 // only if longer than 0, if not we'll get 
                 // "empty" email address
@@ -1386,10 +1411,20 @@
                     start = Min( ii + 1, end );
                     entriesFound = ETrue;
                     }
+                addAddress = EFalse;
                 }
             }
         }
     
+    // add email that wasn't ended with semicolon
+    if ( lastSentinel != KErrNotFound )
+        {
+        if ( lastSentinel < end && start < end )
+            {
+            AddAddressL( KNullDesC(), ptr.Mid(start, end-start) );
+            }
+        }
+    
     CleanupStack::PopAndDestroy( text );
         
     return entriesFound;
@@ -1505,7 +1540,7 @@
     {
     FUNC_LOG;
     return ( aCharacter == KCharAddressDelimeterSemiColon || 
-        aCharacter == KCharAddressDelimeterComma );
+        aCharacter == KCharAddressDelimeterComma || aCharacter == KCharSpace );
     }
 
 // ---------------------------------------------------------------------------
--- a/emailuis/emailui/src/ncscomposeview.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/ncscomposeview.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -965,6 +965,7 @@
                     CAknConfirmationNote* note = 
                         new (ELeave) CAknConfirmationNote( ETrue ); //waiting
                     note->SetTimeout( CAknNoteDialog::ELongTimeout );
+                    note->SetTone( CAknNoteDialog::ENoTone );
                     note->ExecuteLD( *confMessage );
                     CleanupStack::PopAndDestroy( confMessage );
                     DoSafeExit(); // Exit after successful sending
@@ -2464,17 +2465,13 @@
         item = static_cast<CFSEmailUiSendAttachmentsListModelItem*>( 
                 attachmentModel->Item( 
                     iContainer->FocusedAttachmentLabelIndex() ) );
-        if ( !item || item->IsRemote() )
-            {
-            // Only non-remote attachments can be opened
-            iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdOpenAttachment, ETrue );
-            }
-        }
-
-    if ( !item || item->IsReadOnly() )
-        {
-        // Only non-readonly attachments can be removed
-        iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdRemoveAttachment, ETrue );
+        // Only non-remote attachments can be opened
+        TBool dimOpenMenuItem = !item || item->IsRemote(); 
+        iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdOpenAttachment, dimOpenMenuItem );
+
+        // Read-only attachments cannot be removed
+        TBool dimRemoveMenuItem = !item || item->IsReadOnly();  
+        iStylusPopUpMenu->SetItemDimmed( EFsEmailUiCmdRemoveAttachment, dimRemoveMenuItem );
         }
 
     // Set the position for the popup
--- a/emailuis/emailui/src/ncspopuplistbox.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/emailui/src/ncspopuplistbox.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -23,8 +23,8 @@
 #include <FreestyleEmailUi.rsg>						// R_FSE_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH
 #include <StringLoader.h>						// StringLoader
 #include <CPbkContactEngine.h>
-#include <aknsdrawutils.h>
-#include <aknsutils.h>
+#include <AknsDrawUtils.h>
+#include <AknsUtils.h>
 #include <aknlayoutscalable_apps.cdl.h>
 #include <aknlayoutscalable_avkon.cdl.h>
 
--- a/emailuis/uicomponents/inc/fsmultilineitemvisualizer.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/inc/fsmultilineitemvisualizer.h	Wed Jun 09 09:22:57 2010 +0300
@@ -57,7 +57,7 @@
     */
     virtual ~CFsMultiLineItemVisualizer();    
 
-public:
+public:    
     
     //visualizer's interface
     
@@ -173,6 +173,12 @@
                           CAlfTexture*& aMenuIcon,
                           const TUint aTimeout = 0,
                           TBool aUpdateData = ETrue);
+
+    
+    /**
+     * This method sets flag disable wrapping the text item.
+     */
+    virtual void OffWrapping();
     
     /**
      * From MFsTreeItemVisualizer.
--- a/emailuis/uicomponents/inc/fsseparatorvisualizer.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/inc/fsseparatorvisualizer.h	Wed Jun 09 09:22:57 2010 +0300
@@ -224,7 +224,11 @@
                           const TInt aMarqueeCycleStartDelay,
                           const TInt aMarqueeRepetitions);
     
-
+    /**
+     * This method sets flag disable wrapping the text item.
+     */
+    virtual void OffWrapping();
+    
 protected:
 
     /**
--- a/emailuis/uicomponents/inc/fstreeitemvisualizer.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/inc/fstreeitemvisualizer.h	Wed Jun 09 09:22:57 2010 +0300
@@ -398,6 +398,10 @@
                         const TUint aTimeout = 0,
                         TBool aUpdateData = ETrue) = 0;
 
+    /**
+    * This method sets flag disable wrapping the text item.
+    */
+    virtual void OffWrapping() = 0;
     
     /**
      * A call to this function means that the item goes out of the visible 
--- a/emailuis/uicomponents/inc/fstreeplainonelineitemvisualizer.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/inc/fstreeplainonelineitemvisualizer.h	Wed Jun 09 09:22:57 2010 +0300
@@ -126,6 +126,11 @@
                           const TInt aMarqueeRepetitions);
     
     /**
+     * This method sets flag disable wrapping the text item.
+     */    
+    virtual void OffWrapping();
+    
+    /**
      * 
      */
     virtual TBool OfferEventL(const TAlfEvent& aEvent);
@@ -183,6 +188,8 @@
      * Clet for text marquee.
      */
     TFsMarqueeClet* iTextMarquee;
+    
+    TBool iManualWrapper;
 
     };
     
--- a/emailuis/uicomponents/inc/fstreeplainonelinenodevisualizer.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/inc/fstreeplainonelinenodevisualizer.h	Wed Jun 09 09:22:57 2010 +0300
@@ -195,6 +195,11 @@
                           const TInt aMarqueeStartDelay,
                           const TInt aMarqueeCycleStartDelay,
                           const TInt aMarqueeRepetitions);
+                          
+    /**
+    * This method sets flag disable wrapping the text item.
+    */
+    virtual void OffWrapping();
     
     /**
      * 
--- a/emailuis/uicomponents/inc/fstreeplainrootvisualizer.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/inc/fstreeplainrootvisualizer.h	Wed Jun 09 09:22:57 2010 +0300
@@ -123,7 +123,10 @@
                           const TInt aMarqueeCycleStartDelay,
                           const TInt aMarqueeRepetitions);
 
-
+    /**
+     * This method sets flag disable wrapping the text item.
+     */        
+    virtual void OffWrapping();
 protected:
 
     /**
--- a/emailuis/uicomponents/inc/fstreerichitemvisualizer.h	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/inc/fstreerichitemvisualizer.h	Wed Jun 09 09:22:57 2010 +0300
@@ -149,7 +149,11 @@
                           const TInt aMarqueeStartDelay,
                           const TInt aMarqueeCycleStartDelay,
                           const TInt aMarqueeRepetitions);
-
+    
+    /**
+     * This method sets flag disable wrapping the text item.
+     */    
+    virtual void OffWrapping(); 
 protected:
 
     /**
--- a/emailuis/uicomponents/src/fsmultilineitemvisualizer.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/src/fsmultilineitemvisualizer.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -1383,6 +1383,15 @@
     return size;
     }
 
+// ---------------------------------------------------------------------------
+//  From MFsTreeItemVisualizer.
+//  This method sets flag disable wrapping the text item.
+// ---------------------------------------------------------------------------
+//
+void CFsMultiLineItemVisualizer::OffWrapping()
+	{
+	FUNC_LOG;
+	}
 
 //End of file
 
--- a/emailuis/uicomponents/src/fsseparatorvisualizer.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/src/fsseparatorvisualizer.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -403,3 +403,7 @@
     CFsTreeItemVisualizerBase::ConstructL();
     }
 
+void CFsSeparatorVisualizer::OffWrapping()
+	{
+	FUNC_LOG;
+	}
--- a/emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/src/fstreeplainonelineitemvisualizer.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -540,14 +540,19 @@
                 iTextVisual->SetColor( textColor );
                 iTextVisual->SetTextStyle( styleId );
 
-//                iTextVisual->SetWrapping(CAlfTextVisual::ELineWrapManual);
+                if ( iManualWrapper )
+                	{
+                	iTextVisual->SetWrapping( CAlfTextVisual::ELineWrapManual );
+                	}
+                else
+                	{
+					iTextVisual->SetWrapping( CAlfTextVisual::ELineWrapTruncate );
+                	}
 
                 TAlfAlignHorizontal currTextAlign( EAlfAlignHLocale );
                 currTextAlign = CurrentTextAlignmentL( iTextAlign, &data->Data(), iTextVisual );
                 iTextVisual->SetAlign( currTextAlign, EAlfAlignVCenter );
 
-                iTextVisual->SetWrapping(CAlfTextVisual::ELineWrapTruncate);
-
                 if ( currTextAlign == EAlfAlignHRight )
                     {
                     iTextMarquee->SetScrollDirection( TFsMarqueeClet::EScrollFromLeft );
@@ -580,13 +585,32 @@
             
             if ( iTextVisual )
             	{
-            	iTextVisual->SetWrapping(CAlfTextVisual::ELineWrapTruncate);
+				if ( iManualWrapper )
+					{
+					iTextVisual->SetWrapping( CAlfTextVisual::ELineWrapManual );
+					}
+				else
+					{
+					iTextVisual->SetWrapping( CAlfTextVisual::ELineWrapTruncate );
+					}
             	}
+            
+            iManualWrapper = EFalse;
             }
         }
     }
 
 // ---------------------------------------------------------------------------
+//  From MFsTreeItemVisualizer.
+//  This method sets flag disable wrapping the text item.
+// ---------------------------------------------------------------------------
+//
+void CFsTreePlainOneLineItemVisualizer::OffWrapping()
+	{
+	iManualWrapper = ETrue;
+	}
+
+// ---------------------------------------------------------------------------
 // From class MFsTreeItemVisualizer.
 // A call to this function means that the item goes out of the visible items
 // scope.
@@ -687,6 +711,7 @@
     }
 
 
+
 // ---------------------------------------------------------------------------
 //  Handles custom Alf event. Used with text marquee.
 // ---------------------------------------------------------------------------
@@ -718,6 +743,8 @@
     : CFsTreeItemVisualizerBase( aOwnerControl )
     {
     FUNC_LOG;
+    
+    iManualWrapper = EFalse;
 
     }
 
--- a/emailuis/uicomponents/src/fstreeplainonelinenodevisualizer.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/src/fstreeplainonelinenodevisualizer.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -783,7 +783,7 @@
     FUNC_LOG;
     TInt marqueeSize(0), textWidth(0);
 
-    if ( aMarqueeType == EFsTextMarqueeNone )
+    if ( aMarqueeType == EFsTextMarqueeNone || !iTextVisual )
         {
         return;
         }
@@ -888,3 +888,7 @@
     CFsTreeNodeVisualizerBase::ConstructL();
     }
 
+void CFsTreePlainOneLineNodeVisualizer::OffWrapping( )
+	{
+	FUNC_LOG;
+	}
--- a/emailuis/uicomponents/src/fstreeplainrootvisualizer.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/src/fstreeplainrootvisualizer.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -210,3 +210,12 @@
     CFsTreeNodeVisualizerBase::ConstructL();
     }
 
+// ---------------------------------------------------------------------------
+//  From MFsTreeItemVisualizer.
+//  This method sets flag disable wrapping the text item.
+// ---------------------------------------------------------------------------
+//
+void CFsTreePlainRootVisualizer::OffWrapping()
+	{
+	FUNC_LOG;
+	}
--- a/emailuis/uicomponents/src/fstreerichitemvisualizer.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/emailuis/uicomponents/src/fstreerichitemvisualizer.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -605,3 +605,12 @@
     FUNC_LOG;
     }
 
+// ---------------------------------------------------------------------------
+//  From MFsTreeItemVisualizer.
+//  This method sets flag disable wrapping the text item.
+// ---------------------------------------------------------------------------
+//
+void CFsTreeRichItemVisualizer::OffWrapping()
+	{
+	FUNC_LOG;
+	}
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOMboxLogic.h	Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOMboxLogic.h	Wed Jun 09 09:22:57 2010 +0300
@@ -29,7 +29,7 @@
 //</cmail>
 
 #include "IpsSosAOBaseAgent.h"
-#include "IpsSetDataExtension.h"
+#include "ipssetdataextension.h"
 #include "IpsSosAOPluginTimer.h"
 //<cmail>
 //</cmail>
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOSchedulerUtils.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOSchedulerUtils.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -19,7 +19,7 @@
 
 #include "emailtrace.h"
 #include "IpsSosAOSchedulerUtils.h"
-#include "IpsSetDataExtension.h"
+#include "ipssetdataextension.h"
 
 
 
--- a/ipsservices/ipssosplugin/inc/ipsplgheaders.h	Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgheaders.h	Wed Jun 09 09:22:57 2010 +0300
@@ -148,7 +148,7 @@
 #include "ipssetdataapi.h"
 #include "ipssetdatastorer.h"
 #include "ipssetdata.h"
-#include "IpsSetDataExtension.h"
+#include "ipssetdataextension.h"
 #include "ipssetutils.h"
 #include "ipssetutilsconsts.hrh"
 
--- a/ipsservices/ipssosplugin/inc/ipsplgmsgiterator.h	Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgmsgiterator.h	Wed Jun 09 09:22:57 2010 +0300
@@ -210,8 +210,7 @@
     CIpsPlgMsgIterator( 
         CIpsPlgSosBasePlugin& aPlugin,
         const TFSMailMsgId& aMailBoxId,
-        const TFSMailDetails aDetails,
-        const RArray<TFSMailSortCriteria>& aSorting );
+        const TFSMailDetails aDetails );
     
     void ConstructL(        
         CMsvSession& aMsvSession,
@@ -221,7 +220,10 @@
     void ConstructL(        
         CMsvEntry* aFolderEntry, 
         const RArray<TFSMailSortCriteria>& aSorting);
-
+    
+    void StoreSortCriteriaL( 
+        const RArray<TFSMailSortCriteria>& aSorting );
+    
 private: // data
 
     
@@ -249,10 +251,10 @@
     /**
      * Sorting objects
      */    
-    TIpsPlgMsgKey*  iMsgSortKey;
-    TIpsPlgMsgSwap* iMsgSwapper;
-    TBool           iSortingOn;
-    const RArray<TFSMailSortCriteria>& iSortingCriteria;
+    TIpsPlgMsgKey*                  iMsgSortKey;
+    TIpsPlgMsgSwap*                 iMsgSwapper;
+    TBool                           iSortingOn;
+    RArray<TFSMailSortCriteria>     iSortingCriteria;
 
     /**
      * Mailbox identifier
--- a/ipsservices/ipssosplugin/src/ipsplgmsgiterator.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgmsgiterator.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -33,8 +33,7 @@
     {
     FUNC_LOG;
     CIpsPlgMsgIterator* self = 
-        new( ELeave ) CIpsPlgMsgIterator( aPlugin, aMailboxId, aDetails, 
-            aSorting );
+        new( ELeave ) CIpsPlgMsgIterator( aPlugin, aMailboxId, aDetails );
     CleanupStack::PushL( self );
     self->ConstructL( aMsvSession, aFolderId, aSorting );
     CleanupStack::Pop( self );
@@ -53,8 +52,7 @@
     {
     FUNC_LOG;
     CIpsPlgMsgIterator* self = 
-        new( ELeave ) CIpsPlgMsgIterator( aPlugin, aMailboxId, aDetails, 
-            aSorting );
+        new( ELeave ) CIpsPlgMsgIterator( aPlugin, aMailboxId, aDetails );
     CleanupStack::PushL( self );
     self->ConstructL( aFolderEntry, aSorting );
     CleanupStack::Pop( self );
@@ -73,6 +71,8 @@
     delete iMsgMapper;
     delete iMsgSortKey;
     delete iMsgSwapper;
+    
+    iSortingCriteria.Reset();
     }
 
 // ---------------------------------------------------------------------------
@@ -323,10 +323,9 @@
 CIpsPlgMsgIterator::CIpsPlgMsgIterator( 
     CIpsPlgSosBasePlugin& aPlugin,
     const TFSMailMsgId& aMailboxId,
-    const TFSMailDetails aDetails,
-    const RArray<TFSMailSortCriteria>& aSorting )
+    const TFSMailDetails aDetails )
     : iPlugin( aPlugin ), iRequestedDetails( aDetails ), 
-      iSortingCriteria( aSorting ), iMailboxId( aMailboxId )
+      iMailboxId( aMailboxId )
     {
     FUNC_LOG;
     // none
@@ -344,7 +343,9 @@
     {
     FUNC_LOG;
     iFolderEntry  = aMsvSession.GetEntryL( aFolderId.Id() );
-    iMsgSortKey   = new (ELeave) TIpsPlgMsgKey( *iFolderEntry, aSorting );
+    
+    StoreSortCriteriaL(aSorting);
+    iMsgSortKey   = new (ELeave) TIpsPlgMsgKey( *iFolderEntry, iSortingCriteria );
     iMsgSwapper   = new (ELeave) TIpsPlgMsgSwap( *iFolderEntry );
     iSortingOn    = 
         ( aSorting.Count() > 0 ) && ( aSorting[0].iField != EFSMailDontCare);
@@ -363,7 +364,8 @@
     {
     FUNC_LOG;
     iFolderEntry  = aFolderEntry;
-    iMsgSortKey   = new (ELeave) TIpsPlgMsgKey( *iFolderEntry, aSorting );
+    StoreSortCriteriaL(aSorting);
+    iMsgSortKey   = new (ELeave) TIpsPlgMsgKey( *iFolderEntry, iSortingCriteria );
     iMsgSwapper   = new (ELeave) TIpsPlgMsgSwap( *iFolderEntry );
     iSortingOn    = 
         ( aSorting.Count() > 0 ) && ( aSorting[0].iField != EFSMailDontCare);
@@ -482,3 +484,19 @@
 	return filteredEntries;
 	}
 
+// -----------------------------------------------------------------------------
+// stores sort criteria given by user
+// -----------------------------------------------------------------------------
+void CIpsPlgMsgIterator::StoreSortCriteriaL( 
+     const RArray<TFSMailSortCriteria>& aSorting )
+    {
+    for ( TInt i=0; i < aSorting.Count(); i++ )
+        {
+        const TFSMailSortCriteria& criteria  = aSorting[i];
+        TFSMailSortCriteria fsCriteria;
+        fsCriteria.iField = criteria.iField;
+        fsCriteria.iOrder = criteria.iOrder;
+        iSortingCriteria.AppendL(fsCriteria);
+        }
+    }
+
--- a/ipsservices/ipssossettings/group/bld.inf	Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssossettings/group/bld.inf	Wed Jun 09 09:22:57 2010 +0300
@@ -29,7 +29,7 @@
 
 //<cmail>
 ../inc/ipssetdataapi.h |../../inc/ipssetdataapi.h
-../inc/ipssetdataextension.h |../../inc/IpsSetDataExtension.h
+../inc/ipssetdataextension.h |../../inc/ipssetdataextension.h
 ../inc/ipssetutilsconsts.h |../../inc/ipssetutilsconsts.h
 ../inc/ipssetutilsconsts.hrh |../../inc/ipssetutilsconsts.hrh
 ../inc/ipssetdata.h |../../inc/ipssetdata.h
--- a/ipsservices/ipssossettings/inc/ipssetutilsconsts.h	Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssossettings/inc/ipssetutilsconsts.h	Wed Jun 09 09:22:57 2010 +0300
@@ -110,8 +110,7 @@
 
 // default values for ipssetdataextension
 //<cmail> cmail has different default value
-//The default value for sync interval is 1 hour, so ao state should be always on.
-const TInt KIpsSetExtDefaultAlwaysOnlineState = EMailAoAlways;
+const TInt KIpsSetExtDefaultAlwaysOnlineState = EMailAoOff;
 //</cmail>
 const TInt KIpsSetExtDefaultEmailNotificationState = EMailEmnOff;
 const TBool KIpsSetExtDefaultHideMsgs = EFalse;
--- a/ipsservices/ipssossettings/src/ipssetdata.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssossettings/src/ipssetdata.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -891,13 +891,16 @@
     if ( iProtocol == KSenduiMtmImap4Uid )
         {
         iImap4Settings->SetServerAddressL( aIncomingServer );
+		iImap4Settings->SetBearerMobility(ETrue);
         }
     else
         {
         iPop3Settings->SetServerAddressL( aIncomingServer );
+		iPop3Settings->SetBearerMobility(ETrue);
         }
         
-    iSmtpSettings->SetServerAddressL( aOutgoingServer );        
+    iSmtpSettings->SetServerAddressL( aOutgoingServer ); 
+	iSmtpSettings->SetBearerMobility(ETrue);
     }
 
 // ---------------------------------------------------------------------------
--- a/ipsservices/ipssossettings/src/ipssetgwizardadapter.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssossettings/src/ipssetgwizardadapter.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -20,10 +20,6 @@
 #include "emailtrace.h"
 #include <e32base.h>
 #include <SendUiConsts.h>
-//<cmail>
-//#include <aplistitemlist.h>         // CApListItemList
-//#include <aplistitem.h>             // CApListItem
-//</cmail>
 #include <centralrepository.h>      // CRepository
 #include <AlwaysOnlineManagerClient.h>
 #include <cmdestination.h> 
@@ -131,9 +127,7 @@
     iOperatorOutSecurityAuth = 0;
     iOperatorOutSecurityProtocol = 0;
     iOperatorOutgoingPort = 0;
-    //<cmail>
     iHiddenData = EFalse;
-    //</cmail>
     iRecomendedAP.Zero();
     iMailboxName.Zero();
     }
@@ -145,8 +139,6 @@
     FUNC_LOG;
     ClearFields();
     
-    //<cmail>
-    
     TIpsSetUtilsTextPlain tempText;
     TInt error = KErrNone;
      
@@ -295,8 +287,6 @@
     ChangeUnicodePrintable( tempText, iMailboxName );
     
     EmptyWizardCenRep();
-    //</cmail>
-    
     } 
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
@@ -304,11 +294,11 @@
                                               TInt& aVariable )
     {
     FUNC_LOG;
-	if ( &iWizardCenRep )
-		{
-    	return iWizardCenRep.Get( aSetting, aVariable );
-		}
-	return KErrNone;
+    if ( &iWizardCenRep )
+        {
+        return iWizardCenRep.Get( aSetting, aVariable );
+        }
+    return KErrNone;
     }
         
         
@@ -318,11 +308,11 @@
                                  TIpsSetUtilsTextPlain& aVariable )
     {
     FUNC_LOG;
-	if ( &iWizardCenRep )
-		{
-    	return iWizardCenRep.Get( aSetting, aVariable );
-		}
-	return KErrNone;
+    if ( &iWizardCenRep )
+        {
+        return iWizardCenRep.Get( aSetting, aVariable );
+        }
+    return KErrNone;
     }
     
 // ---------------------------------------------------------------------------
@@ -330,38 +320,35 @@
 void CIpsSetWizardAdapter::EmptyWizardCenRep()
     {
     FUNC_LOG;
-    // error is used in debug purposes
-    // <cmail>TInt error = KErrNone; Removed since it is not used.</cmail>
-	if ( &iWizardCenRep )
-		{
-	    iWizardCenRep.Set( ECRKPopImapEmailAddressId, KNullDesC );
-	    iWizardCenRep.Set( ECRKPopImapUsernameId, KNullDesC );
-	    iWizardCenRep.Set( ECRKPopImapPasswordId, KNullDesC );
-	    iWizardCenRep.Set( ECRKPopImapIncomingServerId, KNullDesC );
-	    iWizardCenRep.Set( 
-	            ECRKPopImapProtocolIndicatorId, KErrNotFound );
-	    iWizardCenRep.Set( 
-	            ECRKPopImapIncomingSecurityAuthId, KErrNotFound );
-	    iWizardCenRep.Set( 
-	            ECRKPopImapIncomingSecurityProtocolId, KErrNotFound );
-	    iWizardCenRep.Set( ECRKPopImapIncomingPortId, KErrNotFound );
-	    iWizardCenRep.Set( ECRKPopImapOutgoingServerId, KNullDesC );
-	    iWizardCenRep.Set( 
-	            ECRKPopImapOutgoingSecurityAuthId, KErrNotFound );
-	    iWizardCenRep.Set( 
-	            ECRKPopImapOutgoingSecurityProtocolId, KErrNotFound );
-	    iWizardCenRep.Set( ECRKPopImapOutgoingPortId, KErrNotFound );
-	    iWizardCenRep.Set( 
-	            ECRKPopImapOperatorOutgoingServerId, KNullDesC );
-	    iWizardCenRep.Set( 
-	            ECRKPopImapOperatorSecurityAuthId, KErrNotFound );
-	    iWizardCenRep.Set( 
-	            ECRKPopImapOperatorSecurityProtocolId, KErrNotFound );
-	    iWizardCenRep.Set( ECRKPopImapOperatorPortId, KErrNotFound );
-	    iWizardCenRep.Set( ECRKPopImapAccessPointId, KNullDesC );  
-	    iWizardCenRep.Set( ECRKPopImapMailboxName, KNullDesC );  
-		}
-    
+    if ( &iWizardCenRep )
+        {
+        iWizardCenRep.Set( ECRKPopImapEmailAddressId, KNullDesC );
+        iWizardCenRep.Set( ECRKPopImapUsernameId, KNullDesC );
+        iWizardCenRep.Set( ECRKPopImapPasswordId, KNullDesC );
+        iWizardCenRep.Set( ECRKPopImapIncomingServerId, KNullDesC );
+        iWizardCenRep.Set( 
+                ECRKPopImapProtocolIndicatorId, KErrNotFound );
+        iWizardCenRep.Set( 
+                ECRKPopImapIncomingSecurityAuthId, KErrNotFound );
+        iWizardCenRep.Set( 
+                ECRKPopImapIncomingSecurityProtocolId, KErrNotFound );
+        iWizardCenRep.Set( ECRKPopImapIncomingPortId, KErrNotFound );
+        iWizardCenRep.Set( ECRKPopImapOutgoingServerId, KNullDesC );
+        iWizardCenRep.Set( 
+                ECRKPopImapOutgoingSecurityAuthId, KErrNotFound );
+        iWizardCenRep.Set( 
+                ECRKPopImapOutgoingSecurityProtocolId, KErrNotFound );
+        iWizardCenRep.Set( ECRKPopImapOutgoingPortId, KErrNotFound );
+        iWizardCenRep.Set( 
+                ECRKPopImapOperatorOutgoingServerId, KNullDesC );
+        iWizardCenRep.Set( 
+                ECRKPopImapOperatorSecurityAuthId, KErrNotFound );
+        iWizardCenRep.Set( 
+                ECRKPopImapOperatorSecurityProtocolId, KErrNotFound );
+        iWizardCenRep.Set( ECRKPopImapOperatorPortId, KErrNotFound );
+        iWizardCenRep.Set( ECRKPopImapAccessPointId, KNullDesC );  
+        iWizardCenRep.Set( ECRKPopImapMailboxName, KNullDesC );  
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -376,24 +363,22 @@
     aSetData.SetProtocol( 
         (iProtocol == 0) ? KSenduiMtmPop3Uid : KSenduiMtmImap4Uid );
         
-  //<cmail>
     if(iProtocol == 0)// KSenduiMtmPop3Uid - for Pop account- default is Headers Only
-    	{
+        {
         aSetData.SetDownloadSizeL( CIpsSetData::EHeaders,KIpsSetDataHeadersOnly);
         }
     else 
-    	{
-    	aSetData.SetDownloadSizeL( CIpsSetData::EHeadersPlus, KIpsSetDataDefaultDownloadSizeKb );
+        {
+        aSetData.SetDownloadSizeL( CIpsSetData::EHeadersPlus, KIpsSetDataDefaultDownloadSizeKb );
 
-    	TInt retImFolders = aSetData.RetrieveLimit(CIpsSetData::EImap4Folders); //TRetrieveLimit
+        TInt retImFolders = aSetData.RetrieveLimit(CIpsSetData::EImap4Folders); //TRetrieveLimit
         if(retImFolders==-1)
-        	{
+            {
             TInt retPopInbox = aSetData.RetrieveLimit(CIpsSetData::EPop3Limit); 
-           	TInt retImInbox  = aSetData.RetrieveLimit(CIpsSetData::EImap4Inbox); 
+            TInt retImInbox  = aSetData.RetrieveLimit(CIpsSetData::EImap4Inbox); 
             aSetData.SetRetrieveLimit(retPopInbox,retImInbox,KImapDefFoldersRetrieve);
-        	}
+            }
         }
-    //</cmail>
     aSetData.SetEmailAddressL( iEmailAddress );
     aSetData.SetUserNameL( iUsername, iUsername );
     aSetData.SetUserPwdL( iPassword, iPassword );
@@ -408,38 +393,38 @@
                             security );
     aSetData.SetPort( port.inport, port.outport );                             
     
-    //<cmail>
     aSetData.SetDataHide( iHiddenData );
-    //</cmail>
     aSetData.SetMailboxName( CheckMailboxNamesL( iMailboxName ) );
     aSetData.SetUserAuthentication( CIpsSetData::EUseIncoming );
 
     iap = SetIAPByNameL( iRecomendedAP );
     
     TBool setIAP = ETrue;
-	//if IAP isn't set by SettingWizard, we try to get the SNAP.
+
+    RCmManager cmmgr;
+    cmmgr.OpenLC();
+    TCmDefConnValue defConnValue;
+    cmmgr.ReadDefConnL( defConnValue );
+
+    //if IAP isn't set by SettingWizard, we try to get the SNAP.
     if ( iap.iIAP <= 0 )
         {
         //Use SNAP when we got it and it does contain access point.
         //For other situations as below, we set 'ask when need' or default IAP
         //1. defConnValue.iType == ECmDefConnAskOnce
-        //2. Got SNAP, but it does not contain any acess point
+        //2. Got SNAP, but it does not contain any access point
         //3. Got default IAP when defConnValue.iType == ECmDefConnConnectionMethod
         iap.iDialogPref = ECommDbDialogPrefPrompt;
-        iap.iIAP = 0;		 
+        iap.iIAP = 0;        
 
-        RCmManager cmmgr;
-        cmmgr.OpenLC();
-        TCmDefConnValue defConnValue;
-        cmmgr.ReadDefConnL( defConnValue );
-		//Check default connection is destination or connection method
+        //Check default connection is destination or connection method
         if ( defConnValue.iType == ECmDefConnDestination )
             {
             //Get SNAP from cmmgr
             RCmDestination destination;
             CleanupClosePushL( destination );
             destination = cmmgr.DestinationL( defConnValue.iId );
-			//check if SNAP has IAPs
+            //check if SNAP has IAPs
             if ( destination.ConnectionMethodCount() > 0 )
                 {
                 //if SNAP contain access point, we use SNAP
@@ -448,25 +433,82 @@
               
                 aSetData.SetIapL( *iapPref, *iapPref );
                 CleanupStack::PopAndDestroy( iapPref );
-				 
+                 
                 setIAP = EFalse;
                 }
-                CleanupStack::PopAndDestroy( &destination );			 
+                CleanupStack::PopAndDestroy( &destination );             
             }
         else if( defConnValue.iType == ECmDefConnConnectionMethod ) 
             {
             iap.iDialogPref = ECommDbDialogPrefDoNotPrompt;
             iap.iIAP = defConnValue.iId;
             }
-        CleanupStack::PopAndDestroy( &cmmgr );
         }
-		//If no valid IAP or destination, set zero.
+    else
+        {
+        // recommended IAP is defined
+        // try setting SNAP that contains the IAP
+        TBool found( EFalse );
+        RArray< TUint32 > destArray;
+        CleanupClosePushL( destArray );
+     
+        //Get list of all destinations
+        cmmgr.AllDestinationsL( destArray );
+     
+        TInt arrayCount( destArray.Count() );
+
+        CMManager::TSnapMetadataField metaFieldPurpose( CMManager::ESnapMetadataPurpose );
+        CMManager::TSnapMetadataField metaFieldLocalized( CMManager::ESnapMetadataDestinationIsLocalised );
+
+        //Traverse list of destinations
+        for ( TInt i = 0; i < arrayCount && !found; ++i )
+            {
+            RCmDestination destination = cmmgr.DestinationL( destArray[ i ] );
+            CleanupClosePushL( destination );
+            
+            TUint32  destinationPurpose = destination.MetadataL ( metaFieldPurpose );
+            TUint32  destinationLocalized = destination.MetadataL ( metaFieldLocalized );
+            
+            TInt iapCount ( destination.ConnectionMethodCount() );
+            if ( destinationPurpose == CMManager::ESnapPurposeInternet &&
+                 destinationLocalized == CMManager::ELocalisedDestInternet && 
+                 iapCount )
+                {
+                // found the Internet destination and it has at least one access point
+                for ( TInt c=0;c < iapCount && !found; c++ )
+                    {
+                    RCmConnectionMethod connMethod = destination.ConnectionMethodL( c );
+                    CleanupClosePushL( connMethod );
+                    
+                    TUint32 iapId = connMethod.GetIntAttributeL( CMManager::ECmIapId );
+                    HBufC* connName = connMethod.GetStringAttributeL( CMManager::ECmName );
+                    CleanupStack::PushL( connName );
+                    CleanupStack::PopAndDestroy( connName ); 
+                    if ( iapId == iap.iIAP )
+                        {
+                        CImIAPPreferences* iapPref = CImIAPPreferences::NewLC();
+                        INFO_1( "Setting SNAP %d by IAP", destination.Id() )
+                        iapPref->SetSNAPL( destination.Id());
+                        aSetData.SetIapL( *iapPref, *iapPref );   
+                        found = ETrue;
+                        setIAP = EFalse;
+                        CleanupStack::PopAndDestroy( iapPref );
+                        }
+                    CleanupStack::PopAndDestroy( &connMethod ); 
+                    }
+                }
+            CleanupStack::PopAndDestroy( &destination );
+            }
+        CleanupStack::PopAndDestroy( &destArray );
+        }    
+
+        //If no valid IAP or destination, set zero.
         if ( setIAP )
             {
-            aSetData.SetIapL( iap, iap );		 		 
+            INFO_1( "IAP is uncategorized, using IAP: %d", iap.iIAP )
+            aSetData.SetIapL( iap, iap );                
             }
-    // EIpsSetDataOutSecurityAuth
-    // EIpsSetDataOutSecurityAuth
+    CleanupStack::PopAndDestroy( &cmmgr );
     }
 
 // ---------------------------------------------------------------------------
@@ -570,16 +612,13 @@
     //Initial IAP list
     ipsSetAP->InitializeSelectionL();
     
-    //<cmail>
     iapcount = ipsSetAP->iIapList.Count();
-    //</cmail>
 
     //Set default AP to always ask
     iap.iDialogPref = ECommDbDialogPrefPrompt;
     iap.iIAP = 0;   
 
     //run through all found access points
-	//<cmail>
     TBool found( EFalse );
     for( TInt i = 0;!found &&  i < iapcount; i++ )
         {
@@ -598,7 +637,6 @@
             }
         CleanupStack::PopAndDestroy( name );
         }
-	//</cmail>
     CleanupStack::PopAndDestroy( ipsSetAP );
     return iap;
     }
@@ -621,10 +659,10 @@
     accountcount = RIpsSmtpArray.Count();
 
     //increase mailbox count
-	if ( &iWizardCenRep )
-		{ 
-    	iWizardCenRep.Set( ECRKAccountsConfigured, accountcount );
-		}
+    if ( &iWizardCenRep )
+        { 
+        iWizardCenRep.Set( ECRKAccountsConfigured, accountcount );
+        }
     
     if( accountcount >= KMaxMailboxes && &iWizardCenRep )
         {
@@ -636,7 +674,6 @@
     CleanupStack::PopAndDestroy( setManager );
     
     // notify ao about new mailbox
-// <cmail> RD_IPS_AO_PLUGIN flag removed
     TInt mailboxId = KErrNotFound;
     if ( aSetData.ExtendedSettings() )
         {
@@ -645,6 +682,7 @@
     
     RAlwaysOnlineClientSession aosession; 
     TInt err = aosession.Connect();
+    CleanupClosePushL( aosession );
     if ( mailboxId != KErrNotFound && err == KErrNone )
         {
         TPckgBuf<TMsvId> mboxBuf( mailboxId );
@@ -652,8 +690,7 @@
                 EServerAPIEmailTurnOn, 
                mboxBuf ) );
         }
-    aosession.Close();
-//#endif <cmail>
+    CleanupStack::PopAndDestroy( &aosession );
     }
 
 // ---------------------------------------------------------------------------
@@ -677,7 +714,7 @@
         
         if( !tempName.Compare( mailbox ) )
             {
-            //if mailboxname already exists increase value after name
+            //if mailbox name already exists increase value after name
             tempName = aName;
             endNumber++;
             tempName.AppendNum( endNumber );
--- a/ipsservices/ipssossettings/src/ipssetuidialog.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/ipsservices/ipssossettings/src/ipssetuidialog.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -880,6 +880,9 @@
     CAknQueryDialog* confDialog = CAknQueryDialog::NewL();
     if( confDialog->ExecuteLD( R_IPS_SET_CONNECT_FOR_UPDATE ) )
     	{
+	    iData->SetImapPathL(
+                        GetItem( TUid::Uid( EIpsSetUiWhatImapPath ) )->Text() );
+        iData->SaveL( iSession );
     	CMsvEntrySelection* mySelection=new (ELeave) CMsvEntrySelection;
     	CleanupStack::PushL(mySelection);
 
--- a/layers.sysdef.xml	Tue May 25 12:23:16 2010 +0300
+++ b/layers.sysdef.xml	Wed Jun 09 09:22:57 2010 +0300
@@ -10,23 +10,6 @@
         <unit unitID="EDo.commonemail" mrp="" bldFile="&layer_real_source_path;/group" name="commonemail" />
       </module>
     </layer>
-    <layer name="unit_test_layer">
-      <module name="cmail.emailserver.unittest">
-
-        <unit unitID="EDo.cmail.emailframework.unittest" mrp="" bldFile="sf/app/commonemail/emailservices/emailframework/tsrc/group" name="unittest.emailframework.cmail" />
-
-        <unit unitID="EDo.cmail.emailserver.unittest" mrp="" bldFile="sf/app/commonemail/emailservices/emailserver/tsrc/group" name="unittest.emailserver.cmail" />
-
-        <unit unitID="EDo.cmail.cmailhandlerplugin.unittest" mrp="" bldFile="sf/app/commonemail/emailservices/emailserver/cmailhandlerplugin/tsrc/group" name="unittest.cmailhandlerplugin.cmail" />
-
-        <unit unitID="EDo.cmail.mailserverautostart.unittest" mrp="" bldFile="sf/app/commonemail/emailservices/emailserver/mailserverautostart/tsrc/group" name="unittest.mailserverautostart.cmail" />
-
-        <unit unitID="EDo.cmail.saveascontactplugin.unittest" mrp="" bldFile="sf/app/commonemail/emailcontacts/contactactionservice/saveascontactplugin/tsrc/group" name="unittest.saveascontactplugin.cmail" />
-
-        <unit unitID="EDo.cmail.utils.unittest" mrp="" bldFile="ext/app/eas/Utils/tsrc/group" name="unittest.utils.cmail" />
-
-      </module>
-    </layer>
   </systemModel>
 </SystemDefinition>
 
--- a/meetingrequest/mrgui/loc/mrui.loc	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/loc/mrui.loc	Wed Jun 09 09:22:57 2010 +0300
@@ -17,7 +17,7 @@
 
 
 // d: Status pane text
-// l: title_pane_t2/opt9
+// l: title_pane_t1/opt3
 // r: TB9.1
 //
 #define qtn_meet_req_title_meeting  "Meeting request"
--- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmreditor.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmreditor.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -27,6 +27,7 @@
 #include <gulfont.h>
 #include <eikenv.h>
 #include <avkon.hrh>
+#include <AknUtils.h>
 
 
 #include "emailtrace.h"
@@ -126,7 +127,7 @@
             TInt listHeight = iObserver->ListHeight();
 
             // edwinTlY negative
-            if ( cursorLowerPosition > ( listHeight - edwinTlY )) 
+            if ( cursorLowerPosition > ( listHeight - edwinTlY ))
                 {
                 iObserver->RePositionFields( -RowHeight() );
                 }
@@ -160,9 +161,9 @@
 EXPORT_C void CESMREditor::FocusChanged(TDrawNow aDrawNow)
     {
     FUNC_LOG;
-    
+
     CEikRichTextEditor::FocusChanged( aDrawNow );
-    
+
     TRAPD( error, TryToSetSelectionL() );
     if ( error != KErrNone )
         {
@@ -234,7 +235,7 @@
         			{
         	        TInt curPos = CursorPos ();
         	        TInt textLength = TextLength();
-        	        // Update viewarea scrolling in cases where the cursor location 
+        	        // Update viewarea scrolling in cases where the cursor location
         	        // is changed directly from bottom to upmost position or vise versa.
         	        if ( CursorPos () == TextLength() || CursorPos () == 0 )
         	            {
@@ -244,7 +245,7 @@
         			}
         		break;
         		}
-        		
+
         	case EEventTextUpdate:
         		{
         		if ( IsVisible() )
@@ -253,7 +254,7 @@
         			}
         		break;
         		}
-        		
+
         	default:
         		{
         		break;
@@ -292,6 +293,10 @@
 
     paraFormatMask.SetAttrib( EAttLineSpacing );
     paraFormat->iHorizontalAlignment = CParaFormat::ELeftAlign;
+    if ( AknLayoutUtils::LayoutMirrored() )
+        {
+        paraFormat->iHorizontalAlignment = CParaFormat::ERightAlign;
+        }
     paraFormatMask.SetAttrib( EAttAlignment );
 
     TCharFormat charFormat;
@@ -305,10 +310,10 @@
     formatMask.SetAttrib(EAttFontHighlightColor);
     formatMask.SetAttrib( EAttColor );
 
-    charFormat.iFontPresentation.iTextColor = 
+    charFormat.iFontPresentation.iTextColor =
         NMRColorManager::Color( NMRColorManager::EMRMainAreaTextColor );
-    
-    charFormat.iFontPresentation.iHighlightColor =  
+
+    charFormat.iFontPresentation.iHighlightColor =
         NMRColorManager::Color( NMRColorManager::EMRCutCopyPasteHighlightColor );
 
     CParaFormatLayer* paraFormatLayer =
@@ -321,7 +326,7 @@
     CleanupStack::Pop( paraFormatLayer );
     CleanupStack::PopAndDestroy( paraFormat );
     SetCharFormatLayer( charFormatLayer );
-    
+
     // This forces CEikEdwin::OnReformatL to notify observer
     // through HandleEdwinSizeEventL about changed size.
     // It is notified only if linecount changes.
@@ -385,7 +390,7 @@
     {
     FUNC_LOG;
     SetTextL( aDefaultText );
-    
+
     if ( iDefaultText )
         {
         delete iDefaultText;
--- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -293,11 +293,25 @@
 		const TKeyEvent& aEvent, TEventCode aType )
     {
     FUNC_LOG;
+
+    TKeyResponse response( EKeyWasNotConsumed );
+
     if ( iExtControl )
         {
-        return iExtControl->OfferKeyEventL( aEvent, aType );
+        response = iExtControl->OfferKeyEventL( aEvent, aType );
         }
-    return EKeyWasNotConsumed;
+
+    // If key event was not consumed, and it is the Enter,
+    // let's execute generic command Open
+    if ( response == EKeyWasNotConsumed
+         && aType == EEventKey
+         && ( aEvent.iCode == EKeyEnter
+              || aEvent.iScanCode == EStdKeyEnter ) )
+        {
+        ExecuteGenericCommandL( EAknCmdOpen );
+        }
+
+    return response;
     }
 
 // ---------------------------------------------------------------------------
--- a/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrrichtextviewer.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuildercommon/src/cesmrrichtextviewer.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -12,7 +12,7 @@
 * Contributors:
 *
 *  Description : CEikRichTextEditor based Rich Text viewer
-*  Version     : %version: e002sa32#41 %
+*  Version     : %version: e002sa32#42.1.2 %
 *
 */
 
@@ -306,8 +306,10 @@
                 break;
                 }
             case EKeyDevice3: // Selection key
+            case EKeyEnter:
                 {
-                // No implementation. Non-MSK devices might require this.
+                LinkSelectedL();
+                response = EKeyWasConsumed;
                 break;
                 }
             default:
@@ -633,6 +635,10 @@
 
     iParaFormatMask.SetAttrib( EAttLineSpacing );
     iParaFormat->iHorizontalAlignment = CParaFormat::ELeftAlign;
+    if ( AknLayoutUtils::LayoutMirrored() )
+        {
+        iParaFormat->iHorizontalAlignment = CParaFormat::ERightAlign;
+        }
     iParaFormat->iVerticalAlignment = CParaFormat::ECenterAlign;
     iParaFormatMask.SetAttrib( EAttAlignment );
     iParaFormatMask.SetAttrib( EAttVerticalAlignment );
@@ -1152,7 +1158,8 @@
         if ( AknLayoutUtils::LayoutMirrored() )
             {
             // move top left x to end of text
-            tl.iX -= textWidth;
+			// will be handled further, if all mr fields need to be changed the order from right to left.
+            //tl.iX -= textWidth;
             }
 
         tl.iY -= iFont->FontMaxAscent();
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/group/esmrfieldbuilderplugin.mmp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/group/esmrfieldbuilderplugin.mmp	Wed Jun 09 09:22:57 2010 +0300
@@ -124,6 +124,7 @@
 LIBRARY commonui.lib
 LIBRARY apmime.lib
 LIBRARY aknnotify.lib
+LIBRARY aknlayout2scalable.lib
 
 #if defined( ENABLE_TRACES ) && defined( TRACE_INTO_FILE )
 LIBRARY flogger.lib
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrcheckbox.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrcheckbox.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -56,13 +56,13 @@
 // CESMRCheckbox::CESMRCheckbox
 // ---------------------------------------------------------------------------
 //
-CESMRCheckBox::CESMRCheckBox( MESMRFieldValidator* aValidator ) 
+CESMRCheckBox::CESMRCheckBox( MESMRFieldValidator* aValidator )
 : iChecked( EFalse )
     {
     FUNC_LOG;
-    
+
     iValidator = aValidator;
-    
+
     SetFieldId( EESMRFieldAllDayEvent );
     SetFocusType ( EESMRHighlightFocus );
     }
@@ -76,15 +76,15 @@
     FUNC_LOG;
     iLabel = CMRLabel::NewL();
     iLabel->SetParent( this );
-    
+
     CESMRField::ConstructL( iLabel ); //ownership transfered
-    
+
     HBufC* txt = StringLoader::LoadLC ( R_QTN_MEET_REQ_ALL_DAY_EVENT );
     iLabel->SetTextL( *txt );
     CleanupStack::PopAndDestroy( txt );
 
     // Creating field icon
-    SetIconL ( iChecked );    
+    SetIconL ( iChecked );
     }
 
 // ---------------------------------------------------------------------------
@@ -125,7 +125,7 @@
     if( aCommand == EESMRCmdCheckEvent || aCommand == EAknCmdOpen )
         {
     	HandleTactileFeedbackL();
-    
+
         HandleCheckEventL();
         SwitchMSKLabelL();
         SendFieldChangeEventL( EESMRFieldAllDayEvent );
@@ -201,31 +201,29 @@
     {
     FUNC_LOG;
     TRect rect = Rect();
-    
+
     TAknLayoutRect rowLayoutRect =
      NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
     rect = rowLayoutRect.Rect();
-    
+
     TAknWindowComponentLayout iconLayout =
-     NMRLayoutManager::GetWindowComponentLayout( 
+     NMRLayoutManager::GetWindowComponentLayout(
              NMRLayoutManager::EMRLayoutTextEditorIcon );
     AknLayoutUtils::LayoutImage( iFieldIcon, rect, iconLayout );
-    
+
     TAknLayoutRect bgLayoutRect =
-     NMRLayoutManager::GetLayoutRect( 
+     NMRLayoutManager::GetLayoutRect(
              rect, NMRLayoutManager::EMRLayoutTextEditorBg );
     TRect bgRect( bgLayoutRect.Rect() );
     // Move focus rect so that it's relative to field's position.
     bgRect.Move( -Position() );
     SetFocusRect( bgRect );
-    
-    TAknLayoutText labelLayout = 
-     NMRLayoutManager::GetLayoutText( 
-             rect, NMRLayoutManager::EMRTextLayoutTextEditor );
-    iLabel->SetRect( labelLayout.TextRect() );
-        
-    // Setting font also for the label
-    iLabel->SetFont( labelLayout.Font() );
+
+    TAknTextComponentLayout editorLayout =
+            NMRLayoutManager::GetTextComponentLayout(
+                    NMRLayoutManager::EMRTextLayoutTextEditor );
+
+    AknLayoutUtils::LayoutLabel( iLabel, rect, editorLayout );
     }
 
 // ---------------------------------------------------------------------------
@@ -267,7 +265,7 @@
     FUNC_LOG;
     delete iFieldIcon;
     iFieldIcon = NULL;
-    
+
     NMRBitmapManager::TMRBitmapId iconID;
     if( aChecked )
         {
@@ -277,7 +275,7 @@
         {
         iconID = NMRBitmapManager::EMRBitmapCheckBoxOff;
         }
-    
+
     iFieldIcon = CMRImage::NewL( iconID );
     iFieldIcon->SetParent( this );
 
@@ -343,7 +341,7 @@
 // CESMRCheckbox::SetContainerWindowL
 // ---------------------------------------------------------------------------
 //
-void CESMRCheckBox::SetContainerWindowL( 
+void CESMRCheckBox::SetContainerWindowL(
         const CCoeControl& aContainer )
     {
     CCoeControl::SetContainerWindowL( aContainer );
@@ -371,7 +369,7 @@
         CESMRFieldEventValue* checked = CESMRFieldEventValue::NewLC(
                 CESMRFieldEventValue::EESMRInteger, &iChecked );
         event->AddParamL( checked );
-        CleanupStack::Pop( checked );     
+        CleanupStack::Pop( checked );
         iEventQueue->NotifyEventL( *event );
         CleanupStack::PopAndDestroy( event );
         }
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrlocationfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrlocationfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -12,7 +12,7 @@
 * Contributors:
 *
  *  Description : ESMR location field implementation
- *  Version     : %version: e002sa32#53.1.1 %
+ *  Version     : %version: e002sa32#53.1.2 %
  *
  */
 
@@ -350,7 +350,7 @@
     if ( aEdwin == iLocation && aEventType == EEventTextUpdate )
         {
         TInt textLength( iLocation->TextLength() );
-        
+
         if ( iLocation->GetLimitLength() <= textLength )
             {
             NotifyEventAsyncL( EESMRCmdSizeExceeded );
@@ -500,15 +500,11 @@
     // Layout field title
     if( iTitle )
         {
-        TAknLayoutText labelLayout(
-                NMRLayoutManager::GetLayoutText(
-                        firstRowRect,
-                            NMRLayoutManager::EMRTextLayoutTextEditor ) );
+        TAknTextComponentLayout editorLayout =
+                NMRLayoutManager::GetTextComponentLayout(
+                        NMRLayoutManager::EMRTextLayoutTextEditor );
 
-        iTitle->SetRect( labelLayout.TextRect() );
-
-        // Setting font also for the label. Failures are ignored.
-        iTitle->SetFont( labelLayout.Font() );
+        AknLayoutUtils::LayoutLabel( iTitle, firstRowRect, editorLayout );
         }
 
     TRect editorRect( 0, 0, 0, 0 );
@@ -776,15 +772,15 @@
                         aMenuPane->ItemAndPos( EESMRCmdAddLocation, pos );
 
                 item->iData.iCascadeId = 0;
-                
+
                 if ( FeaturesL().FeatureSupported(
                         CESMRFeatureSettings::EESMRUIMnFwIntegration ) )
                     {
                     item->iData.iCommandId = EESMRCmdAssignFromMap;
-                    StringLoader::Load(item->iData.iText, 
+                    StringLoader::Load(item->iData.iText,
                             R_MEET_REQ_OPTIONS_ASSIGN_FROM_MAP, iCoeEnv );
                     }
-                
+
 #ifdef RD_USE_MYLOCATIONUI
                 else
                     {
@@ -793,7 +789,7 @@
                             R_MEET_REQ_OPTIONS_MY_LOCATIONS, iCoeEnv );
                     }
 #endif //RD_USE_MYLOCATIONUI
-                
+
                 aMenuPane->SetItemDimmed( item->iData.iCommandId, EFalse );
                 break;
                 }
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrpriorityfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrpriorityfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -58,8 +58,8 @@
     FUNC_LOG;
     iArray.ResetAndDestroy();
     iArray.Close();
-    
-    delete iIcon;    
+
+    delete iIcon;
     }
 
 // ---------------------------------------------------------------------------
@@ -82,7 +82,7 @@
 //
 void CESMRPriorityField::ConstructL()
     {
-    FUNC_LOG;    
+    FUNC_LOG;
     iLabel = CMRLabel::NewL();
     iLabel->SetParent( this );
     CESMRField::ConstructL( iLabel ); // ownership transfered
@@ -98,7 +98,7 @@
 void CESMRPriorityField::InitializeL()
     {
     FUNC_LOG;
-    NMRColorManager::SetColor( *iLabel, 
+    NMRColorManager::SetColor( *iLabel,
                                NMRColorManager::EMRMainAreaTextColor );
     }
 
@@ -144,7 +144,7 @@
             }
         }
     // reader
-    CleanupStack::PopAndDestroy(); // codescanner::cleanup 
+    CleanupStack::PopAndDestroy(); // codescanner::cleanup
     }
 
 // ---------------------------------------------------------------------------
@@ -172,7 +172,7 @@
 void CESMRPriorityField::SetOutlineFocusL( TBool aFocus )
     {
     FUNC_LOG;
-    CESMRField::SetOutlineFocusL ( aFocus );    
+    CESMRField::SetOutlineFocusL ( aFocus );
     iLabel->SetFocus( aFocus );
 
     //Focus gained
@@ -193,24 +193,25 @@
     TAknLayoutRect rowLayoutRect =
         NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
     rect = rowLayoutRect.Rect();
-    
+
     TAknWindowComponentLayout iconLayout =
-        NMRLayoutManager::GetWindowComponentLayout( 
+        NMRLayoutManager::GetWindowComponentLayout(
                 NMRLayoutManager::EMRLayoutTextEditorIcon );
     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
-    
+
     TAknLayoutRect bgLayoutRect =
-        NMRLayoutManager::GetLayoutRect( 
+        NMRLayoutManager::GetLayoutRect(
                 rect, NMRLayoutManager::EMRLayoutTextEditorBg );
     TRect bgRect( bgLayoutRect.Rect() );
     // Move focus rect so that it's relative to field's position.
     bgRect.Move( -Position() );
     SetFocusRect( bgRect );
-    
-    TAknLayoutText labelLayout = 
-        NMRLayoutManager::GetLayoutText( 
-                rect, NMRLayoutManager::EMRTextLayoutTextEditor );
-    iLabel->SetRect( labelLayout.TextRect() );
+
+    TAknTextComponentLayout editorLayout =
+            NMRLayoutManager::GetTextComponentLayout(
+                    NMRLayoutManager::EMRTextLayoutTextEditor );
+
+    AknLayoutUtils::LayoutLabel( iLabel, rect, editorLayout );
     }
 
 // ---------------------------------------------------------------------------
@@ -265,7 +266,7 @@
         aCommand == EAknCmdOpen )
         {
     	HandleTactileFeedbackL();
-    	
+
         ExecutePriorityQueryL();
         isUsed = ETrue;
         }
@@ -381,7 +382,7 @@
     CESMRPriority* priority = iArray[ aIndex ];
     iLabel->SetTextL ( priority->Text ( ) );
 
-    NMRBitmapManager::TMRBitmapId bitmapId( 
+    NMRBitmapManager::TMRBitmapId bitmapId(
             NMRBitmapManager::EMRBitmapPriorityNormal );
 
     switch ( priority->Id() )
@@ -408,7 +409,7 @@
         	ASSERT(EFalse);
         	break;
         }
-    
+
     delete iIcon;
     iIcon = NULL;
     iIcon = CMRImage::NewL( bitmapId );
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrrecurencefield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrrecurencefield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -72,9 +72,9 @@
     : iIndex( 0 )
     {
     FUNC_LOG;
-    
+
     iValidator = aValidator;
-    
+
     SetFieldId ( EESMRFieldRecurrence );
     SetFocusType( EESMRHighlightFocus );
     }
@@ -100,7 +100,7 @@
         MESMRFieldValidator* aValidator )
     {
     FUNC_LOG;
-    CESMRRecurenceField* self = 
+    CESMRRecurenceField* self =
         new( ELeave )CESMRRecurenceField( aValidator );
     CleanupStack::PushL( self );
     self->ConstructL();
@@ -118,9 +118,9 @@
     iRecurrence = CMRLabel::NewL();
     iRecurrence->SetParent( this );
     CESMRField::ConstructL( iRecurrence );
-    
+
     iRecurrence->SetTextL( KNullDesC() );
-    
+
     iFieldIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapRecurrence );
     iFieldIcon->SetParent( this );
     }
@@ -159,7 +159,7 @@
                 }
             }
         // resource reader
-        CleanupStack::PopAndDestroy(); // codescanner::cleanup 
+        CleanupStack::PopAndDestroy(); // codescanner::cleanup
         }
     else
         {
@@ -196,7 +196,7 @@
     	aCommand == EAknCmdOpen )
         {
     	HandleTactileFeedbackL();
-    	
+
         ExecuteRecurrenceQueryL();
         isUsed = ETrue;
         }
@@ -210,7 +210,7 @@
 void CESMRRecurenceField::ExecuteRecurrenceQueryL()
     {
     FUNC_LOG;
-    TInt ret = CESMRListQuery::ExecuteL( 
+    TInt ret = CESMRListQuery::ExecuteL(
             CESMRListQuery::EESMRRecurrenceQuery );
 
     if ( ret != KErrCancel )
@@ -311,31 +311,29 @@
     {
     FUNC_LOG;
     TRect rect = Rect();
-    
+
     TAknLayoutRect rowLayoutRect =
      NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
     rect = rowLayoutRect.Rect();
-    
+
     TAknWindowComponentLayout iconLayout =
-     NMRLayoutManager::GetWindowComponentLayout( 
+     NMRLayoutManager::GetWindowComponentLayout(
              NMRLayoutManager::EMRLayoutTextEditorIcon );
     AknLayoutUtils::LayoutImage( iFieldIcon, rect, iconLayout );
-    
+
     TAknLayoutRect bgLayoutRect =
-     NMRLayoutManager::GetLayoutRect( 
+     NMRLayoutManager::GetLayoutRect(
              rect, NMRLayoutManager::EMRLayoutTextEditorBg );
     TRect bgRect( bgLayoutRect.Rect() );
     // Move focus rect so that it's relative to field's position.
     bgRect.Move( -Position() );
     SetFocusRect( bgRect );
-    
-    TAknLayoutText labelLayout = 
-     NMRLayoutManager::GetLayoutText( 
-             rect, NMRLayoutManager::EMRTextLayoutTextEditor );
-    iRecurrence->SetRect( labelLayout.TextRect() );
-    
-    // Setting font also for the field
-    iRecurrence->SetFont( labelLayout.Font() );
+
+    TAknTextComponentLayout editorLayout =
+            NMRLayoutManager::GetTextComponentLayout(
+                    NMRLayoutManager::EMRTextLayoutTextEditor );
+
+    AknLayoutUtils::LayoutLabel( iRecurrence, rect, editorLayout );
     }
 
 // ---------------------------------------------------------------------------
@@ -379,12 +377,12 @@
 // CESMRRecurenceField::SetContainerWindowL
 // ---------------------------------------------------------------------------
 //
-void CESMRRecurenceField::SetContainerWindowL( 
+void CESMRRecurenceField::SetContainerWindowL(
         const CCoeControl& aContainer )
     {
     CCoeControl::SetContainerWindowL( aContainer );
     iRecurrence->SetContainerWindowL( aContainer );
-    
+
     iRecurrence->SetParent( this );
     }
 
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmdatefield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmdatefield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -124,38 +124,36 @@
         NMRLayoutManager::GetWindowComponentLayout(
                 NMRLayoutManager::EMRLayoutTextEditorIcon );
     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
-    
+
     // Layouting lock icon
     if( iLockIcon )
         {
-        TAknWindowComponentLayout iconLayout( 
-                NMRLayoutManager::GetWindowComponentLayout( 
+        TAknWindowComponentLayout iconLayout(
+                NMRLayoutManager::GetWindowComponentLayout(
                     NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
         AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
         }
 
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
+
     if( iLockIcon )
     	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+    	viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+    	        NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
     	}
     else
     	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
+    	viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+    	        NMRLayoutManager::EMRTextLayoutTextEditor );
     	}
-    
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iLabel->SetRect( viewerRect );
-    
+
+    AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
+    TRect viewerRect( iLabel->Rect() );
+
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
     SetFocusRect( viewerRect );
-
-    // Setting font also for the label
-    iLabel->SetFont( viewerLayoutText.Font() );
     }
 
 // ---------------------------------------------------------------------------
@@ -175,12 +173,12 @@
         {
         ++count;
         }
-    
+
     if ( iLockIcon )
     	{
     	++count;
     	}
-    
+
     return count;
     }
 
@@ -223,24 +221,24 @@
 TBool CESMRViewerAlarmDateField::ExecuteGenericCommandL( TInt aCommand )
     {
     FUNC_LOG;
-    
+
     TBool retValue( EFalse );
-    
+
     if( (aCommand == EAknCmdOpen) && IsLocked()  )
     	{
 		HandleTactileFeedbackL();
-		
+
     	CESMRGlobalNote::ExecuteL(
     	                    CESMRGlobalNote::EESMRUnableToEdit );
     	retValue = ETrue;
     	}
-    
+
     if ( EMRCmdDoEnvironmentChange == aCommand )
         {
         FormatAlarmTimeL();
         retValue = ETrue;
         }
-    
+
     return retValue;
     }
 
@@ -255,13 +253,13 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
-	iLockIcon->SetParent( this );	
+	iLockIcon->SetParent( this );
 	}
 
 // ---------------------------------------------------------------------------
@@ -271,7 +269,7 @@
 void CESMRViewerAlarmDateField::FormatAlarmTimeL()
     {
     FUNC_LOG;
-    
+
     // Read format string from AVKON resource
     HBufC* dateFormatString = iEikonEnv->AllocReadResourceLC(
             R_QTN_DATE_USUAL_WITH_ZERO );
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -197,38 +197,36 @@
         NMRLayoutManager::GetWindowComponentLayout(
                 NMRLayoutManager::EMRLayoutTextEditorIcon );
     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
-  
+
     // Layouting lock icon
     if( iLockIcon )
     	{
-    	TAknWindowComponentLayout iconLayout( 
-    			NMRLayoutManager::GetWindowComponentLayout( 
+    	TAknWindowComponentLayout iconLayout(
+    			NMRLayoutManager::GetWindowComponentLayout(
     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
     	}
 
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
+
     if( iLockIcon )
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+        }
     else
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutTextEditor );
+        }
 
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iLabel->SetRect( viewerRect );
+    AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
+    TRect viewerRect( iLabel->Rect() );
 
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
     SetFocusRect( viewerRect );
-
-    // Setting font also for the label
-    iLabel->SetFont( viewerLayoutText.Font() );
     }
 
 // ---------------------------------------------------------------------------
@@ -248,7 +246,7 @@
         {
         ++count;
         }
-    
+
     if ( iLockIcon )
     	{
     	++count;
@@ -299,9 +297,9 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
@@ -315,18 +313,18 @@
 TBool CESMRViewerAlarmField::ExecuteGenericCommandL( TInt aCommand )
 	{
     FUNC_LOG;
-    
+
     TBool retValue( EFalse );
-    
+
     if( (aCommand == EAknCmdOpen) && IsLocked()  )
     	{
 		HandleTactileFeedbackL();
-		
+
     	CESMRGlobalNote::ExecuteL(
     			CESMRGlobalNote::EESMRUnableToEdit );
     	retValue = ETrue;
     	}
-    
+
     return retValue;
 	}
 
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmtimefield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralarmtimefield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -127,34 +127,32 @@
     // Layouting lock icon
     if( iLockIcon )
     	{
-    	TAknWindowComponentLayout iconLayout( 
-    			NMRLayoutManager::GetWindowComponentLayout( 
+    	TAknWindowComponentLayout iconLayout(
+    			NMRLayoutManager::GetWindowComponentLayout(
     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
     	}
 
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
+
     if( iLockIcon )
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+        }
     else
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutTextEditor );
+        }
 
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iLabel->SetRect( viewerRect );
+    AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
+    TRect viewerRect( iLabel->Rect() );
 
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
     SetFocusRect( viewerRect );
-
-    // Setting font also for the label
-    iLabel->SetFont( viewerLayoutText.Font() );
     }
 
 // ---------------------------------------------------------------------------
@@ -174,7 +172,7 @@
         {
         ++count;
         }
-    
+
     if ( iLockIcon )
     	{
     	++count;
@@ -221,24 +219,24 @@
 TBool CESMRViewerAlarmTimeField::ExecuteGenericCommandL( TInt aCommand )
     {
     FUNC_LOG;
-    
+
     TBool retValue( EFalse );
-    
+
     if( (aCommand == EAknCmdOpen) && IsLocked()  )
     	{
 		HandleTactileFeedbackL();
-    	
+
 		CESMRGlobalNote::ExecuteL(
     	                    CESMRGlobalNote::EESMRUnableToEdit );
     	retValue = ETrue;
     	}
-    
+
     if ( EMRCmdDoEnvironmentChange == aCommand )
         {
         FormatAlarmTimeL();
         retValue = ETrue;
         }
-    
+
     return retValue;
     }
 
@@ -253,9 +251,9 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
@@ -269,7 +267,7 @@
 void CESMRViewerAlarmTimeField::FormatAlarmTimeL()
     {
     FUNC_LOG;
-    
+
     // Read format string from AVKON resource
     HBufC* dateFormatString =
         iEikonEnv->AllocReadResourceLC( R_QTN_TIME_USUAL_WITH_ZERO );
@@ -279,7 +277,7 @@
     iAlarmTime.FormatL( ptr, *dateFormatString );
     AknTextUtils::DisplayTextLanguageSpecificNumberConversion( ptr );
     iLabel->SetTextL( ptr );
-    CleanupStack::PopAndDestroy( 2, dateFormatString );    
+    CleanupStack::PopAndDestroy( 2, dateFormatString );
     }
 // EOF
 
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralldayeventfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrvieweralldayeventfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -135,30 +135,28 @@
     // Layouting lock icon
     if( iLockIcon )
     	{
-    	TAknWindowComponentLayout iconLayout( 
-    			NMRLayoutManager::GetWindowComponentLayout( 
+    	TAknWindowComponentLayout iconLayout(
+    			NMRLayoutManager::GetWindowComponentLayout(
     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
     	}
 
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
+
     if( iLockIcon )
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+        }
     else
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutTextEditor );
+        }
 
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iLabel->SetRect( viewerRect );    
-    // Setting font for the label also
-    iLabel->SetFont( viewerLayoutText.Font() );
-
+    AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
+    TRect viewerRect( iLabel->Rect() );
 
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
@@ -229,9 +227,9 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
@@ -245,18 +243,18 @@
 TBool CESMRViewerAllDayEventField::ExecuteGenericCommandL( TInt aCommand )
 	{
     FUNC_LOG;
-    
+
     TBool retValue( EFalse );
-    
+
     if( (aCommand == EAknCmdOpen) && IsLocked()  )
     	{
 		HandleTactileFeedbackL();
-		
+
     	CESMRGlobalNote::ExecuteL(
     	                    CESMRGlobalNote::EESMRUnableToEdit );
     	retValue = ETrue;
     	}
-    
+
     return retValue;
 	}
 
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerlocationfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerlocationfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -229,8 +229,12 @@
             break;
             }
         case EAknSoftkeySelect:
+        case EAknCmdOpen:
             {
-            iRichTextViewer->LinkSelectedL();
+            if ( !iRichTextViewer->LinkSelectedL() )
+                {
+                NotifyEventL( EAknSoftkeyContextOptions );
+                }
             isUsed = ETrue;
 
             break;
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerpriorityfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerpriorityfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -81,10 +81,10 @@
     iLabel = CMRLabel::NewL();
     iLabel->SetParent( this );
     CESMRField::ConstructL( iLabel ); // ownership transfered
-    
+
     iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapPriorityNormal );
     iIcon->SetParent( this );
-    
+
     HBufC* priorityText = StringLoader::LoadLC(
                         R_QTN_CALENDAR_MEETING_OPT_PRIORITY_NORMAL,
                         iEikonEnv );
@@ -182,43 +182,41 @@
     TAknLayoutRect rowLayoutRect =
         NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
     rect = rowLayoutRect.Rect();
-    
+
     TAknWindowComponentLayout iconLayout =
-        NMRLayoutManager::GetWindowComponentLayout( 
+        NMRLayoutManager::GetWindowComponentLayout(
                 NMRLayoutManager::EMRLayoutTextEditorIcon );
     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
-    
+
     // Layouting lock icon
     if( iLockIcon )
     	{
-    	TAknWindowComponentLayout iconLayout( 
-    			NMRLayoutManager::GetWindowComponentLayout( 
+    	TAknWindowComponentLayout iconLayout(
+    			NMRLayoutManager::GetWindowComponentLayout(
     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
     	}
-    
+
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
+
     if( iLockIcon )
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+        }
     else
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutTextEditor );
+        }
 
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iLabel->SetRect( viewerRect );
+    AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
+    TRect viewerRect( iLabel->Rect() );
 
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
     SetFocusRect( viewerRect );
-
-    // Setting font also for the label
-    iLabel->SetFont( viewerLayoutText.Font() );
     }
 
 // ---------------------------------------------------------------------------
@@ -273,8 +271,8 @@
     {
     FUNC_LOG;
     CESMRField::SetOutlineFocusL ( aFocus );
-    
-    iLabel->SetFocus( aFocus );    
+
+    iLabel->SetFocus( aFocus );
     }
 
 // ---------------------------------------------------------------------------
@@ -288,9 +286,9 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
@@ -310,7 +308,7 @@
 	if( (aCommand == EAknCmdOpen) && IsLocked()  )
 		{
 		HandleTactileFeedbackL();
-		
+
 		CESMRGlobalNote::ExecuteL(
 				CESMRGlobalNote::EESMRUnableToEdit );
 		retValue = ETrue;
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencedatefield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencedatefield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -37,7 +37,6 @@
 namespace // codescanner::namespace
     {
     const TInt KComponentCount( 2 );
-    const TInt KMargin (5);
     }
 // ======== MEMBER FUNCTIONS ========
 
@@ -71,7 +70,7 @@
 CESMRViewerRecurrenceDateField* CESMRViewerRecurrenceDateField::NewL()
     {
     FUNC_LOG;
-    CESMRViewerRecurrenceDateField* self = 
+    CESMRViewerRecurrenceDateField* self =
             new (ELeave) CESMRViewerRecurrenceDateField();
     CleanupStack::PushL( self );
     self->ConstructL();
@@ -116,24 +115,24 @@
 TBool CESMRViewerRecurrenceDateField::ExecuteGenericCommandL( TInt aCommand )
     {
     FUNC_LOG;
-    
+
     TBool retValue( EFalse );
-    
+
     if( (aCommand == EAknCmdOpen) && IsLocked()  )
     	{
 		HandleTactileFeedbackL();
-		
+
     	CESMRGlobalNote::ExecuteL(
-    			CESMRGlobalNote::EESMRUnableToEdit );    	
+    			CESMRGlobalNote::EESMRUnableToEdit );
     	retValue = ETrue;
-    	}    
+    	}
     else if ( EMRCmdDoEnvironmentChange == aCommand )
         {
         FormatRepeatUntilDateL();
         retValue = ETrue;
         }
-    
-    return retValue;    
+
+    return retValue;
     }
 
 // -----------------------------------------------------------------------------
@@ -149,13 +148,11 @@
         NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
     rect = row1LayoutRect.Rect();
 
-    TAknLayoutText topicRect =
-        NMRLayoutManager::GetLayoutText(
-                rect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor );
+    TAknTextComponentLayout topicLayoutText =
+            NMRLayoutManager::GetTextComponentLayout(
+                    NMRLayoutManager::EMRTextLayoutMultiRowTextEditor );
 
-    TRect rectWithMargin = topicRect.TextRect();
-    rectWithMargin.iTl.iX += KMargin;
-    iRepeatTopic->SetRect( rectWithMargin );
+    AknLayoutUtils::LayoutLabel( iRepeatTopic, rect, topicLayoutText );
 
     rect = Rect();
     // Move the iY down the height of the topic field
@@ -167,17 +164,11 @@
         NMRLayoutManager::GetFieldRowLayoutRect( rect, 2 );
     rect = row2LayoutRect.Rect();
 
-    TAknLayoutText dateRect =
-        NMRLayoutManager::GetLayoutText(
-                rect, NMRLayoutManager::EMRTextLayoutMultiRowTextEditor );
+    TAknTextComponentLayout dateLayoutText =
+            NMRLayoutManager::GetTextComponentLayout(
+                    NMRLayoutManager::EMRTextLayoutMultiRowTextEditor );
 
-        rectWithMargin = dateRect.TextRect();
-    rectWithMargin.iTl.iX += KMargin;
-    iRepeatDate->SetRect( rectWithMargin );
-
-    // Setting font also for the label
-    iRepeatTopic->SetFont( topicRect.Font() );
-    iRepeatDate->SetFont( dateRect.Font() );
+    AknLayoutUtils::LayoutLabel( iRepeatDate, rect, dateLayoutText );
     }
 
 // -----------------------------------------------------------------------------
@@ -209,12 +200,12 @@
     {
     FUNC_LOG;
     // Get recurrence
-    TESMRRecurrenceValue recValue( ERecurrenceNot );    
+    TESMRRecurrenceValue recValue( ERecurrenceNot );
     aEntry.GetRecurrenceL( recValue, iRepeatUntilDate );
 
     // Recurrence time has to be shown in the viewer as local time
     TCalTime recurrenceTime;
-    recurrenceTime.SetTimeUtcL( iRepeatUntilDate );    
+    recurrenceTime.SetTimeUtcL( iRepeatUntilDate );
     iRepeatUntilDate = recurrenceTime.TimeLocalL();
 
     if( aEntry.IsRecurrentEventL() &&
@@ -277,9 +268,9 @@
             StringLoader::LoadLC(
                     R_QTN_MEET_REQ_REPEAT_UNTIL,
                     iEikonEnv );
-    
+
     // Set text for repeat topic (e.g. "Repeat until")
-    iRepeatTopic->SetTextL( topicHolder->Des() );
+    iRepeatTopic->SetTextL( *topicHolder );
     CleanupStack::PopAndDestroy( topicHolder );
 
     // Format date string
@@ -293,7 +284,7 @@
     AknTextUtils::DisplayTextLanguageSpecificNumberConversion( finalBuf );
     iRepeatDate->SetTextL( finalBuf );
     CleanupStack::PopAndDestroy( timeFormatString );
-    timeFormatString = NULL;    
+    timeFormatString = NULL;
     }
 
 // End of file
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencefield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerrecurrencefield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -202,34 +202,31 @@
     // Layouting lock icon
     if( iLockIcon )
     	{
-    	TAknWindowComponentLayout iconLayout( 
-    			NMRLayoutManager::GetWindowComponentLayout( 
+    	TAknWindowComponentLayout iconLayout(
+    			NMRLayoutManager::GetWindowComponentLayout(
     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
     	}
-        
+
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
     if( iLockIcon )
     	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+    	viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+    	        NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
     	}
     else
     	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
+    	viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+    	        NMRLayoutManager::EMRTextLayoutTextEditor );
     	}
 
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iLabel->SetRect( viewerRect );
+    AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
+    TRect viewerRect( iLabel->Rect() );
 
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
     SetFocusRect( viewerRect );
-
-    // Setting font also for the label
-    iLabel->SetFont( viewerLayoutText.Font() );
     }
 
 // -----------------------------------------------------------------------------
@@ -243,7 +240,7 @@
     	{
     	++count;
     	}
-    
+
     return count;
     }
 
@@ -289,9 +286,9 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
@@ -311,7 +308,7 @@
 	if( (aCommand == EAknCmdOpen) && IsLocked()  )
 		{
 		HandleTactileFeedbackL();
-		
+
 		CESMRGlobalNote::ExecuteL(
 				CESMRGlobalNote::EESMRUnableToEdit );
 		retValue = ETrue;
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstartdatefield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstartdatefield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -55,7 +55,7 @@
 CESMRViewerStartDateField::CESMRViewerStartDateField()
     {
     FUNC_LOG;
-    
+
     SetFieldId ( EESMRFieldStartDate );
     SetFocusType( EESMRHighlightFocus );
     }
@@ -67,7 +67,7 @@
 CESMRViewerStartDateField::~CESMRViewerStartDateField()
     {
     FUNC_LOG;
-    
+
     delete iIcon;
     delete iLockIcon;
     }
@@ -79,8 +79,8 @@
 CESMRViewerStartDateField* CESMRViewerStartDateField::NewL()
     {
     FUNC_LOG;
-    
-    CESMRViewerStartDateField* self = 
+
+    CESMRViewerStartDateField* self =
             new (ELeave) CESMRViewerStartDateField();
     CleanupStack::PushL( self );
     self->ConstructL();
@@ -95,7 +95,7 @@
 void CESMRViewerStartDateField::ConstructL()
     {
     FUNC_LOG;
-    
+
     iLabel = CMRLabel::NewL();
     iLabel->SetParent( this );
     CESMRField::ConstructL( iLabel ); // ownership transfered
@@ -112,7 +112,7 @@
     {
     FUNC_LOG;
 
-    CCalEntry& entry = aEntry.Entry();    
+    CCalEntry& entry = aEntry.Entry();
     iStartTime = entry.StartTimeL().TimeLocalL();
 
     FormatDateStringL();
@@ -125,7 +125,7 @@
 void CESMRViewerStartDateField::SizeChanged()
     {
     FUNC_LOG;
-    
+
     TRect rect = Rect();
     TAknLayoutRect rowLayoutRect =
         NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
@@ -139,35 +139,31 @@
     // Layouting lock icon
     if( iLockIcon )
     	{
-    	TAknWindowComponentLayout iconLayout( 
-    			NMRLayoutManager::GetWindowComponentLayout( 
+    	TAknWindowComponentLayout iconLayout(
+    			NMRLayoutManager::GetWindowComponentLayout(
     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
     	}
-        
+
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
     if( iLockIcon )
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+        }
     else
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutTextEditor );
+        }
 
-    // Layouting viewer field
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iLabel->SetRect( viewerRect );
+    AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
+    TRect viewerRect( iLabel->Rect() );
 
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
     SetFocusRect( viewerRect );
-
-    // Setting font also for the label
-    iLabel->SetFont( viewerLayoutText.Font() );
     }
 
 // ---------------------------------------------------------------------------
@@ -177,7 +173,7 @@
 TInt CESMRViewerStartDateField::CountComponentControls() const
     {
     FUNC_LOG;
-    
+
     TInt count( KComponentCount );
     if( iLockIcon )
     	{
@@ -193,7 +189,7 @@
 CCoeControl* CESMRViewerStartDateField::ComponentControl( TInt aIndex ) const
     {
     FUNC_LOG;
-    
+
     switch ( aIndex )
         {
         case 0:
@@ -214,7 +210,7 @@
 void CESMRViewerStartDateField::SetOutlineFocusL( TBool aFocus )
     {
     FUNC_LOG;
-    
+
     CESMRField::SetOutlineFocusL ( aFocus );
     iLabel->SetFocus( aFocus );
     }
@@ -226,24 +222,24 @@
 TBool CESMRViewerStartDateField::ExecuteGenericCommandL( TInt aCommand )
     {
     FUNC_LOG;
-    
+
     TBool retValue( EFalse );
-    
+
     if( (aCommand == EAknCmdOpen) && IsLocked()  )
     	{
 		HandleTactileFeedbackL();
-		
+
     	CESMRGlobalNote::ExecuteL(
     			CESMRGlobalNote::EESMRUnableToEdit );
     	retValue = ETrue;
     	}
-    
+
     if ( EMRCmdDoEnvironmentChange == aCommand )
         {
         FormatDateStringL();
         retValue = ETrue;
         }
-    
+
     return retValue;
     }
 
@@ -258,9 +254,9 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
@@ -274,18 +270,18 @@
 void CESMRViewerStartDateField::FormatDateStringL()
     {
     FUNC_LOG;
-    
+
     // Read format string from AVKON resource
-    HBufC* dateFormatString = 
+    HBufC* dateFormatString =
             iEikonEnv->AllocReadResourceLC(
                     R_QTN_DATE_USUAL_WITH_ZERO);
-    
+
     TBuf<KMaxTimeBuffer> buf;
     iStartTime.FormatL(buf, *dateFormatString);
 
     AknTextUtils::DisplayTextLanguageSpecificNumberConversion( buf );
     iLabel->SetTextL( buf );
-    CleanupStack::PopAndDestroy( dateFormatString );    
+    CleanupStack::PopAndDestroy( dateFormatString );
     }
 
 // EOF
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstopdatefield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewerstopdatefield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -43,7 +43,7 @@
     { // codescanner::namespace
 
 const TInt KComponentCount( 2 ); // icon and label
-const TInt KMaxTimeBuffer( 32 ); // buffer for date formatting    
+const TInt KMaxTimeBuffer( 32 ); // buffer for date formatting
 
     } // unnamed namespace
 
@@ -176,34 +176,31 @@
     // Layouting lock icon
     if( iLockIcon )
     	{
-    	TAknWindowComponentLayout iconLayout( 
-    			NMRLayoutManager::GetWindowComponentLayout( 
+    	TAknWindowComponentLayout iconLayout(
+    			NMRLayoutManager::GetWindowComponentLayout(
     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
     	}
-        
+
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
     if( iLockIcon )
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+        }
     else
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutTextEditor );
+        }
 
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iLabel->SetRect( viewerRect );
+    AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
+    TRect viewerRect( iLabel->Rect() );
 
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
     SetFocusRect( viewerRect );
-
-    // Setting font also for the label
-    iLabel->SetFont( viewerLayoutText.Font() );
     }
 
 // ---------------------------------------------------------------------------
@@ -257,24 +254,24 @@
 TBool CESMRViewerStopDateField::ExecuteGenericCommandL( TInt aCommand )
     {
     FUNC_LOG;
-    
+
     TBool retValue( EFalse );
-    
+
     if( (aCommand == EAknCmdOpen) && IsLocked()  )
     	{
 		HandleTactileFeedbackL();
-		
+
     	CESMRGlobalNote::ExecuteL(
     			CESMRGlobalNote::EESMRUnableToEdit );
     	retValue = ETrue;
     	}
-    
+
     if ( EMRCmdDoEnvironmentChange == aCommand )
         {
         FormatDateStringL();
         retValue = ETrue;
         }
-    
+
     return retValue;
     }
 
@@ -289,9 +286,9 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
@@ -305,18 +302,18 @@
 void CESMRViewerStopDateField::FormatDateStringL()
     {
     FUNC_LOG;
-    
+
     // Read format string from AVKON resource
-    HBufC* dateFormatString = 
+    HBufC* dateFormatString =
             iEikonEnv->AllocReadResourceLC(
                     R_QTN_DATE_USUAL_WITH_ZERO);
-    
+
     TBuf<KMaxTimeBuffer> buf;
     iStopTime.FormatL(buf, *dateFormatString);
 
     AknTextUtils::DisplayTextLanguageSpecificNumberConversion( buf );
     iLabel->SetTextL( buf );
-    CleanupStack::PopAndDestroy( dateFormatString );    
+    CleanupStack::PopAndDestroy( dateFormatString );
     }
 
 // EOF
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewersyncfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewersyncfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -168,34 +168,31 @@
     // Layouting lock icon
     if( iLockIcon )
     	{
-    	TAknWindowComponentLayout iconLayout( 
-    			NMRLayoutManager::GetWindowComponentLayout( 
+    	TAknWindowComponentLayout iconLayout(
+    			NMRLayoutManager::GetWindowComponentLayout(
     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
     	}
-        
+
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
     if( iLockIcon )
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+        }
     else
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutTextEditor );
+        }
 
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iLabel->SetRect( viewerRect );
+    AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
+    TRect viewerRect( iLabel->Rect() );
 
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
     SetFocusRect( viewerRect );
-
-    // Setting font also for the label
-    iLabel->SetFont( viewerLayoutText.Font() );
     }
 
 // ---------------------------------------------------------------------------
@@ -262,9 +259,9 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
@@ -284,7 +281,7 @@
 	if( (aCommand == EAknCmdOpen) && IsLocked()  )
 		{
 		HandleTactileFeedbackL();
-		
+
 		CESMRGlobalNote::ExecuteL(
 				CESMRGlobalNote::EESMRUnableToEdit );
 		retValue = ETrue;
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewertimefield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cesmrviewertimefield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -60,7 +60,7 @@
 CESMRViewerTimeField::CESMRViewerTimeField()
     {
     FUNC_LOG;
-    
+
     SetFieldId( EESMRFieldMeetingTime );
     SetFocusType( EESMRHighlightFocus );
     }
@@ -98,7 +98,7 @@
 void CESMRViewerTimeField::ConstructL()
     {
     FUNC_LOG;
-    
+
     iLabel = CMRLabel::NewL();
     iLabel->SetParent( this );
     CESMRField::ConstructL( iLabel ); // ownership transfered
@@ -118,8 +118,8 @@
     CCalEntry& entry = aEntry.Entry();
 
     iStartTime = entry.StartTimeL().TimeLocalL();
-    iEndTime   = entry.EndTimeL().TimeLocalL();    
-    
+    iEndTime   = entry.EndTimeL().TimeLocalL();
+
     if ( aEntry.IsAllDayEventL() )
         {
         // set the field as hidden:
@@ -138,7 +138,7 @@
 void CESMRViewerTimeField::InitializeL()
     {
     FUNC_LOG;
-    
+
     TAknLayoutText text = NMRLayoutManager::GetLayoutText(
             Rect(),
             NMRLayoutManager::EMRTextLayoutTextEditor );
@@ -158,7 +158,7 @@
 void CESMRViewerTimeField::SizeChanged()
     {
     FUNC_LOG;
-    
+
     TRect rect = Rect();
     TAknLayoutRect rowLayoutRect =
         NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
@@ -172,34 +172,31 @@
     // Layouting lock icon
     if( iLockIcon )
         {
-        TAknWindowComponentLayout iconLayout( 
-                NMRLayoutManager::GetWindowComponentLayout( 
+        TAknWindowComponentLayout iconLayout(
+                NMRLayoutManager::GetWindowComponentLayout(
                     NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
         AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
         }
-    
+
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
     if( iLockIcon )
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+        }
     else
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutTextEditor );
+        }
 
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iLabel->SetRect( viewerRect );
+    AknLayoutUtils::LayoutLabel( iLabel, rect, viewerLayoutText );
+    TRect viewerRect( iLabel->Rect() );
 
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
     SetFocusRect( viewerRect );
-
-    // Setting font also for the label
-    iLabel->SetFont( viewerLayoutText.Font() );
     }
 
 // ---------------------------------------------------------------------------
@@ -209,7 +206,7 @@
 TInt CESMRViewerTimeField::CountComponentControls() const
     {
     FUNC_LOG;
-    
+
     TInt count( 0 );
     if ( iIcon )
     	{
@@ -220,7 +217,7 @@
     	{
     	++count;
     	}
-    
+
     if ( iLockIcon )
     	{
     	++count;
@@ -235,7 +232,7 @@
 CCoeControl* CESMRViewerTimeField::ComponentControl( TInt aIndex ) const
     {
     FUNC_LOG;
-    
+
     switch ( aIndex )
         {
         case 0:
@@ -256,7 +253,7 @@
 void CESMRViewerTimeField::SetOutlineFocusL( TBool aFocus )
     {
     FUNC_LOG;
-    
+
     CESMRField::SetOutlineFocusL ( aFocus );
 
     iLabel->SetFocus( aFocus );
@@ -269,24 +266,24 @@
 TBool CESMRViewerTimeField::ExecuteGenericCommandL( TInt aCommand )
     {
     FUNC_LOG;
-    
+
     TBool retValue( EFalse );
-    
+
     if( (aCommand == EAknCmdOpen) && IsLocked()  )
     	{
 		HandleTactileFeedbackL();
-		
+
     	CESMRGlobalNote::ExecuteL(
     			CESMRGlobalNote::EESMRUnableToEdit );
     	retValue = ETrue;
     	}
-    
+
     if ( EMRCmdDoEnvironmentChange == aCommand )
         {
         FormatTimeFieldStringL();
         retValue = ETrue;
         }
-    
+
     return retValue;
     }
 
@@ -301,9 +298,9 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
@@ -318,7 +315,7 @@
     {
     HBufC* timeFormatString =
         iEikonEnv->AllocReadResourceLC( R_QTN_TIME_USUAL_WITH_ZERO );
-    
+
     HBufC* finalBuf = HBufC::NewLC( KTimeBufferSize );
     HBufC* startBuf = HBufC::NewLC( KTempBufferSize );
     HBufC* endBuf = HBufC::NewLC( KTempBufferSize );
@@ -335,7 +332,7 @@
     AknTextUtils::DisplayTextLanguageSpecificNumberConversion( finalPtr );
     iLabel->SetTextL( finalPtr );
     CleanupStack::PopAndDestroy( KNumBuffers, timeFormatString );
-    
+
     }
 
 // EOF
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmralarmonofffield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmralarmonofffield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -50,11 +50,11 @@
 // CMRAlarmOnOffField::CMRAlarmOnOffField
 // ---------------------------------------------------------------------------
 //
-CMRAlarmOnOffField::CMRAlarmOnOffField() 
+CMRAlarmOnOffField::CMRAlarmOnOffField()
     {
     FUNC_LOG;
     iStatus = ETrue;
-    
+
     SetFieldId ( EESMRFieldAlarmOnOff );
     SetFocusType ( EESMRHighlightFocus );
     }
@@ -68,10 +68,10 @@
     FUNC_LOG;
     iValidator = aValidator;
     iValidator->SetAbsoluteAlarmOnOffFieldL( *this );
-        
+
     iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapAlarm );
     iIcon->SetParent( this );
-    
+
     iLabel = CMRLabel::NewL();
     CESMRField::ConstructL( iLabel ); // ownership transfered
     iLabel->SetTextL( KNullDesC() );
@@ -140,8 +140,8 @@
                 iStatus = ETrue;// Change the status to "ON" for these dialog default
                 }
                 break;
-                
-            case MESMRCalEntry::EESMRCalEntryAnniversary: // Anniversary    
+
+            case MESMRCalEntry::EESMRCalEntryAnniversary: // Anniversary
                 {
                 iStatus = ETrue;// Change the status to "ON" for these dialog default
                 }
@@ -149,7 +149,7 @@
                 // Flow through
             case MESMRCalEntry::EESMRCalEntryMemo: // Memo
             case MESMRCalEntry::EESMRCalEntryReminder: // Reminder
-            
+
             default:
                 iStatus = EFalse; // Change the status to "OFF" for these dialog default
                 break;
@@ -198,7 +198,7 @@
     CESMRField::SetOutlineFocusL( aFocus );
 
     iLabel->SetFocus( aFocus );
-    
+
     if( aFocus ) //Focus is gained on the field
         {
         if ( iStatus )
@@ -235,11 +235,11 @@
     FUNC_LOG;
     TBool isUsed( EFalse );
     // EAknCmdOpen is added for the Pointer events, see ListPane
-    if( aCommand == EESMRCmdAlarmOn || aCommand == EESMRCmdAlarmOff 
+    if( aCommand == EESMRCmdAlarmOn || aCommand == EESMRCmdAlarmOff
             || aCommand == EAknCmdOpen )
         {
 		HandleTactileFeedbackL();
-		
+
         SwitchMiddleSoftKeyL();
         isUsed = ETrue;
         }
@@ -257,13 +257,13 @@
     ResetFieldL();
     if( iStatus )
         {
-        ChangeMiddleSoftKeyL( EESMRCmdAlarmOff,R_QTN_MEET_REQ_ALARM_OFF ); 
+        ChangeMiddleSoftKeyL( EESMRCmdAlarmOff,R_QTN_MEET_REQ_ALARM_OFF );
         }
     else
         {
-        ChangeMiddleSoftKeyL( EESMRCmdAlarmOn,R_QTN_MEET_REQ_ALARM_ON ); 
+        ChangeMiddleSoftKeyL( EESMRCmdAlarmOn,R_QTN_MEET_REQ_ALARM_ON );
         }
-    
+
     if( iLabel->IsVisible() )
         {
         iLabel->DrawDeferred();
@@ -313,27 +313,24 @@
     TAknLayoutRect rowLayoutRect =
      NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
     rect = rowLayoutRect.Rect();
-    
+
     TAknWindowComponentLayout iconLayout =
-     NMRLayoutManager::GetWindowComponentLayout( 
+     NMRLayoutManager::GetWindowComponentLayout(
              NMRLayoutManager::EMRLayoutTextEditorIcon );
     AknLayoutUtils::LayoutImage( iIcon, rect, iconLayout );
-    
+
     TAknLayoutRect bgLayoutRect =
-     NMRLayoutManager::GetLayoutRect( 
+     NMRLayoutManager::GetLayoutRect(
              rect, NMRLayoutManager::EMRLayoutTextEditorBg );
     TRect bgRect( bgLayoutRect.Rect() );
     // Move focus rect so that it's relative to field's position.
     bgRect.Move( -Position() );
     SetFocusRect( bgRect );
-    
-    TAknLayoutText labelLayout = 
-     NMRLayoutManager::GetLayoutText( 
-             rect, NMRLayoutManager::EMRTextLayoutTextEditor );
-    iLabel->SetRect( labelLayout.TextRect() );
-    
-    // Setting font for the label also
-    iLabel->SetFont( labelLayout.Font() );
+
+    TAknTextComponentLayout labelLayout =
+            NMRLayoutManager::GetTextComponentLayout(
+                    NMRLayoutManager::EMRTextLayoutTextEditor );
+    AknLayoutUtils::LayoutLabel( iLabel, rect, labelLayout );
     }
 
 // ---------------------------------------------------------------------------
@@ -378,7 +375,7 @@
 // CMRAlarmOnOffField::SetContainerWindowL
 // ---------------------------------------------------------------------------
 //
-void CMRAlarmOnOffField::SetContainerWindowL( 
+void CMRAlarmOnOffField::SetContainerWindowL(
         const CCoeControl& aContainer )
     {
     FUNC_LOG;
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentsfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrattachmentsfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -316,15 +316,10 @@
     // Layout field title
     if( iTitle )
         {
-        TAknLayoutText labelLayout(
-                NMRLayoutManager::GetLayoutText(
-                        firstRowRect,
-                            NMRLayoutManager::EMRTextLayoutTextEditor ) );
-
-        iTitle->SetRect( labelLayout.TextRect() );
-
-        // Setting font also for the label. Failures are ignored.
-        TRAP_IGNORE( iTitle->SetFont( labelLayout.Font() ) );
+        TAknTextComponentLayout labelLayout =
+                NMRLayoutManager::GetTextComponentLayout(
+                        NMRLayoutManager::EMRTextLayoutTextEditor );
+        AknLayoutUtils::LayoutLabel( iTitle, firstRowRect, labelLayout );
         }
 
     TRect edwinRect( 0, 0, 0, 0 );
@@ -501,7 +496,7 @@
         iAttCommandHandler->HandleAttachmentCommandL(
                 aCommand,
                 *currentLink );
-        
+
 		HandleTactileFeedbackL();
 
         handled = ETrue;
@@ -845,7 +840,7 @@
         if( Rect().Contains( aPosition ) )
             {
 			HandleTactileFeedbackL();
-			
+
             ret = AddAttachmentL();
             }
         }
@@ -857,7 +852,7 @@
                 iFieldIcon->Rect().Contains( aPosition ) )
             {
 			HandleTactileFeedbackL();
-			
+
 			ret = AddAttachmentL();
             }
         }
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrmulticalenfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrmulticalenfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -124,7 +124,7 @@
     //Focus gained
     if ( aFocus )
         {
-        ChangeMiddleSoftKeyL( 
+        ChangeMiddleSoftKeyL(
                 EESMRCmdOpenMultiCalenSelectQuery, R_QTN_MSK_OPEN );
         }
     }
@@ -144,16 +144,16 @@
         if( IsLocked() )
         	{
 			HandleTactileFeedbackL();
-			
+
         	CESMRGlobalNote::ExecuteL(
         			CESMRGlobalNote::EESMRUnableToEdit );
         	isUsed = ETrue;
 			}
-        		    	
+
 		else if( iTypeChangeEnabled )
             {
 			HandleTactileFeedbackL();
-		
+
 		    ExecuteTypeQueryL();
             isUsed = ETrue;
             }
@@ -176,10 +176,10 @@
 
 	CESMRField::LockL();
 
-	delete iLockIcon;	
+	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
-	iIcon->SetParent( this );		
+	iIcon->SetParent( this );
 	}
 
 // ---------------------------------------------------------------------------
@@ -238,7 +238,7 @@
     iCalenName->SetAlignment( align );
 
     iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapCalendarSelection );
-    
+
     }
 
 // ---------------------------------------------------------------------------
@@ -270,7 +270,7 @@
     	{
     	++count;
     	}
-    
+
     if ( iLockIcon )
     	{
     	++count;
@@ -324,49 +324,49 @@
                 rect, NMRLayoutManager::EMRLayoutTextEditorIcon );
     TRect iconRect( iconLayout.Rect() );
     iIcon->SetRect( iconRect );
-    
+
     // Layouting lock icon
-    TAknLayoutRect rowLayoutRect( 
+    TAknLayoutRect rowLayoutRect(
             NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) );
     TRect rowRect( rowLayoutRect.Rect() );
     if( iLockIcon )
         {
-        TAknWindowComponentLayout iconLayout( 
-                NMRLayoutManager::GetWindowComponentLayout( 
+        TAknWindowComponentLayout iconLayout(
+                NMRLayoutManager::GetWindowComponentLayout(
                     NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
         AknLayoutUtils::LayoutImage( iLockIcon, rowRect, iconLayout );
         }
 
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
     if( iLockIcon )
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+        }
     else
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rowRect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutTextEditor );
+        }
 
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iCalenName->SetRect( viewerRect );
-    
+    AknLayoutUtils::LayoutLabel( iCalenName, rect, viewerLayoutText );
+    TRect viewerRect( iCalenName->Rect() );
+
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
-    
-    TAknLayoutRect bgLayoutRect = 
-        NMRLayoutManager::GetLayoutRect( 
+
+    TAknLayoutRect bgLayoutRect =
+        NMRLayoutManager::GetLayoutRect(
                 rect, NMRLayoutManager::EMRLayoutTextEditorBg );
     TRect bgRect( bgLayoutRect.Rect() );
-    
-    // Adjust background rect according to viewerRect 
+
+    // Adjust background rect according to viewerRect
     bgRect.SetWidth( viewerRect.Width() );
-    
+
     // Move focus rect so that it's relative to field's position.
     bgRect.Move( -Position() );
-        
+
     SetFocusRect( bgRect );
     }
 
@@ -392,9 +392,9 @@
 void CMRMultiCalenField::SetTextDimmed()
     {
     FUNC_LOG;
-    
+
     NMRColorManager::SetColor(
-            *iCalenName, 
+            *iCalenName,
             NMRColorManager::EMRMainAreaTextColorDimmed );
     }
 
@@ -403,58 +403,58 @@
 // ---------------------------------------------------------------------------
 //
 TBool CMRMultiCalenField::TypeChangeEnabledL()
-    {  
+    {
     TBool ret( ETrue );
-    
+
     /*
      * Case 1:
-     * If entry is single occurancy of a series, calendar type change  
+     * If entry is single occurancy of a series, calendar type change
      * is disabled for the user.
      */
-    if( iEntry->IsRecurrentEventL() && 
+    if( iEntry->IsRecurrentEventL() &&
             iEntry->RecurrenceModRule() == MESMRCalEntry::EESMRThisOnly &&
                 FieldMode() == EESMRFieldModeEdit )
         {
         ret = EFalse;
         }
-    
+
     /*
      * Case 2:
      * If entry is meeting request, and opened from mailbox that does not
-     * support multiple calendar, calendar type change is disabled 
+     * support multiple calendar, calendar type change is disabled
      * for the user.
      */
     if( ret && CCalenInterimUtils2::IsMeetingRequestL( iEntry->Entry() ) &&
             FieldMode() == EESMRFieldModeEdit )
         {
-        MESMRMeetingRequestEntry* entry = 
+        MESMRMeetingRequestEntry* entry =
             static_cast< MESMRMeetingRequestEntry* >( iEntry );
-        
-        // If entry's current plugin is active sync, it means that 
-        // Mail For Exchange is in use. This means, that multiple calendar 
+
+        // If entry's current plugin is active sync, it means that
+        // Mail For Exchange is in use. This means, that multiple calendar
         // functionality is not supported.
         if( entry->CurrentPluginL() == EESMRActiveSync )
             {
             ret = EFalse;
             }
         }
-    
+
     /*
      * Case 3:
-	 * When the organizer of the MR edits an already sent MR, calendar 
+	 * When the organizer of the MR edits an already sent MR, calendar
 	 * cannot be changed --> calendar selection needs to be locked.
      */
     if( ret && CCalenInterimUtils2::IsMeetingRequestL( iEntry->Entry() ) &&
             FieldMode() == EESMRFieldModeEdit )
     	{
-		MESMRMeetingRequestEntry* entry = 
+		MESMRMeetingRequestEntry* entry =
 				static_cast< MESMRMeetingRequestEntry* >( iEntry );
 		if( entry->RoleL() == EESMRRoleOrganizer && entry->IsSentL() )
 			{
-			ret = EFalse;    
+			ret = EFalse;
 			}
     	}
-    
+
     return ret;
     }
 
--- a/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrunifiededitorfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderplugin/src/cmrunifiededitorfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -179,7 +179,7 @@
             }
         // resource reader
         CleanupStack::PopAndDestroy(); // codescanner::cleanup
-        
+
         SetIconL( aEntry );
         }
     }
@@ -214,18 +214,18 @@
         if( IsLocked() )
         	{
 			HandleTactileFeedbackL();
-			
+
             CESMRGlobalNote::ExecuteL(
             		CESMRGlobalNote::EESMRUnableToEdit );
-            isUsed = ETrue;            
+            isUsed = ETrue;
         	}
         else
         	{
 			HandleTactileFeedbackL();
-			
+
         	ExecuteTypeQueryL();
         	isUsed = ETrue;
-        	}        
+        	}
         }
     return isUsed;
     }
@@ -241,9 +241,9 @@
 		{
 		return;
 		}
-	
+
 	CESMRField::LockL();
-	
+
 	delete iLockIcon;
 	iLockIcon = NULL;
 	iLockIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapLockField, ETrue );
@@ -296,8 +296,8 @@
     align.SetHAlignment( EHLeft );
     align.SetVAlignment( EVCenter );
     iType->SetAlignment( align );
-    
-    // An icon is required for layouting the field. Actual correct icon 
+
+    // An icon is required for layouting the field. Actual correct icon
     // is set after InternalizeL.
     iIcon = CMRImage::NewL( NMRBitmapManager::EMRBitmapEventTypeMeeting );
     }
@@ -331,7 +331,7 @@
     	{
     	++count;
     	}
-    
+
     if ( iLockIcon )
     	{
     	++count;
@@ -386,45 +386,45 @@
     // Layouting lock icon
     if( iLockIcon )
     	{
-    	TAknWindowComponentLayout iconLayout( 
-    			NMRLayoutManager::GetWindowComponentLayout( 
+    	TAknWindowComponentLayout iconLayout(
+    			NMRLayoutManager::GetWindowComponentLayout(
     					NMRLayoutManager::EMRLayoutSingleRowDColumnGraphic ) );
     	AknLayoutUtils::LayoutImage( iLockIcon, rect, iconLayout );
     	}
-        
+
     // Layouting label
-    TAknLayoutText viewerLayoutText;
+    TAknTextComponentLayout viewerLayoutText;
     if( iLockIcon )
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutSingleRowEditorText );
+        }
     else
-    	{
-    	viewerLayoutText = NMRLayoutManager::GetLayoutText( rect, 
-    			NMRLayoutManager::EMRTextLayoutTextEditor );
-    	}
+        {
+        viewerLayoutText = NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutTextEditor );
+        }
 
-    TRect viewerRect( viewerLayoutText.TextRect() );    
-    iType->SetRect( viewerRect );
+    AknLayoutUtils::LayoutLabel( iType, rect, viewerLayoutText );
+    TRect viewerRect( iType->Rect() );
 
     // Move focus rect so that it's relative to field's position.
     viewerRect.Move( -Position() );
 
-    TAknLayoutRect bgLayoutRect = 
-        NMRLayoutManager::GetLayoutRect( 
+    TAknLayoutRect bgLayoutRect =
+        NMRLayoutManager::GetLayoutRect(
                 rect, NMRLayoutManager::EMRLayoutTextEditorBg );
     TRect bgRect( bgLayoutRect.Rect() );
-    
-    // Adjust background rect according to viewerRect 
+
+    // Adjust background rect according to viewerRect
     bgRect.SetWidth( viewerRect.Width() );
-    
+
     // Move focus rect so that it's relative to field's position.
     bgRect.Move( -Position() );
-        
+
     SetFocusRect( bgRect );
-    
-        
+
+
     TAknTextComponentLayout editorLayout(
     		NMRLayoutManager::GetTextComponentLayout(
     				NMRLayoutManager::EMRTextLayoutTextEditor ) );
@@ -438,11 +438,11 @@
 void CMRUnifiedEditorField::SetIconL( MESMRCalEntry& aEntry )
     {
     FUNC_LOG;
-    NMRBitmapManager::TMRBitmapId bitmapId( 
+    NMRBitmapManager::TMRBitmapId bitmapId(
             NMRBitmapManager::EMRBitmapNotSet );
-    
+
     CCalEntry& entry = aEntry.Entry();
-    
+
     switch ( entry.EntryTypeL() )
         {
         case CCalEntry::EAppt:
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrattendeefield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -75,8 +75,8 @@
 :iRole( aRole )
     {
     FUNC_LOG;
-    SetFocusType( EESMRHighlightFocus );    
-    SetFieldId ( (iRole == CCalAttendee::EReqParticipant) ? 
+    SetFocusType( EESMRHighlightFocus );
+    SetFieldId ( (iRole == CCalAttendee::EReqParticipant) ?
             EESMRFieldAttendee : EESMRFieldOptAttendee );
     }
 
@@ -128,23 +128,23 @@
 
     iTitle = CMRLabel::NewL();
     iTitle->SetParent( this );
-    
+
     HBufC* buf = NULL;
     if( FieldId() == EESMRFieldAttendee )
         {
         buf = StringLoader::LoadLC( R_QTN_MEET_REQ_LABEL_REQUIRED );
         }
-    
+
     if( FieldId() == EESMRFieldOptAttendee )
         {
         buf = StringLoader::LoadLC( R_QTN_MEET_REQ_LABEL_OPT );
         }
-    
+
     iTitle->SetTextL( *buf ); // ownership transferred
     CleanupStack::Pop( buf );
 
-    
-    iEditor = 
+
+    iEditor =
         new ( ELeave ) CESMRNcsAifEditor( *iContactHandler, iDefaultText );
     CESMRField::ConstructL( iEditor );
     iEditor->ConstructL (
@@ -154,13 +154,13 @@
             CEikEdwin::EAvkonEditor | CEikEdwin::EResizable |
             CEikEdwin::ENoAutoSelection |CEikEdwin::EInclusiveSizeFixed |
             CEikEdwin::ENoHorizScrolling
-            );    
+            );
     iEditor->SetEdwinSizeObserver( this );
     iEditor->SetParent( this );
     iEditor->SetPopupList( this );
     iEditor->SetAlignment ( EAknEditorAlignBidi | EAknEditorAlignCenter );
     iEditor->SetAknEditorInputMode ( EAknEditorTextInputMode );
-    iEditor->SetAknEditorFlags ( 
+    iEditor->SetAknEditorFlags (
             EAknEditorFlagNoT9| EAknEditorFlagUseSCTNumericCharmap );
     iEditor->SetAknEditorCurrentCase ( EAknEditorLowerCase );
 
@@ -168,10 +168,10 @@
     TRect tempRect( 0, 0, 0, 0 );
     NMRBitmapManager::TMRBitmapStruct bitmapStruct;
     bitmapStruct = NMRBitmapManager::GetBitmapStruct( NMRBitmapManager::EMRBitmapInputCenter );
-    iBgCtrlContext = CAknsBasicBackgroundControlContext::NewL( 
-                bitmapStruct.iItemId, 
-                tempRect, 
-                EFalse );        
+    iBgCtrlContext = CAknsBasicBackgroundControlContext::NewL(
+                bitmapStruct.iItemId,
+                tempRect,
+                EFalse );
     iEditor->SetSkinBackgroundControlContextL( iBgCtrlContext );
     }
 
@@ -182,23 +182,23 @@
 TSize CESMRAttendeeField::MinimumSize()
     {
     TRect parentRect( Parent()->Rect() );
-    
-    TRect richTextRect = 
+
+    TRect richTextRect =
        NMRLayoutManager::GetFieldLayoutRect( parentRect, 1 ).Rect();
 
-    TRect textRect( NMRLayoutManager::GetLayoutText( 
-            richTextRect, 
+    TRect textRect( NMRLayoutManager::GetLayoutText(
+            richTextRect,
        NMRLayoutManager::EMRTextLayoutTextEditor ).TextRect() );
-    
+
     // Adjust field size so that there's room for expandable editor.
     richTextRect.Resize( 0, iSize.iHeight - textRect.Height() );
-    
+
     // Add title area to the required size
     TSize titleSize( CESMRField::MinimumSize() );
-    
+
     TSize completeFieldSize( titleSize );
     completeFieldSize.iHeight += richTextRect.Height();
-    
+
     return completeFieldSize;
     }
 
@@ -219,27 +219,27 @@
 void CESMRAttendeeField::InternalizeL( MESMRCalEntry& aEntry )
     {
     FUNC_LOG;
-    iEditor->CreateScrollBarFrameL()->SetScrollBarVisibilityL ( 
+    iEditor->CreateScrollBarFrameL()->SetScrollBarVisibilityL (
             CEikScrollBarFrame::EOff,
             CEikScrollBarFrame::EOff );
-    
+
     TInt fieldAttendeeCount( 0 );
-    
+
     CCalEntry& entry = aEntry.Entry ( );
     RPointerArray< CCalAttendee > attendees = entry.AttendeesL ( );
     RCPointerArray< CESMRNcsEmailAddressObject > addressList;
-    CleanupClosePushL( addressList );    
+    CleanupClosePushL( addressList );
 
     for (TInt i(0); i < attendees.Count(); i++ )
         {
         if ( attendees[i]->RoleL() == iRole )
             {
             fieldAttendeeCount++;
-            
+
             const TDesC& addr = attendees[i]->Address ( );
             const TDesC& commonName = attendees[i]->CommonName ( );
 
-            CESMRNcsEmailAddressObject* obj = 
+            CESMRNcsEmailAddressObject* obj =
                 CESMRNcsEmailAddressObject::NewL ( commonName, addr );
             CleanupStack::PushL (obj );
             addressList.AppendL( obj );
@@ -275,7 +275,7 @@
     // this is needed to be re-called here, otherwise the CEikEdwin
     // does not get correctly instantiated with default text
     iEditor->FocusChanged(EDrawNow);
-    
+
     UpdateSendOptionL();
     }
 
@@ -303,7 +303,7 @@
     UpdateAttendeesL( *mrEntry );
 
     HBufC* text = iEditor->GetTextInHBufL();
-        
+
     //If there is no attendees, put back the default text
     if( !text )
         {
@@ -326,7 +326,7 @@
         {
         ++count;
         }
-    
+
     if ( iTitle )
         {
         ++count;
@@ -368,65 +368,61 @@
     {
     FUNC_LOG;
     TRect rect( Rect() );
-       
-    TAknLayoutRect firstRowLayoutRect( 
+
+    TAknLayoutRect firstRowLayoutRect(
            NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 ) );
     TRect firstRowRect( firstRowLayoutRect.Rect() );
-    
+
     TRect secondRowRect( firstRowRect );
     secondRowRect.Move( 0, firstRowRect.Height() );
-    
+
     // Layout field button
     if( iFieldButton )
        {
-       TAknWindowComponentLayout buttonLayout( 
+       TAknWindowComponentLayout buttonLayout(
                NMRLayoutManager::GetWindowComponentLayout(
                    NMRLayoutManager::EMRLayoutTextEditorIcon ) );
-       AknLayoutUtils::LayoutControl( 
+       AknLayoutUtils::LayoutControl(
                iFieldButton, firstRowRect, buttonLayout );
        }
-    
+
     // Layout field title
-    if( iTitle )
-       {
-       TAknLayoutText labelLayout( 
-               NMRLayoutManager::GetLayoutText(
-                       firstRowRect, 
-                           NMRLayoutManager::EMRTextLayoutTextEditor ) );
-    
-       iTitle->SetRect( labelLayout.TextRect() );
-    
-       // Setting font also for the label. Failures are ignored.
-       iTitle->SetFont( labelLayout.Font() );
-       }
-    
+    if ( iTitle )
+        {
+        TAknTextComponentLayout editorLayout =
+                NMRLayoutManager::GetTextComponentLayout(
+                        NMRLayoutManager::EMRTextLayoutTextEditor );
+
+        AknLayoutUtils::LayoutLabel( iTitle, rect, editorLayout );
+        }
+
     // Layout field editor
     if( iEditor )
         {
-        TAknLayoutText editorLayoutText = NMRLayoutManager::GetLayoutText( 
-                  secondRowRect, 
+        TAknLayoutText editorLayoutText = NMRLayoutManager::GetLayoutText(
+                  secondRowRect,
                   NMRLayoutManager::EMRTextLayoutTextEditor );
 
         TRect editorRect = editorLayoutText.TextRect();
 
         // Resize height according to actual height required by edwin.
         editorRect.Resize( 0, iSize.iHeight - editorRect.Height() );
-        
+
         iEditor->SetRect( editorRect );
-        
+
         // Try setting font. Failures are ignored.
-        TRAP_IGNORE( iEditor->SetFontL( editorLayoutText.Font() ) );    
+        TRAP_IGNORE( iEditor->SetFontL( editorLayoutText.Font() ) );
         }
-    
+
     // Layout field focus
     if( iEditor )
        {
        // Layouting focus for rich text editor area
        TRect bgRect( iEditor->Rect() );
-    
+
        // Move focus rect so that it's relative to field's position.
        bgRect.Move( -Position() );
-       SetFocusRect( bgRect );   
+       SetFocusRect( bgRect );
        }
 
     if ( iAacListBox && iAacListBox->IsVisible ( ) )
@@ -450,40 +446,40 @@
         {
         return TRect( 0, 0, 0, 0 );
         }
-    
+
     TRect popupRect( 0, 0, 0, 0 );
-    
+
     // Let's determine Popup's maximum height
-    TInt requiredPopupHeight = iAacListBox->CalcHeightBasedOnNumOfItems( 
+    TInt requiredPopupHeight = iAacListBox->CalcHeightBasedOnNumOfItems(
             iAacListBox->Model()->NumberOfItems() );
     TInt numberOfItemsInPopUp = iAacListBox->Model()->NumberOfItems();
-    
+
     if( numberOfItemsInPopUp > KMaxAmountOfItems )
         {
         // reducing popup item count shown at once to maximum value
-        requiredPopupHeight = iAacListBox->CalcHeightBasedOnNumOfItems( 
+        requiredPopupHeight = iAacListBox->CalcHeightBasedOnNumOfItems(
                 KMaxAmountOfItems );
         }
-    
+
     // Popup x-coords are always the same
     TInt topLeftX = iEditor->Rect().iTl.iX;
     TInt bottomRightX = iEditor->Rect().iBr.iX;
-    
+
     // Popup y-coords need to be calculated
     TInt topLeftY( 0 );
     TInt bottomRightY( 0 );
-           
-    // Next we have to resolve if popup needs to be drawn below or 
+
+    // Next we have to resolve if popup needs to be drawn below or
     // above the cursor (space requirement)
-    
+
     TRect editorLineRect;
     iEditor->GetLineRectL( editorLineRect );
     TInt editorLineTopLeftY = editorLineRect.iTl.iY;
     TInt diff = iEditor->Rect().iTl.iY;
     TInt editorLineTopLeftYRelativeToParent = editorLineTopLeftY + diff;
-    
+
     TInt listPaneHeight = Parent()->Rect().Height();
-    
+
     // Popup will be drawn above the cursor
     if( editorLineTopLeftYRelativeToParent > TReal( listPaneHeight / 2 ) )
         {
@@ -498,7 +494,7 @@
         }
 
     popupRect.SetRect( topLeftX, topLeftY, bottomRightX, bottomRightY );
-    
+
     return popupRect;
     }
 
@@ -528,7 +524,7 @@
 // CESMRAttendeeField::OfferKeyEventL
 // ---------------------------------------------------------------------------
 //
-TKeyResponse CESMRAttendeeField::OfferKeyEventL( 
+TKeyResponse CESMRAttendeeField::OfferKeyEventL(
         const TKeyEvent& aKeyEvent,
         TEventCode aType )
     {
@@ -536,7 +532,7 @@
 
     TKeyResponse ret( EKeyWasNotConsumed);
 
-    if ( aKeyEvent.iCode == EKeyEnter || 
+    if ( aKeyEvent.iCode == EKeyEnter ||
          aKeyEvent.iScanCode == EStdKeyEnter ||
          aKeyEvent.iCode == EKeyYes ||
          aKeyEvent.iScanCode == EStdKeyYes )
@@ -574,7 +570,7 @@
         UpdateSendOptionL();
         }
 
-    // Scroll editor visible, if for example cursor is out of the 
+    // Scroll editor visible, if for example cursor is out of the
     // viewable area when user enters more text.
     if ( iObserver && aType == EEventKey )
         {
@@ -586,7 +582,7 @@
 
         TInt editorTlY = iEditor->Position().iY;
         TInt listHeight = iObserver->ViewableAreaRect().Height();
-        
+
         TInt cursorTopY = cursorPos.iY - lineHeight + editorTlY;
         TInt cursorBottomY = cursorPos.iY + lineHeight + editorTlY;
 
@@ -616,19 +612,19 @@
 
     iFieldButton->SetContainerWindowL( aControl );
     iFieldButton->SetParent( this );
-	
+
     iTitle->SetContainerWindowL( aControl );
     iTitle->SetParent( this );
-    
+
     iEditor->SetContainerWindowL( aControl );
     iEditor->SetParent( this );
-        
+
     iAacListBox = CESMRNcsPopupListBox::NewL ( this, *iContactHandler );
     iAacListBox->MakeVisible ( EFalse );
     iAacListBox->SetListBoxObserver( this );
     iAacListBox->SetObserver( this );
     iAacListBox->ActivateL();
-    
+
     iButtonGroupContainer = CEikButtonGroupContainer::Current();
 	}
 
@@ -641,12 +637,12 @@
     {
     FUNC_LOG;
     TBool reDraw( EFalse );
-    
+
     if( iSize != aSize )
         {
         // Let's save the required size for the iEditor
         iSize = aSize;
-    
+
         if ( iObserver && aEdwin == iEditor )
             {
             iObserver->ControlSizeChanged ( this );
@@ -661,8 +657,8 @@
 // CESMRAttendeeField::UpdatePopupContactListL
 // ---------------------------------------------------------------------------
 //
-void CESMRAttendeeField::UpdatePopupContactListL( 
-        const TDesC& aMatchString, 
+void CESMRAttendeeField::UpdatePopupContactListL(
+        const TDesC& aMatchString,
         TBool /*iListAll*/)
     {
     FUNC_LOG;
@@ -695,15 +691,15 @@
     {
     if( aShow )
         {
-        iButtonGroupContainer->SetCommandSetL( 
+        iButtonGroupContainer->SetCommandSetL(
                 R_CONTACT_POPUP_SOFTKEYS_SELECT_CANCEL);
         }
     else
         {
-        iButtonGroupContainer->SetCommandSetL( 
-                R_CONTACT_EDITOR_SOFTKEYS_OPTIONS_DONE__ADD);       
+        iButtonGroupContainer->SetCommandSetL(
+                R_CONTACT_EDITOR_SOFTKEYS_OPTIONS_DONE__ADD);
         }
-    
+
     iButtonGroupContainer->DrawDeferred();
     }
 
@@ -741,7 +737,7 @@
              if(iEditor->IsFocused())
                  NotifyEventL(EESMRCmdLongtapDetected);
              isUsed = ETrue;
-             
+
      		HandleTactileFeedbackL();
              break;
              }
@@ -760,7 +756,7 @@
     FUNC_LOG;
     CESMRField::SetOutlineFocusL( aFocus );
 
-    
+
     if (aFocus) //Focus is gained on the field
         {
         if ( iEditor->HasDefaultText() )
@@ -784,7 +780,7 @@
         {
         if( aContacts->Count() > 0 )
             {
-            RCPointerArray<CESMRNcsEmailAddressObject> ncsObjects;  // codescanner::resourcenotoncleanupstack        
+            RCPointerArray<CESMRNcsEmailAddressObject> ncsObjects;  // codescanner::resourcenotoncleanupstack
             CleanupClosePushL( ncsObjects );
             for ( int i = 0; i < aContacts->Count(); i++ )
                 {
@@ -819,7 +815,7 @@
 // ---------------------------------------------------------------------------
 //
 void CESMRAttendeeField::HandleControlEventL(
-        CCoeControl *aControl, 
+        CCoeControl *aControl,
         TCoeEvent aEventType )
     {
     FUNC_LOG;
@@ -869,7 +865,7 @@
         }
     else if( iAacListBox && !iAacListBox->IsPopupEmpty() )
         {
-        CESMRNcsEmailAddressObject* emailAddress  = 
+        CESMRNcsEmailAddressObject* emailAddress  =
                 iAacListBox->ReturnCurrentEmailAddressLC();
         if( emailAddress )
             {
@@ -914,8 +910,8 @@
         iAacListBox->MakeVisible( EFalse );
         AknsUtils::SetAvkonSkinEnabledL( ETrue );
         }
-    
-    ShowPopupCbaL( EFalse );    
+
+    ShowPopupCbaL( EFalse );
     UpdateSendOptionL();
     }
 
@@ -934,13 +930,13 @@
     RBuf emailAddress;  // codescanner::resourcenotoncleanupstack
     emailAddress.CreateL( KMaxRemoteSearchResponseLength );
     emailAddress.CleanupClosePushL();
-    
-    // Pop-up needs to be closed before executing remote lookup with 
+
+    // Pop-up needs to be closed before executing remote lookup with
     // query dialog, because combination of this pop-up and any query dialog
-    // causes background drawing problems with CEikMfne editors. 
+    // causes background drawing problems with CEikMfne editors.
     // Reason unknown.
     ClosePopupContactListL();
-    
+
     TBool contactSelected = iContactHandler->LaunchRemoteLookupL( aSearchText,
                                                                   displayname,
                                                                   emailAddress );
@@ -977,7 +973,7 @@
     if( enable )
     	{
         TPtr ptr = text->Des();
-        ptr.Trim();        	
+        ptr.Trim();
     	}
     enable = text && text->Length() > 0 && text->Compare( *iDefaultText ) != 0;
     delete text;
@@ -1006,7 +1002,7 @@
             command = EESMRCmdAttendeeOptionalDisabled;
             }
         }
-    
+
     NotifyEventL( command );
     }
 
@@ -1014,21 +1010,21 @@
 // CESMRAttendeeField::HandleListBoxEventL
 // ---------------------------------------------------------------------------
 //
-void CESMRAttendeeField::HandleListBoxEventL( CEikListBox* aListBox, 
+void CESMRAttendeeField::HandleListBoxEventL( CEikListBox* aListBox,
                                               TListBoxEvent aEventType )
     {
-    if( aEventType == EEventEnterKeyPressed || aEventType == EEventItemClicked 
+    if( aEventType == EEventEnterKeyPressed || aEventType == EEventItemClicked
             || aEventType == EEventItemDoubleClicked || aEventType == EEventItemSingleClicked )
         {
         TInt newIndex = aListBox->CurrentItemIndex();
-        
-        // if item is already highlighted and then clicked, 
+
+        // if item is already highlighted and then clicked,
         // it is considered that it has been selected
         if( newIndex == iPreviousIndex )
             {
 			HandleTactileFeedbackL();
             DoPopupSelectL();
-            
+
             // Item selected, index reseted
             iPreviousIndex = 0;
             }
@@ -1073,12 +1069,12 @@
     {
     FUNC_LOG;
     TBool ret( EFalse );
-    
+
     if( iTitle->Rect().Contains( aPosition ) ||
             iFieldButton->Rect().Contains( aPosition ) )
         {
     	HandleTactileFeedbackL();
-    	
+
         iContactHandler->GetAddressesFromPhonebookL( this );
         ret = ETrue;
         }
@@ -1093,7 +1089,7 @@
 void CESMRAttendeeField::HandleLongtapEventL( const TPoint& aPosition )
     {
     FUNC_LOG;
-           
+
     if( iTitle->Rect().Contains( aPosition ) ||
             iFieldButton->Rect().Contains( aPosition ) )
         {
@@ -1109,29 +1105,29 @@
     {
     FUNC_LOG;
 	/*
-	 * Compare editor attendees to existing attendees and add / remove 
+	 * Compare editor attendees to existing attendees and add / remove
 	 * when necessary.
 	 */
 	iEditor->CheckAddressWhenFocusLostL();
-	
+
 	CCalEntry& entry( aMREntry.Entry() );
-	
+
 	// Get editor's attendees
-	RPointerArray<CESMRNcsEmailAddressObject> editorAttendees = 
+	RPointerArray<CESMRNcsEmailAddressObject> editorAttendees =
 			iEditor->GetAddressesL();
 	TInt editorAttendeesCount( editorAttendees.Count() );
-	
+
 	// Get existing attendees
 	RPointerArray<CCalAttendee>& existingAttendees = entry.AttendeesL();
 	TInt existingAttendeesCount( existingAttendees.Count() );
-	
+
 	// Remove removed attendees from entry
 	for( TInt i( existingAttendeesCount - 1 ); i >= 0 ; --i )
 		{
 		// existing address and role
 		const TDesC& address = existingAttendees[i]->Address();
 		CCalAttendee::TCalRole role = existingAttendees[i]->RoleL();
-		
+
 		// Let's try to find them amongst editor attendees
 		TBool matchFound( EFalse );
 		for( TInt j( 0 ); j < editorAttendeesCount ; ++j )
@@ -1158,13 +1154,13 @@
 				}
 			}
 		}
-	
+
 	// Update existing attendees count, because some attendees might
 	// have been removed
 	existingAttendees.Reset();
 	existingAttendees = entry.AttendeesL();
 	existingAttendeesCount = existingAttendees.Count();
-	
+
 	// Add new attendees to entry
 	for( TInt i( 0 ); i < editorAttendeesCount ; ++i )
 		{
@@ -1172,14 +1168,14 @@
 		CCalAttendee* attendee = CCalAttendee::NewL( obj->EmailAddress() );
 		attendee->SetRoleL( iRole );
 		attendee->SetCommonNameL( obj->DisplayName() );
-	
-		if ( EESMRRoleOrganizer == aMREntry.RoleL() || 
+
+		if ( EESMRRoleOrganizer == aMREntry.RoleL() ||
 			 aMREntry.IsForwardedL() )
 			{
 			attendee->SetResponseRequested( ETrue );
 			}
-		
-		TBool isNewAttendee( ETrue );		
+
+		TBool isNewAttendee( ETrue );
 		for( TInt i( 0 ); i < existingAttendeesCount; ++i )
 			{
 			if( existingAttendees[i]->Address().Compare( attendee->Address() ) == 0 )
@@ -1193,7 +1189,7 @@
 				}
 			}
 		// If this is new attendee, let's add it to entry
-		if( isNewAttendee ) 
+		if( isNewAttendee )
 			{
 			entry.AddAttendeeL( attendee );
 			}
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncseditor.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrncseditor.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -459,6 +459,10 @@
 
     paraFormatMask.SetAttrib( EAttLineSpacing );
     paraFormat->iHorizontalAlignment = CParaFormat::ELeftAlign;
+    if ( AknLayoutUtils::LayoutMirrored() )
+        {
+        paraFormat->iHorizontalAlignment = CParaFormat::ERightAlign;
+        }
     paraFormatMask.SetAttrib( EAttAlignment );
 
     TCharFormat charFormat;
@@ -472,10 +476,10 @@
     formatMask.SetAttrib(EAttFontHighlightColor);
     formatMask.SetAttrib( EAttColor );
 
-    charFormat.iFontPresentation.iTextColor = 
+    charFormat.iFontPresentation.iTextColor =
            NMRColorManager::Color( NMRColorManager::EMRMainAreaTextColor );
 
-    charFormat.iFontPresentation.iHighlightColor =  
+    charFormat.iFontPresentation.iHighlightColor =
            NMRColorManager::Color( NMRColorManager::EMRCutCopyPasteHighlightColor );
 
     CParaFormatLayer* paraFormatLayer =
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrresponsefield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -157,13 +157,21 @@
         TInt movement = choiceLayoutRect.Rect().Height();
         rect.Move( 0, movement * ( i - 1 ) );
 
+        TInt leftMargin = choiceLayoutRect.Rect().iTl.iX;
+        TInt rightMargin = choiceLayoutRect.Rect().iBr.iX;
+        if ( AknLayoutUtils::LayoutMirrored() )
+            {
+            leftMargin -= parentRect.iTl.iX;
+            rightMargin -= parentRect.iTl.iX;
+            }
+
         AknLayoutUtils::LayoutControl(
                 ControlItem( i - 1 ),
                 rect,
                 choiceLayoutRect.Color().Value(),
-                choiceLayoutRect.Rect().iTl.iX,
+                leftMargin,
                 0,
-                choiceLayoutRect.Rect().iBr.iX,
+                rightMargin,
                 choiceLayoutRect.Rect().iBr.iY,
                 choiceLayoutRect.Rect().Width(),
                 choiceLayoutRect.Rect().Height() );
@@ -525,14 +533,21 @@
     {
     FUNC_LOG;
     TBool isUsed( EFalse );
-    if ( aCommand == EAknSoftkeySelect )
+
+    switch ( aCommand )
         {
-        ItemSelectedL();
-        isUsed = ETrue;
-        }
-    else
-        {
-        isUsed = CESMRField::ExecuteGenericCommandL( aCommand );
+        case EAknSoftkeySelect:
+        case EAknCmdOpen:
+            {
+            ItemSelectedL();
+            isUsed = ETrue;
+            break;
+            }
+        default:
+            {
+            isUsed = CESMRField::ExecuteGenericCommandL( aCommand );
+            break;
+            }
         }
 
     return isUsed;
--- a/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattendeesfield.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/mrfieldbuilderpluginextension/src/cesmrviewerattendeesfield.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -358,23 +358,36 @@
 //
 TSize CESMRViewerAttendeesField::MinimumSize()
     {
-    // Parent rect will be list area later --> no need to calculate it manually.
-    TRect parentRect = Parent()->Rect();
-    TRect contentRect = NMRLayoutManager::GetLayoutRect(
-            parentRect, NMRLayoutManager::EMRLayoutListArea ).Rect();
-    // We have two lines;  title and richtextviewer.
-    TRect fieldRect =
-        NMRLayoutManager::GetFieldLayoutRect( contentRect, 2 ).Rect();
-    // Get row size for second row (richtext viewer).
-    TRect rowRect =
-        NMRLayoutManager::GetFieldRowLayoutRect( fieldRect, 2 ).Rect();
-    // Get size for default 1 line editor.
-    TRect viewerRect = NMRLayoutManager::GetLayoutText(
-            rowRect,
-            NMRLayoutManager::EMRTextLayoutMultiRowTextEditor ).TextRect();
-    // Adjust field size so that there's room for expandable editor.
-    fieldRect.Resize( 0, iExpandedSize.iHeight - viewerRect.Height() );
-    return fieldRect.Size();
+    // Minimum size ->  Height: TitleRow + Editor size + Margin
+    //                  Width: Parent's Width
+    //                   (so the content pane that holds all the fields)
+    TRect rect( Rect() );
+    TAknLayoutRect row1LayoutRect =
+        NMRLayoutManager::GetFieldRowLayoutRect( rect, 1 );
+    TInt titleHeight = row1LayoutRect.Rect().Height();
+
+    // Add title field height
+    TInt totalHeight = titleHeight;
+
+    TAknLayoutRect row2LayoutRect =
+        NMRLayoutManager::GetFieldRowLayoutRect( rect, 2 );
+    TInt editorRowHeight = row2LayoutRect.Rect().Height();
+
+    TAknTextComponentLayout editorLayout =
+        NMRLayoutManager::GetTextComponentLayout(
+                NMRLayoutManager::EMRTextLayoutMultiRowTextEditor );
+
+    // Editor height from Layout data
+    TInt editorHeight = editorLayout.H();
+    // Margin is the outer row's height - editor's layout height
+    TInt margin = editorRowHeight - editorHeight;
+    // Parent has the width
+    TInt width( Parent()->Size().iWidth );
+    // Count the total height of the attendee field.
+    // iExpandedSize is used because the Editor size might be something else
+    // than what is stated in Layout data.
+    totalHeight += iExpandedSize.iHeight + margin;
+    return TSize( width, totalHeight );
     }
 
 // ---------------------------------------------------------------------------
--- a/meetingrequest/mrgui/src/cesmrview.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/src/cesmrview.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -679,8 +679,16 @@
         // List panes default rect needs to be modified due to
         // scrollbar and calendar indication stripe
         
-        // Remove stripe width from list pane width
-        listareaRect.iTl.iX += iStripeRect.Width();
+        if ( AknLayoutUtils::LayoutMirrored() )
+            {
+            // Remove stripe width from list pane width when align is R to L
+            listareaRect.iBr.iX -= iStripeRect.Width();
+            }
+        else
+            {
+            // Remove stripe width from list pane width when align is L to R
+            listareaRect.iTl.iX += iStripeRect.Width();
+            }
         
         if( iScrollBar )
            {
@@ -692,9 +700,6 @@
            scrollareaRect.SetHeight( listareaRect.Height() );
            
            iScrollBar->SetRect( scrollareaRect );
-           
-           // Remove scroll bar width from list area's width
-           listareaRect.iBr.iX -= iScrollBar->Rect().Width();
            }
 
         iListPane->SetRect( listareaRect );
@@ -752,9 +757,16 @@
                        NMRLayoutManager::EMRLayoutListArea );
         TRect listareaRect( listareaLayoutRect.Rect() );
         
-        // The listPane's area should be:
-        // X: Should subtract the width of stripe
-        listareaRect.iTl.iX += iStripeRect.Width();
+        if ( AknLayoutUtils::LayoutMirrored() )
+            {
+            // Remove stripe width from list pane width when align is R to L
+            listareaRect.iBr.iX -= iStripeRect.Width();
+            }
+        else
+            {
+            // Remove stripe width from list pane width when align is L to R
+            listareaRect.iTl.iX += iStripeRect.Width();
+            }
                 
         iListPane->SetRect( listareaRect );
         
@@ -1140,16 +1152,23 @@
     {
     TRect containerRect( ContainerRect() );
     
-    TAknLayoutRect naviArrowLeftLayoutRect =
-            NMRLayoutManager::GetLayoutRect( containerRect,
-                    NMRLayoutManager::EMRLayoutMRNaviArrowLeft );    
-    TRect naviArrowLeftRect = naviArrowLeftLayoutRect.Rect();
-    
-    TAknLayoutRect naviArrowRightLayoutRect =
-            NMRLayoutManager::GetLayoutRect( containerRect,
-                    NMRLayoutManager::EMRLayoutMRNaviArrowRight );
-    TRect naviArrowRightRect = naviArrowRightLayoutRect.Rect();
-    
+
+	TAknLayoutRect naviArrowLeftLayoutRect =
+			NMRLayoutManager::GetLayoutRect( containerRect,
+					NMRLayoutManager::EMRLayoutMRNaviArrowLeft );    
+	TRect naviArrowLeftRect = naviArrowLeftLayoutRect.Rect();
+	
+	TAknLayoutRect naviArrowRightLayoutRect =
+			NMRLayoutManager::GetLayoutRect( containerRect,
+					NMRLayoutManager::EMRLayoutMRNaviArrowRight );
+	TRect naviArrowRightRect = naviArrowRightLayoutRect.Rect();
+	//Exchange the narrows' rect when LayoutMirrored
+	if ( AknLayoutUtils::LayoutMirrored() )
+		{
+		naviArrowLeftRect = naviArrowRightLayoutRect.Rect();
+		naviArrowRightRect= naviArrowLeftLayoutRect.Rect();
+		}
+	
     if( Layout_Meta_Data::IsLandscapeOrientation() )
         {                
         naviArrowLeftRect.Move( iStripeRect.Width(), 0 );
--- a/meetingrequest/mrgui/src/cmrlistpane.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrgui/src/cmrlistpane.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -317,7 +317,7 @@
     response = FocusedField()->OfferKeyEventL( aKeyEvent, aType );
 
     if ( aType == EEventKey
-            && response == EKeyWasNotConsumed )
+         && response == EKeyWasNotConsumed )
         {
         // Check if the focus should be changed
         switch ( aKeyEvent.iScanCode )
@@ -340,6 +340,11 @@
                 iClickedField = NULL;
                 break;
                 }
+            case EStdKeyEnter:
+                {
+                FocusedField()->ExecuteGenericCommandL( EAknCmdOpen );
+                break;
+                }
             default:
                 {
                 break;
--- a/meetingrequest/mrservices/src/cesmrconflictchecker.cpp	Tue May 25 12:23:16 2010 +0300
+++ b/meetingrequest/mrservices/src/cesmrconflictchecker.cpp	Wed Jun 09 09:22:57 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* 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 "Eclipse Public License v1.0"
@@ -12,7 +12,7 @@
 * Contributors:
 *
 *  Description : ESMR conflict checker implementation
-*  Version     : %version: e002sa33#7 %
+*  Version     : %version: e002sa33#9 %
 *
 */
 
@@ -29,6 +29,7 @@
 #include <calinstanceview.h>
 #include <calinstanceiterator.h>
 #include <ct/rcpointerarray.h>
+#include <calrrule.h>
 
 /// Unnamed namespace for local definitions
 namespace { // codescanner::namespace
@@ -94,7 +95,7 @@
         CCalInstanceView* aInstanceView )
     {
     FUNC_LOG;
-    const CalCommon::TCalViewFilter instanceFilter = 
+    const CalCommon::TCalViewFilter instanceFilter =
             CalCommon::EIncludeAppts;
 
     TDateTime start = aStart.DateTime();
@@ -110,11 +111,11 @@
     end.SetSecond( KZero );
     end.SetMicroSecond( KZero );
     TTime endTime = end;
-    
-    if ( TTime(start) == endTime || 
+
+    if ( TTime(start) == endTime ||
          endTime < aEnd )
         {
-        
+
         endTime += TTimeIntervalDays(1);
         end = endTime.DateTime();
         }
@@ -166,17 +167,17 @@
 
     TTime startTimeLocal = aStartTime.TimeLocalL();
     TTime endTimeLocal = aEndTime.TimeLocalL();
-    
+
     while( index < instanceArray.Count() )
         {
         TBool conflictingInstance( ETrue );
         CCalInstance* instance = instanceArray[index];
-        
+
         TTime entryStartTimeLocal = instance->StartTimeL().TimeLocalL();
-        TTime entryEndTimeLocal = instance->EndTimeL().TimeLocalL();            
+        TTime entryEndTimeLocal = instance->EndTimeL().TimeLocalL();
 
         TPtrC8 uid( instance->Entry().UidL() );
-        if ( ERemoveSameUID == aFilterType && 
+        if ( ERemoveSameUID == aFilterType &&
              0 == aUid.CompareF(uid) )
             {
             conflictingInstance = EFalse;
@@ -201,14 +202,14 @@
             }
         else
             {
-            conflictingInstance = EFalse;            
+            conflictingInstance = EFalse;
             }
-        
+
         // Remove non-conflicting instance from instance array
         if ( !conflictingInstance )
             {
             instanceArray.Remove(index);
-            delete instance; 
+            delete instance;
             instance = NULL;
             }
         }
@@ -226,22 +227,479 @@
         RPointerArray<CCalEntry>& aConflictingEntries )
     {
     FUNC_LOG;
-    TInt instanceCount( instanceArray.Count() );    
+    TInt instanceCount( instanceArray.Count() );
     for ( TInt i(0); i < instanceCount; ++i )
-        {        
+        {
         CCalEntry& parent( instanceArray[i]->Entry() );
-        CCalEntry* entry = ESMRHelper::CopyEntryLC( parent, 
+        CCalEntry* entry = ESMRHelper::CopyEntryLC( parent,
                                                     parent.MethodL(),
                                                     ESMRHelper::ECopyFull );
-        
+
         entry->SetStartAndEndTimeL( instanceArray[i]->StartTimeL(),
                                     instanceArray[i]->EndTimeL() );
 
-        User::LeaveIfError( aConflictingEntries.Append( entry ) );
+        aConflictingEntries.AppendL( entry );
         CleanupStack::Pop( entry );
         }
     }
 
+/**
+ * Checks if entry is repeating.
+ * @return ETrue if entry is repeating
+ */
+TBool IsRepeatingMeetingL( const CCalEntry& aEntry,
+                           MESMRCalDbMgr& aDb )
+    {
+    FUNC_LOG;
+
+    TBool recurrent( EFalse );
+
+    CCalInstance* instance = aDb.FindInstanceL( aEntry );
+
+    if ( instance )
+        {
+        CleanupStack::PushL( instance );
+        recurrent = ESMREntryHelper::IsRepeatingMeetingL( instance->Entry() );
+        CleanupStack::PopAndDestroy( instance );
+        }
+    else
+        {
+        recurrent = ESMREntryHelper::IsRepeatingMeetingL( aEntry );
+        }
+
+    return recurrent;
+    }
+
+/**
+ * Finds conflicts for entry
+ */
+void FindConflictsForEntryL(
+        const CCalEntry& aEntry,
+        RPointerArray< CCalInstance >& aInstances,
+        MESMRCalDbMgr& aDb )
+    {
+    FUNC_LOG;
+
+    // Get instance views of all calendar
+    RPointerArray<CCalInstanceView> allCalenInstanceView =
+            aDb.NormalDbAllCalenInstanceView();
+
+    // Check if there is any conflict in each calendar
+    for( TInt i = 0; i < allCalenInstanceView.Count(); i++ )
+        {
+        CalCommon::TCalTimeRange timeRange =
+                    ResolveFetchTimeRangeL(
+                                    aEntry.StartTimeL().TimeUtcL(),
+                                    aEntry.EndTimeL().TimeUtcL(),
+                                    allCalenInstanceView[i] );
+
+        allCalenInstanceView[i]->FindInstanceL(
+                aInstances,
+                CalCommon::EIncludeAppts,
+                timeRange );
+        }
+
+    RemoveAndDeleteNonConflictingInstancesL(
+            aInstances,
+            aEntry.StartTimeL(),
+            aEntry.EndTimeL(),
+            aEntry.UidL(),
+            ERemoveSameUID );
+    }
+
+/**
+ * Moves instances from an array to another.
+ */
+void MoveInstancesL(
+        RPointerArray< CCalInstance >& aFrom,
+        RPointerArray< CCalInstance >& aTo )
+    {
+    FUNC_LOG;
+
+    aTo.ReserveL( aTo.Count() + aFrom.Count() );
+    while ( aFrom.Count() )
+        {
+        aTo.AppendL( aFrom[ 0 ] );
+        aFrom.Remove( 0 );
+        }
+    }
+
+/**
+ * Finds conflicts based on Daily recurrence.
+ *
+ */
+void FindConflictsForDailyRRuleL(
+        CCalEntry& aEntry,
+        RPointerArray< CCalInstance >& aInstances,
+        MESMRCalDbMgr& aDb,
+        TBool aFindAllConflicts )
+    {
+    FUNC_LOG;
+
+    TCalRRule rRule;
+    aEntry.GetRRuleL( rRule );
+    RCPointerArray< CCalInstance > tmpInstanceArray;
+    CleanupClosePushL( tmpInstanceArray );
+
+    // Entry start and end time
+    TTime start( aEntry.StartTimeL().TimeUtcL() );
+    TTime end( aEntry.EndTimeL().TimeUtcL() );
+
+    if ( rRule.Count() )
+        {
+        for ( TInt i = 0; i < rRule.Count(); ++i )
+            {
+            // Set each occurence start and end time on entry
+            TTimeIntervalDays interval( i * rRule.Interval() );
+            TCalTime startTime;
+            startTime.SetTimeUtcL( start + interval );
+            TCalTime endTime;
+            endTime.SetTimeUtcL( end + interval );
+            aEntry.SetStartAndEndTimeL(
+                    startTime,
+                    endTime );
+
+            // Find conflicts for this occurence
+            FindConflictsForEntryL( aEntry, tmpInstanceArray, aDb );
+
+            if ( tmpInstanceArray.Count() )
+                {
+                MoveInstancesL( tmpInstanceArray, aInstances );
+                if ( !aFindAllConflicts )
+                    {
+                    break;
+                    }
+                }
+            }
+        }
+    else if ( rRule.Until().TimeUtcL() != Time::NullTTime() )
+        {
+        TTime until( rRule.Until().TimeUtcL() );
+        TTime start( aEntry.StartTimeL().TimeUtcL() );
+        TTime end( aEntry.EndTimeL().TimeUtcL() );
+        TTimeIntervalDays interval( rRule.Interval() );
+
+        // Loop while start time is before until time
+        while ( start <= until )
+            {
+            // Set start and end time for occurence
+            TCalTime startTime;
+            startTime.SetTimeUtcL( start );
+            TCalTime endTime;
+            endTime.SetTimeUtcL( end );
+            aEntry.SetStartAndEndTimeL(
+                    startTime,
+                    endTime );
+
+            // Find conflicts
+            FindConflictsForEntryL( aEntry, tmpInstanceArray, aDb );
+
+            if ( tmpInstanceArray.Count() )
+                {
+                MoveInstancesL( tmpInstanceArray, aInstances );
+                if ( !aFindAllConflicts )
+                    {
+                    break;
+                    }
+                }
+
+            // Move to next occurence
+            start += interval;
+            end += interval;
+            }
+        }
+
+    CleanupStack::PopAndDestroy( &tmpInstanceArray );
+    }
+
+/**
+ * Finds conflicts based on Weekly recurrence.
+ */
+void FindConflictsForWeeklyRRuleL(
+        CCalEntry& aEntry,
+        RPointerArray< CCalInstance >& aInstances,
+        MESMRCalDbMgr& aDb,
+        TBool aFindAllConflicts )
+    {
+    FUNC_LOG;
+
+    TCalRRule rRule;
+    aEntry.GetRRuleL( rRule );
+
+    // Tmp array for conflic instances
+    RCPointerArray< CCalInstance > tmpInstanceArray;
+    CleanupClosePushL( tmpInstanceArray );
+
+    // Array of recurrence days
+    RArray< TDay > days;
+    CleanupClosePushL( days );
+    rRule.GetByDayL( days );
+
+    // Recurrence start time
+    TTime start( aEntry.StartTimeL().TimeUtcL() );
+    // Recurrence end time
+    TTime end( aEntry.EndTimeL().TimeUtcL() );
+    const TTimeIntervalDays KWeek( 7 );
+    TDay startDayOfWeek( start.DayNoInWeek() );
+
+    // Instance duration
+    TTimeIntervalMinutes duration;
+    end.MinutesFrom( start, duration );
+
+    if ( rRule.Count() )
+        {
+        for ( TInt i = 0; i < rRule.Count(); ++i )
+            {
+            // Calculate weekly start time
+            TTimeIntervalDays interval( i* KWeek.Int() );
+            TDateTime date( TTime( start + interval ).DateTime() );
+            date.SetDay( date.Day() - startDayOfWeek );
+            TTime weekStartTime( date );
+
+            for ( TInt j = 0; j < days.Count(); ++j )
+                {
+                // Iterate through days of week
+                TTime entryStartTime( weekStartTime + TTimeIntervalDays( days[ j ] ) );
+
+                if ( start <= entryStartTime )
+                    {
+                    // Start time is in recurrence range
+                    // Calcualte end time
+                    TCalTime startCalTime;
+                    startCalTime.SetTimeUtcL( entryStartTime );
+                    TCalTime endCalTime;
+                    endCalTime.SetTimeUtcL( entryStartTime + duration );
+                    aEntry.SetStartAndEndTimeL( startCalTime, endCalTime );
+
+                    // Find conflicts of for entry and move them to result array
+                    FindConflictsForEntryL( aEntry, tmpInstanceArray, aDb );
+
+                    if ( tmpInstanceArray.Count() )
+                        {
+                        MoveInstancesL( tmpInstanceArray, aInstances );
+                        if ( !aFindAllConflicts )
+                            {
+                            break;
+                            }
+                        }
+                    }
+                }
+
+            if ( !aFindAllConflicts && aInstances.Count() )
+                {
+                break;
+                }
+            }
+        }
+    else if ( rRule.Until().TimeUtcL() != Time::NullTTime() )
+        {
+        TDateTime date( start.DateTime() );
+        date.SetDay( date.Day() - startDayOfWeek );
+        TTime weekStartTime( date );
+        TTime until( rRule.Until().TimeUtcL() );
+
+        while ( weekStartTime < until )
+            {
+            for ( TInt j = 0; j < days.Count(); ++j )
+                {
+                // Iterate through days of week
+                TTime entryStartTime( weekStartTime + TTimeIntervalDays( days[ j ] ) );
+
+                if ( start <= entryStartTime )
+                    {
+                    // Start time is in recurrence range
+                    // Calculate end time
+                    TCalTime startCalTime;
+                    startCalTime.SetTimeUtcL( entryStartTime );
+                    TCalTime endCalTime;
+                    endCalTime.SetTimeUtcL( entryStartTime + duration );
+                    aEntry.SetStartAndEndTimeL( startCalTime, endCalTime );
+
+                    // Find conflicts of for entry and move them to result array
+                    FindConflictsForEntryL( aEntry, tmpInstanceArray, aDb );
+
+                    if ( tmpInstanceArray.Count() )
+                        {
+                        MoveInstancesL( tmpInstanceArray, aInstances );
+                        if ( !aFindAllConflicts )
+                            {
+                            break;
+                            }
+                        }
+                    }
+                }
+
+            if ( !aFindAllConflicts && aInstances.Count() )
+                {
+                break;
+                }
+            else
+                {
+                weekStartTime += KWeek;
+                }
+            }
+        }
+
+    CleanupStack::PopAndDestroy( &days );
+    CleanupStack::PopAndDestroy( &tmpInstanceArray );
+    }
+
+/**
+ * Finds conflict for recurrent entry
+ */
+void FindConflictsForRepeatingMeetingL(
+        const CCalEntry& aEntry,
+        RPointerArray< CCalInstance >& aInstances,
+        MESMRCalDbMgr& aDb,
+        TBool aFindAllConflicts )
+    {
+    FUNC_LOG;
+
+    CCalInstance* instance = aDb.FindInstanceL( aEntry );
+
+    if ( instance ) // Instance is stored
+        {
+        CleanupStack::PushL( instance );
+        RCPointerArray< CCalInstance > tmpInstanceArray;
+        CleanupClosePushL( tmpInstanceArray );
+
+        CCalEntry& parent = instance->Entry();
+        CCalInstanceView* instanceView = aDb.InstanceViewL( parent );
+        CCalInstanceIterator* iterator = instanceView->FindInstanceByUidL(
+                        parent.UidL(),
+                        parent.StartTimeL() );
+        CleanupStack::PushL( iterator );
+        CCalEntry* entry = ESMRHelper::CopyEntryLC(
+                            parent,
+                            parent.MethodL(),
+                            ESMRHelper::ECopyFull );
+
+        while ( iterator->HasMore() )
+            {
+            CCalInstance* next = iterator->NextL();
+            CleanupStack::PushL( next );
+            entry->SetStartAndEndTimeL( next->StartTimeL(), next->EndTimeL() );
+            CleanupStack::PopAndDestroy( next );
+            FindConflictsForEntryL( *entry,
+                                    tmpInstanceArray,
+                                    aDb );
+
+            if ( tmpInstanceArray.Count() )
+                {
+                MoveInstancesL( tmpInstanceArray, aInstances );
+
+                if ( !aFindAllConflicts )
+                    {
+                    break;
+                    }
+                }
+            }
+
+        CleanupStack::PopAndDestroy( entry );
+
+        CleanupStack::PopAndDestroy( iterator );
+
+        if ( aFindAllConflicts
+             || !aInstances.Count() )
+            {
+            // Find conflicts also for parent entry
+            FindConflictsForEntryL( parent, tmpInstanceArray, aDb );
+            MoveInstancesL( tmpInstanceArray, aInstances );
+            }
+
+        CleanupStack::PopAndDestroy( &tmpInstanceArray );
+        CleanupStack::PopAndDestroy( instance );
+        }
+    else // Entry is not stored yet
+        {
+        CCalEntry* entry = ESMRHelper::CopyEntryLC(
+                aEntry,
+                aEntry.MethodL(),
+                ESMRHelper::ECopyFull );
+
+        TCalRRule rRule;
+        if ( aEntry.GetRRuleL( rRule ) )
+            {
+            switch ( rRule.Type() )
+                {
+                case TCalRRule::EDaily:
+                    {
+                    FindConflictsForDailyRRuleL(
+                            *entry,
+                            aInstances,
+                            aDb,
+                            aFindAllConflicts );
+                    break;
+                    }
+                case TCalRRule::EWeekly:
+                    {
+                    FindConflictsForWeeklyRRuleL(
+                            *entry,
+                            aInstances,
+                            aDb,
+                            aFindAllConflicts );
+                    break;
+                    }
+                default:
+                    break;
+                }
+            }
+        else
+            {
+            // Entry has RDates set
+            RCPointerArray< CCalInstance > tmpInstanceArray;
+            CleanupClosePushL( tmpInstanceArray );
+
+            RArray< TCalTime > rDates;
+            CleanupClosePushL( rDates );
+            aEntry.GetRDatesL( rDates );
+
+            // Get entry start time, end time and duration
+            TTime start( aEntry.StartTimeL().TimeUtcL() );
+            TTime end( aEntry.EndTimeL().TimeUtcL() );
+            TTimeIntervalMinutes duration(0);
+            end.MinutesFrom(
+                    start,
+                    duration );
+
+            for ( TInt i = 0; i < rDates.Count(); ++i )
+                {
+                // Set start and end times for entry
+                TCalTime startTime( rDates[ i ] );
+                TCalTime endTime;
+                endTime.SetTimeUtcL( startTime.TimeUtcL() + duration );
+                entry->SetStartAndEndTimeL( startTime, endTime );
+
+                // Find conflicts
+                FindConflictsForEntryL( *entry, tmpInstanceArray, aDb );
+
+                if ( tmpInstanceArray.Count() )
+                    {
+                    MoveInstancesL( tmpInstanceArray, aInstances );
+                    if ( !aFindAllConflicts )
+                        {
+                        break;
+                        }
+                    }
+                }
+
+            CleanupStack::PopAndDestroy( &rDates );
+
+            if ( aFindAllConflicts
+                 || aInstances.Count() == 0 )
+                {
+                // Find conflicts for parent entry
+                FindConflictsForEntryL( aEntry, tmpInstanceArray, aDb );
+                MoveInstancesL( tmpInstanceArray, aInstances );
+                }
+
+            CleanupStack::PopAndDestroy( &tmpInstanceArray );
+            }
+
+        CleanupStack::PopAndDestroy( entry );
+        }
+    }
+
 }  // namespace
 
 // ======== MEMBER FUNCTIONS ========
@@ -307,38 +765,27 @@
 
 #endif
 
-    // Get instance views of all calendar
-    RPointerArray<CCalInstanceView> allCalenInstanceView = 
-                                    iDbMgr.NormalDbAllCalenInstanceView();
-    
     RCPointerArray<CCalInstance> instanceArray;
     CleanupClosePushL( instanceArray );
-    
-    // Check if there is any conflict in each calendar
-    for( TInt i = 0; i < allCalenInstanceView.Count(); i++ )
+
+    if ( IsRepeatingMeetingL( aEntry, iDbMgr ) )
         {
-        CalCommon::TCalTimeRange timeRange =
-                    ResolveFetchTimeRangeL( 
-                                    aEntry.StartTimeL().TimeUtcL(),
-                                    aEntry.EndTimeL().TimeUtcL(), 
-                                    allCalenInstanceView[i] );
-        
-        allCalenInstanceView[i]->FindInstanceL( instanceArray,
-                                                CalCommon::EIncludeAppts,
-                                                timeRange );
-
+        FindConflictsForRepeatingMeetingL(
+                aEntry,
+                instanceArray,
+                iDbMgr,
+                EFalse );
+        }
+    else
+        {
+        FindConflictsForEntryL(
+                aEntry,
+                instanceArray,
+                iDbMgr );
+        }
 
-        }
-    
-    RemoveAndDeleteNonConflictingInstancesL(
-                                    instanceArray,
-                                    aEntry.StartTimeL(),
-                                    aEntry.EndTimeL(),
-                                    aEntry.UidL(),
-                                    ERemoveSameUID );
-    
     CreateEntriesFromInstancesL( instanceArray, aConflicts );
-    CleanupStack::PopAndDestroy(); // instanceArray
+    CleanupStack::PopAndDestroy( &instanceArray);
     }
 
 // ---------------------------------------------------------------------------
@@ -346,10 +793,10 @@
 // ---------------------------------------------------------------------------
 //
 EXPORT_C void CESMRConflictChecker::FindInstancesForEntryL(
-        TTime aStart, 
+        TTime aStart,
         TTime aEnd,
         const CCalEntry& aEntry,
-        TCalCollectionId aColId, 
+        TCalCollectionId aColId,
         RPointerArray<CCalEntry>& aInstances )
     {
     FUNC_LOG;
@@ -359,17 +806,17 @@
     CleanupClosePushL( instanceArray );
 
     // First we need the parent entry of the series ...
-    CCalInstance* entryInstance = instanceView->FindInstanceL( 
-    		aEntry.LocalUidL(), 
+    CCalInstance* entryInstance = instanceView->FindInstanceL(
+    		aEntry.LocalUidL(),
     		aEntry.StartTimeL() ); //Ownership gained
     CleanupStack::PushL( entryInstance );
 
-    CCalInstance* parentEntryInstance = instanceView->FindInstanceL( 
-    		aEntry.LocalUidL(), 
+    CCalInstance* parentEntryInstance = instanceView->FindInstanceL(
+    		aEntry.LocalUidL(),
     		entryInstance->Entry().StartTimeL() );
     CleanupStack::PopAndDestroy( entryInstance );
     CleanupStack::PushL( parentEntryInstance );
-    
+
     // ... And the parent entry instances start time
     TCalTime firstIntanceStartTime( parentEntryInstance->StartTimeL() );
 
@@ -378,53 +825,53 @@
 
     // Let's get all instances which have same uid and collection id
     // as the aEntry to an iterator.
-    CCalInstanceIterator* instanceIterator = instanceView->FindInstanceByUidL( 
-    		aColId, 
-    		aEntry.UidL(), 
+    CCalInstanceIterator* instanceIterator = instanceView->FindInstanceByUidL(
+    		aColId,
+    		aEntry.UidL(),
     		firstIntanceStartTime );
     CleanupStack::PushL( instanceIterator );
-    
+
     TInt count( instanceIterator->Count() );
-    
+
     for( TInt i = 0; i < count; ++i )
     	{
 		CCalInstance* instance = NULL;
 		TRAPD( err, instance = instanceIterator->NextL() ); //Ownership gained
 		if( !err && instance )
 			{
-			instanceArray.Append( instance );	
+			instanceArray.Append( instance );
 			}
     	}
 
     CleanupStack::PopAndDestroy( instanceIterator );
 
-    // Now the instanceArray has all instances of the aEntry, 
+    // Now the instanceArray has all instances of the aEntry,
     // let's remove this instance == instance of aEntry, from the array
 	TInt i( 0 );
     while( i < instanceArray.Count() )
     	{
 		CCalInstance* instance = instanceArray[i];
-		
-        TBool thisInstance( 
-                instance->StartTimeL().TimeLocalL() == 
+
+        TBool thisInstance(
+                instance->StartTimeL().TimeLocalL() ==
                 aEntry.StartTimeL().TimeLocalL() &&
-                instance->EndTimeL().TimeLocalL() == 
+                instance->EndTimeL().TimeLocalL() ==
                 aEntry.EndTimeL().TimeLocalL() );
-        
+
         if( thisInstance )
         	{
 			delete instance;
-			instanceArray.Remove( i );  
+			instanceArray.Remove( i );
         	}
         else
         	{
 			++i;
         	}
     	}
-  
+
     TCalTime start;
     start.SetTimeLocalL( aStart );
-    
+
     TCalTime end;
     end.SetTimeLocalL( aEnd );
 
@@ -434,10 +881,10 @@
             end,
             aEntry.UidL(),
             EIncludeSameUID );
-    
+
     CreateEntriesFromInstancesL( instanceArray, aInstances );
-    
-    CleanupStack::PopAndDestroy(); // instanceArray    
+
+    CleanupStack::PopAndDestroy(); // instanceArray
     }
 
 // EOF