Merge heads.
authorPat Downey <patd@symbian.org>
Wed, 23 Jun 2010 17:00:39 +0100
changeset 46 1aa3b69b573c
parent 30 759dc5235cdb (diff)
parent 25 61b206842ac4 (current diff)
Merge heads.
emailuis/nmailui/conf/nmeditorview.docml
emailuis/nmailui/conf/nmmessagelistview.docml
emailuis/nmhswidget/conf/nmhswidgetmail.docml
emailuis/nmhswidget/conf/nmhswidgettitle.docml
--- a/emailservices/emailcommon/bwins/fsfwcommonlibu.def	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/bwins/fsfwcommonlibu.def	Wed Jun 23 17:00:39 2010 +0100
@@ -257,4 +257,5 @@
 	??_ECEmailExtension@@UAE@I@Z @ 256 NONAME ; CEmailExtension::~CEmailExtension(unsigned int)
 	?GetCCRecipients@CFSMailMessageBase@@QAE?AV?$RPointerArray@VCFSMailAddress@@@@XZ @ 257 NONAME ; class RPointerArray<class CFSMailAddress> CFSMailMessageBase::GetCCRecipients(void)
 	?NewL@CFSMailMessagePart@@SAPAV1@VTFSMailMsgId@@0@Z @ 258 NONAME ; class CFSMailMessagePart * CFSMailMessagePart::NewL(class TFSMailMsgId, class TFSMailMsgId)
+	?RemoveMessageL@CFSMailFolder@@QAEHVTFSMailMsgId@@AAVMFSMailRequestObserver@@@Z @ 259 NONAME ; int CFSMailFolder::RemoveMessageL(class TFSMailMsgId, class MFSMailRequestObserver &)
 
--- a/emailservices/emailcommon/eabi/fsfwcommonlibu.def	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/eabi/fsfwcommonlibu.def	Wed Jun 23 17:00:39 2010 +0100
@@ -292,4 +292,5 @@
 	_ZThn4_N15CFSMailIterator9PreviousLERK7TDesC16jR13RPointerArrayI14CFSMailMessageE @ 291 NONAME
 	_ZThn4_N15CFSMailIteratorD0Ev @ 292 NONAME
 	_ZThn4_N15CFSMailIteratorD1Ev @ 293 NONAME
+	_ZN13CFSMailFolder14RemoveMessageLE12TFSMailMsgIdR22MFSMailRequestObserver @ 294 NONAME
 
--- a/emailservices/emailcommon/inc/CFSMailBox.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/inc/CFSMailBox.h	Wed Jun 23 17:00:39 2010 +0100
@@ -158,7 +158,7 @@
      *
      * @param aOperationObserver Observer for the operation 
      * 
-     * @return id of the request, KErrNotSupported if the protocol plugin this
+     * @return id of the request, KErrFSMailPluginNotSupported if the protocol plugin this
      * instance is attached to does not support the async method.
      */
      IMPORT_C TInt CreateMessageToSendL( MFSMailRequestObserver& aOperationObserver );
--- a/emailservices/emailcommon/inc/CFSMailFolder.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/inc/CFSMailFolder.h	Wed Jun 23 17:00:39 2010 +0100
@@ -76,6 +76,20 @@
      */
      IMPORT_C void RemoveMessageL( const TFSMailMsgId aMessageId );
 
+     // <qmail>
+     /**
+      * removes given message from folder
+      *
+      * @param aMessageId id of message to be removed
+      * @param aObserver Observer for the operation completion
+      * 
+      * @return id of the request, KErrFSMailPluginNotSupported if the protocol plugin this
+      * instance is attached to does not support the async method.
+      */
+     IMPORT_C TInt RemoveMessageL( const TFSMailMsgId aMessageId,
+                                   MFSMailRequestObserver& aObserver );
+     // </qmail>
+     
     /**
      * lists subfolders contained by this folder
      *
--- a/emailservices/emailcommon/inc/cmailboxstateext.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/inc/cmailboxstateext.h	Wed Jun 23 17:00:39 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2009 - 2010 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"
@@ -11,7 +11,8 @@
 *
 * Contributors:
 *
-* Description:  Message extension interface
+* Description:  Mailbox state extension for notifying email protocol plugins
+*               about application state changes.
 *
 */
 
@@ -30,16 +31,21 @@
 class MEmailMailboxState
 {
 public:
+// <qmail>
     /**
     * Returns currently active folder and related mailbox that
     * is currently being used.
-    * @param aActiveMailboxId id of currently active mailbox 
+    * @param aActiveMailboxId id of currently active mailbox
+    * 
     * @param aActiveFolderId id of currently active mail folder
+    *        If aActiveFolderId.IsNullId() returns true there is no active
+    *        folder. This happens if e.g. email applications is closed. 
     * @return Symbian OS error code
     */
     virtual TInt GetActiveFolderId( 
         TFSMailMsgId& aActiveMailboxId,
         TFSMailMsgId& aActiveFolderId ) const = 0;
+// </qmail>    
 };
 
 /**
@@ -50,10 +56,21 @@
 public:
     
     /**
-     * Sets data provider interface
-     * @param aDataProvider data provider
+     * Sets data provider interface.
+     * @param aDataProvider data provider.
      */
     virtual void SetStateDataProvider( MEmailMailboxState* aDataProvider ) = 0;
+// <qmail>    
+    /**
+    * Notification that folder has changed in email application.
+    * @param aActiveMailboxId id of the mailbox container the folder
+    * @param aActiveFolderId currently active folder id or null id if
+    *        there's currently no active folder (e.g. application is closed)
+    */
+    virtual void NotifyActiveFolderChanged(
+        const TFSMailMsgId& aActiveMailboxId,
+        const TFSMailMsgId& aActiveFolderId) = 0;
+// </qmail>
 
 protected:    
     inline CMailboxStateExtension();
@@ -66,5 +83,5 @@
          CEmailExtension( KEmailMailboxStateExtensionUid )
     {
     }
-         
+
 #endif // CMAILBOXSTATEEXT_H
--- a/emailservices/emailcommon/src/CFSMailAddress.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailAddress.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,10 +15,10 @@
 *
 */
 
+#include "emailtrace.h"
 
 //<cmail>
 #include <nmcommonheaders.h>
-#include "emailtrace.h"
 #include "CFSMailAddress.h"
 //</cmail>
 
@@ -32,7 +32,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailAddress* CFSMailAddress::NewLC()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailAddress* adr = new (ELeave) CFSMailAddress();
     CleanupStack::PushL(adr);
     adr->ConstructL();
@@ -44,7 +45,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailAddress* CFSMailAddress::NewL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailAddress* adr =  CFSMailAddress::NewLC();
     CleanupStack::Pop(adr);
     return adr;
@@ -56,7 +58,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailAddress* CFSMailAddress::NewL( const NmAddress& aNmAddress )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailAddress* adr = new (ELeave) CFSMailAddress();
     CleanupStack::PushL(adr);
     adr->ConstructL(aNmAddress);
@@ -70,7 +73,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailAddress::ConstructL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     // Construction of shared data object
     iNmPrivateAddress = new NmAddressPrivate();
@@ -83,7 +87,8 @@
 // --------------------------------_--------------------------------------------
 void CFSMailAddress::ConstructL( const NmAddress& aNmAddress )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // shared data object
     iNmPrivateAddress = aNmAddress.d;
 	}
@@ -94,7 +99,8 @@
 // -----------------------------------------------------------------------------
 CFSMailAddress::CFSMailAddress()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
 // Unnecessary members initialization removed: iEmailAddress, iDisplayName
 // </qmail>
@@ -105,7 +111,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailAddress::~CFSMailAddress()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
 // Unnecessary members destruction removed: iEmailAddress, iDisplayName
 // </qmail>
@@ -116,7 +123,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TDesC& CFSMailAddress::GetEmailAddress() const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iEmailAddressPtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateAddress->mAddress.utf16()),
         iNmPrivateAddress->mAddress.length());
@@ -129,7 +137,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailAddress::SetEmailAddress(const TDesC& aAddress)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     QString qtEmailAddress = QString::fromUtf16(aAddress.Ptr(), aAddress.Length());
     iNmPrivateAddress->mAddress = qtEmailAddress;
@@ -141,7 +150,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TDesC& CFSMailAddress::GetDisplayName() const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iDisplayNamePtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateAddress->mDisplayName.utf16()),
         iNmPrivateAddress->mDisplayName.length());
@@ -154,7 +164,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailAddress::SetDisplayName(const TDesC& aDisplayName)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     QString qtDisplayName = QString::fromUtf16(aDisplayName.Ptr(), aDisplayName.Length());
     iNmPrivateAddress->mDisplayName = qtDisplayName;
@@ -167,7 +178,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C NmAddress CFSMailAddress::GetNmAddress()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     NmAddress nmAddress(iNmPrivateAddress);
     return nmAddress;
 	}
--- a/emailservices/emailcommon/src/CFSMailBox.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailBox.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 // <qmail>
 #include <nmcommonheaders.h>
 // <//qmail>
 
-#include "emailtrace.h"
 #include <bamdesca.h>
 #include "CFSMailPlugin.h"
 #include "cmrcalendarinfoimpl.h"
@@ -39,11 +40,12 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailBox* CFSMailBox::NewLC(TFSMailMsgId aMailBoxId)
 {
-    FUNC_LOG;
-  CFSMailBox* api = new (ELeave) CFSMailBox();
-  CleanupStack:: PushL(api);
-  api->ConstructL(aMailBoxId);
-  return api;
+    NM_FUNCTION;
+    
+    CFSMailBox* api = new (ELeave) CFSMailBox();
+    CleanupStack:: PushL(api);
+    api->ConstructL(aMailBoxId);
+    return api;
 } 
 
 // -----------------------------------------------------------------------------
@@ -51,10 +53,11 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailBox* CFSMailBox::NewL(TFSMailMsgId aMailBoxId)
 {
-    FUNC_LOG;
-  CFSMailBox* api =  CFSMailBox::NewLC(aMailBoxId);
-  CleanupStack:: Pop(api);
-  return api;
+    NM_FUNCTION;
+    
+    CFSMailBox* api =  CFSMailBox::NewLC(aMailBoxId);
+    CleanupStack:: Pop(api);
+    return api;
 }
 
 // -----------------------------------------------------------------------------
@@ -62,7 +65,8 @@
 // -----------------------------------------------------------------------------
 CFSMailBox::CFSMailBox()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // get requesthandler pointer
     iRequestHandler = static_cast<CFSMailRequestHandler*>(Dll::Tls());
 }
@@ -72,7 +76,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailBox::~CFSMailBox()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     iFolders.ResetAndDestroy();
 }
 
@@ -81,7 +86,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailBox::ConstructL(TFSMailMsgId aMailBoxId)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     CFSMailBoxBase::ConstructL(aMailBoxId);
 // </qmail>
@@ -92,7 +98,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::GoOnlineL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
@@ -105,7 +111,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::GoOfflineL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
@@ -119,7 +125,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::CancelSyncL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
@@ -132,7 +138,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSProgress CFSMailBox::GetLastSyncStatusL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TFSProgress progress;
     progress.iError = EFalse;
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
@@ -148,8 +155,8 @@
 EXPORT_C TInt CFSMailBox::RefreshNowL(
     MFSMailRequestObserver& aOperationObserver )
     {
-    FUNC_LOG;
-
+    NM_FUNCTION;
+    
     TFSPendingRequest request;
     request.iRequestId = 0;
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
@@ -166,16 +173,15 @@
             }
         }
     return request.iRequestId;
-
-   }
+    }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::RefreshNowL
 // -----------------------------------------------------------------------------
 EXPORT_C TInt CFSMailBox::RefreshNowL( )
     {
-    FUNC_LOG;
-
+    NM_FUNCTION;
+    
     TFSPendingRequest request;
     request.iRequestId = 0;
     MFSMailRequestObserver* observer = NULL;
@@ -193,16 +199,15 @@
             }
         }
     return request.iRequestId;
-
-   }
+    }
 
 // -----------------------------------------------------------------------------
 // CFSMailBox::CreateMessageToSend
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessage* CFSMailBox::CreateMessageToSend( )
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
+    
     CFSMailMessage* message = NULL;
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
@@ -222,6 +227,8 @@
 EXPORT_C TInt CFSMailBox::CreateMessageToSendL(
         MFSMailRequestObserver& aOperationObserver )
     {
+    NM_FUNCTION;
+    
     TFSPendingRequest request;
     
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() );
@@ -258,6 +265,8 @@
     RPointerArray<CFSMailMessage> &messages,
     MFSMailRequestObserver& aOperationObserver)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(aMailboxId);
     TFSPendingRequest request;
         
@@ -298,7 +307,8 @@
 EXPORT_C CFSMailMessage* CFSMailBox::CreateForwardMessage(  TFSMailMsgId aOriginalMessageId,
                                                             const TDesC& aHeaderDescriptor )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailMessage* message = NULL;
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
@@ -321,6 +331,8 @@
                         MFSMailRequestObserver& aOperationObserver,
                         const TDesC& aHeaderDescriptor )
     {
+    NM_FUNCTION;
+    
     TFSPendingRequest request;
     
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() );
@@ -358,7 +370,8 @@
                                                          TBool aReplyToAll,
                                                          const TDesC& aHeaderDescriptor )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailMessage* message = NULL;
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
@@ -383,6 +396,8 @@
                                       MFSMailRequestObserver& aOperationObserver,
                                       const TDesC& aHeaderDescriptor )
 {
+    NM_FUNCTION;
+    
     TFSPendingRequest request;
     
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() );
@@ -418,8 +433,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailBox::GetStandardFolderId(TFSFolderType aFolderType)
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
+    
     TFSMailMsgId folderId;
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
@@ -437,7 +452,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::SendMessageL( CFSMailMessage& aMessage )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
         // <qmail> Not activated yet.
@@ -457,7 +473,7 @@
         CFSMailMessage& aMessage,
         MFSMailRequestObserver& aOperationObserver )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     TFSPendingRequest request;
 
@@ -501,8 +517,8 @@
 EXPORT_C void CFSMailBox::ListFolders(  TFSMailMsgId aFolder,
                                         RPointerArray<CFSMailFolder>& aFolderList)
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
+    
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
     {
         TRAPD(err, plugin->ListFoldersL(GetId(),aFolder,aFolderList));
@@ -518,6 +534,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C RPointerArray<CFSMailFolder>& CFSMailBox::ListFolders( )
 {   
+    NM_FUNCTION;
+    
     iFolders.ResetAndDestroy();
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
     {
@@ -536,7 +554,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TDesC& CFSMailBox::GetBrandingIdL( )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return BrandingId();
 }
 
@@ -547,7 +566,8 @@
                                          const TFSMailMsgId aSourceFolderId, 
                                          const TFSMailMsgId aDestinationFolderId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
         plugin->MoveMessagesL(GetId(), aMessageIds, aSourceFolderId, aDestinationFolderId);
@@ -562,7 +582,8 @@
                                          const TFSMailMsgId aSourceFolderId, 
                                          const TFSMailMsgId aDestinationFolderId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TFSPendingRequest request;
     if( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
         {
@@ -588,7 +609,8 @@
                                          const TFSMailMsgId aSourceFolderId, 
                                          const TFSMailMsgId aDestinationFolderId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
         plugin->CopyMessagesL(GetId(), aMessageIds, aNewMessages,
@@ -604,8 +626,7 @@
                                    MFSMailBoxSearchObserver&   /*aSearchObserver*/,
                                    const RArray<TFSMailMsgId>  /*aFolderIds */ )
     {
-    FUNC_LOG;
-
+    NM_FUNCTION;
     }
     
 // -----------------------------------------------------------------------------
@@ -615,7 +636,8 @@
                                    const TFSMailSortCriteria& aSortCriteria,
                                    MFSMailBoxSearchObserver& aSearchObserver )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
 
@@ -649,7 +671,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::CancelSearch()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
         plugin->CancelSearch( GetId() );
@@ -661,7 +684,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::ClearSearchResultCache()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
         plugin->ClearSearchResultCache( GetId() );
@@ -673,7 +697,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C MDesCArray* CFSMailBox::ListMrusL() const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     MDesCArray* mruList(0);
     if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) )
         {
@@ -688,7 +713,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TSSMailSyncState CFSMailBox::CurrentSyncState() const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TSSMailSyncState syncState(Idle);
     if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
         {
@@ -702,7 +728,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailBox::HasCapability( const TFSMailBoxCapabilities aCapability ) const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TBool capability = EFalse;
     if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
         {
@@ -720,7 +747,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailBoxStatus CFSMailBox::GetMailBoxStatus()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TFSMailBoxStatus status(EFSMailBoxOffline);
     if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) )
     {
@@ -734,7 +762,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::SetCredentialsL( const TDesC& aUsername, const TDesC& aPassword )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId() ) )
         {
         plugin->SetCredentialsL( GetId(), aUsername, aPassword );
@@ -746,7 +775,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::RemoveDownLoadedAttachmentsL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() );
     if ( plugin )
@@ -767,7 +796,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TInt CFSMailBox::GetConnectionId( TUint32& aConnectionId )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TInt rcode = KErrNotSupported;
     if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
         {
@@ -781,7 +811,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TInt CFSMailBox::IsConnectionAllowedWhenRoaming( TBool& aConnectionAllowed )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TInt rcode = KErrNotSupported;
     if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
         {
@@ -795,7 +826,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessage* CFSMailBox::CreateMessageFromFileL( const RFile& aFile )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailMessage* message = NULL;
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
     {
@@ -812,7 +844,7 @@
     const RPointerArray<CFSMailAddress>& aCCRecipients,
     const RPointerArray<CFSMailAddress>& aBCCRecipients ) const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
     // First lets make a copy of the current mru list
     // whose content we can later alter as we wish
@@ -867,7 +899,8 @@
 // -----------------------------------------------------------------------------    
 CDesCArraySeg* CFSMailBox::CopyArrayL( MDesCArray& aArrayToBeCopied ) const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CDesCArraySeg* newArray = new (ELeave) CDesCArraySeg( 10 );
     CleanupStack::PushL( newArray );
     
@@ -890,7 +923,8 @@
     CDesCArraySeg& aMruList,
     const RPointerArray<CFSMailAddress>& aNewRecentlyUsedOnes ) const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TUint newCount( aNewRecentlyUsedOnes.Count() );
     TUint newIndexer( 0 );
     
@@ -931,7 +965,8 @@
                                          TDesC& searchedAddress,
                                          TInt& aPos ) const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // CDesCArray::Find() is not used here because there is
     // possibility that we have to go through the whole array
     // and return the index for one specific match. Find() returns
@@ -971,7 +1006,8 @@
 void CFSMailBox::AddAndRemoveExcessMruL( CDesCArraySeg& aMruList,
                                          CFSMailAddress& aToBeAdded ) const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if ( aMruList.Count() == KMaxMruEntries )
         {
         // Remove the oldest entry pair from the beginning
@@ -988,7 +1024,8 @@
                                       TInt aPosition,
                                       CFSMailAddress& aMostRecent ) const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // Position of the address is given so the possible display name is
     // in the previous slot. Delete both.
     aMruList.Delete( aPosition - 1, 2 );
@@ -1002,7 +1039,8 @@
 void CFSMailBox::AppendMruItemL( CDesCArraySeg& aMruList,
                                  CFSMailAddress& aToBeAppended ) const
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // In the array, display name is always the first and then comes
     // the actual address.
     
@@ -1028,7 +1066,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBox::ReleaseExtension( CEmailExtension* aExtension )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // no specialized behaviour, call base class
     CExtendableEmail::ReleaseExtension( aExtension );
     }
@@ -1038,11 +1077,14 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CEmailExtension* CFSMailBox::ExtensionL( const TUid& aInterfaceUid )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CEmailExtension* extension = NULL;
+// <qmail>
+    extension = CExtendableEmail::ExtensionL( aInterfaceUid );    
     if ( aInterfaceUid == KMailboxExtMrCalInfo )
         {
-        extension = CExtendableEmail::ExtensionL( aInterfaceUid );
+// </qmail>        
         if ( extension == NULL )
             {
             extension = new ( ELeave ) CMRCalendarInfoImpl();
--- a/emailservices/emailcommon/src/CFSMailBoxBase.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailBoxBase.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 // <qmail>
 #include <nmcommonheaders.h>
 // </qmail>
 
-#include "emailtrace.h"
 #include "CFSMailBoxBase.h"
 // <qmail>
 #include "CFSMailAddress.h"
@@ -38,11 +39,12 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailBoxBase* CFSMailBoxBase::NewLC(TFSMailMsgId aMailBoxId)
 {
-    FUNC_LOG;
-  CFSMailBoxBase* api = new (ELeave) CFSMailBoxBase();
-  CleanupStack:: PushL(api);
-  api->ConstructL(aMailBoxId);
-  return api;
+    NM_FUNCTION;
+    
+    CFSMailBoxBase* api = new (ELeave) CFSMailBoxBase();
+    CleanupStack:: PushL(api);
+    api->ConstructL(aMailBoxId);
+    return api;
 } 
 
 // -----------------------------------------------------------------------------
@@ -50,10 +52,11 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailBoxBase* CFSMailBoxBase::NewL(TFSMailMsgId aMailBoxId)
 {
-    FUNC_LOG;
-  CFSMailBoxBase* api =  CFSMailBoxBase::NewLC(aMailBoxId);
-  CleanupStack:: Pop(api);
-  return api;
+    NM_FUNCTION;
+    
+    CFSMailBoxBase* api =  CFSMailBoxBase::NewLC(aMailBoxId);
+    CleanupStack:: Pop(api);
+    return api;
 }
 
 // -----------------------------------------------------------------------------
@@ -61,8 +64,7 @@
 // -----------------------------------------------------------------------------
 CFSMailBoxBase::CFSMailBoxBase() : CExtendableEmail()
 {
-    FUNC_LOG;
-	
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -70,7 +72,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailBoxBase::~CFSMailBoxBase()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if( iMailBoxName )
         {
   		delete iMailBoxName;
@@ -101,7 +104,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailBoxBase::ConstructL(const TFSMailMsgId aMailBoxId)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail> Removed iMailboxId </qmail>
     // prepare null empty descriptor
     iMailBoxName = HBufC::NewL(1);
@@ -132,7 +136,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailBoxBase::GetId() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return TFSMailMsgId(iNmPrivateMailbox->mId);
 // </qmail>
@@ -143,7 +148,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TDesC& CFSMailBoxBase::GetName()const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iTextPtr.Set( 
         reinterpret_cast<const TUint16*> (iNmPrivateMailbox->mName.utf16()),
@@ -157,7 +163,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBoxBase::SetName( const TDesC& aMailBoxName )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     QString qtName = QString::fromUtf16(aMailBoxName.Ptr(), aMailBoxName.Length());
     // Fix from Cmail 9.2 rewritten with QString methods
@@ -174,7 +181,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailBoxStatus CFSMailBoxBase::GetStatus( ) const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return EFSMailBoxOffline;
 }
 
@@ -183,8 +191,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBoxBase::SetStatus( const TFSMailBoxStatus /*aStatus*/ )
 {
-    FUNC_LOG;
-	
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -192,7 +199,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBoxBase::GetRCLInfo(TUid& aProtocolUid, TUint& aAccountUid)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	aProtocolUid = iProtocolUid;
 	aAccountUid = iAccountUid;
 }
@@ -202,7 +210,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBoxBase::SetRCLInfo(const TUid aProtocolUid, const TUint aAccountUid)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iProtocolUid = aProtocolUid;
 	iAccountUid = aAccountUid;
 }
@@ -212,7 +221,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TUid CFSMailBoxBase::GetSettingsUid()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return iSettingsUid;
 	}
 
@@ -221,7 +231,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBoxBase::SetSettingsUid(const TUid aUid)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 		iSettingsUid = aUid;
 	}
 
@@ -230,7 +241,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C MMRInfoProcessor& CFSMailBoxBase::MRInfoProcessorL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return *iMRInfoProcessor;
 	}
 
@@ -239,7 +251,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailBoxBase::IsMRInfoProcessorSet()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(iMRInfoProcessor)
 		{
 		return ETrue;
@@ -255,8 +268,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBoxBase::SetMRInfoProcessorL(MMRInfoProcessor* aMRInfoProcessor)
 	{
-    FUNC_LOG;
-
+    NM_FUNCTION;
+    
 	if(iMRInfoProcessor)
 	{
 		delete iMRInfoProcessor;
@@ -269,7 +282,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailAddress& CFSMailBoxBase::OwnMailAddress( )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return *iOwnMailAddress;
 }
 
@@ -278,7 +292,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailBoxBase::SetOwnMailAddressL( CFSMailAddress* aOwnMailAddress)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(iOwnMailAddress)
 		{
 		delete iOwnMailAddress;
@@ -309,7 +324,8 @@
 // -----------------------------------------------------------------------------
 TDesC& CFSMailBoxBase::BrandingId( )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return *iBrId;
 }
 
@@ -321,6 +337,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C NmMailbox* CFSMailBoxBase::GetNmMailbox()
 {
+    NM_FUNCTION;
+    
     NmMailbox* nmmailbox = new NmMailbox(iNmPrivateMailbox);
     return nmmailbox;
 }
--- a/emailservices/emailcommon/src/CFSMailFolder.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailFolder.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,12 +15,13 @@
 *
 */
 
+#include "emailtrace.h"
+
 // <qmail>
 #include <nmcommonheaders.h>
 // </qmail>
 
 //<cmail>
-#include "emailtrace.h"
 #include "CFSMailFolder.h"
 #include "CFSMailPlugin.h"
 //</cmail>
@@ -34,11 +35,12 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailFolder* CFSMailFolder::NewLC( TFSMailMsgId aFolderId )
 {
-    FUNC_LOG;
-  CFSMailFolder* api = new (ELeave) CFSMailFolder();
-  CleanupStack:: PushL(api);
-  api->ConstructL( aFolderId );
-  return api;
+    NM_FUNCTION;
+    
+    CFSMailFolder* api = new (ELeave) CFSMailFolder();
+    CleanupStack:: PushL(api);
+    api->ConstructL( aFolderId );
+    return api;
 } 
 
 // -----------------------------------------------------------------------------
@@ -46,10 +48,11 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailFolder* CFSMailFolder::NewL( TFSMailMsgId aFolderId )
 {
-    FUNC_LOG;
-  CFSMailFolder* api =  CFSMailFolder::NewLC( aFolderId );
-  CleanupStack:: Pop(api);
-  return api;
+    NM_FUNCTION;
+    
+    CFSMailFolder* api =  CFSMailFolder::NewLC( aFolderId );
+    CleanupStack:: Pop(api);
+    return api;
 }
 
 // -----------------------------------------------------------------------------
@@ -57,8 +60,7 @@
 // -----------------------------------------------------------------------------
 CFSMailFolder::CFSMailFolder()
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -66,7 +68,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailFolder::ConstructL( TFSMailMsgId aFolderId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     CFSMailFolderBase::ConstructL( aFolderId );
 // </qmail>
@@ -80,8 +83,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailFolder::~CFSMailFolder()
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -90,8 +92,8 @@
 EXPORT_C MFSMailIterator* CFSMailFolder::ListMessagesL( const TFSMailDetails aDetails,
         						const RArray<TFSMailSortCriteria>& aSorting)
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
+    
 	CFSMailIterator* iterator = NULL;
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetFolderId()))
 		{
@@ -112,7 +114,8 @@
      							 				TFSMailDetails aDetails,
      							 				MFSMailRequestObserver& aObserver )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// init asynchronous request
 	CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetFolderId());
     TFSPendingRequest request = 
@@ -150,7 +153,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolder::GetSubFoldersL(RPointerArray<CFSMailFolder>& aSubFolders)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetFolderId()))
 		{
 		TRAPD(err,plugin->ListFoldersL( GetMailBoxId(), GetFolderId(), aSubFolders));
@@ -166,7 +170,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolder::RemoveMessageL(TFSMailMsgId aMessage)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetFolderId()))
 		{
 		RArray<TFSMailMsgId> messages;
@@ -177,13 +182,60 @@
 		}
 }
 
+// <qmail>
+// -----------------------------------------------------------------------------
+// CFSMailFolder::RemoveMessageL
+// -----------------------------------------------------------------------------
+EXPORT_C TInt CFSMailFolder::RemoveMessageL(TFSMailMsgId aMessage,
+                                            MFSMailRequestObserver& aObserver)
+{
+    NM_FUNCTION;
+
+    // init asynchronous request
+    CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetFolderId());
+    TFSPendingRequest request = 
+        iRequestHandler->InitAsyncRequestL( GetFolderId().PluginId(), aObserver );
+
+    TInt err = KErrNone;
+    
+    if (plugin)
+        {
+        MFSMailRequestObserver* observer = request.iObserver;
+        
+        RArray<TFSMailMsgId> messages;
+        messages.Reset();
+        messages.Append(aMessage);
+        
+        TRAP(err,plugin->DeleteMessagesByUidL(
+            GetMailBoxId(),
+            GetFolderId(),
+            messages,
+            *observer,
+            request.iRequestId));
+        
+        messages.Close();
+        }
+    else 
+        {
+        err = KErrNotFound;        
+        }
+    
+    if(err != KErrNone)
+        {
+        iRequestHandler->CompleteRequest(request.iRequestId);
+        User::Leave(err);
+        }
+    return request.iRequestId;
+}
+// </qmail>
+
 // -----------------------------------------------------------------------------
 // CFSMailFolder::SupportsCopyFromL
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailFolder::SupportsCopyFromL( TFSFolderType aFolderType )
 	{
-    FUNC_LOG;
-	
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetFolderId()))
 		{
 		TFSMailBoxStatus onlineStatus = plugin->GetMailBoxStatus(GetMailBoxId());
@@ -216,8 +268,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailFolder::SupportsMoveFromL( TFSFolderType aFolderType )
 	{
-    FUNC_LOG;
-
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetFolderId()))
 		{
 		TFSMailBoxStatus onlineStatus = plugin->GetMailBoxStatus(GetMailBoxId());
@@ -250,7 +302,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolder::RemoveDownLoadedAttachmentsL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetFolderId());
     if(plugin != NULL)
@@ -291,7 +343,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolder::ReleaseExtension( CEmailExtension* aExtension )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // no specialized behaviour, call base class
     CExtendableEmail::ReleaseExtension( aExtension );
     }
@@ -301,7 +354,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CEmailExtension* CFSMailFolder::ExtensionL( const TUid& aInterfaceUid )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return CExtendableEmail::ExtensionL( aInterfaceUid );
     }
 
--- a/emailservices/emailcommon/src/CFSMailFolderBase.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailFolderBase.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,12 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 // <qmail>
 #include <nmcommonheaders.h>
 // </qmail>
 
-#include "emailtrace.h"
-
 // <qmail>
 #include "CFSMailFolderBase.h"
 #include "nmfolder.h"
@@ -32,7 +32,8 @@
 // -----------------------------------------------------------------------------
 CFSMailFolderBase::CFSMailFolderBase()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail> unnecessary iFolderName initialization removed </qmail>
 	iMoveOfflineBlocked.Reset();
 	iMoveOnlineBlocked.Reset();
@@ -45,7 +46,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailFolderBase::~CFSMailFolderBase()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail> unnecessary iFolderName destruction removed </qmail>
 	iMoveOfflineBlocked.Reset();
 	iMoveOnlineBlocked.Reset();
@@ -58,7 +60,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolderBase::ConstructL( TFSMailMsgId aFolderId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateFolder = new NmFolderPrivate();
     iNmPrivateFolder->mFolderId = aFolderId.GetNmId();
@@ -70,11 +73,12 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailFolderBase* CFSMailFolderBase::NewLC( TFSMailMsgId aFolderId )
 {
-    FUNC_LOG;
-  CFSMailFolderBase* folder = new (ELeave) CFSMailFolderBase();
-  CleanupStack:: PushL(folder);
-  folder->ConstructL(aFolderId);
-  return folder;
+    NM_FUNCTION;
+    
+    CFSMailFolderBase* folder = new (ELeave) CFSMailFolderBase();
+    CleanupStack:: PushL(folder);
+    folder->ConstructL(aFolderId);
+    return folder;
 } 
 
 // -----------------------------------------------------------------------------
@@ -82,10 +86,11 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailFolderBase* CFSMailFolderBase::NewL(const TFSMailMsgId aFolderId)
 {
-    FUNC_LOG;
-  CFSMailFolderBase* folder =  CFSMailFolderBase::NewLC(aFolderId);
-  CleanupStack:: Pop(folder);
-  return folder;
+    NM_FUNCTION;
+    
+    CFSMailFolderBase* folder =  CFSMailFolderBase::NewLC(aFolderId);
+    CleanupStack:: Pop(folder);
+    return folder;
 }
 
 // -----------------------------------------------------------------------------
@@ -93,7 +98,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailFolderBase::GetFolderId() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
 	return TFSMailMsgId(iNmPrivateFolder->mFolderId);
 // </qmail>
@@ -105,7 +111,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailFolderBase::GetParentFolderId() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return TFSMailMsgId(iNmPrivateFolder->mParentFolderId);
 // </qmail>
@@ -116,7 +123,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolderBase::SetParentFolderId(TFSMailMsgId aFolderId)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateFolder->mParentFolderId = aFolderId.GetNmId();
 // </qmail>
@@ -127,7 +135,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailFolderBase::GetMailBoxId() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
 	return TFSMailMsgId(iNmPrivateFolder->mMailboxId);
 // </qmail>
@@ -138,7 +147,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolderBase::SetMailBoxId(TFSMailMsgId aMailBoxId)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateFolder->mMailboxId = aMailBoxId.GetNmId();
 // </qmail>
@@ -150,7 +160,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSFolderType CFSMailFolderBase::GetFolderType() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return static_cast<TFSFolderType>(iNmPrivateFolder->mFolderType);
 // </qmail>
@@ -161,7 +172,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolderBase::SetFolderType(const TFSFolderType aFolderType)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateFolder->mFolderType = static_cast<NmFolderType>(aFolderType);
 // </qmail>
@@ -172,7 +184,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TDesC& CFSMailFolderBase::GetFolderName() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iTextPtr.Set(
         reinterpret_cast<const TUint16*> (iNmPrivateFolder->mName.utf16()),
@@ -186,7 +199,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolderBase::SetFolderName(const TDesC& aFolderName)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     QString qtName = QString::fromUtf16(aFolderName.Ptr(), aFolderName.Length());
     iNmPrivateFolder->mName = qtName;
@@ -198,7 +212,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TUint CFSMailFolderBase::GetMessageCount() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return (TUint)iNmPrivateFolder->mMessageCount;
 // </qmail>
@@ -209,7 +224,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TUint CFSMailFolderBase::GetUnreadCount() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return (TUint)iNmPrivateFolder->mUnreadMessageCount;
 // </qmail>
@@ -220,7 +236,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TUint CFSMailFolderBase::GetUnseenCount() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return (TUint)iNmPrivateFolder->mUnseenCount;
 // </qmail>
@@ -231,7 +248,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TUint CFSMailFolderBase::GetSubFolderCount() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return (TUint)iNmPrivateFolder->mSubFolderCount;
 // </qmail>
@@ -241,7 +259,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolderBase::SetMessageCount( TUint aMessageCount )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateFolder->mMessageCount = aMessageCount;
 // </qmail>
@@ -252,7 +271,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolderBase::SetUnreadCount( TUint aMessageCount )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateFolder->mUnreadMessageCount = aMessageCount;
 // </qmail>
@@ -263,7 +283,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolderBase::SetUnseenCount( TUint aMessageCount )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateFolder->mUnseenCount = aMessageCount;
 // </qmail>
@@ -274,7 +295,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailFolderBase::SetSubFolderCount(TUint aFolderCount)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateFolder->mSubFolderCount = aFolderCount;
 // </qmail>
@@ -286,7 +308,8 @@
 EXPORT_C void CFSMailFolderBase::BlockCopyFromL( RArray<TFSFolderType> aFolderTypes, 
 													TFSMailBoxStatus aMailBoxStatus )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	switch(aMailBoxStatus)
 		{
 			case EFSMailBoxOnline:
@@ -314,7 +337,8 @@
 EXPORT_C void CFSMailFolderBase::BlockMoveFromL( RArray<TFSFolderType> aFolderTypes, 
 													TFSMailBoxStatus aMailBoxStatus )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	switch(aMailBoxStatus)
 		{
 			case EFSMailBoxOnline:
@@ -342,6 +366,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C NmFolder* CFSMailFolderBase::GetNmFolder()
 {
+    NM_FUNCTION;
+    
     NmFolder* nmFolder = new NmFolder(iNmPrivateFolder);
     return nmFolder;
 }
--- a/emailservices/emailcommon/src/CFSMailIterator.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailIterator.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 // <qmail>
 #include <nmcommonheaders.h>
 // </qmail>
 
-#include "emailtrace.h"
 #include "CFSMailIterator.h"
 
 // ================= MEMBER FUNCTIONS ==========================================
@@ -29,11 +30,12 @@
 EXPORT_C CFSMailIterator* CFSMailIterator::NewLC( 	MFSMailIterator& aIterator,
 													CFSMailRequestHandler* aRequestHandler )
 {
-    FUNC_LOG;
-  CFSMailIterator* api = new (ELeave) CFSMailIterator();
-  CleanupStack:: PushL(api);
-  api->ConstructL( aIterator, aRequestHandler );
-  return api;
+    NM_FUNCTION;
+    
+    CFSMailIterator* api = new (ELeave) CFSMailIterator();
+    CleanupStack:: PushL(api);
+    api->ConstructL( aIterator, aRequestHandler );
+    return api;
 } 
 
 // -----------------------------------------------------------------------------
@@ -42,10 +44,11 @@
 EXPORT_C CFSMailIterator* CFSMailIterator::NewL( 	MFSMailIterator& aIterator,
 													CFSMailRequestHandler* aRequestHandler )
 {
-    FUNC_LOG;
-  CFSMailIterator* api =  CFSMailIterator::NewLC( aIterator, aRequestHandler );
-  CleanupStack:: Pop(api);
-  return api;
+    NM_FUNCTION;
+    
+    CFSMailIterator* api =  CFSMailIterator::NewLC( aIterator, aRequestHandler );
+    CleanupStack:: Pop(api);
+    return api;
 }
 
 // -----------------------------------------------------------------------------
@@ -53,7 +56,8 @@
 // -----------------------------------------------------------------------------
 CFSMailIterator::CFSMailIterator()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iIterator = NULL;
 }
 
@@ -63,7 +67,8 @@
 void CFSMailIterator::ConstructL( 	MFSMailIterator& aIterator,
 									CFSMailRequestHandler* aRequestHandler )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iIterator = &aIterator;
 	iRequestHandler = aRequestHandler;
  }
@@ -73,7 +78,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailIterator::~CFSMailIterator()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(iIterator)
 		{
 		delete iIterator;
@@ -88,7 +94,8 @@
         TUint aCount, 
         RPointerArray<CFSMailMessage>& aMessages)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// call plugin iterator
 	TBool ret = iIterator->NextL(aCurrentMessageId,aCount,aMessages);
 	
@@ -104,7 +111,7 @@
         TUint aCount, 
         RPointerArray<CFSMailMessage>& aMessages)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	// call plugin iterator
 	TBool ret = iIterator->NextL(aStartWith,aCount,aMessages);
@@ -120,8 +127,9 @@
         TUint aCount, 
         RPointerArray<CFSMailMessage>& aMessages)
 	{
-    FUNC_LOG;
-		// call plugin iterator
+    NM_FUNCTION;
+    
+	// call plugin iterator
 	TBool ret = iIterator->PreviousL(aCurrentMessageId,aCount,aMessages);
 		
 	return ret;
@@ -136,7 +144,7 @@
         TUint aCount, 
         RPointerArray<CFSMailMessage>& aMessages)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	// call plugin iterator
 	TBool ret = iIterator->PreviousL(aStartWith,aCount,aMessages);
--- a/emailservices/emailcommon/src/CFSMailMessage.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailMessage.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -16,6 +16,7 @@
 */
 
 #include "emailtrace.h"
+
 #include <apgcli.h>
 #include <apmrec.h>
 #include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroy
@@ -39,7 +40,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessage * CFSMailMessage::NewLC(TFSMailMsgId aMessageId)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
   	CFSMailMessage* message = new (ELeave) CFSMailMessage();
   	CleanupStack:: PushL(message);
   	message->ConstructL( aMessageId );
@@ -51,7 +53,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessage * CFSMailMessage::NewL(TFSMailMsgId aMessageId)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
   	CFSMailMessage* message =  CFSMailMessage::NewLC(aMessageId);
   	CleanupStack:: Pop(message);
   	return message;
@@ -63,7 +66,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessage* CFSMailMessage::NewL( const NmMessage &aMessage )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailMessage* self = new (ELeave) CFSMailMessage();
     CleanupStack::PushL(self);
     self->ConstructL(aMessage);
@@ -77,7 +81,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailMessage::ConstructL( TFSMailMsgId aMessageId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     // Base class initialization
     CFSMailMessagePart::ConstructL( aMessageId, TFSMailMsgId() );
@@ -90,7 +95,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailMessage::ConstructL( const NmMessage &aMessage )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // Base class initialization
     
     CFSMailMessagePart::ConstructL( aMessage, aMessage.envelope() );
@@ -102,7 +108,7 @@
 // -----------------------------------------------------------------------------
 CFSMailMessage::CFSMailMessage() : CFSMailMessagePart()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -110,7 +116,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessage::~CFSMailMessage()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iMessageBufferForAsyncOp.Reset();
 // </qmail>
@@ -121,7 +128,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessage::SaveMessageL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
 		{
 		plugin->StoreMessageL(GetMailBoxId(),*this);
@@ -134,7 +142,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TInt CFSMailMessage::SaveMessageL( MFSMailRequestObserver& aOperationObserver )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId());
     TFSPendingRequest request = iRequestHandler->InitAsyncRequestL(
@@ -160,7 +168,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TInt CFSMailMessage::SaveMessagePartsL( MFSMailRequestObserver& aOperationObserver )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     RPointerArray<CFSMailMessagePart> messageParts;
     CleanupResetAndDestroyPushL(messageParts);
@@ -208,7 +216,7 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessage::AddNewAttachmentL( RFile& aFile,
                                                                 const TDesC8& aMimeType )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
     CFSMailMessagePart* newPart = NULL;
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
@@ -259,7 +267,7 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessage::AddNewAttachmentL(	const TDesC& aFilePath,
 																const TFSMailMsgId /*aInsertBefore*/ )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	CFSMailMessagePart* newPart = NULL;
 	
@@ -304,7 +312,8 @@
 EXPORT_C TInt CFSMailMessage::AddNewAttachmentL( const TDesC& aFilePath,
                                                  MFSMailRequestObserver& aOperationObserver)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TFSPendingRequest request;
   
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
@@ -358,7 +367,8 @@
 EXPORT_C void CFSMailMessage::AttachmentListL(
     RPointerArray<CFSMailMessagePart>& aParts )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // First list all message parts
     AppendAttachmentsL( aParts ); 
 
@@ -420,7 +430,8 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessage::PlainTextBodyPartL(
         TFSMailMessagePartDataSource aDataSource)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailMessagePart* part = FindBodyPartL(KFSMailContentTypeTextPlain, aDataSource);
     
     // special case, single part content type is not given
@@ -442,7 +453,8 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessage::HtmlBodyPartL(
         TFSMailMessagePartDataSource aDataSource)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailMessagePart* part = FindBodyPartL(KFSMailContentTypeTextHtml, aDataSource);
     iMessageParts.ResetAndDestroy();
 	iReadMessageParts = ETrue;
@@ -456,7 +468,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailMessage::IsMessageL() const
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return CFSMailMessagePart::IsMessageL();
 	}
 // </qmail>
@@ -466,7 +479,8 @@
 // -----------------------------------------------------------------------------
 CDesCArray& CFSMailMessage::ContentTypeParameters()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
    CDesCArray* faked = NULL;
    return *faked;
 }
@@ -476,7 +490,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailMessage::DoAttachmentListL( RPointerArray<CFSMailMessagePart>& aParts )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     AttachmentListL(aParts);
     }
 
@@ -487,6 +502,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C NmMessage* CFSMailMessage::GetNmMessage()
 {
+    NM_FUNCTION;
+    
 	NmMessage* message = new NmMessage(iNmPrivateMessageEnvelope, iNmPrivateMessagePart);
 	return message;
 }
--- a/emailservices/emailcommon/src/CFSMailMessageBase.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailMessageBase.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,10 +15,10 @@
 *
 */
 
+#include "emailtrace.h"
 
 //<cmail>
 #include "CFSMailRequestHandler.h"
-#include "emailtrace.h"
 #include "CFSMailMessageBase.h"
 #include "cmailmessageext.h"
 //</cmail>
@@ -35,7 +35,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessageBase * CFSMailMessageBase::NewLC( TFSMailMsgId aMessageId )
 {
-  FUNC_LOG;
+  NM_FUNCTION;
+  
   CFSMailMessageBase* message = new (ELeave) CFSMailMessageBase();
   CleanupStack:: PushL(message);
   message->ConstructL(aMessageId);
@@ -47,7 +48,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessageBase * CFSMailMessageBase::NewL( TFSMailMsgId aMessageId )
 {
-  FUNC_LOG;
+  NM_FUNCTION;
+  
   CFSMailMessageBase* message =  CFSMailMessageBase::NewLC(aMessageId);
   CleanupStack:: Pop(message);
   return message;
@@ -58,7 +60,8 @@
 // -----------------------------------------------------------------------------
 CFSMailMessageBase::CFSMailMessageBase(): iSender(NULL)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail> unnecessary member initialization removed: iSubject, iFlags </qmail>
   	// set request handler pointer
 	iRequestHandler = static_cast<CFSMailRequestHandler*>(Dll::Tls());
@@ -69,7 +72,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::ConstructL( TFSMailMsgId aMessageId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     // Construction of shared data object
     iNmPrivateMessageEnvelope = new NmMessageEnvelopePrivate();
@@ -92,7 +96,7 @@
 EXPORT_C void CFSMailMessageBase::ConstructL(
     const NmMessageEnvelope &aMessageEnvelope )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     iNmPrivateMessageEnvelope = aMessageEnvelope.d;
 }
@@ -103,7 +107,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessageBase::~CFSMailMessageBase()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(iSender)
 		{
 		delete iSender;
@@ -117,7 +122,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailMessageBase::GetMessageId(  ) const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     //For message  
     TFSMailMsgId id = TFSMailMsgId(iNmPrivateMessageEnvelope->mMessageId);
@@ -137,6 +143,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::SetMessageId( const TFSMailMsgId aMessageId )
 {
+    NM_FUNCTION;
+    
     // typedef long int TInt32 -> typedef unsigned int quint32
     iNmPrivateMessageEnvelope->mMessageId.setId32( aMessageId.Id() );
 
@@ -151,7 +159,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailMessageBase::GetFolderId( ) const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return TFSMailMsgId(iNmPrivateMessageEnvelope->mFolderId);
 // </qmail>
@@ -162,7 +171,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::SetFolderId( const TFSMailMsgId aFolderId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->mFolderId = NmConverter::mailMsgIdToNmId(aFolderId);
 // </qmail>
@@ -173,7 +183,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailMessageBase::GetMailBoxId( ) const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return NmId(iNmPrivateMessageEnvelope->mMailboxId);
 // </qmail>
@@ -184,7 +195,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::SetMailBoxId( const TFSMailMsgId aMailBoxId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->mMailboxId = NmConverter::mailMsgIdToNmId(aMailBoxId);
 // </qmail>
@@ -195,7 +207,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::SetSender(CFSMailAddress* aSender)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
 	// store sender
 	if (iSender)
@@ -213,7 +226,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailAddress* CFSMailMessageBase::GetSender() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return iSender;
 }
 
@@ -223,7 +237,8 @@
 EXPORT_C RPointerArray<CFSMailAddress> CFSMailMessageBase::GetToRecipients()
 {
 // <qmail>
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return NmConverter::toRPointerArray(
         iNmPrivateMessageEnvelope->mToRecipients);
 // </qmail>
@@ -235,7 +250,8 @@
 EXPORT_C RPointerArray<CFSMailAddress> CFSMailMessageBase::GetCCRecipients()
 {
 // <qmail>
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return NmConverter::toRPointerArray(
         iNmPrivateMessageEnvelope->mCcRecipients);
 // </qmail>
@@ -247,7 +263,8 @@
 EXPORT_C RPointerArray<CFSMailAddress> CFSMailMessageBase::GetBCCRecipients()
 {
 // <qmail>
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return NmConverter::toRPointerArray(
         iNmPrivateMessageEnvelope->mBccRecipients);
 // </qmail>
@@ -258,7 +275,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::AppendToRecipient(CFSMailAddress* aRecipient)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->mToRecipients.append(
         aRecipient->GetNmAddress());
@@ -270,7 +288,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::AppendCCRecipient(CFSMailAddress* aRecipient )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->mCcRecipients.append(
         aRecipient->GetNmAddress());
@@ -282,7 +301,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::AppendBCCRecipient( CFSMailAddress* aRecipient )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->mBccRecipients.append(
         aRecipient->GetNmAddress());
@@ -294,7 +314,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::ClearToRecipients( )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->mToRecipients.clear();
 // </qmail>
@@ -305,7 +326,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::ClearCcRecipients( )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->mCcRecipients.clear();
 // </qmail>
@@ -316,7 +338,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::ClearBccRecipients( )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->mBccRecipients.clear();
 // </qmail>
@@ -328,7 +351,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TDesC& CFSMailMessageBase::GetSubject() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iSubjectPtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateMessageEnvelope->mSubject.utf16()),
         iNmPrivateMessageEnvelope->mSubject.length());
@@ -341,7 +365,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TTime CFSMailMessageBase::GetDate() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return NmConverter::toTTime(iNmPrivateMessageEnvelope->mSentTime);
 // </qmail>
@@ -352,7 +377,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::SetDate( const TTime aDate )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->mSentTime = NmConverter::toQDateTime(aDate);
 // </qmail>
@@ -363,7 +389,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::SetSubject(const TDesC& aSubject)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     QString qtSubject = QString::fromUtf16(aSubject.Ptr(), aSubject.Length());
     iNmPrivateMessageEnvelope->mSubject = qtSubject;
@@ -375,7 +402,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TInt CFSMailMessageBase::GetFlags( ) const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     return (TInt)iNmPrivateMessageEnvelope->flags();
 // </qmail>
@@ -386,7 +414,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::SetFlag(const TInt aFlag)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->setFlags((NmMessageFlags)aFlag, true);
 // </qmail>
@@ -397,7 +426,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::ResetFlag(const TInt aFlag)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     iNmPrivateMessageEnvelope->setFlags((NmMessageFlags)aFlag, false);
 // </qmail>
@@ -408,7 +438,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailMessageBase::IsFlagSet(const TInt aFlag) const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 // <qmail>
     TBool result = EFalse;
     if (iNmPrivateMessageEnvelope->isFlagSet((NmMessageFlag)aFlag)) 
@@ -424,7 +455,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailMessageBase::IsRelatedTo() const
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return iRelatedTo;
 	}
 
@@ -433,7 +465,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::SetRelatedTo( const TFSMailMsgId aMessageId )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iRelatedTo = aMessageId;
 	}
 
@@ -442,7 +475,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::SetReplyToAddress(CFSMailAddress* aReplyToAddress)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// store sender
 	if (iReplyTo)
 		{
@@ -457,12 +491,15 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const CFSMailAddress& CFSMailMessageBase::GetReplyToAddress()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return *iReplyTo;
 }
 
 EXPORT_C CFSMailRequestHandler& CFSMailMessageBase::RequestHandler( )
 {
+    NM_FUNCTION;
+    
 	return *iRequestHandler;
 }
 
@@ -472,7 +509,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C NmMessageEnvelope* CFSMailMessageBase::GetNmMessageEnvelope()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return new NmMessageEnvelope(iNmPrivateMessageEnvelope);
 }
 // </qmail>
@@ -482,7 +520,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessageBase::ReleaseExtension( CEmailExtension* aExtension )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(
 		iNmPrivateMessageEnvelope->mMessageId ) )
         {
@@ -501,7 +540,8 @@
 EXPORT_C CEmailExtension* CFSMailMessageBase::ExtensionL( 
     const TUid& aInterfaceUid )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CEmailExtension* ext = CExtendableEmail::ExtensionL( aInterfaceUid );
     // didn't find already created instance, try now
     if ( !ext )
--- a/emailservices/emailcommon/src/CFSMailMessagePart.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailMessagePart.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 //<qmail>
 #include <nmcommonheaders.h>
 //</qmail>
 
-#include "emailtrace.h"
 #include <apgcli.h>
 #include <apmrec.h>
 #include <mmf/common/mmfcontrollerpluginresolver.h> // CleanupResetAndDestroy
@@ -44,11 +45,12 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewLC( TFSMailMsgId aMessageId,
 														TFSMailMsgId aMessagePartId )
 {
-    FUNC_LOG;
-  CFSMailMessagePart* adr = new (ELeave) CFSMailMessagePart();
-  CleanupStack::PushL(adr);
-  adr->ConstructL( aMessageId, aMessagePartId );
-  return adr;
+    NM_FUNCTION;
+    
+    CFSMailMessagePart* adr = new (ELeave) CFSMailMessagePart();
+    CleanupStack::PushL(adr);
+    adr->ConstructL( aMessageId, aMessagePartId );
+    return adr;
 } 
 
 // -----------------------------------------------------------------------------
@@ -57,10 +59,11 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewL(	TFSMailMsgId aMessageId,
 														TFSMailMsgId aMessagePartId )
 {
-    FUNC_LOG;
-  CFSMailMessagePart* adr =  CFSMailMessagePart::NewLC( aMessageId, aMessagePartId );
-  CleanupStack::Pop(adr);
-  return adr;
+    NM_FUNCTION;
+    
+    CFSMailMessagePart* adr =  CFSMailMessagePart::NewLC( aMessageId, aMessagePartId );
+    CleanupStack::Pop(adr);
+    return adr;
 }
 
 //<qmail>
@@ -70,7 +73,8 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewLC(const NmId &aNmMessageId,
     const NmMessagePart& aNmMessage )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailMessagePart* self = new (ELeave) CFSMailMessagePart();
 	CleanupStack::PushL(self);
 	self->ConstructL( aNmMessageId,aNmMessage );
@@ -84,7 +88,8 @@
 void CFSMailMessagePart::ConstructL( TFSMailMsgId aMessageId,
                                      TFSMailMsgId aMessagePartId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
 	// Base class initialization
     CFSMailMessageBase::ConstructL(aMessageId);
@@ -107,7 +112,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailMessagePart::ConstructL( const NmId &aNmMessageId,const NmMessagePart& aNmMessage )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // Base class initialization
     CFSMailMessageBase::ConstructL(TFSMailMsgId(aNmMessageId));
     
@@ -129,7 +135,8 @@
     const NmMessagePart& aNmMessage,
     const NmMessageEnvelope& aNmMessageEnvelope)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     // Base class initialization
     CFSMailMessageBase::ConstructL(aNmMessageEnvelope);
     
@@ -148,7 +155,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessagePart::~CFSMailMessagePart()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail> iContentType, iContentDescription, iContentDisposition, iContentID removed </qmail>
 	if(iAttachmentName)
 	{
@@ -187,7 +195,7 @@
 // -----------------------------------------------------------------------------
 CFSMailMessagePart::CFSMailMessagePart() : CFSMailMessageBase()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 //<qmail> iContentType, iContentDescription, iContentDisposition, iContentID removed </qmail>
 	iContentClass = HBufC::New(1);
@@ -204,7 +212,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TDesC& CFSMailMessagePart::GetContentType() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     iContentTypePtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateMessagePart->mContentType.utf16()),
     		iNmPrivateMessagePart->mContentType.length());
@@ -217,7 +226,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentType(const TDesC& aContentType)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     QString qtContentType = QString::fromUtf16(aContentType.Ptr(), aContentType.Length());
     iNmPrivateMessagePart->mContentType = qtContentType;
@@ -229,7 +239,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSMailMsgId CFSMailMessagePart::GetPartId() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     return TFSMailMsgId(iNmPrivateMessagePart->mPartId);
 //</qmail>	
@@ -242,7 +253,7 @@
 EXPORT_C void CFSMailMessagePart::ChildPartsL( RPointerArray<CFSMailMessagePart>& aParts,
     TFSMailMessagePartDataSource aDataSource)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
     if (aDataSource == EDataSourceMessageStore)
         {
@@ -272,7 +283,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::ChildPartL(TFSMailMsgId aPartId)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 	CFSMailMessagePart* part = NULL;
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetMessageId()))
@@ -290,7 +301,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailMessagePart::IsMessageL() const
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	TBuf<KMaxDataTypeLength> ptr;
 //<qmail>
@@ -318,7 +329,7 @@
 EXPORT_C CFSMailMessagePart* CFSMailMessagePart::NewChildPartL( const TFSMailMsgId aInsertBefore,
 																const TDesC& aContentType )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	CFSMailMessagePart* part = NULL;
 	
@@ -335,7 +346,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::RemoveChildPartL(TFSMailMsgId aPartId)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// get plugin pointer
 	TFSMailMsgId id = GetPartId();
 	if(id.IsNullId())
@@ -357,7 +369,8 @@
 EXPORT_C TInt CFSMailMessagePart::RemoveChildPartL( TFSMailMsgId aPartId,
                                                     MFSMailRequestObserver& aOperationObserver)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TFSPendingRequest request;
     // get plugin pointer
     TFSMailMsgId id = GetPartId();
@@ -402,7 +415,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TDesC& CFSMailMessagePart::GetContentClass()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 		return *iContentClass;
 	}
 
@@ -411,7 +425,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentClass( const TDesC& aContentClass )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	// 
 	HBufC* contentClass = HBufC::New(aContentClass.Length());
@@ -435,7 +449,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TUint CFSMailMessagePart::ContentSize() const
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     return (TUint)iNmPrivateMessagePart->mSize;
 //</qmail>
@@ -446,7 +461,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentSize( TUint aContentSize )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     iNmPrivateMessagePart->mSize = quint32(aContentSize);
 //</qmail>
@@ -457,7 +473,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TDesC& CFSMailMessagePart::ContentID()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>	
     iContentIDPtr.Set(reinterpret_cast<const TUint16*> (iNmPrivateMessagePart->mContentId.utf16()),
     		iNmPrivateMessagePart->mContentId.length());
@@ -470,7 +487,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentIDL(const TDesC& aContentID)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     QString qtContentID = QString::fromUtf16(aContentID.Ptr(), aContentID.Length());
     iNmPrivateMessagePart->mContentId = qtContentID;    
@@ -484,7 +502,7 @@
 													TFSMailMsgId aInsertBefore,
 													CFSMailMessage* aMessage)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 	CFSMailMessagePart* part = NULL;
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
@@ -500,7 +518,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::RemoveContentL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 	CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId());
 	if(plugin == NULL)
@@ -529,7 +547,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::RemoveDownLoadedAttachmentsL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
         
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId());
     if(plugin == NULL)
@@ -569,7 +587,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C RFile CFSMailMessagePart::GetContentFileL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
@@ -596,7 +614,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentFromFileL(const TDesC& aFilePath)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
 		plugin->SetPartContentFromFileL(GetMailBoxId(), GetFolderId(),
@@ -609,7 +628,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::CopyContentFileL( const TDesC& aFilePath )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
 		plugin->CopyMessagePartFileL( GetMailBoxId(), GetFolderId(),
@@ -622,7 +642,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::GetContentToBufferL(TDes16& aBuffer, TUint aStartOffset)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
 		plugin->GetContentToBufferL( GetMailBoxId(), GetFolderId(), GetMessageId(),
@@ -635,7 +656,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContent( TDes16& aBuffer )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
 // <qmail>
@@ -650,7 +672,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TDesC& CFSMailMessagePart::ContentDescription()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     iContentDescriptionPtr.Set(reinterpret_cast<const TUint16*> (
             iNmPrivateMessagePart->mContentDescription.utf16()),
@@ -665,7 +688,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentDescription( const TDesC& aContentDescription )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     QString qtContentDescription = QString::fromUtf16(
             aContentDescription.Ptr(), aContentDescription.Length());
@@ -677,7 +701,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C const TDesC& CFSMailMessagePart::ContentDisposition()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
 	iContentDispositionPtr.Set(reinterpret_cast<const TUint16*> (
 	        iNmPrivateMessagePart->mContentDisposition.utf16()),
@@ -691,7 +716,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetContentDisposition( const TDesC& aContentDisposition )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     QString qtContentDisposition = QString::fromUtf16(
             aContentDisposition.Ptr(), aContentDisposition.Length());
@@ -704,7 +730,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CDesCArray& CFSMailMessagePart::ContentTypeParameters()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>	
     if (iNmPrivateMessagePart->mContentType.isNull())
 		{
@@ -801,7 +828,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CDesCArray& CFSMailMessagePart::ContentDispositionParameters()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 //<qmail>
     const TDesC& contentDisposition = ContentDisposition();
@@ -935,7 +962,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C MMRInfoObject& CFSMailMessagePart::GetMRInfo()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return *iMeetingRequest;
 }
 
@@ -944,7 +972,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailMessagePart::IsMRInfoSet()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(iMeetingRequest)
 		{
 		return ETrue;
@@ -960,7 +989,8 @@
 // -----------------------------------------------------------------------------	
 EXPORT_C void CFSMailMessagePart::SetMRInfo(MMRInfoObject* aMeetingRequest)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(iMeetingRequest)
 	{
 		delete iMeetingRequest;
@@ -973,7 +1003,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SaveL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
 		{
 		plugin->StoreMessagePartL( GetMailBoxId(), GetFolderId(), GetMessageId(), *this );		
@@ -986,7 +1017,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetAttachmentNameL(const TDesC& aFilePath)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	    // Parse file name in case full path is given
 		TPtrC name;
 		for(TInt i=0;i<aFilePath.Length();)
@@ -1057,7 +1089,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TDesC& CFSMailMessagePart::AttachmentNameL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     // Look first from Content-Type param "name"
 	TInt ptr = GetContentType().Find(KFSMailContentTypeParamName);
@@ -1109,7 +1142,7 @@
         const TDesC& aContentType, 
         TFSMailMessagePartDataSource aDataSource)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     TBuf<KMaxDataTypeLength> ptr;
     if (!iNmPrivateMessagePart->mContentType.isNull())
@@ -1216,7 +1249,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TBool CFSMailMessagePart::ContentTypeMatches( const TDesC& aContentType )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	TBuf<KMaxDataTypeLength> ptr;
 	TBool result(EFalse);
@@ -1246,7 +1279,8 @@
 EXPORT_C void CFSMailMessagePart::AppendAttachmentsL(
     RPointerArray<CFSMailMessagePart>& aParts)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetMessageId() );
     if ( plugin )
         {
@@ -1283,7 +1317,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TUint CFSMailMessagePart::FetchedContentSize() const
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     return (TUint)iNmPrivateMessagePart->mFetchedSize;
 //</qmail>
@@ -1294,7 +1329,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetFetchedContentSize(TUint aContentSize)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
     iNmPrivateMessagePart->mFetchedSize = quint32(aContentSize);
 //</qmail>
@@ -1305,7 +1341,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TFSPartFetchState CFSMailMessagePart::FetchLoadState() const
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 //<qmail>
 	 if(iMessagePartsStatus != EFSDefault)
 		{
@@ -1337,7 +1374,7 @@
         										  		MFSMailRequestObserver& aOperationObserver,
         												const TUint aPreferredByteCount)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
 	TInt requestId(0);
 	if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetPartId()))
@@ -1379,7 +1416,7 @@
         							MFSMailRequestObserver& aOperationObserver,
         							const TUint aPreferredByteCount)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	TInt requestId(0);
     
@@ -1421,7 +1458,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetMessagePartsStatus(TFSPartFetchState aMessagePartStatus)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iMessagePartsStatus = aMessagePartStatus;
 	}
 
@@ -1432,7 +1470,8 @@
 																const TFSMailMsgId /*aInsertBefore*/,
 																const TDesC& aContentType )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailMessagePart* newPart = NULL;
 
     CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetMessageId() );
@@ -1464,7 +1503,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TUint CFSMailMessagePart::ReadOnlyPartSize() const
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return iReadOnlyPartSize;
 }
 
@@ -1473,7 +1513,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailMessagePart::SetReadOnlyPartSize(const TUint aReadOnlyPartSize)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     iReadOnlyPartSize = aReadOnlyPartSize;
 }
 
@@ -1482,7 +1523,7 @@
 // -----------------------------------------------------------------------------
 void CFSMailMessagePart::DoAttachmentListL( RPointerArray<CFSMailMessagePart>& /*aParts*/ )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 }
 
 //<qmail>
@@ -1491,7 +1532,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C NmMessagePart* CFSMailMessagePart::GetNmMessagePart()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return new NmMessagePart(iNmPrivateMessagePart);
 }
 //</qmail>
@@ -1502,7 +1544,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C HBufC* CFSMailMessagePart::GetLocalTextContentLC()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return NmConverter::qstringToHBufCLC(iNmPrivateMessagePart->mTextContent);
 }
 //</qmail>
--- a/emailservices/emailcommon/src/CFSMailPluginData.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailPluginData.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 // <qmail>
 #include <nmcommonheaders.h>
 // </qmail>
 
-#include "emailtrace.h"
 #include "CFSMailPluginData.h"
 
 // -----------------------------------------------------------------------------
@@ -27,8 +28,7 @@
 // -----------------------------------------------------------------------------
 CFSMailPluginData::CFSMailPluginData()
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -36,7 +36,8 @@
 // -----------------------------------------------------------------------------
 CFSMailPluginData::~CFSMailPluginData()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(iPlugin)
 		{
 		delete iPlugin;
--- a/emailservices/emailcommon/src/CFSMailRequestHandler.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailRequestHandler.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,12 +15,13 @@
 *
 */
 
+#include "emailtrace.h"
+
 // <qmail>
 // Exports removed because entire class is exported from DLL
 #include <nmcommonheaders.h>
 // </qmail>
 
-#include "emailtrace.h"
 #include "CFSMailRequestHandler.h"
 #include "CFSMailRequestObserver.h"
 
@@ -31,7 +32,7 @@
 // -----------------------------------------------------------------------------
  CFSMailRequestHandler::CFSMailRequestHandler() : iRequestId(0)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     // store pointer to TLS
     TInt err = Dll::SetTls(static_cast<TAny*>(this));
@@ -48,7 +49,8 @@
 // -----------------------------------------------------------------------------
  CFSMailRequestHandler::~CFSMailRequestHandler()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TRAP_IGNORE( CancelAllRequestsL() );
     RemoveAllRequests();
     iPendingRequests.Reset();
@@ -72,11 +74,12 @@
                                     RPointerArray<CImplementationInformation>& aPluginInfo,
                                     RPointerArray<CFSMailPlugin>& aPlugins )
 {
-    FUNC_LOG;
-  CFSMailRequestHandler* pluginHandler = new (ELeave) CFSMailRequestHandler();
-  CleanupStack:: PushL(pluginHandler);
-  pluginHandler->ConstructL( aPluginInfo, aPlugins );
-  return pluginHandler;
+    NM_FUNCTION;
+    
+    CFSMailRequestHandler* pluginHandler = new (ELeave) CFSMailRequestHandler();
+    CleanupStack:: PushL(pluginHandler);
+    pluginHandler->ConstructL( aPluginInfo, aPlugins );
+    return pluginHandler;
 } 
 
 // -----------------------------------------------------------------------------
@@ -86,11 +89,12 @@
                                     RPointerArray<CImplementationInformation>& aPluginInfo,
                                     RPointerArray<CFSMailPlugin>& aPlugins )
 {
-    FUNC_LOG;
-  CFSMailRequestHandler* pluginHandler =  
-                CFSMailRequestHandler::NewLC( aPluginInfo, aPlugins );
-  CleanupStack:: Pop(pluginHandler);
-  return pluginHandler;
+    NM_FUNCTION;
+    
+    CFSMailRequestHandler* pluginHandler =  
+        CFSMailRequestHandler::NewLC( aPluginInfo, aPlugins );
+    CleanupStack:: Pop(pluginHandler);
+    return pluginHandler;
 }
 
 // -----------------------------------------------------------------------------
@@ -100,9 +104,7 @@
                                 RPointerArray<CImplementationInformation> /*aPluginInfo*/,
                                 RPointerArray<CFSMailPlugin> /*aPlugins*/ )
 {
-    FUNC_LOG;
-
-
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -110,7 +112,7 @@
 // -----------------------------------------------------------------------------
  CFSMailPlugin* CFSMailRequestHandler::GetPluginByUid( TFSMailMsgId aObjectId )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     for(TInt i=0;i<iPluginList.Count();i++)
         {
@@ -131,7 +133,8 @@
                                                     TUid aPluginId,
                                                     MFSMailRequestObserver& aOperationObserver)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
         TFSPendingRequest newRequest;
         for(TInt i=0;i<iPendingRequests.Count();i++)
             {
@@ -161,7 +164,8 @@
 // -----------------------------------------------------------------------------
  void CFSMailRequestHandler::CompleteRequest( TInt aRequestId )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
         for(TInt i=0;i<iPendingRequests.Count();i++)
         {
         if(iPendingRequests[i].iRequestId == aRequestId)
@@ -178,7 +182,8 @@
 // -----------------------------------------------------------------------------
  void CFSMailRequestHandler::CancelRequestL( TInt aRequestId )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
         for(TInt i=0;i<iPendingRequests.Count();i++)
         {
         if(iPendingRequests[i].iRequestId == aRequestId &&
@@ -200,7 +205,8 @@
 // -----------------------------------------------------------------------------
  void CFSMailRequestHandler::CancelAllRequestsL( )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
         for(TInt i=0;i<iPendingRequests.Count();i++)
         {
             if(iPendingRequests[i].iRequestStatus == TFSPendingRequest::EFSRequestPending)
@@ -220,7 +226,7 @@
 // -----------------------------------------------------------------------------
  void CFSMailRequestHandler::AddPluginL( TUid aPluginId, CFSMailPlugin* aPlugin )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     CFSMailPluginData* pluginData = new (ELeave) CFSMailPluginData;
     pluginData->iPluginId = aPluginId;
@@ -234,7 +240,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailRequestHandler::RemoveAllRequests()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     for(TInt i=0;i<iPendingRequests.Count();i++)
         {
         delete iPendingRequests[i].iObserver;
@@ -247,7 +254,7 @@
 // -----------------------------------------------------------------------------
  RFile CFSMailRequestHandler::GetTempFileL( TFSMailMsgId aContentId, TFileName aFileName )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
     
     // get temp dir path
     if(iTempDirName == NULL)
@@ -274,7 +281,7 @@
 // -----------------------------------------------------------------------------
  void CFSMailRequestHandler::CleanTempDirL( )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     }
 
 // -----------------------------------------------------------------------------
@@ -282,7 +289,8 @@
 // -----------------------------------------------------------------------------
  TDesC& CFSMailRequestHandler::GetTempDirL( )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     return *iTempDirName;
     }
 
--- a/emailservices/emailcommon/src/CFSMailRequestObserver.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/CFSMailRequestObserver.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 // <qmail>
 #include <nmcommonheaders.h>
 // </qmail>
 
-#include "emailtrace.h"
 #include "CFSMailRequestObserver.h"
 #include "CFSMailRequestHandler.h"
 
@@ -29,8 +30,7 @@
 // -----------------------------------------------------------------------------
 CFSMailRequestObserver::CFSMailRequestObserver()
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -38,8 +38,7 @@
 // -----------------------------------------------------------------------------
 CFSMailRequestObserver::~CFSMailRequestObserver()
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
 }
 // -----------------------------------------------------------------------------
 // CFSMailRequestObserver::NewLC
@@ -47,7 +46,8 @@
 CFSMailRequestObserver* CFSMailRequestObserver::NewLC( CFSMailRequestHandler& aPluginManager,
 											 MFSMailRequestObserver& aObserver)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailRequestObserver* obs = new (ELeave) CFSMailRequestObserver();
   	CleanupStack:: PushL(obs);
   	obs->ConstructL(aPluginManager,aObserver);
@@ -60,7 +60,8 @@
 CFSMailRequestObserver* CFSMailRequestObserver::NewL( CFSMailRequestHandler& aPluginRequestHandler,
 											MFSMailRequestObserver& aObserver )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
   	CFSMailRequestObserver* obs =  CFSMailRequestObserver::NewLC(aPluginRequestHandler,aObserver);
   	CleanupStack::Pop(obs);
   	return obs;
@@ -72,7 +73,8 @@
 void CFSMailRequestObserver::ConstructL( CFSMailRequestHandler& aPluginRequestHandler,
 									MFSMailRequestObserver& aObserver )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iObserver = &aObserver;
 	iRequestHandler = &aPluginRequestHandler;
 }
@@ -82,7 +84,7 @@
 // -----------------------------------------------------------------------------
 void CFSMailRequestObserver::RequestResponseL( TFSProgress aEvent, TInt aRequestId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	if(iObserver)
 		{
@@ -102,7 +104,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailRequestObserver::SetUserObserver(MFSMailRequestObserver& aObserver)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     iObserver = &aObserver;
 	}
 	
--- a/emailservices/emailcommon/src/cemailextensionbase.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/cemailextensionbase.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,8 +15,9 @@
 *
 */
 
+#include "emailtrace.h"
+
 #include "cemailextensionbase.h"
-#include "emailtrace.h"
 
 /**
 *
@@ -29,7 +30,8 @@
     
 void Panic( TEmailFwPanic aPanic )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     User::Panic( KEmailExtensionPanic, aPanic );
     }
 
@@ -40,6 +42,7 @@
 CEmailExtension::CEmailExtension( const TUid& aUid ) : 
     iUid( TUid::Uid(aUid.iUid ) )
     {
+    NM_FUNCTION;
     }
 
 // ---------------------------------------------------------------------------
@@ -48,6 +51,7 @@
 //
 CEmailExtension::~CEmailExtension()
     {
+    NM_FUNCTION;
     }
 
 // ---------------------------------------------------------------------------
@@ -56,6 +60,8 @@
 //
 TUid CEmailExtension::Uid() const
     {
+    NM_FUNCTION;
+    
     return iUid;
     }
 
@@ -65,6 +71,8 @@
 //
 TUint CEmailExtension::DecRef()
     {
+    NM_FUNCTION;
+    
     if ( iRefCount )
         {
         iRefCount--;
@@ -78,6 +86,8 @@
 //
 void CEmailExtension::IncRef()
     {
+    NM_FUNCTION;
+    
     ++iRefCount;
     }
         
@@ -87,7 +97,8 @@
 //
 void CExtendableEmail::ReleaseExtension( CEmailExtension* aExtension )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if ( !aExtension->DecRef() )
         {
         iExtensions.Remove( aExtension );
@@ -101,7 +112,8 @@
 //
 CEmailExtension* CExtendableEmail::ExtensionL( const TUid& aInterfaceUid )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TInt index = iExtensions.FindExtension( aInterfaceUid );
     CEmailExtension* ext = NULL;
     if ( index != KErrNotFound )
@@ -119,7 +131,8 @@
 //
 CExtendableEmail::CExtendableEmail()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     }
 //</qmail>
 
@@ -129,6 +142,8 @@
 //
 TEmailExtensions::~TEmailExtensions()
     {
+    NM_FUNCTION;
+    
     iExtensions.Close();
     }
 
@@ -138,6 +153,8 @@
 //
 TEmailExtensions::TEmailExtensions() : iExtensions( 1 )
     {
+    NM_FUNCTION;
+    
     }
 
 // ---------------------------------------------------------------------------
@@ -146,6 +163,8 @@
 //
 TInt TEmailExtensions::FindExtension( const TUid& aUid ) const
     {
+    NM_FUNCTION;
+    
     TInt index = KErrNotFound;
     for ( TInt i = 0; i < iExtensions.Count(); i++ )
         {        
@@ -165,6 +184,8 @@
 //
 CEmailExtension* TEmailExtensions::Extension( const TInt aIndex ) const
     {
+    NM_FUNCTION;
+    
     __ASSERT_ALWAYS( aIndex>=0 && aIndex < iExtensions.Count(),
         Panic( EEmailExtensionIndexOutOfRange ) );
     return iExtensions[aIndex];
@@ -176,7 +197,8 @@
 //
 void TEmailExtensions::AddL( CEmailExtension* aExtension )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if ( !aExtension )
         {
         User::Leave( KErrArgument );
@@ -194,7 +216,8 @@
 void TEmailExtensions::Remove( 
     const CEmailExtension* aExtension )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     const TInt index( FindExtension( aExtension->Uid() ) );
     if ( index != KErrNotFound )    
         {
--- a/emailservices/emailcommon/src/emailcalendarinfoimpl.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/emailcalendarinfoimpl.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -16,6 +16,7 @@
 */
 
 #include "emailtrace.h"
+
 #include "cmrcalendarinfoimpl.h"          
 
 // ---------------------------------------------------------------------------
@@ -24,6 +25,7 @@
 //
 CMRCalendarInfo::CMRCalendarInfo( const TUid& aUid ) : CEmailExtension( aUid )
     {
+    NM_FUNCTION;
     }
 
 // ---------------------------------------------------------------------------
@@ -33,6 +35,8 @@
 CMRCalendarInfoImpl::CMRCalendarInfoImpl() : 
     CMRCalendarInfo( KMailboxExtMrCalInfo )
     {
+    NM_FUNCTION;
+    
     iDatabaseId = MAKE_TINT64(0,0);
     }
 
@@ -42,7 +46,7 @@
 //
 CMRCalendarInfoImpl::~CMRCalendarInfoImpl()
     {
-    FUNC_LOG
+    NM_FUNCTION;
     }
 
 // ---------------------------------------------------------------------------
@@ -51,7 +55,8 @@
 //
 void CMRCalendarInfoImpl::GetCalendarDatabaseIdL( TCalFileId& aId ) const
     {
-    FUNC_LOG
+    NM_FUNCTION;
+    
     aId = iDatabaseId;
     }
     
@@ -61,7 +66,8 @@
 //
 void CMRCalendarInfoImpl::SetCalendarDatabaseIdL( const TCalFileId& aId )
     {
-    FUNC_LOG
+    NM_FUNCTION;
+    
     iDatabaseId = aId;
     }
 
--- a/emailservices/emailcommon/src/nmconverter.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailcommon/src/nmconverter.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
 *
 */
 
+#include "emailtrace.h"
+
 #include "nmconverter.h"
 
 /*!
@@ -22,6 +24,8 @@
  */
 EXPORT_C NmMailSortCriteria NmConverter::FSMailSortCriteria2NM(TFSMailSortCriteria criteria) 
 {
+    NM_FUNCTION;
+    
     NmMailSortCriteria toReturn;
 
     // setting defaults
@@ -78,6 +82,8 @@
  */
 EXPORT_C QString NmConverter::toQString(const TDesC& aText)
 {
+    NM_FUNCTION;
+    
     return QString::fromUtf16(aText.Ptr(), aText.Length());
 }
 
@@ -86,6 +92,8 @@
  */
 EXPORT_C QDateTime NmConverter::toQDateTime(const TTime& aTime)
 {
+    NM_FUNCTION;
+    
     QDateTime toReturn;
     TDateTime sTime = aTime.DateTime();
 
@@ -106,6 +114,8 @@
  */
 EXPORT_C TTime NmConverter::toTTime(const QDateTime &aTime)
 {
+    NM_FUNCTION;
+    
     QDate qDate = aTime.date();
     QTime qTime = aTime.time();
 
@@ -120,6 +130,8 @@
  */
 EXPORT_C TFSMailSortCriteria NmConverter::NMMailSortCriteria2FS(NmMailSortCriteria criteria)
 {
+    NM_FUNCTION;
+    
     TFSMailSortCriteria toReturn;
 
     // setting defaults
@@ -176,6 +188,8 @@
  */
 EXPORT_C NmId NmConverter::mailMsgIdToNmId(const TFSMailMsgId aId)
 {
+    NM_FUNCTION;
+    
     NmId id;
     id.setId32( aId.Id() );
     id.setPluginId32( aId.PluginId().iUid );
@@ -188,6 +202,8 @@
  */
 EXPORT_C TFSMailMsgId NmConverter::nmIdToMailMsgId(const NmId aId)
 {
+    NM_FUNCTION;
+    
     TFSMailMsgId id( aId.pluginId32(), aId.id32() );
     return id;
 }
@@ -197,6 +213,8 @@
  */
 EXPORT_C HBufC* NmConverter::qstringToHBufCLC( const QString &string )
 {
+    NM_FUNCTION;
+    
     HBufC* buf = HBufC::NewLC(string.length());    
     buf->Des().Copy( string.utf16() );
     return buf;
@@ -208,6 +226,8 @@
 EXPORT_C RPointerArray<CFSMailAddress> NmConverter::toRPointerArray(
     const QList<NmAddress> &list)
 {
+    NM_FUNCTION;
+    
     RPointerArray<CFSMailAddress> ret;
 
      for (QList<NmAddress>::const_iterator it = list.constBegin();
--- a/emailservices/emaildebug/inc/emailtrace.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emaildebug/inc/emailtrace.h	Wed Jun 23 17:00:39 2010 +0100
@@ -1,309 +1,192 @@
 /*
-* 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:  Header file describing trace utilities for commonemail
-*
-*/
+ * Copyright (c) 2010 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:
+ *
+ */
 
 #ifndef EMAILTRACE_H
 #define EMAILTRACE_H
 
-#include "emailtraceconfig.hrh"
+#include <e32debug.h>
+#include <qdebug.h>
+#include <qfile.h>
 
-#ifdef TRACE_INTO_FILE
-#include <flogger.h> // RFileLogger
-#else
-#include <e32debug.h> // RDebug
-#endif
+/*
+ * The macros COMMENT_TRACES, ERROR_TRACES, and FUNCTION_TRACES control which
+ * trace messages are printed. The trace message logging is controlled with
+ * the LOG_TO_FILE macro, whereas the LOG_FILE macro defines which file is to
+ * be used in logging. The print_trace() helper function implements printing.
+ * If LOG_TO_FILE is zero or the LOG_FILE cannot be opened, the messages are
+ * printed to qDebug().
+ */
+#if defined(DEBUG) || defined(_DEBUG)
 
-/**
-* Constants
-*/
-#ifdef TRACE_INTO_FILE
+#define COMMENT_TRACES  1
+#define ERROR_TRACES    1
+#define FUNCTION_TRACES 1
+
+#if COMMENT_TRACES || ERROR_TRACES || FUNCTION_TRACES
+
+#define LOG_TO_FILE     0
+#define LOG_FILE        "c:/logs/nmail_trace.log"
 
-    _LIT(  KEmailDir, "email" );
-    _LIT(  KEmailTraceFile, "email.txt" );
+inline void print_trace(const QString& msg)
+{
+    QFile out(LOG_FILE);
+    if (LOG_TO_FILE && out.open(QIODevice::Append | QIODevice::Text)) {
+        QDebug(&out) << "[Nmail]" << msg;
+        out.putChar('\n');
+        out.close();
+    } else {
+        qDebug() << "[Nmail]" << msg;
+    }
+}
 
 #endif
 
-//-----------------------------------------------------------------------------
-// Error trace macros
-//-----------------------------------------------------------------------------
-//
-#ifdef ERROR_TRACE
-
-    /**
-    * Error trace definitions. Does not automatically log the error code!
-    */
-    #ifdef TRACE_INTO_FILE
+#endif /* DEBUG */
 
-        #define ERROR( aErr, aMsg )\
-            {\
-            if( aErr != KErrNone )\
-                {\
-                _LIT( KMsg, aMsg );\
-                RFileLogger::Write(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KMsg );\
-                }\
-            }
-        #define ERROR_1( aErr, aMsg, aP1 )\
-            {\
-            if( aErr != KErrNone )\
-                {\
-                _LIT( KMsg, aMsg );\
-                RFileLogger::WriteFormat(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KMsg, aP1 );\
-                }\
-            }
-        #define ERROR_2( aErr, aMsg, aP1, aP2 )\
-            {\
-            if( aErr != KErrNone )\
-                {\
-                _LIT( KMsg, aMsg );\
-                RFileLogger::WriteFormat(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KMsg, aP1, aP2 );\
-                }\
-            }
-        #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\
-            {\
-            if( aErr != KErrNone )\
-                {\
-                _LIT( KMsg, aMsg );\
-                RFileLogger::WriteFormat(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KMsg, aP1, aP2, aP3 );\
-                }\
-            }
-        #define ERROR_GEN( aMsg ) ERROR( KErrGeneral, aMsg )
-        #define ERROR_GEN_1( aMsg, aP1 ) ERROR_1( KErrGeneral, aMsg, aP1 )
-
-    #else//TRACE_INTO_FILE not defined
+/*
+ * The function NM_COMMENT() prints a trace message. The INFO macros and the
+ * NMLOG macro are provided for legacy compatibility. They are deprecated and
+ * should not be used. If sprintf() type of formatting is desired, consider
+ * using QString::arg() or QTextStream.
+ */
+#if COMMENT_TRACES
 
-        #define ERROR( aErr, aMsg )\
-            {\
-            if( aErr != KErrNone )\
-                {\
-                _LIT( KMsg, aMsg ); RDebug::Print( KMsg );\
-                }\
-            }
-        #define ERROR_1( aErr, aMsg, aP1 )\
-            {\
-            if( aErr != KErrNone )\
-                {\
-                _LIT( KMsg, aMsg ); RDebug::Print( KMsg, aP1 );\
-                }\
-            }
-        #define ERROR_2( aErr, aMsg, aP1, aP2 )\
-            {\
-            if( aErr != KErrNone )\
-                {\
-                _LIT( KMsg, aMsg ); RDebug::Print( KMsg, aP1, aP2 );\
-                }\
-            }
-        #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\
-            {\
-            if( aErr != KErrNone )\
-                {\
-                _LIT( KMsg, aMsg ); RDebug::Print( KMsg, aP1, aP2, aP3 );\
-                }\
-            }
-        #define ERROR_GEN( aMsg ) ERROR( KErrGeneral, aMsg )
-        #define ERROR_GEN_1( aMsg, aP1 ) ERROR_1( KErrGeneral, aMsg, aP1 )
-
-    #endif//TRACE_INTO_FILE
-
-#else//ERROR_TRACE not defined
+inline void NM_COMMENT(const QString& msg)
+{
+    print_trace("COMMENT : " + msg);
+}
+#define INFO(msg) NM_COMMENT(msg)
+#define INFO_1(msg,arg1)\
+do {\
+    QString __msg;\
+    __msg.sprintf(msg,arg1);\
+    NM_COMMENT(__msg);\
+} while (0)
+#define INFO_2(msg,arg1,arg2)\
+do {\
+    QString __msg;\
+    __msg.sprintf(msg,arg1,arg2);\
+    NM_COMMENT(__msg);\
+} while (0)
+#define INFO_3(msg,arg1,arg2,arg3)\
+do {\
+    QString __msg;\
+    __msg.sprintf(msg,arg1,arg2,arg3);\
+    NM_COMMENT(__msg);\
+} while (0)
+#define NMLOG(msg) NM_COMMENT(msg)
 
-    #define ERROR( aErr, aMsg )
-    #define ERROR_1( aErr, aMsg, aP1 )
-    #define ERROR_2( aErr, aMsg, aP1, aP2 )
-    #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )
-    #define ERROR_GEN( aMsg )
-    #define ERROR_GEN_1( aMsg, aP1 )
-
-#endif//ERROR_TRACE
+#else
 
-//-----------------------------------------------------------------------------
-// Info trace macros
-//-----------------------------------------------------------------------------
-//
-#ifdef INFO_TRACE
-
-    /**
-    * Info log message definitions.
-    */
-    #ifdef TRACE_INTO_FILE
+#define NM_COMMENT(msg)
+#define INFO(msg)
+#define INFO_1(msg,arg1)
+#define INFO_2(msg,arg1,arg2)
+#define INFO_3(msg,arg1,arg2,arg3)
+#define NMLOG(msg)
 
-        #define INFO( aMsg )\
-            {\
-            _LIT( KMsg, aMsg );\
-            RFileLogger::Write(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KMsg );\
-            }
-        #define INFO_1( aMsg, aP1 )\
-            {\
-            _LIT( KMsg, aMsg );\
-            RFileLogger::WriteFormat(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KMsg, aP1 );\
-            }
-        #define INFO_2( aMsg, aP1, aP2 )\
-            {\
-            _LIT( KMsg, aMsg );\
-            RFileLogger::WriteFormat(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KMsg, aP1, aP2 );\
-            }
-        #define INFO_3( aMsg, aP1, aP2, aP3 )\
-            {\
-            _LIT( KMsg, aMsg );\
-            RFileLogger::WriteFormat(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KMsg, aP1, aP2, aP3 );\
-            }
+#endif /* COMMENT_TRACES */
 
-    #else//TRACE_INTO_FILE not defined
+/*
+ * The function NM_ERROR() prints its second argument if the first argument
+ * is non-zero. The ERROR macros are provided for legacy compatibility. They
+ * are deprecated and should not be used. If sprintf() type of formatting is
+ * desired, consider using QString::arg() or QTextStream.
+ */
+#if ERROR_TRACES
 
-        #define INFO( aMsg )\
-            {\
-            _LIT( KMsg, aMsg ); RDebug::Print( KMsg );\
-            }
-        #define INFO_1( aMsg, aP1 )\
-            {\
-            _LIT( KMsg, aMsg ); RDebug::Print( KMsg, aP1 );\
-            }
-        #define INFO_2( aMsg, aP1, aP2 )\
-            {\
-            _LIT( KMsg, aMsg ); RDebug::Print( KMsg, aP1, aP2 );\
-            }
-        #define INFO_3( aMsg, aP1, aP2, aP3 )\
-            {\
-            _LIT( KMsg, aMsg ); RDebug::Print( KMsg, aP1, aP2, aP3 );\
-            }
-
-    #endif//TRACE_INTO_FILE
-
-#else//INFO_TRACE not defined
-
-    #define INFO( aMsg )
-    #define INFO_1( aMsg, aP1 )
-    #define INFO_2( aMsg, aP1, aP2 )
-    #define INFO_3( aMsg, aP1, aP2, aP3 )
-
-#endif//INFO_TRACE
-
-//-----------------------------------------------------------------------------
-// Function trace macros
-//-----------------------------------------------------------------------------
-//
-#ifdef FUNC_TRACE
+inline void NM_ERROR(int err, const QString& msg)
+{
+    if (err) {
+        print_trace("ERROR : " + msg);
+    }
+}
+#define ERROR(err,msg) NM_ERROR(err,msg)
+#define ERROR_1(err,msg,arg1)\
+do {\
+    QString __msg;\
+    __msg.sprintf(msg,arg1);\
+    NM_ERROR(err,__msg);\
+} while (0)
+#define ERROR_2(err,msg,arg1,arg2)\
+do {\
+    QString __msg;\
+    __msg.sprintf(msg,arg1,arg2);\
+    NM_ERROR(err,__msg);\
+} while(0)
+#define ERROR_3(err,msg,arg1,arg2,arg3)\
+do {\
+    QString __msg;\
+    __msg.sprintf(msg,arg1,srg2,arg3);\
+    NM_ERROR(err,__msg);\
+} while(0)
+#define ERROR_GEN(msg) ERROR(KErrGeneral,msg)
+#define ERROR_GEN_1(msg,arg1) ERROR_1(KErrGeneral,msg,arg1)
 
-    // Constants
-    _LIT8( KEllipse, "(" );
-
-    /**
-    * Function logging definitions.
-    */
-    #ifdef TRACE_INTO_FILE
-
-        #define FUNC( aMsg, aP1 )\
-            {\
-            _LIT8( KMsg, aMsg ); RFileLogger::WriteFormat(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KMsg, aP1 );\
-            }\
-
-    #else//TRACE_INTO_FILE not defined
+#else
 
-        #define FUNC( aMsg, aP1 )\
-            {\
-            RDebug::Printf( aMsg, aP1 );\
-            }\
-
-    #endif//TRACE_INTO_FILE
+#define NM_ERROR(err,msg)
+#define ERROR(err,msg)
+#define ERROR_1(err,msg,arg1)
+#define ERROR_2(err,msg,arg1,arg2)
+#define ERROR_3(err,msg,arg1,arg2,arg3)
+#define ERROR_GEN(msg)
+#define ERROR_GEN_1(msg,arg1)
 
-    /**
-    * Function trace helper class.
-    */
-    class TFuncLog
-        {
-        public:
-            inline TFuncLog( const char* aFunc ): iFunc( (TUint8*)aFunc )
-                {
-                TInt pos = iFunc.Find( KEllipse );
-                if( pos != KErrNotFound )
-                    {
-                    iFunc.Set( iFunc.Left( iFunc.Find( KEllipse ) ) );
-                    }
-                #ifdef TRACE_INTO_FILE
+#endif /* ERROR_TRACES */
 
-                    //"CMAIL" string is added in the beginning of every trace
-                    //line for filtering purposes
-                    FUNC( "CMAIL %S <", &iFunc );
-
-                #else//TRACE_INTO_FILE notdefined
-
-                    FUNC( "CMAIL %s <", iFunc.Ptr() );
-
-                #endif//TRACE_INTO_FILE
-                }
-            inline ~TFuncLog()
-                {
-                #ifdef TRACE_INTO_FILE
-
-                    FUNC( "CMAIL %S >", &iFunc );
-
-                #else//TRACE_INTO_FILE not defined
-
-                    FUNC( "CMAIL %s >", iFunc.Ptr() );
-
-                #endif//TRACE_INTO_FILE
-                }
-            TPtrC8 iFunc;
-        };
-
-    #define FUNC_LOG TFuncLog _fl( __PRETTY_FUNCTION__ );
-
-#else//FUNC_TRACE not defined
-
-    #define FUNC_LOG
-
-#endif//FUNC_TRACE
+/*
+ * The macro NM_FUNCTION, when used inside a function body, enables tracing
+ * for a function. Trace messages with labels ENTER and RETURN are printed
+ * when entering into and returning from a function, respectively. In case of
+ * an exception or a Symbian leave, a message with label UNWIND is printed
+ * (UNWIND stands for stack unwinding). The FUNC_LOG macro is provided for
+ * legacy compatibility. It is deprecated and should not be used.
+ */
+#if FUNCTION_TRACES
 
-//-----------------------------------------------------------------------------
-// Timestamp trace macros
-//-----------------------------------------------------------------------------
-//
-#ifdef TIMESTAMP_TRACE
-
-    #ifdef TRACE_INTO_FILE
-
-        #define TIMESTAMP( aCaption )\
-            {\
-            TTime t;\
-            t.HomeTime();\
-            TDateTime dt = t.DateTime();\
-            _LIT( KMsg, aCaption );\
-            _LIT( KFormat, "[TIMESTAMP] %S %d:%02d:%02d.%d us");\
-            RFileLogger::WriteFormat(  KEmailDir,  KEmailTraceFile, EFileLoggingModeAppend, KFormat,\
-                &KMsg, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\
-            }
-
-    #else//TRACE_INTO_FILE not defined
+class __ftracer
+{
+public:
+    __ftracer(const QString& _fn)
+    : fn(_fn)
+    {
+        print_trace("ENTER : " + fn);
+    }
+    ~__ftracer()
+    {
+        if (std::uncaught_exception()) {
+            print_trace("UNWIND : " + fn);
+        } else {
+            print_trace("RETURN : " + fn);
+        }
+    }
+private:
+    QString fn;
+};
 
-        #define TIMESTAMP( aCaption )\
-            {\
-            TTime t;\
-            t.HomeTime();\
-            TDateTime dt = t.DateTime();\
-            _LIT( KMsg, aCaption );\
-            _LIT( KFormat, "[TIMESTAMP] %S %d:%02d:%02d.%d us");\
-            RDebug::Print( KFormat,\
-                &KMsg, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\
-            }
+#define NM_FUNCTION __ftracer __ft(__PRETTY_FUNCTION__)
+#define FUNC_LOG NM_FUNCTION
+
+#else
 
-    #endif//TRACE_INTO_FILE
-
-#else//TIMESTAMP_TRACE not defined
+#define NM_FUNCTION
+#define FUNC_LOG
 
-    #define TIMESTAMP( aCaption )
+#endif /* FUNCTION TRACES */
 
-#endif//TIMESTAMP_TRACE
-
-#endif // EMAILTRACE_H
+#endif /* EMAILTRACE_H */
--- a/emailservices/emaildebug/inc/emailtraceconfig.hrh	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* 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:  Configuration header file for tracing utilities in commonemail
-*
-*/
-
-
-#ifndef EMAILTRACECONFIG_HRH
-#define EMAILTRACECONFIG_HRH
-
-#ifndef __WINS__
-#ifdef _DEBUG
-#define ENABLE_TRACES
-#endif // _DEBUG
-#endif // __WINS__
-                     
-#ifdef ENABLE_TRACES                     
-/**
-* Trace definitions
-*/
-// Error trace enabled
-#define ERROR_TRACE
-
-// Info trace enabled
-#define INFO_TRACE
-
-// Function trace enabled
-#define FUNC_TRACE
-
-// Tracing into file enabled, default RDebug
-#undef TRACE_INTO_FILE
-
-#endif // ENABLE_TRACES
-
-#endif // EMAILTRACECONFIG_HRH
--- a/emailservices/emailframework/inc/CFSMailPlugin.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailframework/inc/CFSMailPlugin.h	Wed Jun 23 17:00:39 2010 +0100
@@ -529,7 +529,25 @@
      virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId,
                                         const TFSMailMsgId& aFolderId,
                                         const RArray<TFSMailMsgId>& aMessages ) = 0;
-
+     
+// <qmail>
+     /**
+      * deletes email defined by message id
+      *
+      * @param aMailBoxId id of the mailbox containing email
+      * @param aFolderId email parent folder id
+      * @param aMessages ids of messages to be deleted
+      * @param aOperationObserver Observer for the operation 
+      * @param aRequestId id of the operation
+      * @return KErrNone if this method is supported, KErrNotSupported if not
+      */
+      virtual void DeleteMessagesByUidL( const TFSMailMsgId& aMailBoxId,
+                                         const TFSMailMsgId& aFolderId,
+                                         const RArray<TFSMailMsgId>& aMessages,
+                                         MFSMailRequestObserver& aOperationObserver,
+                                         const TInt aRequestId );
+// </qmail>
+      
     /**
      * creates new email template into drafts folder
      *
--- a/emailservices/emailframework/inc/CFSMailPlugin.inl	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailframework/inc/CFSMailPlugin.inl	Wed Jun 23 17:00:39 2010 +0100
@@ -164,4 +164,16 @@
     {
     User::Leave( KErrFSMailPluginNotSupported );
     }
+
+// -----------------------------------------------------------------------------
+// CFSMailPlugin::DeleteMessagesByUidL
+// -----------------------------------------------------------------------------
+inline void CFSMailPlugin::DeleteMessagesByUidL( const TFSMailMsgId& /*aMailBoxId*/,
+                                   const TFSMailMsgId& /*aFolderId*/,
+                                   const RArray<TFSMailMsgId>& /*aMessages*/,
+                                   MFSMailRequestObserver& /*aOperationObserver*/,
+                                   const TInt /*aRequestId*/ )
+    {
+    User::Leave( KErrFSMailPluginNotSupported );
+    }
 // </qmail>
--- a/emailservices/emailframework/src/CFSFWImplementation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailframework/src/CFSFWImplementation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 //<qmail>
 #include <nmcommonheaders.h>
 //</qmail>
 
-#include "emailtrace.h"
 #include "CFSFWImplementation.h"
 //<cmail>
 #include "CFSMailPlugin.h"
@@ -32,7 +33,8 @@
 // -----------------------------------------------------------------------------
 CFSFWImplementation::CFSFWImplementation()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iPluginManager = NULL;
 }
 
@@ -41,7 +43,8 @@
 // -----------------------------------------------------------------------------
 CFSFWImplementation::~CFSFWImplementation()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	delete iPluginManager;
 }
 // -----------------------------------------------------------------------------
@@ -49,11 +52,12 @@
 // -----------------------------------------------------------------------------
 CFSFWImplementation* CFSFWImplementation::NewLC(TInt aConfiguration)
 {
-    FUNC_LOG;
-  CFSFWImplementation* impl = new (ELeave) CFSFWImplementation();
-  CleanupStack:: PushL(impl);
-  impl->ConstructL(aConfiguration);
-  return impl;
+    NM_FUNCTION;
+    
+    CFSFWImplementation* impl = new (ELeave) CFSFWImplementation();
+    CleanupStack:: PushL(impl);
+    impl->ConstructL(aConfiguration);
+    return impl;
 } 
 
 // -----------------------------------------------------------------------------
@@ -61,10 +65,11 @@
 // -----------------------------------------------------------------------------
 CFSFWImplementation* CFSFWImplementation::NewL(TInt aConfiguration)
 {
-    FUNC_LOG;
-  CFSFWImplementation* impl =  CFSFWImplementation::NewLC(aConfiguration);
-  CleanupStack:: Pop(impl);
-  return impl;
+    NM_FUNCTION;
+    
+    CFSFWImplementation* impl =  CFSFWImplementation::NewLC(aConfiguration);
+    CleanupStack:: Pop(impl);
+    return impl;
 }
 
 // -----------------------------------------------------------------------------
@@ -72,7 +77,8 @@
 // -----------------------------------------------------------------------------
 void CFSFWImplementation::ConstructL(TInt aConfiguration)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// create plugin manager
 	iPluginManager = CFSMailPluginManager::NewL(aConfiguration);
 }
@@ -82,7 +88,8 @@
 // -----------------------------------------------------------------------------
 CFSMailPluginManager& CFSFWImplementation::GetPluginManager( )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return *iPluginManager;
 }
 
--- a/emailservices/emailframework/src/CFSMailBrand.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailframework/src/CFSMailBrand.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 //<qmail>
 #include <nmcommonheaders.h>
 //</qmail>
 
-#include "emailtrace.h"
 #include <barsread.h>
 //<qmail> Commented out in Qmail
 //#include <AknIconUtils.h>
@@ -45,7 +46,8 @@
 // -----------------------------------------------------------------------------
 CFSMailBrand* CFSMailBrand::NewL( TResourceReader& aReader, TBool aIsWhiteLabel )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailBrand* brManager =  CFSMailBrand::NewLC(aReader, aIsWhiteLabel);
   	CleanupStack:: Pop(brManager);
   	return brManager;
@@ -56,7 +58,8 @@
 // -----------------------------------------------------------------------------
 CFSMailBrand* CFSMailBrand::NewLC( TResourceReader& aReader, TBool aIsWhiteLabel )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailBrand* self = new ( ELeave ) CFSMailBrand();
     CleanupStack::PushL( self );
     if ( aIsWhiteLabel )
@@ -76,7 +79,7 @@
 // -----------------------------------------------------------------------------
 void CFSMailBrand::ConstructFromCenrepL( )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
 	/*
     TBuf<KMaxStringLenFromCenrep> tBuf; // Temporary buffer
@@ -144,7 +147,7 @@
 // -----------------------------------------------------------------------------
 void CFSMailBrand::ConstructFromResourceL( TResourceReader& aReader )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     // read icon filepath
     iIconFilePath = aReader.ReadHBufCL();
@@ -206,7 +209,8 @@
 // -----------------------------------------------------------------------------
 CFSMailBrand::~CFSMailBrand()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iBrandMatchStrings.ResetAndDestroy();
 	delete iIconFilePath;
 	delete iGraphicElements;
@@ -221,7 +225,8 @@
 // -----------------------------------------------------------------------------
 CFSMailBrand::CFSMailBrand()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 		// prepare null empty descriptor
 	iEmpty = HBufC::New(1);
 	iEmpty->Des().Copy(KNullDesC());
@@ -233,7 +238,7 @@
 // -----------------------------------------------------------------------------
 TBool CFSMailBrand::IsMatching( const TDesC& aBrandId )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     TInt count = iBrandMatchStrings.Count();
     for(TInt i=0;i<count;i++)
@@ -251,7 +256,8 @@
 // -----------------------------------------------------------------------------
 TDesC& CFSMailBrand::GetText( TFSBrandElement aElementId )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TInt textCount( iTextElements->Count() );
 
     for ( TInt i( 0 ); i < textCount; i++ )
@@ -270,7 +276,8 @@
 // -----------------------------------------------------------------------------
 TInt CFSMailBrand::GetColor( TFSBrandElement aElementId, TRgb& aColor )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TInt colorCount( iColorElements->Count() );
 
     for ( TInt i( 0 ); i < colorCount; i++ )
@@ -290,7 +297,8 @@
 // -----------------------------------------------------------------------------
 CGulIcon* CFSMailBrand::GetGraphicL( TFSBrandElement aElementId )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     TInt graphicsCount( iGraphicElements->Count() );
 
     for ( TInt i( 0 ); i < graphicsCount; i++ )
@@ -340,7 +348,7 @@
 TInt CFSMailBrand::GetGraphicIdsL( TFSBrandElement aElementId,
                                    TDes& aIconIds)
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
     aIconIds.Zero();
     TInt graphicsCount( iGraphicElements->Count() );
--- a/emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailframework/src/CFSMailBrandManagerImpl.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 //<qmail>
 #include <nmcommonheaders.h>
 //</qmail>
 
-#include "emailtrace.h"
 #include <FSMAILBRANDMANAGER.rsg>
 #include <barsread.h>
 #include <bautils.h>
@@ -61,6 +62,8 @@
 #ifdef __WINS__
 LOCAL_C void RetrieveNextToken( TDes8& aContent, TDes& aToken )	
 	{
+    NM_FUNCTION;
+    
 	_LIT8( KComma, "," );
 	TInt pos = aContent.Find( KComma );
 	if ( pos != KErrNotFound ) 
@@ -80,8 +83,7 @@
     CFSMailClient& aMailClient ) :
     iMailClient( aMailClient )
 	{
-    FUNC_LOG;
-
+    NM_FUNCTION;
 	}
 
 // -----------------------------------------------------------------------------
@@ -89,7 +91,7 @@
 // -----------------------------------------------------------------------------
 void CFSMailBrandManagerImpl::ConstructL()
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     // Read resource file, get the drive letter according to the DLL drive
     TFileName dllFileName;
@@ -126,7 +128,7 @@
 // -----------------------------------------------------------------------------
 CFSMailBrandManagerImpl::~CFSMailBrandManagerImpl()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 	iResourceFile.Close();
     iFsSession.Close();
@@ -144,7 +146,8 @@
 CFSMailBrandManagerImpl* CFSMailBrandManagerImpl::NewL(
     CFSMailClient& aMailClient )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailBrandManagerImpl* self =
         CFSMailBrandManagerImpl::NewLC( aMailClient );
     CleanupStack::Pop( self );
@@ -157,7 +160,8 @@
 CFSMailBrandManagerImpl* CFSMailBrandManagerImpl::NewLC(
     CFSMailClient& aMailClient )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailBrandManagerImpl* self =
         new( ELeave ) CFSMailBrandManagerImpl( aMailClient );
     CleanupStack::PushL( self );
@@ -170,7 +174,7 @@
 // -----------------------------------------------------------------------------
 void CFSMailBrandManagerImpl::UpdateMailboxNamesL( const TFSMailMsgId aMailBoxId )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
     
     // list all mailboxes
     RPointerArray<CFSMailBox> mailBoxes;
@@ -220,7 +224,8 @@
     TFSBrandElement aElement, 
 	const TFSMailMsgId& aMailboxId )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailBox* mailBox( NULL );
 	TRAPD( mailboxError,
 	       mailBox = iMailClient.GetMailBoxByUidL( aMailboxId ) );
@@ -250,7 +255,8 @@
     TFSBrandElement aElement, 
     const TDesC& aBrandId )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     CFSMailBrand* brand = FindMatchingBrandL( aBrandId );
     if ( brand == NULL )
         {
@@ -267,7 +273,8 @@
 	const TFSMailMsgId& aMailboxId,
     TDes& aIconIds  )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailBox* mailBox( NULL );
 	TRAPD( mailboxError,
 	       mailBox = iMailClient.GetMailBoxByUidL( aMailboxId ) );
@@ -298,7 +305,7 @@
     const TDesC& aBrandId,
     TDes& aIconIds  )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
 
     CFSMailBrand* brand = FindMatchingBrandL( aBrandId );
     if ( brand == NULL )
@@ -315,7 +322,8 @@
     TFSBrandElement aElement,
     const TFSMailMsgId& aMailboxId )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailBox* mailBox( NULL );
 	TRAPD( mailboxError,
 	       mailBox = iMailClient.GetMailBoxByUidL( aMailboxId ) );
@@ -345,7 +353,7 @@
 	TFSBrandElement aElement,
 	const TDesC& aBrandId )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	CFSMailBrand* brand = FindMatchingBrandL( aBrandId );
 	if ( brand == NULL )
@@ -364,7 +372,8 @@
     const TFSMailMsgId& aMailboxId,
     TRgb& aColor )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailBox* mailBox = iMailClient.GetMailBoxByUidL( aMailboxId );
 	User::LeaveIfNull( mailBox );
     CleanupStack::PushL( mailBox );    
@@ -385,7 +394,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailBrandManagerImpl::ConstructFromResourceL( TResourceReader& aReader )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iBrands = new ( ELeave )
 				CArrayPtrSeg< CFSMailBrand >( KBrandArrayGranularity );
 						
@@ -411,7 +421,8 @@
 // -----------------------------------------------------------------------------
 CFSMailBrand* CFSMailBrandManagerImpl::FindMatchingBrandL( const TDesC& aBrandId )
     {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     if( aBrandId.Length() )
         {
         TInt brandCount( iBrands->Count() );
@@ -430,6 +441,8 @@
 CFSMailBox* CFSMailBrandManagerImpl::MailboxMatchingBrandIdL(
     const TDesC& aBrandId ) const
     {    
+    NM_FUNCTION;
+    
     RPointerArray<CFSMailBox> mailboxes;
 
     CleanupResetAndDestroyPushL( mailboxes );
@@ -471,6 +484,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailBrandManagerImpl::GetMCCValueL( TDes& aMcc ) const
     {
+    NM_FUNCTION;
+    
     aMcc.Zero();
     
     TInt err = KErrNone;
@@ -561,6 +576,8 @@
 // 
 void CFSMailBrandManagerImpl::GetMCCValueFromSIML( TDes& aMcc ) const
     {
+    NM_FUNCTION;
+    
     RTelServer telServer;
 
     CleanupClosePushL( telServer );
@@ -601,6 +618,8 @@
 // 
 TUint8 CFSMailBrandManagerImpl::GetCurrentCountryL() const
     {
+    NM_FUNCTION;
+    
     CTzLocalizer* localizer = CTzLocalizer::NewLC();
 
     CTzLocalizedCity* city = localizer->GetFrequentlyUsedZoneCityL(
@@ -627,6 +646,8 @@
 void CFSMailBrandManagerImpl::VerifyMailAccountName(
         TPtrC& aBrandedName ) const
     {
+    NM_FUNCTION;
+    
     // Due to legal reasons we don't show brand name "Gmail" in Germany and UK
     if ( !aBrandedName.CompareF( KBrandNameGmail ) )
         {
--- a/emailservices/emailframework/src/CFSMailClient.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailframework/src/CFSMailClient.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 //<qmail>
 #include <nmcommonheaders.h>
 //</qmail>
 
-#include "emailtrace.h"
 #include "CFSMailClient.h"
 #include "CFSFWImplementation.h"
 #include "CFSMailPluginManager.h"
@@ -34,7 +35,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailClient* CFSMailClient::NewLC(TInt aConfiguration)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	CFSMailClient* client = Instance();
 	if(!client)
@@ -61,10 +62,11 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailClient* CFSMailClient::NewL()
 {
-    FUNC_LOG;
-  CFSMailClient* client =  CFSMailClient::NewLC(EFSLoadPlugins);
-  CleanupStack:: Pop(client);
-  return client;
+    NM_FUNCTION;
+    
+    CFSMailClient* client =  CFSMailClient::NewLC(EFSLoadPlugins);
+    CleanupStack:: Pop(client);
+    return client;
 }
 
 // -----------------------------------------------------------------------------
@@ -72,11 +74,11 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailClient* CFSMailClient::NewL(TInt aConfiguration)
 {
-    FUNC_LOG;
-
-  CFSMailClient* client =  CFSMailClient::NewLC(aConfiguration);
-  CleanupStack:: Pop(client);
-  return client;
+    NM_FUNCTION;
+    
+    CFSMailClient* client =  CFSMailClient::NewLC(aConfiguration);
+    CleanupStack:: Pop(client);
+    return client;
 }
 
 // -----------------------------------------------------------------------------
@@ -84,7 +86,8 @@
 // -----------------------------------------------------------------------------
 void CFSMailClient::ConstructL(TInt aConfiguration)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iFWImplementation = CFSFWImplementation::NewL(aConfiguration);
 }
 
@@ -93,7 +96,8 @@
 // -----------------------------------------------------------------------------
 CFSMailClient::CFSMailClient()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// clear pointers
 	iFWImplementation = NULL;
 	iBrandManager = NULL;
@@ -105,7 +109,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailClient::~CFSMailClient()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	if(iBrandManager)
 		{
 		delete iBrandManager;
@@ -118,7 +123,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CFSMailBox* CFSMailClient::GetMailBoxByUidL(const TFSMailMsgId aMailBoxId)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// select plugin
 	CFSMailBox* mailBox = NULL;
 	CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId);
@@ -137,7 +143,8 @@
 EXPORT_C CFSMailFolder* CFSMailClient::GetFolderByUidL( const TFSMailMsgId aMailBoxId,
 													   const TFSMailMsgId aFolderId )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailFolder* folder = NULL;
 	
 	// select plugin
@@ -158,7 +165,8 @@
 														 const TFSMailMsgId aMessageId,
 														 const TFSMailDetails aDetails)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailMessage* message = NULL;
     // select plugin
     CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMessageId);
@@ -178,7 +186,8 @@
 												   const TFSMailMsgId aFolderId,
 											 	   const RArray<TFSMailMsgId>& aMessages )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aFolderId);
 	if(plugin)
 	{
@@ -192,7 +201,8 @@
 EXPORT_C TInt CFSMailClient::DeleteMailBoxByUidL( const TFSMailMsgId aMailBoxId,
  								  MFSMailRequestObserver& aOperationObserver )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// select plugin
 	CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId);
 	if(plugin)
@@ -218,7 +228,7 @@
 EXPORT_C TInt CFSMailClient::ListMailBoxes(const TFSMailMsgId aPlugin,
 											 RPointerArray<CFSMailBox>& aMailBoxes)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	RArray<TFSMailMsgId> mailBoxList;
 	mailBoxList.Reset();
@@ -311,7 +321,7 @@
         						const TFSMailMsgId aFolderId, const TFSMailDetails aDetails,
         						const RArray<TFSMailSortCriteria>& aSorting)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	MFSMailIterator* iterator = NULL;
 	MFSMailIterator* pluginIterator = NULL;
@@ -339,7 +349,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C MFSMailBrandManager& CFSMailClient::GetBrandManagerL( void )
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	if(iBrandManager == NULL)
 		{
@@ -360,7 +370,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailClient::AddObserverL(MFSMailEventObserver& aObserver)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++)
 		{
 		CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i);
@@ -376,7 +387,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailClient::RemoveObserver(MFSMailEventObserver& aObserver)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++)
 	{
 		CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i);
@@ -392,7 +404,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailClient::UnregisterRequestObserver(TInt aRequestId)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++)
 	{
 		if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByIndex(i))
@@ -409,7 +422,8 @@
 EXPORT_C void CFSMailClient::SubscribeMailboxEventsL(TFSMailMsgId aMailBoxId,
 													 	MFSMailEventObserver& aObserver)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// select plugin
 	if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId))
 		{
@@ -424,7 +438,8 @@
 EXPORT_C void CFSMailClient::UnsubscribeMailboxEvents(TFSMailMsgId aMailBoxId,
 														MFSMailEventObserver& aObserver)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	// select plugin
 	if(CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId))
 		{
@@ -438,7 +453,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TInt CFSMailClient::WizardDataAvailableL()
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 	
 	TInt ret = KErrNone;
 	for(TInt i=0;i<iFWImplementation->GetPluginManager().GetPluginCount();i++)
@@ -465,7 +480,7 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TInt CFSMailClient::AuthenticateL(MFSMailRequestObserver& aOperationObserver)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	TInt requestId(0);
 	
@@ -496,7 +511,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailClient::CleanTempDirL( )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
     iFWImplementation->GetPluginManager().CleanTempDirL();	
 	}
 
@@ -505,7 +521,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TDesC& CFSMailClient::GetTempDirL( )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return iFWImplementation->GetPluginManager().GetTempDirL();
 	}
 
@@ -514,7 +531,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailClient::CancelL( const TInt aRequestId )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iFWImplementation->GetPluginManager().CancelRequestL(aRequestId);
 	}
 
@@ -523,7 +541,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailClient::CancelAllL( )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 		iFWImplementation->GetPluginManager().CancelAllRequestsL();
 	}
 
@@ -532,7 +551,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailClient::SetMailboxName( const TFSMailMsgId aMailboxId, const TDesC& aMailboxName )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid( aMailboxId );
 	if ( plugin )
 		{
@@ -545,7 +565,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailClient::Close()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	CFSMailClient* instance = Instance();
 	if(!instance)
 	{
@@ -569,7 +590,8 @@
 // -----------------------------------------------------------------------------
 CFSMailClient* CFSMailClient::Instance()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return static_cast<CFSMailClient*>(Dll::Tls());
 }
 
@@ -578,7 +600,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C TInt CFSMailClient::IncReferenceCount()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return ++iReferenceCount;
 }
 
@@ -587,7 +610,8 @@
 // -----------------------------------------------------------------------------
 TInt CFSMailClient::DecReferenceCount()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return --iReferenceCount;
 }
 
@@ -596,6 +620,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C void CFSMailClient::ReleaseExtension( CEmailExtension* aExtension )
     {
+    NM_FUNCTION;
+    
     CExtendableEmail::ReleaseExtension( aExtension );
     }
 
@@ -604,6 +630,8 @@
 // -----------------------------------------------------------------------------
 EXPORT_C CEmailExtension* CFSMailClient::ExtensionL( const TUid& aInterfaceUid )
     {
+    NM_FUNCTION;
+    
     return CExtendableEmail::ExtensionL( aInterfaceUid );
     }
     
--- a/emailservices/emailframework/src/CFSMailEventObserver.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailframework/src/CFSMailEventObserver.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,11 +15,12 @@
 *
 */
 
+#include "emailtrace.h"
+
 //<qmail>
 #include <nmcommonheaders.h>
 //</qmail>
 
-#include "emailtrace.h"
 #include "CFSClientRequestObserver.h"
 
 // ================= MEMBER FUNCTIONS ==========================================
@@ -28,8 +29,7 @@
 // -----------------------------------------------------------------------------
 CFSClientRequestObserver::CFSClientRequestObserver()
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -37,19 +37,19 @@
 // -----------------------------------------------------------------------------
 CFSClientRequestObserver::~CFSClientRequestObserver()
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
 }
 // -----------------------------------------------------------------------------
 // CFSClientRequestObserver::NewLC
 // -----------------------------------------------------------------------------
 CFSClientRequestObserver* CFSClientRequestObserver::NewLC()
 {
-    FUNC_LOG;
-  CFSClientRequestObserver* obs = new (ELeave) CFSClientRequestObserver();
-  CleanupStack:: PushL(obs);
-  obs->ConstructL();
-  return obs;
+    NM_FUNCTION;
+    
+    CFSClientRequestObserver* obs = new (ELeave) CFSClientRequestObserver();
+    CleanupStack:: PushL(obs);
+    obs->ConstructL();
+    return obs;
 } 
 
 // -----------------------------------------------------------------------------
@@ -57,10 +57,11 @@
 // -----------------------------------------------------------------------------
 CFSClientRequestObserver* CFSClientRequestObserver::NewL()
 {
-    FUNC_LOG;
-  CFSClientRequestObserver* obs =  CFSClientRequestObserver::NewLC();
-  CleanupStack:: Pop(obs);
-  return obs;
+    NM_FUNCTION;
+    
+    CFSClientRequestObserver* obs =  CFSClientRequestObserver::NewLC();
+    CleanupStack:: Pop(obs);
+    return obs;
 }
 
 // -----------------------------------------------------------------------------
@@ -68,8 +69,7 @@
 // -----------------------------------------------------------------------------
 void CFSClientRequestObserver::ConstructL()
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -77,8 +77,7 @@
 // -----------------------------------------------------------------------------
 void CFSClientRequestObserver::ListMessagesResponse( RPointerArray<CFSMailMessage>& aMessages )
 {
-    FUNC_LOG;
-	
+    NM_FUNCTION;
 }
 
 
--- a/emailservices/emailframework/src/CFSMailPluginManager.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailframework/src/CFSMailPluginManager.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,10 +15,11 @@
 *
 */
 
+#include "emailtrace.h"
+
 //<qmail>
 #include <nmcommonheaders.h>
 //</qmail>
-#include "emailtrace.h"
 #include "CFSMailPluginManager.h"
 #include "CFSMailRequestObserver.h"
 #include "CFSMailRequestHandler.h"
@@ -29,8 +30,7 @@
 // -----------------------------------------------------------------------------
 CFSMailPluginManager::CFSMailPluginManager()
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
 }
 
 // -----------------------------------------------------------------------------
@@ -38,7 +38,8 @@
 // -----------------------------------------------------------------------------
 CFSMailPluginManager::~CFSMailPluginManager()
 {
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	iPluginInfo.ResetAndDestroy();
 }
 
@@ -48,11 +49,12 @@
 // -----------------------------------------------------------------------------
 CFSMailPluginManager* CFSMailPluginManager::NewLC(TInt aConfiguration)
 {
-    FUNC_LOG;
-  CFSMailPluginManager* pluginManager = new (ELeave) CFSMailPluginManager();
-  CleanupStack:: PushL(pluginManager);
-  pluginManager->ConstructL(aConfiguration);
-  return pluginManager;
+    NM_FUNCTION;
+    
+    CFSMailPluginManager* pluginManager = new (ELeave) CFSMailPluginManager();
+    CleanupStack:: PushL(pluginManager);
+    pluginManager->ConstructL(aConfiguration);
+    return pluginManager;
 } 
 
 // -----------------------------------------------------------------------------
@@ -60,10 +62,11 @@
 // -----------------------------------------------------------------------------
 CFSMailPluginManager* CFSMailPluginManager::NewL(TInt aConfiguration)
 {
-    FUNC_LOG;
-  CFSMailPluginManager* pluginManager =  CFSMailPluginManager::NewLC(aConfiguration);
-  CleanupStack:: Pop(pluginManager);
-  return pluginManager;
+    NM_FUNCTION;
+    
+    CFSMailPluginManager* pluginManager =  CFSMailPluginManager::NewLC(aConfiguration);
+    CleanupStack:: Pop(pluginManager);
+    return pluginManager;
 }
 
 // -----------------------------------------------------------------------------
@@ -71,7 +74,7 @@
 // -----------------------------------------------------------------------------
 void CFSMailPluginManager::ConstructL(TInt aConfiguration)
 {
-    FUNC_LOG;
+    NM_FUNCTION;
 
 	// list plugin implementations
 
@@ -110,8 +113,7 @@
 // -----------------------------------------------------------------------------
 void CFSMailPluginManager::LoadPluginL( TUid /*aPlugin*/ )
 {
-    FUNC_LOG;
-
+    NM_FUNCTION;
 }
 	
 // -----------------------------------------------------------------------------
@@ -119,7 +121,8 @@
 // -----------------------------------------------------------------------------
 CFSMailPlugin* CFSMailPluginManager::GetPluginByIndex(TUint aIndex)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return iPluginList[aIndex]->iPlugin;
 	}
 
@@ -128,7 +131,8 @@
 // -----------------------------------------------------------------------------
 TUid CFSMailPluginManager::GetPluginIdByIndex(TUint aIndex)
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return iPluginList[aIndex]->iPluginId;
 	}
 
@@ -137,7 +141,8 @@
 // -----------------------------------------------------------------------------
 TUint CFSMailPluginManager::GetPluginCount( )
 	{
-    FUNC_LOG;
+    NM_FUNCTION;
+    
 	return iPluginList.Count();
 	}
 	
--- a/emailservices/emailserver/inc/fsmailserverconst.h	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* 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 "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:  Constant definitions for FSMailServer
-*
-*/
-
-
-#ifndef FSMAILSERVERCONST_H_
-#define FSMAILSERVERCONST_H_
-
-//<cmail>
-#include "fsmailserverconst.hrh"
-//</cmail>
-
-///////////////////////////////////////////////////////////////////////////
-// Different error notes that can be shown via this notifier
-enum TFsEmailNotifierSystemMessageType
-    {
-    // Used to indicate that system message type is not set
-    // -> meant only for internal use
-    EFsEmailNotifErrUndefined = -1,
-
-    EFsEmailNotifErrCustom = 0,
-
-    // Error messages that doesn't require response
-    EFsEmailNotifErrAccountDisabled,
-    EFsEmailNotifErrPasswordExpired,
-    EFsEmailNotifErrDataDeleted,
-    EFsEmailNotifErrLoginUnsuccesfull,
-    EFsEmailNotifErrPasswordChanged,
-    EFsEmailNotifErrLoginCanceled,
-    EFsEmailNotifErrServerNotAvailable,
-    EFsEmailNotifErrNetworkNotAvailable,
-    EFsEmailNotifErrServerBusy,
-    EFsEmailNotifErrUnableToConnectToServerTryAgain,
-    EFsEmailNotifErrEmailAddrAndPwdDontMatch,
-    EFsEmailNotifErrInvalidEmailAddress,
-    EFsEmailNotifErrServerOffline,
-    EFsEmailNotifErrRoamingTurnedOn,
-    EFsEmailNotifErrRoamingCosts,
-    EFsEmailNotifErrUnableToComplete,
-    EFsEmailNotifErrConnectionError,
-    EFsEmailNotifErrUnableToConnect,
-    EFsEmailNotifErrMultipleSyncErrors,
-    EFsEmailNotifErrOutOfMemory,
-    EFsEmailNotifErrLoginFailed,
-    EFsEmailNotifErrServerNotFoundCheckSettings,
-    EFsEmailNotifErrUnableToConnectToServer,
-    EFsEmailNotifErrDisconnected,
-    EFsEmailNotifErrServerErroTryAgain,
-    
-    EFsEmailNotifErrLastNoResponse = 1000,
-
-    // Error messages that do require response (which soft key pressed)
-    EFsEmailNotifErrCustomResponse,
-    EFsEmailNotifErrSynchronizationFailed,
-
-    // Note! Not yet implemented as not currently needed.
-    // Value kept here as a placeholder for future needs.
-    EFsEmailNotifErrAuthenticatingWaitNote = 2000
-    };
-
-#endif /*FSMAILSERVERCONST_H_*/
--- a/emailservices/emailserver/inc/fsmailserverconst.hrh	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-/*
-* 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 "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:  Resource headers for project FSMailServer
-*
-*/
-
-
-#ifndef FSMAILSERVERCONST_HRH_
-#define FSMAILSERVERCONST_HRH_
-
-#define KFsEmailNotifierMailboxNameMaxLength 50
-#define KFsEmailNotifierPasswordMaxLength 50
-#define KFsEmailNotifierCustomMessageMaxLength 200
-
-#endif /*FSMAILSERVERCONST_HRH_*/
--- a/emailservices/emailservermonitor/inc/emailshutdownconst.h	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* 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:
-* Constant definitions for Email shutdown
-*
-*/
-
-#ifndef EMAILSHUTDOWNCONST_H
-#define EMAILSHUTDOWNCONST_H
-
-#include <e32cmn.h>                 // TUid
-#include "emailshutdownconst.hrh"   // KEmailShutdownUidAsTInt
-
-
-// Publish & Subscribe category for Email shutdown events
-const TUid KEmailShutdownPsCategory = { KEmailShutdownUidAsTInt };
-
-// Size of one item in platform API UID list (in Publish & Subscribe
-// key EEmailPsKeyPlatformApiAppsToClose)
-const TInt KEmailPlatformApiUidItemSize = sizeof( TInt32 );
-
-// Publish & Subscribe keys used in shutdown process
-enum TEmailShutdownPsKeys
-    {
-    // Publish & Subscribe key used in communication between Shutter
-    // application and installation initiators
-    EEmailPsKeyInstallationStatus = 1,
-    
-    // Publish & Subscribe keys for Email shutdown events
-    EEmailPsKeyShutdownClients,
-    EEmailPsKeyShutdownPlugins,
-    EEmailPsKeyShutdownMsgStore,
-    
-    // Publish & Subscribe keys to register 3rd party applications to be closed
-    EEmailPsKeyPlatformApiAppsToCloseLength,
-    EEmailPsKeyPlatformApiAppsToClose
-    };
-
-// Publish & Subscribe values to be used with key EEmailPsKeyInstallationStatus
-enum TEmailShutdownPsInstallationValues
-    {
-    // Value to be set by installation initiators when installation is starting
-    EEmailPsValueInstallationStarting = 1,
-    // Value to be set by Shutter when all services are shutdown
-    EEmailPsValueInstallationOkToStart,
-    // Value to be set by installation initiators when installation is started
-    // after EEmailPsValueInstallationOkToStart event received
-    EEmailPsValueInstallationStarted,
-    // Value to be set by Starter when installation has finished
-    EEmailPsValueInstallationFinished
-    };
-
-// Executable name of the process that implements the shutdown functionality
-_LIT( KEmailShutdownHandlerExe, "emailservermonitor.exe" );
-
-// Command line arguments that can be given to shutdown handler process when
-// starting it
-
-// KEmailShutdownHandlerArgOnlyShutter should be used when starting the process
-// just before starting installation (if it wasn't already running)
-_LIT( KEmailShutdownHandlerArgOnlyShutter, "OnlyShutter" );
-
-// KEmailShutdownHandlerArgRestart should be given when restarting
-// the process after installation
-_LIT( KEmailShutdownHandlerArgRestart, "RestartAfterInstallation" );
-
-
-#endif // EMAILSHUTDOWNCONST_H
--- a/emailservices/emailservermonitor/inc/emailshutdownconst.hrh	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-/*
-* 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:
-* Constant definitions for Cmail shutdown
-*
-*/
-
-#ifndef EMAILSHUTDOWNCONST_HRH
-#define EMAILSHUTDOWNCONST_HRH
-
-
-// Publish & Subscribe category for Cmail shutdown events, needs to be the
-// same as UID of the process that implements the shutdown functionality
-#define KEmailShutdownUidAsTInt 0x20025FAD
-
-// Executable name of the process that implements the shutdown functionality
-#define KEmailShutdownProcessExeName emailservermonitor.exe
-
-
-#endif // EMAILSHUTDOWNCONST_HRH
--- a/emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -241,6 +241,8 @@
     __LOG_ENTER( "DeleteMessagesInChunksL" );
     TBool done=EFalse;
     TInt endIndex;
+//<qmail>
+    TInt result(KErrNone);
     if( aStartIndex + KSizeOfChunk < iMessages.Count() )
         {
             endIndex = aStartIndex + KSizeOfChunk;
@@ -260,18 +262,30 @@
         
         if ( EFalse == iImmediateDelete )
             {
-            //try to find the message in the deleted items folder.
+            //try to find the message
             CMsgStoreMessage* theMessage = NULL;
-            TRAP_IGNORE( theMessage = mailBox.FetchMessageL(
-              msgId, mailBoxInfo.iRootFolders.iFolders[EFSDeleted] ) );
-            
-            if ( NULL == theMessage )
+            theMessage = mailBox.FetchMessageL(
+                                      msgId, KMsgStoreInvalidId ) ;
+            //save parentId
+            TMsgStoreId msgParentId;
+            msgParentId =theMessage->ParentId();
+            //check if message is in deleted folder or not.
+            if ( msgParentId != mailBoxInfo.iRootFolders.iFolders[EFSDeleted] )
                 {
-                //if not in deleted items then move it there.
+            	//if not in deleted items then move it there.
                 __LOG_WRITE8_FORMAT1_INFO("Moving message 0x%X to the deleted items.", msgId );
-                mailBox.MoveMessageL(
+                TRAP(result,mailBox.MoveMessageL(
                    msgId, KMsgStoreInvalidId,
-                   mailBoxInfo.iRootFolders.iFolders[EFSDeleted] );
+                   mailBoxInfo.iRootFolders.iFolders[EFSDeleted] ));
+                if(result == KErrNone)
+                    {
+                    GetPlugin().NotifyEventL( iMailBoxId, msgId, KMsgStoreInvalidId , TFSEventMailMoved, msgParentId);
+                    }
+                else
+                    {
+                    User::Leave(result);
+                    }
+                
                 }
             else
                 {
@@ -279,13 +293,30 @@
                 __LOG_WRITE8_FORMAT1_INFO( "Deleting message 0x%X.", msgId );
 
                 delete theMessage;
-                mailBox.DeleteMessageL( msgId, iFolderId );
+                TRAP(result,mailBox.DeleteMessageL( msgId, iFolderId ));
+                if(result == KErrNone)
+                    {
+                    GetPlugin().NotifyEventL( iMailBoxId, msgId, KMsgStoreInvalidId, TFSEventMailDeleted, iFolderId );
+                    }
+                else
+                    {
+                    User::Leave(result);
+                    }
                 }
             }
         else
-            {
-            mailBox.DeleteMessageL( msgId, iFolderId );
+            {        
+            TRAP(result,mailBox.DeleteMessageL( msgId, iFolderId ));
+            if(result == KErrNone)
+                {  
+                GetPlugin().NotifyEventL( iMailBoxId, msgId, KMsgStoreInvalidId, TFSEventMailDeleted, iFolderId );
+                }
+            else
+                {
+                User::Leave(result);
+                }
             }
+//</qmail>
         }
     __LOG_EXIT;
     return done;    
--- a/emailservices/emailstore/base_plugin/src/nestedao.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailstore/base_plugin/src/nestedao.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -20,7 +20,7 @@
 //
 
 
-#include "NestedAO.h"
+#include "nestedao.h"
 #include "baseplugindelayedops.h"
 #include "baseplugindelayedopsprivate.h"
 
--- a/emailservices/emailstore/emailstore.pro	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailstore/emailstore.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -29,7 +29,8 @@
         preinstall
         
     BLD_INF_RULES.prj_exports += \
-        "rom/emailstore.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(emailstore.iby)"        
+        "rom/emailstore.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(emailstore.iby)" \
+        "sis/emailstore_stub.sis             /epoc32/data/z/system/install/emailstore_stub.sis"     
  
 }
 CONFIG += ordered
--- a/emailservices/emailstore/message_store/server/group/MessageStoreServer.mmp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailstore/message_store/server/group/MessageStoreServer.mmp	Wed Jun 23 17:00:39 2010 +0100
@@ -30,8 +30,8 @@
 CAPABILITY    CAP_CLIENT_DLL
 //<qmail>
 //VERSION       KEmailBinaryVersionNumber
+//KEmailBinaryDemandPaging
 //</qmail>
-KEmailBinaryDemandPaging
 
 MACRO DEBUG_USE_PROJECT_LOGGING_OPTIONS
 MACRO DEBUG_LOG_OPTION_ENTER
--- a/emailservices/emailstore/message_store/server/src/MessageStoreServer.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/emailstore/message_store/server/src/MessageStoreServer.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -38,7 +38,7 @@
 #include "ImsPointsecMonitor.h"
 #include "ImsPointsecObserver.h"
 #include "emailstorepskeys.h" // Support for on-the-fly upgrade
-#include "emailshutdownconst.h"
+//<qmail> removing #include "emailshutdownconst.h"
 //</cmail>
 
 // =========
@@ -318,19 +318,9 @@
     // Support for on-the-fly upgrade
     // Watch for KProperty_EmailStore_Upgrade property. When set to our UID3/SECUREID,
     // then, this server should stop.
-    RProcess process;
-	CleanupClosePushL( process ); //+process
-    TSecurityPolicy readPolicy( ECapabilityReadDeviceData );
-    TSecurityPolicy writePolicy( ECapabilityWriteDeviceData );
-    iUpgradePropertyWatcher = CPSIntPropertyWatcher::NewL( this );
-    iUpgradePropertyWatcher->StartL( KEmailShutdownPsCategory, 
-                                     EEmailPsKeyShutdownMsgStore,
-                                     KEmailShutterPsValue,
-                                     /*ETrue*/EFalse,
-                                     readPolicy,
-                                     writePolicy ); 
-    CleanupStack::PopAndDestroy(); //-process
-        
+
+    // <qmail> removed code to observe shutdown commands
+
     __LOG_EXIT
     } // end ConstructL
 
--- a/emailservices/nmailagent/inc/nmmailagent.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailagent/inc/nmmailagent.h	Wed Jun 23 17:00:39 2010 +0100
@@ -23,6 +23,8 @@
 class NmMailbox;
 class NmDataPluginFactory;
 class NmDataPluginInterface;
+class HbIndicator;
+class XQSystemToneService;
 
 class NmMailboxInfo
 {
@@ -41,6 +43,7 @@
     QList<NmId> mUnreadMailIdList;
     int mOutboxMails;
     bool mActive;
+    QDateTime mLastSeenTime;
 
     NmMailboxInfo();
 };
@@ -66,17 +69,19 @@
             NmMessageEvent event,
             const NmId &folderId,
             const QList<NmId> &messageIds,
-            const NmId& mailboxId);
+            const NmId &mailboxId);
 
     void handleSyncStateEvent(
             NmSyncState state,
             const NmOperationCompletionEvent &event);
 
-    void handleConnectionEvent(NmConnectState state, const NmId mailboxId);
+    void handleConnectionEvent(NmConnectState state, const NmId mailboxId, int errorcode);
 
     void delayedStart();
+
+    void enableAlertTone();
     
-    void enableAlertTone();
+    void indicatorActivated(const QString &type, const QVariantMap &data);
 
 private:
 
@@ -84,10 +89,18 @@
 
     bool updateUnreadCount(const NmId &mailboxId, NmMailboxInfo &mailboxInfo);
 
-    int getOutboxCount(const NmId& mailboxId);
+    int getOutboxCount(const NmId &mailboxId);
+
+    NmMailboxInfo *getMailboxByType(const QString &type);
 
-    int getIndicatorIndex();
+    int getFreeIndicatorIndex();
+    
+    int getTotalUnreadCount() const;
 
+    bool updateUnreadIndicator();
+    
+    bool updateUnreadIndicator(bool active);
+    
     bool updateIndicator(bool active,
         const NmMailboxInfo& mailboxInfo);
 
@@ -104,18 +117,25 @@
         bool active, bool refreshAlways);
 
     static QStringList pluginFolders();
-    
-    bool getMessageUnreadInfo(const NmId &folderId, 
+
+    bool getMessageUnreadInfo(const NmId &folderId,
         const NmId &messageId, const NmId &mailboxId, bool &unreadMessage);
+
+    bool playAlertTone();
+
+    void updateSendIndicator();
     
-    void playAlertTone();
-    
+    bool launchMailbox(quint64 mailboxId);
+
 private: // data
 
+    HbIndicator *mIndicator;
+    XQSystemToneService *mSystemTone;
     NmDataPluginFactory *mPluginFactory;
     QList<NmMailboxInfo*> mMailboxes;
-    bool mSendingState;
     bool mAlertToneAllowed;
+    int mLastOutboxCount;
+    bool mUnreadIndicatorActive;
 };
 
 
--- a/emailservices/nmailagent/nmailagent.pro	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailagent/nmailagent.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -49,6 +49,7 @@
     TARGET.EPOCHEAPSIZE = 0x1000 0x100000 // MAX 1MB
 
     LIBS += -ldomaincli
+    LIBS += -lxqservice
 
     TARGET.UID2 = 0x100039CE
     TARGET.UID3 = 0x2002C326
--- a/emailservices/nmailagent/src/main.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailagent/src/main.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -14,6 +14,9 @@
 * Description:
 *
 */
+
+#include "emailtrace.h"
+
 #include "nmmailagentheaders.h"
 #include "nmmailagent.h"
 #include "ssastartupwatcher.h"
@@ -31,7 +34,9 @@
 */
 static void startupCallback(int status)
 {
-    NMLOG(QString("nmailagent: startupCallback %1").arg(status));
+    NM_FUNCTION;
+    NM_COMMENT(QString("nmailagent: startupCallback(): status=%1").arg(status));
+    
     Q_UNUSED(status);
 
     // either it is an error or 'non critical startup' state has been reached
@@ -44,13 +49,15 @@
 */
 int main(int argc, char *argv[])
 {
+    NM_FUNCTION;
+    
     QCoreApplication app(argc, argv);
 
     agent = new NmMailAgent;
 
     CSSAStartupWatcher *startupWatcher = CSSAStartupWatcher::New(startupCallback);
     if (!startupWatcher) {
-        NMLOG("nmmailagent - watcher start failed");
+        NM_ERROR(1,"nmmailagent: watcher start failed");
         QTimer::singleShot(NmStartupDelay, agent, SLOT(delayedStart()));
     }
 
--- a/emailservices/nmailagent/src/nmmailagent.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailagent/src/nmmailagent.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,12 +15,21 @@
 *
 */
 
+#include <xqservicerequest.h>
+#include <email_services_api.h>
+
+#include "emailtrace.h"
 #include "nmmailagentheaders.h"
 #include "nmmailagent.h"
 
+#include <xqsystemtoneservice.h>
+
 // CONSTS
 const int NmAgentIndicatorNotSet = -1;
 const int NmAgentAlertToneTimer = 60000; // 60s
+static const QString NmMailboxIndicatorType = "com.nokia.nmail.indicatorplugin_%1/1.0";
+static const QString NmSendIndicatorName = "com.nokia.nmail.indicatorplugin.send/1.0";
+static const QString NmUnreadIndicatorName = "com.nokia.nmail.indicatorplugin.unread/1.0";
 
 
 /*!
@@ -31,6 +40,8 @@
 
 NmMailboxInfo::NmMailboxInfo()
 {
+    NM_FUNCTION;
+
     mId = 0;
     mIndicatorIndex = NmAgentIndicatorNotSet;
     mSyncState = SyncComplete;
@@ -45,11 +56,14 @@
 }
 
 NmMailAgent::NmMailAgent() :
+ mIndicator(NULL),
+ mSystemTone(NULL),
  mPluginFactory(NULL),
- mSendingState(false),
- mAlertToneAllowed(true)
+ mAlertToneAllowed(true),
+ mLastOutboxCount(0),
+ mUnreadIndicatorActive(false)
 {
-    NMLOG("NmMailAgent::NmMailAgent");
+    NM_FUNCTION;
 }
 
 /*!
@@ -57,7 +71,8 @@
 */
 void NmMailAgent::delayedStart()
 {
-	NMLOG("NmMailAgent::delayedStart");
+    NM_FUNCTION;
+
 	if (!init()) {
 		// Initialisation failed. Quit the agent.
 		QCoreApplication::exit(1);
@@ -69,13 +84,20 @@
 */
 bool NmMailAgent::init()
 {
-	NMLOG("NmMailAgent::init");
+    NM_FUNCTION;
+
     mPluginFactory = NmDataPluginFactory::instance();
     if (!mPluginFactory) {
-        NMLOG("NmMailAgent::init PluginFactory not created");
+        NM_ERROR(1,"NmMailAgent::init(): PluginFactory not created");
         return false;
     }
 
+    //mSystemTone = new XQSystemToneService();
+    
+    mIndicator = new HbIndicator();
+    connect(mIndicator,SIGNAL(userActivated(const QString &, const QVariantMap&)),
+        this, SLOT(indicatorActivated(const QString&, const QVariantMap&)));
+
     QList<QObject*> *plugins = mPluginFactory->pluginInstances();
 
     foreach (QObject *plugin, *plugins) {
@@ -95,8 +117,8 @@
 				this, SLOT(handleSyncStateEvent(NmSyncState, const NmOperationCompletionEvent&)),
 				Qt::UniqueConnection);
 
-			connect(plugin, SIGNAL(connectionEvent(NmConnectState, const NmId)),
-				this, SLOT(handleConnectionEvent(NmConnectState, const NmId)),
+			connect(plugin, SIGNAL(connectionEvent(NmConnectState, const NmId, int)),
+				this, SLOT(handleConnectionEvent(NmConnectState, const NmId, int)),
 				Qt::UniqueConnection);
     	}
     }
@@ -109,7 +131,10 @@
 
 NmMailAgent::~NmMailAgent()
 {
+    NM_FUNCTION;
+
     qDeleteAll(mMailboxes);
+    //delete mSystemTone;
     NmDataPluginFactory::releaseInstance(mPluginFactory);
 }
 
@@ -118,7 +143,8 @@
 */
 void NmMailAgent::initMailboxStatus()
 {
-    NMLOG("NmMailAgent::initMailboxStatus");
+    NM_FUNCTION;
+
     QList<NmMailbox*> mailboxes;
     QList<QObject*> *plugins = mPluginFactory->pluginInstances();
 
@@ -153,6 +179,7 @@
         }
         qDeleteAll(mailboxes);
     }
+    updateSendIndicator();
 }
 
 /*!
@@ -163,7 +190,8 @@
 */
 bool NmMailAgent::updateUnreadCount(const NmId &mailboxId, NmMailboxInfo &mailboxInfo)
 {
-    NMLOG("NmMailAgent::getUnreadCount");
+    NM_FUNCTION;
+
     int newUnreadMessages(0);
 
     NmDataPluginInterface *plugin = mPluginFactory->interfaceInstance(mailboxId);
@@ -202,8 +230,8 @@
 		// Save updated list of unread message IDs
         mailboxInfo.mUnreadMailIdList = newUnreadMessageIdList;
     }
-	NMLOG(QString("NmMailAgent::getUnreadCount count=%1 new=%2").
-	    arg(mailboxInfo.mUnreadMailIdList.count()).arg(newUnreadMessages));
+    NM_COMMENT(QString("NmMailAgent::getUnreadCount(): count=%1, new=%2").
+        arg(mailboxInfo.mUnreadMailIdList.count()).arg(newUnreadMessages));
 
     return (newUnreadMessages > 0);
 }
@@ -216,7 +244,8 @@
 */
 int NmMailAgent::getOutboxCount(const NmId &mailboxId)
 {
-    NMLOG("NmMailAgent::getOutboxCount");
+    NM_FUNCTION;
+
     int count(0);
 
     NmDataPluginInterface *plugin = mPluginFactory->interfaceInstance(mailboxId);
@@ -231,12 +260,37 @@
 		count = messageList.count();
 		qDeleteAll(messageList);
     }
-    NMLOG(QString("NmMailAgent::getOutboxCount count=%1").arg(count));
+    NM_COMMENT(QString("NmMailAgent::getOutboxCount(): count=%1").arg(count));
 
     return count;
 }
 
 /*!
+    Get list of unread counts in active mailboxes
+	\returns total number of unread mails
+*/
+int NmMailAgent::getTotalUnreadCount() const
+{
+    int unreads = 0;
+    foreach (const NmMailboxInfo *mailbox, mMailboxes) {
+        if (mailbox->mActive) {
+            unreads += mailbox->mUnreadMailIdList.count();
+        }
+    }
+    return unreads;
+}
+
+/*!
+    Update the "@" indicator state according to unread state
+    \return true if the indicator was activated
+*/
+bool NmMailAgent::updateUnreadIndicator()
+{
+    int unreads = getTotalUnreadCount();
+    return updateUnreadIndicator(unreads>0);
+}
+
+/*!
     Update the mailbox visibility and status
     \param mailboxId id of the mailbox
     \param active visibility state of the mailbox
@@ -246,14 +300,7 @@
 bool NmMailAgent::updateMailboxState(const NmId &mailboxId,
     bool active, bool refreshAlways)
 {
-    // Update the global sending state
-    mSendingState = false;
-    foreach (NmMailboxInfo *mailboxInfo, mMailboxes) {
-        if (mailboxInfo->mOutboxMails>0) {
-            mSendingState = true;
-            break;
-        }
-    }
+    NM_FUNCTION;
 
     NmMailboxInfo *mailboxInfo = getMailboxInfo(mailboxId);
     bool changed = false;
@@ -264,7 +311,7 @@
         if (active) {
             // Mailbox is not yet assigned to any indicator
             if (mailboxInfo->mIndicatorIndex < 0) {
-                mailboxInfo->mIndicatorIndex = getIndicatorIndex();
+                mailboxInfo->mIndicatorIndex = getFreeIndicatorIndex();
             }
 
             updateIndicator(true,*mailboxInfo);
@@ -290,11 +337,12 @@
 bool NmMailAgent::updateIndicator(bool active,
     const NmMailboxInfo& mailboxInfo)
 {
-    NMLOG(QString("NmMailAgent::updateIndicator index=%1 active=%2").
+    NM_FUNCTION;
+    NM_COMMENT(QString("NmMailAgent::updateIndicator(): index=%1, active=%2").
         arg(mailboxInfo.mIndicatorIndex).arg(active));
 
     bool ok = false;
-    QString name = QString("com.nokia.nmail.indicatorplugin_%1/1.0").
+    QString name = QString(NmMailboxIndicatorType).
         arg(mailboxInfo.mIndicatorIndex);
 
     QList<QVariant> list;
@@ -305,15 +353,62 @@
     list.append(mailboxInfo.mConnectState);
     list.append(mailboxInfo.mOutboxMails);
     list.append(mailboxInfo.mIconName);
-    list.append(mSendingState);
+    list.append(mLastOutboxCount);
 
-    HbIndicator indicator;
     if (active) {
-        ok = indicator.activate(name,list);
+        ok = mIndicator->activate(name,list);
     }
     else {
-        ok = indicator.deactivate(name,list);
+        ok = mIndicator->deactivate(name,list);
+    }
+
+    updateUnreadIndicator();
+
+    return ok;
+}
+
+/*!
+    update the unread indicator state
+    \return true if the indicator was activated
+*/
+bool NmMailAgent::updateUnreadIndicator(bool active)
+{
+    NM_FUNCTION;
+    bool activated = false;
+
+    if (active) {
+        mIndicator->activate(NmUnreadIndicatorName);
+        if (!mUnreadIndicatorActive) {
+            activated = true;
+        }
     }
+    else {
+        mIndicator->deactivate(NmUnreadIndicatorName);
+    }
+    mUnreadIndicatorActive = active;
+    
+    return activated;
+}
+
+/*!
+    Opens inbox view to specific mailbox
+    \return true if inbox is succesfully opened
+*/
+bool NmMailAgent::launchMailbox(quint64 mailboxId)
+{
+    NM_FUNCTION;
+
+    XQServiceRequest request(
+        emailFullServiceNameMailbox,
+        emailOperationViewInbox,
+        true);
+
+    QList<QVariant> list;
+    list.append(QVariant(mailboxId));
+
+    request.setArguments(list);
+    bool ok = request.send();
+    NM_COMMENT(QString("Launch ok=%1 error=%2").arg(ok).arg(request.latestError()));
     return ok;
 }
 
@@ -321,8 +416,10 @@
     Get next free indicator index, starting from 0
     @return index of the indicator that is available
  */
-int NmMailAgent::getIndicatorIndex()
+int NmMailAgent::getFreeIndicatorIndex()
 {
+    NM_FUNCTION;
+
     int index = 0;
     bool found(false);
     do {
@@ -345,7 +442,8 @@
 */
 void NmMailAgent::handleMailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds)
 {
-    NMLOG(QString("NmMailAgent::handleMailboxEvent %1").arg(event));
+    NM_FUNCTION;
+    NM_COMMENT(QString("NmMailAgent::handleMailboxEvent(): event=%1").arg(event));
 
     switch(event) {
         case NmMailboxCreated:
@@ -381,6 +479,7 @@
                 // Will hide also the indicator
                 removeMailboxInfo(mailboxId);
             }
+            updateUnreadIndicator();
             break;
         default:
             break;
@@ -388,6 +487,47 @@
 }
 
 /*!
+   Map the type name to mailbox info
+    \return NULL if no mailbox match the type
+*/
+NmMailboxInfo *NmMailAgent::getMailboxByType(const QString &type)
+{
+    foreach (NmMailboxInfo *mailbox, mMailboxes) {
+        // mailbox is shown in indicators
+        if (mailbox->mIndicatorIndex >= 0 && mailbox->mActive) {
+            QString typeName = QString(NmMailboxIndicatorType).arg(mailbox->mIndicatorIndex);
+
+            // type names match(!)
+            if(type==typeName) {
+                return mailbox;
+            }
+        }
+    }
+    return NULL;
+}
+
+/*!
+    Called when indicator is clicked from the indicator menu
+    - indicator will be hide from the menu
+    - mailbox will be launched
+*/
+void NmMailAgent::indicatorActivated(const QString &type, const QVariantMap &data)
+{
+    NM_FUNCTION;
+    Q_UNUSED(data);
+    
+    // map the indicator type to mailbox
+    NmMailboxInfo *info = getMailboxByType(type);
+    if (info) {
+        info->mLastSeenTime = QDateTime::currentDateTime();
+        info->mActive = false; // indicator is no longer active
+        updateUnreadIndicator();
+
+        launchMailbox(info->mId.id());
+    }
+}
+
+/*!
     Received from NmFrameworkAdapter messageEvent signal
     \sa NmFrameworkAdapter
 */
@@ -397,7 +537,10 @@
             const QList<NmId> &messageIds,
             const NmId& mailboxId)
 {
-    NMLOG(QString("NmMailAgent::handleMessageEvent %1 %2").arg(event).arg(mailboxId.id()));
+    NM_FUNCTION;
+    NM_COMMENT(QString("NmMailAgent::handleMessageEvent(): event=%1, id=%2").
+        arg(event).arg(mailboxId.id()));
+
     bool updateNeeded = false;
     bool activate = false;
 
@@ -425,6 +568,12 @@
                             if (messageUnread) {
                                 mailboxInfo->mUnreadMailIdList.append(messageId);
                                 updateMailboxState(mailboxId, true, false);
+
+                                // make the "@" appear immediatelly
+                                updateUnreadIndicator(true);
+								
+                                // Play the tone as well
+                                playAlertTone();
                             }
                         }
                     }
@@ -438,9 +587,12 @@
             if (mailboxInfo->mOutboxFolderId == folderId) {
                 // The first mail created in the outbox
                 if (mailboxInfo->mOutboxMails <= 0) {
+					NM_COMMENT("NmMailAgent: first mail in outbox");
+					activate = true;
                     updateNeeded = true;
                 }
                 mailboxInfo->mOutboxMails += messageIds.count();
+				updateSendIndicator();
             }
             break;
         }
@@ -458,8 +610,8 @@
                 int oldCount = mailboxInfo->mUnreadMailIdList.count();
                 activate = updateUnreadCount(mailboxId, *mailboxInfo);
 
-                // new unread mails found or no more unread mails in the mailbox
-                if (activate || (oldCount>0 && mailboxInfo->mUnreadMailIdList.count()==0)) {
+                // new unread mails found or no more unread mails in the inbox
+                if (oldCount>0 && mailboxInfo->mUnreadMailIdList.count()==0) {
                     updateNeeded = true;
                 }
             }
@@ -483,10 +635,12 @@
 
                 // The last mail was now deleted
                 if (mailboxInfo->mOutboxMails == 0) {
+					NM_COMMENT("NmMailAgent: last mail deleted from outbox");
                     // Keep it active if there is unread mails
                     activate = mailboxInfo->mUnreadMailIdList.count() > 0;
                     updateNeeded = true;
                 }
+				updateSendIndicator();
             }
             break;
         }
@@ -495,6 +649,8 @@
     }
 
     if (updateNeeded) {
+        updateUnreadIndicator();
+
         NmMailboxInfo *mailboxInfo = getMailboxInfo(mailboxId);
         updateMailboxState(mailboxId,
             activate, true /* force refresh */);
@@ -509,7 +665,10 @@
             NmSyncState state,
             const NmOperationCompletionEvent &event)
 {
-    NMLOG(QString("NmMailAgent::handleSyncStateEvent %1 %2").arg(state).arg(event.mMailboxId.id()));
+    NM_FUNCTION;
+    NM_COMMENT(QString("NmMailAgent::handleSyncStateEvent(): state=%1, id=%2").
+        arg(state).arg(event.mMailboxId.id()));
+
     NmMailboxInfo *info = getMailboxInfo(event.mMailboxId);
     if (info) {
         info->mSyncState = state;
@@ -533,12 +692,15 @@
                 info->mOutboxMails;
 
             // Refresh the indicator if messages created or changed
-            NMLOG(QString(" created=%1, changed=%2, deleted=%3").
+            NM_COMMENT(QString("NmMailAgent::handleSyncStateEvent(): "
+                "created=%1, changed=%2, deleted=%3").
                 arg(info->mInboxCreatedMessages).
                 arg(info->mInboxChangedMessages).
                 arg(info->mInboxDeletedMessages));
             bool refresh = (info->mInboxCreatedMessages > 0) || (info->mInboxChangedMessages > 0);
 
+            updateUnreadIndicator();
+
             if (activate) {
                 updateMailboxState(event.mMailboxId, active, refresh);
             }
@@ -550,9 +712,13 @@
     Received from NmFrameworkAdapter connectionState signal
     \sa NmFrameworkAdapter
 */
-void NmMailAgent::handleConnectionEvent(NmConnectState state, const NmId mailboxId)
+void NmMailAgent::handleConnectionEvent(NmConnectState state, const NmId mailboxId, int errorcode)
 {
-    NMLOG(QString("NmMailAgent::handleConnectionEvent %1 %2").arg(state).arg(mailboxId.id()));
+    NM_FUNCTION;
+    NM_COMMENT(QString("NmMailAgent::handleConnectionEvent(): state=%1, id=%2").
+        arg(state).arg(mailboxId.id()));
+    Q_UNUSED(errorcode);
+
     NmMailboxInfo *mailboxInfo = getMailboxInfo(mailboxId);
     if (mailboxInfo) {
         // Connecting, Connected, Disconnecting, Disconnected
@@ -566,6 +732,8 @@
 */
 bool NmMailAgent::removeMailboxInfo(const NmId &id)
 {
+    NM_FUNCTION;
+
     bool found = false;
     foreach (NmMailboxInfo *mailbox, mMailboxes) {
         if (mailbox->mId == id) {
@@ -587,6 +755,8 @@
 */
 NmMailboxInfo *NmMailAgent::createMailboxInfo(const NmId &id)
 {
+    NM_FUNCTION;
+
     // get information of the mailbox
     NmMailbox *mailbox = NULL;
     NmMailboxInfo *info = NULL;
@@ -607,6 +777,8 @@
 */
 NmMailboxInfo *NmMailAgent::createMailboxInfo(const NmMailbox &mailbox, NmDataPluginInterface *plugin)
 {
+    NM_FUNCTION;
+
     NmMailboxInfo *mailboxInfo = new NmMailboxInfo();
     mailboxInfo->mId = mailbox.id();
     mailboxInfo->mName = mailbox.name();
@@ -627,15 +799,10 @@
     // Get branded mailbox icon
     NmMailbox mailbox2( mailbox );
     QString domainName = mailbox2.address().address();
-    int delimIndex = domainName.indexOf('@');
-    if( delimIndex >= 0 ) {
-        domainName = domainName.mid(delimIndex+1);
-        NMLOG(QString("Mailbox domain name: %1").arg(domainName));
-    }
     EmailMailboxInfo emailMailboxInfo;
     mailboxInfo->mIconName =
         emailMailboxInfo.mailboxIcon(domainName);
-    
+
     return mailboxInfo;
 }
 
@@ -645,6 +812,8 @@
 */
 NmMailboxInfo *NmMailAgent::getMailboxInfo(const NmId &id)
 {
+    NM_FUNCTION;
+
     foreach (NmMailboxInfo *mailbox, mMailboxes) {
         if (mailbox->mId == id) {
             return mailbox;
@@ -666,7 +835,7 @@
 bool NmMailAgent::getMessageUnreadInfo(const NmId &folderId,
     const NmId &messageId, const NmId &mailboxId, bool &unreadMessage)
 {
-    NMLOG("NmMailAgent::messageInfo");
+    NM_FUNCTION;
 
     NmDataPluginInterface *plugin = mPluginFactory->interfaceInstance(mailboxId);
     bool ok = false;
@@ -687,15 +856,23 @@
 }
 
 /*!
-    Plays email alert tune when new messages arrive
+    Plays email alert tone when new messages arrive
+	\returns true if the tone was played
 */
-void NmMailAgent::playAlertTone()
+bool NmMailAgent::playAlertTone()
 {
+    NM_FUNCTION;
+	bool played = false;
+
     if (mAlertToneAllowed) {
-        // play alert
+        //mSystemTone->playTone(XQSystemToneService::EmailAlertTone);
+        
+        // play alert only once per minute
         mAlertToneAllowed = false;
         QTimer::singleShot(NmAgentAlertToneTimer, this, SLOT(enableAlertTone()));
+		played = true;
     }
+	return played;
 }
 
 /*!
@@ -703,8 +880,34 @@
 */
 void NmMailAgent::enableAlertTone()
 {
+    NM_FUNCTION;
+
     mAlertToneAllowed = true;
 }
 
+/*!
+    update send indicator according to outbox state
+*/
+void NmMailAgent::updateSendIndicator()
+{
+    // Get number of mails in outboxes
+    int outboxMails = 0;
+    foreach (NmMailboxInfo *mailboxInfo, mMailboxes) {
+        outboxMails += mailboxInfo->mOutboxMails;
+    }
+
+    if( outboxMails == 0 ) {
+        mIndicator->deactivate(NmSendIndicatorName);
+    }
+    else if (outboxMails > mLastOutboxCount) {
+        // New mails detected in outbox
+
+    	// indicator will disappear automatically after a delay
+        mIndicator->activate(NmSendIndicatorName);
+	}
+
+	mLastOutboxCount = outboxMails;
+}
+
 // End of file
 
--- a/emailservices/nmailagent/src/ssastartupwatcher.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailagent/src/ssastartupwatcher.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -13,6 +13,8 @@
 // Description:
 //
 
+#include "emailtrace.h"
+
 #include "ssastartupwatcher.h"
 
 /*!
@@ -21,6 +23,8 @@
 */
 CSSAStartupWatcher* CSSAStartupWatcher::NewL(TStartupCallBack aCallback)
 {
+    NM_FUNCTION;
+    
 	CSSAStartupWatcher* self = new (ELeave) CSSAStartupWatcher(KDmHierarchyIdStartup, 
 	    KSM2AppServicesDomain3, aCallback);
 	CleanupStack::PushL(self);
@@ -35,6 +39,8 @@
 */
 CSSAStartupWatcher* CSSAStartupWatcher::New(TStartupCallBack aCallback)
 {
+    NM_FUNCTION;
+    
     CSSAStartupWatcher* self = NULL;
     TRAP_IGNORE( self = NewL(aCallback); );
     return self;
@@ -51,6 +57,7 @@
 : CDmDomain(aHierarchyId,aDomainId), 
   iCallback(aCallback)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -58,6 +65,8 @@
 */
 CSSAStartupWatcher::~CSSAStartupWatcher()
 {
+    NM_FUNCTION;
+    
 	Cancel();
 }
 
@@ -69,6 +78,8 @@
 */
 void CSSAStartupWatcher::ConstructL()
 {
+    NM_FUNCTION;
+    
 	// Connect to the Domain Manager
 	CDmDomain::ConstructL();
 
@@ -94,6 +105,8 @@
 */
 void CSSAStartupWatcher::NotifyState(TInt aValue) 
 {
+    NM_FUNCTION;
+    
     (*iCallback)(aValue);
 }
 
@@ -103,6 +116,8 @@
 */
 void CSSAStartupWatcher::RunL()
 {
+    NM_FUNCTION;
+    
 	// Leave if our previous request to be notified a state change has
 	// returned an error and let RunError handle this.
 	if (iStatus.Int()!=KErrNone) {
--- a/emailservices/nmailbase/inc/nmcommon.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailbase/inc/nmcommon.h	Wed Jun 23 17:00:39 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 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"
@@ -22,6 +22,9 @@
 #include <QString>
 #include <QMetaType>
 #include <QVariant>
+#include <QDateTime>
+
+#include "emailtrace.h"
 
 #define USE_POPIMAP_TESTPLUGIN
 
@@ -52,7 +55,8 @@
 {
     NmMessageCreated,
     NmMessageChanged,
-    NmMessageDeleted
+    NmMessageDeleted,
+    NmMessageFound // Search functionality related enumeration.
 };
 Q_DECLARE_METATYPE(NmMessageEvent)
 
@@ -302,52 +306,6 @@
     mPluginId = pluginId32;
 }
 
-/*!
-     static function for debug prints
- */
-#include <QDebug>
-#include <QFile>
-#include <QDateTime>
-
-static void printToFileAndConsole(QString str, QString filename)
-{    
-    // Print to file
-    QFile debugFile(filename);
-    QIODevice::OpenMode openMode = QIODevice::Text;
-    if (debugFile.exists()) {
-        openMode |= QIODevice::Append;
-    } else {
-        openMode |= QIODevice::WriteOnly;
-    }
-
-    // Create date string
-    QString d = QDateTime::currentDateTime().toString("dd.MM.yyyy hh:mm:ss");
-
-    if (debugFile.open(openMode)) {
-        QTextStream debugStream(&debugFile);
-        debugStream << d << "  " << str << endl;
-        debugFile.close();
-    }
-    // Print to console
-    qDebug() << d << str << endl; 
-}
-
-// 
-// NMLOG is used to log QStrings to text file. For example:
-//
-// NMLOG("nmailui: application opened successfully");
-//
-// QString fileName = "mailbox.xml";
-// int error = -12;
-// NMLOG(QString("### cannot open file: err=%1  file='%2' ###").arg(error).arg(fileName));
-//
-#ifdef _DEBUG
-#define NMLOG(a) { printToFileAndConsole(a, "c:/logs/nmail.log"); }
-#else
-#define NMLOG(a)
-#endif
-
-
 /*! email list sort criteria definition */
 class NmMailSortCriteria
 {
--- a/emailservices/nmailbase/src/nmaddress.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailbase/src/nmaddress.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
 *
 */
 
+#include "emailtrace.h"
+
 #include <QString>
 
 #include "nmaddress.h"
@@ -26,6 +28,7 @@
 :mDisplayName(""),
 mAddress("")
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -33,6 +36,7 @@
  */
 NmAddressPrivate::~NmAddressPrivate()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -53,6 +57,8 @@
  */
 NmAddress::NmAddress()
 {
+    NM_FUNCTION;
+    
     d = new NmAddressPrivate();
 }
 
@@ -61,6 +67,8 @@
  */
 NmAddress::NmAddress(const QString &displayName, const QString &address)
 {
+    NM_FUNCTION;
+    
     d = new NmAddressPrivate();
     d->mDisplayName = displayName;
     d->mAddress = address;
@@ -71,6 +79,8 @@
  */
 NmAddress::NmAddress(const QString &address)
 {
+    NM_FUNCTION;
+    
     d = new NmAddressPrivate();
     d->mAddress = address;
 }
@@ -80,6 +90,7 @@
  */
 NmAddress::NmAddress(const NmAddress &nmAddress) : d(nmAddress.d)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -87,6 +98,8 @@
  */
 NmAddress::NmAddress(QExplicitlySharedDataPointer<NmAddressPrivate> nmPrivateAddress)
 {
+    NM_FUNCTION;
+    
     d = nmPrivateAddress;
 }
 
@@ -95,6 +108,8 @@
  */
 NmAddress &NmAddress::operator=(const NmAddress &nmAddress)
 {
+    NM_FUNCTION;
+    
     if (this != &nmAddress) {
       d = nmAddress.d;
     }
@@ -106,6 +121,7 @@
  */
 NmAddress::~NmAddress()
 {
+    NM_FUNCTION;
 }
 
 
@@ -115,6 +131,8 @@
  */
 bool NmAddress::operator==(const NmAddress &otherAddress) const
 {
+    NM_FUNCTION;
+    
     bool ret = false;
     if (otherAddress.address().compare(d->mAddress, Qt::CaseInsensitive) == 0 &&
         otherAddress.displayName().compare(
@@ -130,6 +148,8 @@
  */
 bool NmAddress::operator!=(const NmAddress &otherAddress) const
 {
+    NM_FUNCTION;
+    
     bool ret = true;
     if (otherAddress.address().compare(d->mAddress, Qt::CaseInsensitive) == 0 &&
         otherAddress.displayName().compare(
@@ -144,6 +164,8 @@
  */
 void NmAddress::setDisplayName(const QString &displayName)
 {
+    NM_FUNCTION;
+    
     d->mDisplayName = displayName;
 }
 
@@ -152,6 +174,8 @@
  */
 QString NmAddress::displayName() const
 {
+    NM_FUNCTION;
+    
     return d->mDisplayName;
 }
 
@@ -160,6 +184,8 @@
  */
 void NmAddress::setAddress(const QString &address)
 {
+    NM_FUNCTION;
+    
     d->mAddress = address;
 }
 
@@ -168,5 +194,7 @@
  */
 QString NmAddress::address() const
 {
+    NM_FUNCTION;
+    
     return d->mAddress;
 }
--- a/emailservices/nmailbase/src/nmfolder.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailbase/src/nmfolder.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
 *
 */
 
+#include "emailtrace.h"
+
 #include "nmfolder.h"
 
 
@@ -31,10 +33,12 @@
 mSubFolderCount(0),
 mUpdated(QDateTime())
 {
+    NM_FUNCTION;
 }
 
 NmFolderPrivate::~NmFolderPrivate()
 {
+    NM_FUNCTION;
 }
 
 
@@ -49,6 +53,8 @@
 */
 NmFolder::NmFolder(NmId folderId)
 {
+    NM_FUNCTION;
+    
     d = new NmFolderPrivate();
     d->mFolderId = folderId;
 }
@@ -58,6 +64,8 @@
 */
 NmFolder::NmFolder(const NmFolder &folder)
 {
+    NM_FUNCTION;
+    
     d = folder.d;
 }
 
@@ -66,6 +74,8 @@
  */
 NmFolder::NmFolder(QExplicitlySharedDataPointer<NmFolderPrivate> folderPrivate)
 {
+    NM_FUNCTION;
+    
   d = folderPrivate;
 }
 
@@ -74,6 +84,8 @@
 */
 NmFolder &NmFolder::operator=(const NmFolder &folder)
 {
+    NM_FUNCTION;
+    
   if (this != &folder) {
     d = folder.d;
   }
@@ -85,6 +97,7 @@
 */
 NmFolder::~NmFolder()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -92,6 +105,8 @@
 */
 NmId NmFolder::folderId() const
 {
+    NM_FUNCTION;
+    
     return d->mFolderId;
 }
 
@@ -100,6 +115,8 @@
 */
 void NmFolder::setFolderId(NmId folderId)
 {
+    NM_FUNCTION;
+    
   d->mFolderId = folderId;
 }
 
@@ -108,6 +125,8 @@
 */
 NmId NmFolder::parentId() const
 {
+    NM_FUNCTION;
+    
     return d->mParentFolderId;
 }
 
@@ -116,6 +135,8 @@
 */
 void NmFolder::setParentId(NmId parentFolderId)
 {
+    NM_FUNCTION;
+    
     d->mParentFolderId = parentFolderId;
 }
 
@@ -124,6 +145,8 @@
 */
 NmId NmFolder::mailboxId() const
 {
+    NM_FUNCTION;
+    
     return d->mMailboxId;
 }
 
@@ -132,6 +155,8 @@
 */
 void NmFolder::setMailboxId(NmId mailboxId)
 {
+    NM_FUNCTION;
+    
     d->mMailboxId = mailboxId;
 }
 
@@ -140,6 +165,8 @@
 */
 QString NmFolder::name() const
 {
+    NM_FUNCTION;
+    
     return d->mName;
 }
 
@@ -148,6 +175,8 @@
 */
 void NmFolder::setName(QString name)
 {
+    NM_FUNCTION;
+    
     d->mName = name;
 }
 
@@ -156,6 +185,8 @@
 */
 NmFolderType NmFolder::folderType() const
 {
+    NM_FUNCTION;
+    
     return d->mFolderType;
 }
 
@@ -164,6 +195,8 @@
 */
 void NmFolder::setFolderType(NmFolderType folderType)
 {
+    NM_FUNCTION;
+    
     d->mFolderType = folderType;
 }
 
@@ -172,6 +205,8 @@
 */
 QDateTime NmFolder::lastUpdated() const
 {
+    NM_FUNCTION;
+    
     return d->mUpdated;
 }
 
@@ -180,6 +215,8 @@
 */
 void NmFolder::setLastUpdated(QDateTime time)
 {
+    NM_FUNCTION;
+    
     d->mUpdated = time;
 }
 
@@ -188,6 +225,8 @@
  */
 quint32 NmFolder::messageCount() const
 {
+    NM_FUNCTION;
+    
   return d->mMessageCount;
 }
 
@@ -196,6 +235,8 @@
  */
 void NmFolder::setMessageCount(quint32 messageCount)
 {
+    NM_FUNCTION;
+    
   d->mMessageCount = messageCount;
 }
 
@@ -204,6 +245,8 @@
  */
 quint32 NmFolder::unreadMessageCount() const
 {
+    NM_FUNCTION;
+    
   return d->mUnreadMessageCount;
 }
 
@@ -212,6 +255,8 @@
  */
 void NmFolder::setUnreadMessageCount(quint32 unreadMessageCount)
 {
+    NM_FUNCTION;
+    
   d->mUnreadMessageCount = unreadMessageCount;
 }
 
@@ -220,6 +265,8 @@
  */
 quint32 NmFolder::unseenCount() const
 {
+    NM_FUNCTION;
+    
   return d->mUnseenCount;
 }
 
@@ -228,6 +275,8 @@
  */
 void NmFolder::setUnseenCount(quint32 unseenCount)
 {
+    NM_FUNCTION;
+    
   d->mUnseenCount =  unseenCount;
 }
 
@@ -236,6 +285,8 @@
  */
 quint32 NmFolder::subFolderCount() const
 {
+    NM_FUNCTION;
+    
   return d->mSubFolderCount;
 }
 
@@ -244,6 +295,8 @@
  */
 void NmFolder::setSubFolderCount(quint32 subFolderCount)
 {
+    NM_FUNCTION;
+    
   d->mSubFolderCount = subFolderCount;
 }
 
--- a/emailservices/nmailbase/src/nmmailbox.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailbase/src/nmmailbox.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -14,16 +14,21 @@
 * Description:
 *
 */
+
+#include "emailtrace.h"
+
 #include <QString>
 
 #include "nmmailbox.h"
 
 NmMailboxPrivate::NmMailboxPrivate()
 {
+    NM_FUNCTION;
 }
 
 NmMailboxPrivate::~NmMailboxPrivate()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -36,6 +41,8 @@
  */
 NmMailbox::NmMailbox()
 {
+    NM_FUNCTION;
+    
     d = new NmMailboxPrivate();
 }
 
@@ -44,6 +51,8 @@
  */
 NmMailbox::NmMailbox(const NmMailbox &mailbox)
 {
+    NM_FUNCTION;
+    
     d = mailbox.d;
 }
 
@@ -52,6 +61,8 @@
  */
 NmMailbox::NmMailbox(QExplicitlySharedDataPointer<NmMailboxPrivate> mailboxprivate)
 {
+    NM_FUNCTION;
+    
     d = mailboxprivate;
 }
 
@@ -60,6 +71,8 @@
  */
 NmMailbox &NmMailbox::operator=(const NmMailbox &mailbox)
 {
+    NM_FUNCTION;
+    
     if (this != &mailbox) {
         d = mailbox.d;
     }
@@ -71,6 +84,7 @@
  */
 NmMailbox::~NmMailbox()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -78,6 +92,8 @@
  */
 NmId NmMailbox::id() const
 {
+    NM_FUNCTION;
+    
     return d->mId;
 }
 
@@ -86,6 +102,8 @@
  */
 void NmMailbox::setId(const NmId& id)
 {
+    NM_FUNCTION;
+    
     d->mId = id;
 }
 
@@ -94,6 +112,8 @@
  */
 QString NmMailbox::name() const
 {
+    NM_FUNCTION;
+    
     return d->mName;
 }
 
@@ -102,6 +122,8 @@
  */
 void NmMailbox::setName(const QString &name)
 {
+    NM_FUNCTION;
+    
     d->mName = name;
 }
 
@@ -110,6 +132,8 @@
  */
 bool NmMailbox::operator==(const NmMailbox &mailbox) const
 {
+    NM_FUNCTION;
+    
     bool ret = true;
 
     if (this->name().compare(mailbox.name()) != 0) {
@@ -124,12 +148,16 @@
 
 NmAddress NmMailbox::address() const
 {
+    NM_FUNCTION;
+    
     return d->mAddress;
 }
 
 
 void NmMailbox::setAddress(const NmAddress& address)
 {
+    NM_FUNCTION;
+    
     d->mAddress = address;
 }
 
--- a/emailservices/nmailbase/src/nmmessage.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailbase/src/nmmessage.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
 *
 */
 
+#include "emailtrace.h"
+
 #include "nmmessage.h"
 #include "nmmessageenvelope.h"
 
@@ -23,7 +25,7 @@
  */
 NmMessagePrivate::NmMessagePrivate() : mEnvelope(0)
 {
-    
+    NM_FUNCTION;
 }
 
 /*!
@@ -31,7 +33,7 @@
  */
 NmMessagePrivate::~NmMessagePrivate()
 {
-    
+    NM_FUNCTION;
 }
 
 /*!
@@ -44,6 +46,8 @@
  */
 NmMessage::NmMessage()
 {
+    NM_FUNCTION;
+    
     d = new NmMessagePrivate();
 }
 
@@ -52,6 +56,8 @@
  */
 NmMessage::NmMessage(const NmId &messageId) : NmMessagePart(0)
 {
+    NM_FUNCTION;
+    
     d = new NmMessagePrivate();
     d->mEnvelope.setMessageId(messageId);
 }
@@ -63,6 +69,8 @@
 NmMessage::NmMessage(const NmId &messageId, const NmId &folderId)
 : NmMessagePart(0)
 {
+    NM_FUNCTION;
+    
     d = new NmMessagePrivate();
 	d->mEnvelope.setMessageId(messageId);
 	d->mEnvelope.setFolderId(folderId);
@@ -77,6 +85,8 @@
                      const NmId &mailboxId)
 :NmMessagePart(0)
 {
+    NM_FUNCTION;
+    
     d = new NmMessagePrivate();
 	d->mEnvelope.setMessageId(messageId);
 	d->mEnvelope.setFolderId(folderId);
@@ -88,6 +98,8 @@
  */
 NmMessage::NmMessage(const NmMessageEnvelope &envelope)
 {
+    NM_FUNCTION;
+    
     d = new NmMessagePrivate();
     d->mEnvelope = envelope;
     // set message id same as envelope id
@@ -101,6 +113,8 @@
         QExplicitlySharedDataPointer<NmMessagePartPrivate> nmPrivateMessagePart)
         : NmMessagePart(nmPrivateMessagePart)
 {
+    NM_FUNCTION;
+    
     d = new NmMessagePrivate();
 	d->mEnvelope = envelope;
     // set message id same as envelope id
@@ -112,6 +126,8 @@
  */
 NmMessage::NmMessage(const NmMessagePart& message):NmMessagePart(message)
 {
+    NM_FUNCTION;
+    
     d = new NmMessagePrivate();
 }
 
@@ -124,6 +140,8 @@
  */
 NmMessage &NmMessage::operator=(const NmMessage &message)
 {
+    NM_FUNCTION;
+    
 	if (this != &message) {
 		d = message.d;
 	}
@@ -135,6 +153,7 @@
  */
 NmMessage::~NmMessage()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -144,6 +163,8 @@
  */
 const NmMessagePart *NmMessage::plainTextBodyPart() const
 {
+    NM_FUNCTION;
+    
     const NmMessagePart *ret = NULL;
     ret = findContentPart(NmContentTypeTextPlain);
     return ret;
@@ -156,6 +177,8 @@
  */
 NmMessagePart *NmMessage::plainTextBodyPart()
 {
+    NM_FUNCTION;
+    
     NmMessagePart *ret = NULL;
     ret = findContentPart(NmContentTypeTextPlain);
     return ret;
@@ -168,6 +191,8 @@
  */
 const NmMessagePart *NmMessage::htmlBodyPart() const
 {
+    NM_FUNCTION;
+    
     const NmMessagePart *ret = NULL;
     ret = findContentPart(NmContentTypeTextHtml);
     return ret;
@@ -180,6 +205,8 @@
  */
 NmMessagePart *NmMessage::htmlBodyPart()
 {
+    NM_FUNCTION;
+    
     NmMessagePart *ret = NULL;
     ret = findContentPart(NmContentTypeTextHtml);
     return ret;
@@ -190,6 +217,8 @@
  */
 NmMessageEnvelope &NmMessage::envelope()
 {
+    NM_FUNCTION;
+    
     return d->mEnvelope;
 }
 
@@ -198,6 +227,8 @@
  */
 const NmMessageEnvelope &NmMessage::envelope() const
 {
+    NM_FUNCTION;
+    
     return d->mEnvelope;
 }
 
@@ -210,6 +241,8 @@
 */        
 void NmMessage::attachmentList(QList<NmMessagePart*> &parts) const
 {
+    NM_FUNCTION;
+    
     parts.clear();
     appendAttachments(parts);
 
--- a/emailservices/nmailbase/src/nmmessageenvelope.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailbase/src/nmmessageenvelope.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -18,6 +18,8 @@
 #ifndef NMMESSAGEENVELOPE_CPP_
 #define NMMESSAGEENVELOPE_CPP_
 
+#include "emailtrace.h"
+
 #include "nmmessageenvelope.h"
 
 /*!
@@ -29,6 +31,7 @@
 mMailboxId(0),
 mMessageFlags(0)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -36,15 +39,20 @@
  */
 NmMessageEnvelopePrivate::~NmMessageEnvelopePrivate()
 {
+    NM_FUNCTION;
 }
 
 NmMessageFlags NmMessageEnvelopePrivate::flags() const
 {
+    NM_FUNCTION;
+    
     return mMessageFlags;
 }
 
 void NmMessageEnvelopePrivate::setFlags(const NmMessageFlags flags, bool set)
 {
+    NM_FUNCTION;
+    
     if (set) {
         mMessageFlags |= flags;
     } else {
@@ -54,6 +62,8 @@
 
 void NmMessageEnvelopePrivate::setFlag(const NmMessageFlag flag, bool set)
 {
+    NM_FUNCTION;
+    
     if (set) {
         mMessageFlags |= flag;
     } else {
@@ -63,6 +73,8 @@
 
 bool NmMessageEnvelopePrivate::isFlagSet(const NmMessageFlag flag) const
 {
+    NM_FUNCTION;
+    
     return mMessageFlags.testFlag(flag);
 }
 
@@ -79,6 +91,8 @@
  */
 NmMessageEnvelope::NmMessageEnvelope()
 {
+    NM_FUNCTION;
+    
     d = new NmMessageEnvelopePrivate();
 }
 
@@ -87,6 +101,8 @@
  */
 NmMessageEnvelope::NmMessageEnvelope(const NmId &messageId)
 {
+    NM_FUNCTION;
+    
     d = new NmMessageEnvelopePrivate();
     d->mMessageId = messageId;
 }
@@ -96,6 +112,7 @@
  */
 NmMessageEnvelope::NmMessageEnvelope(const NmMessageEnvelope &envelope):d(envelope.d)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -103,6 +120,8 @@
  */
 NmMessageEnvelope::NmMessageEnvelope(QExplicitlySharedDataPointer<NmMessageEnvelopePrivate> nmPrivateMessageEnvelope)
 {
+    NM_FUNCTION;
+    
     d = nmPrivateMessageEnvelope;
 }
 
@@ -111,6 +130,8 @@
  */
 NmMessageEnvelope &NmMessageEnvelope::operator=(const NmMessageEnvelope &envelope)
 {
+    NM_FUNCTION;
+    
     if (this != &envelope) {
         d = envelope.d;
     }
@@ -124,6 +145,8 @@
  */
 bool NmMessageEnvelope::operator==(const NmMessageEnvelope &envelope) const
 {
+    NM_FUNCTION;
+    
     bool ret = false;
     if (0 == subject().compare(envelope.subject(), Qt::CaseInsensitive)
         && sender() == envelope.sender()
@@ -142,6 +165,8 @@
  */
 bool NmMessageEnvelope::operator!=(const NmMessageEnvelope &envelope) const
 {
+    NM_FUNCTION;
+    
     return !(*this==envelope);
 }
 
@@ -150,6 +175,7 @@
  */
 NmMessageEnvelope::~NmMessageEnvelope()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -157,6 +183,8 @@
  */
 void NmMessageEnvelope::setMessageId(const NmId &messageId)
 {
+    NM_FUNCTION;
+    
     d->mMessageId = messageId;
 }
 
@@ -165,6 +193,8 @@
  */
 NmId NmMessageEnvelope::messageId() const
 {
+    NM_FUNCTION;
+    
     return d->mMessageId;
 }
 
@@ -173,6 +203,8 @@
  */
 NmId NmMessageEnvelope::folderId() const
 {
+    NM_FUNCTION;
+    
     return d->mFolderId;
 }
 
@@ -181,6 +213,8 @@
  */
 void NmMessageEnvelope::setFolderId(const NmId &folderId)
 {
+    NM_FUNCTION;
+    
     d->mFolderId = folderId;
 }
 
@@ -189,6 +223,8 @@
  */
 NmId NmMessageEnvelope::mailboxId() const
 {
+    NM_FUNCTION;
+    
     return d->mMailboxId;
 }
 
@@ -197,6 +233,8 @@
  */
 void NmMessageEnvelope::setMailboxId(const NmId &mailboxId)
 {
+    NM_FUNCTION;
+    
     d->mMailboxId = mailboxId;
 }
 
@@ -205,6 +243,8 @@
  */
 void NmMessageEnvelope::setSubject(const QString &subject)
 {
+    NM_FUNCTION;
+    
     d->mSubject = subject;
 }
 
@@ -213,6 +253,8 @@
  */
 QString NmMessageEnvelope::subject() const
 {
+    NM_FUNCTION;
+    
   return d->mSubject;
 }
 
@@ -221,6 +263,8 @@
  */
 void NmMessageEnvelope::setSender(const NmAddress &sender)
 {
+    NM_FUNCTION;
+    
     d->mSender = sender;
 }
 
@@ -229,6 +273,8 @@
  */
 NmAddress NmMessageEnvelope::sender() const
 {
+    NM_FUNCTION;
+    
     return d->mSender;
 }
 
@@ -237,6 +283,8 @@
  */
 void NmMessageEnvelope::setSentTime(const QDateTime &sentTime)
 {
+    NM_FUNCTION;
+    
     d->mSentTime = sentTime;
 }
 
@@ -245,6 +293,8 @@
  */
 QDateTime NmMessageEnvelope::sentTime() const
 {
+    NM_FUNCTION;
+    
     return d->mSentTime;
 }
 
@@ -253,6 +303,8 @@
  */
 void NmMessageEnvelope::setHasAttachments(bool hasAttachments)
 {
+    NM_FUNCTION;
+    
     d->setFlag(NmMessageFlagAttachments, hasAttachments);
 }
 
@@ -261,6 +313,8 @@
  */
 bool NmMessageEnvelope::hasAttachments() const
 {
+    NM_FUNCTION;
+    
     return d->isFlagSet(NmMessageFlagAttachments);
 }
 
@@ -269,6 +323,8 @@
  */
 void NmMessageEnvelope::setRead(bool read)
 {
+    NM_FUNCTION;
+    
     d->setFlag(NmMessageFlagRead, read);
 }
 
@@ -277,6 +333,8 @@
  */
 bool NmMessageEnvelope::isRead() const
 {
+    NM_FUNCTION;
+    
     return d->isFlagSet(NmMessageFlagRead);
 }
 
@@ -285,6 +343,8 @@
  */
 void NmMessageEnvelope::setReplied(bool replyed)
 {
+    NM_FUNCTION;
+    
     d->setFlag(NmMessageFlagAnswered, replyed);
 }
 
@@ -293,6 +353,8 @@
  */
 bool NmMessageEnvelope::isReplied() const
 {
+    NM_FUNCTION;
+    
     return d->isFlagSet(NmMessageFlagAnswered);
 }
 
@@ -301,6 +363,8 @@
  */
 void NmMessageEnvelope::setForwarded(bool forwarded)
 {
+    NM_FUNCTION;
+    
     d->setFlag(NmMessageFlagForwarded, forwarded);
 }
 
@@ -309,6 +373,8 @@
  */
 bool NmMessageEnvelope::isForwarded() const
 {
+    NM_FUNCTION;
+    
     return d->isFlagSet(NmMessageFlagForwarded);
 }
 
@@ -317,6 +383,8 @@
  */
 void NmMessageEnvelope::setPriority(NmMessagePriority priority)
 {
+    NM_FUNCTION;
+    
     if (priority == NmMessagePriorityLow) {
         d->setFlag(NmMessageFlagLow, true);
         d->setFlag(NmMessageFlagImportant, false);
@@ -336,6 +404,8 @@
  */
 NmMessagePriority NmMessageEnvelope::priority() const
 {
+    NM_FUNCTION;
+    
     NmMessagePriority ret = NmMessagePriorityNormal;
     if (d->isFlagSet(NmMessageFlagImportant)) {
         ret = NmMessagePriorityHigh;
@@ -351,6 +421,8 @@
  */
 NmMessageFlags NmMessageEnvelope::flags() const
 {
+    NM_FUNCTION;
+    
     return d->flags();
 }
 
@@ -359,6 +431,8 @@
  */
 QList<NmAddress>& NmMessageEnvelope::toRecipients() const
 {
+    NM_FUNCTION;
+    
     return d->mToRecipients;
 }
 
@@ -367,6 +441,8 @@
  */
 void NmMessageEnvelope::setToRecipients(QList<NmAddress> toRecipients)
 {
+    NM_FUNCTION;
+    
     clearToRecipients();
     d->mToRecipients = toRecipients;
 }
@@ -376,6 +452,8 @@
  */
 void NmMessageEnvelope::clearToRecipients()
 {
+    NM_FUNCTION;
+    
     d->mToRecipients.clear();
 }
 
@@ -384,6 +462,8 @@
  */
 QList<NmAddress>& NmMessageEnvelope::ccRecipients() const
 {
+    NM_FUNCTION;
+    
     return d->mCcRecipients;
 }
 
@@ -392,6 +472,8 @@
  */
 void NmMessageEnvelope::setCcRecipients(QList<NmAddress> ccRecipients)
 {
+    NM_FUNCTION;
+    
     clearCcRecipients();
     d->mCcRecipients = ccRecipients;
 }
@@ -401,6 +483,8 @@
  */
 void NmMessageEnvelope::clearCcRecipients()
 {
+    NM_FUNCTION;
+    
     d->mCcRecipients.clear();
 }
 
@@ -409,6 +493,8 @@
  */
 QList<NmAddress>& NmMessageEnvelope::bccRecipients() const
 {
+    NM_FUNCTION;
+    
     return d->mBccRecipients;
 }
 
@@ -417,6 +503,8 @@
  */
 void NmMessageEnvelope::setBccRecipients(QList<NmAddress> bccRecipients)
 {
+    NM_FUNCTION;
+    
     clearBccRecipients();
     d->mBccRecipients = bccRecipients;
 }
@@ -426,6 +514,8 @@
  */
 void NmMessageEnvelope::clearBccRecipients()
 {
+    NM_FUNCTION;
+    
     d->mBccRecipients.clear();
 }
 
--- a/emailservices/nmailbase/src/nmmessagepart.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmailbase/src/nmmessagepart.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
 *
 */
 
+#include "emailtrace.h"
+
 #include "nmmessagepart.h"
 #include "nmmessageenvelope.h"
 
@@ -24,8 +26,9 @@
  */
 NmMessagePartPrivate::NmMessagePartPrivate()
 		: mPartId(0), mSize(0), mFetchedSize(0),
-		mTextContent(0)
+		mTextContent()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -33,6 +36,7 @@
  */
 NmMessagePartPrivate::~NmMessagePartPrivate() 
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -41,6 +45,8 @@
  */
 bool NmMessagePartPrivate::isMessage() const
 {
+    NM_FUNCTION;
+    
     bool isMessage = false;
     if (!mContentType.isEmpty()) {
 		if (mContentType.contains(NmContentTypeTypeMessage, Qt::CaseInsensitive)) {
@@ -56,6 +62,8 @@
  */
 bool NmMessagePartPrivate::isTextContent() const
 {
+    NM_FUNCTION;
+    
 	bool isText = false;
 	if (!mContentType.isEmpty()) {
 		if (mContentType.contains(NmContentTypeTextPlain, Qt::CaseInsensitive) ||
@@ -77,6 +85,8 @@
  */
 NmMessagePart::NmMessagePart()
 {
+    NM_FUNCTION;
+    
     d = new NmMessagePartPrivate();
 }
 
@@ -85,6 +95,8 @@
  */
 NmMessagePart::NmMessagePart(const NmId &partId)
 {
+    NM_FUNCTION;
+    
     d = new NmMessagePartPrivate();
     d->mPartId = partId;
 }
@@ -95,6 +107,8 @@
 NmMessagePart::NmMessagePart(
         QExplicitlySharedDataPointer<NmMessagePartPrivate> nmPrivateMessagePart)
 {
+    NM_FUNCTION;
+    
 	d = nmPrivateMessagePart;
 }
 
@@ -103,6 +117,7 @@
  */
 NmMessagePart::NmMessagePart(const NmMessagePart &part) : d(part.d)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -110,6 +125,8 @@
  */
 NmMessagePart &NmMessagePart::operator=(const NmMessagePart &part)
 {
+    NM_FUNCTION;
+    
 	if (this != &part) {
 		d = part.d;
 	}
@@ -121,6 +138,8 @@
  */
 NmMessagePart::~NmMessagePart()
 {
+    NM_FUNCTION;
+    
 	for (int i = 0; i < d->mChildParts.count(); i++) {
 		delete d->mChildParts[i];
 	}
@@ -132,6 +151,8 @@
  */
 NmId NmMessagePart::partId() const
 {
+    NM_FUNCTION;
+    
     return d->mPartId;
 }
 
@@ -140,6 +161,8 @@
  */
 void NmMessagePart::setPartId(const NmId &id)
 {
+    NM_FUNCTION;
+    
     d->mPartId = id;
 }
 
@@ -148,6 +171,8 @@
  */
 quint32 NmMessagePart::size() const
 {
+    NM_FUNCTION;
+    
     return d->mSize;
 }
 
@@ -156,6 +181,8 @@
  */
 void NmMessagePart::setSize(quint32 size)
 {
+    NM_FUNCTION;
+    
     d->mSize = size;
 }
 
@@ -164,6 +191,8 @@
  */
 quint32 NmMessagePart::fetchedSize() const
 {
+    NM_FUNCTION;
+    
     return d->mFetchedSize;
 }
 
@@ -172,6 +201,8 @@
  */
 void NmMessagePart::setFetchedSize(quint32 fetchedSize)
 {
+    NM_FUNCTION;
+    
     d->mFetchedSize = fetchedSize;
 }
 
@@ -180,6 +211,8 @@
  */
 bool NmMessagePart::isMessage() const
 {
+    NM_FUNCTION;
+    
 	return d->isMessage();
 }
 
@@ -191,6 +224,8 @@
     const QString &content,
     const QString &contentType)
 {
+    NM_FUNCTION;
+    
     d->mTextContent = content;
     d->mContentType = contentType;
     d->mBinaryContent.clear();
@@ -201,6 +236,8 @@
  */
 const QString &NmMessagePart::textContent() const
 {
+    NM_FUNCTION;
+    
     return d->mTextContent;
 }
 
@@ -210,6 +247,8 @@
  */
 void NmMessagePart::setContentType(const QString &contentType)
 {
+    NM_FUNCTION;
+    
     d->mContentType = contentType;
 }
 
@@ -218,6 +257,8 @@
  */
 QString NmMessagePart::contentType() const
 {
+    NM_FUNCTION;
+    
     return d->mContentType;
 }
 
@@ -226,6 +267,8 @@
  */
 void NmMessagePart::setContentDescription(const QString &contentDescription)
 {
+    NM_FUNCTION;
+    
     d->mContentDescription = contentDescription;
 }
 
@@ -234,6 +277,8 @@
  */
 QString NmMessagePart::contentDescription() const
 {
+    NM_FUNCTION;
+    
     return d->mContentDescription;
 }
 
@@ -242,6 +287,8 @@
  */
 void NmMessagePart::setContentDisposition(const QString &contentDisposition)
 {
+    NM_FUNCTION;
+    
     d->mContentDisposition = contentDisposition;
 }
 
@@ -250,6 +297,8 @@
  */
 QString NmMessagePart::contentDisposition() const
 {
+    NM_FUNCTION;
+    
     return d->mContentDisposition;
 }
 
@@ -258,6 +307,8 @@
  */
 void NmMessagePart::setContentId(const QString &contentId)
 {
+    NM_FUNCTION;
+    
     d->mContentId = contentId;
 }
 
@@ -266,6 +317,8 @@
  */
 QString NmMessagePart::contentId()
 {
+    NM_FUNCTION;
+    
     return d->mContentId;
 }
 
@@ -275,7 +328,8 @@
  */
 void NmMessagePart::setChildParts(QList<NmMessagePart*> parts)
 {
-
+    NM_FUNCTION;
+    
     if (d->mChildParts.count() > 0) {
         for (int i = 0; i < d->mChildParts.count(); i++) {
             delete d->mChildParts[i];
@@ -295,6 +349,8 @@
  */
 QList<NmMessagePart*>& NmMessagePart::childParts() const
 {
+    NM_FUNCTION;
+    
     return d->mChildParts;
 }
 
@@ -305,6 +361,8 @@
  */
 void NmMessagePart::addChildPart(NmMessagePart *part)
 {
+    NM_FUNCTION;
+    
     if (!part) {
         return;
     }
@@ -317,6 +375,8 @@
  */
 void NmMessagePart::removeChildPart(const NmId &partId)
 {
+    NM_FUNCTION;
+    
     for (int i = 0; i < d->mChildParts.count(); i++) {
         if (d->mChildParts[i]->partId() == partId) {
             delete d->mChildParts[i];
@@ -331,6 +391,8 @@
  */
 void NmMessagePart::removeAllChildParts()
 {
+    NM_FUNCTION;
+    
     while (!d->mChildParts.isEmpty()) {
         delete d->mChildParts.takeFirst();
     }
@@ -343,6 +405,8 @@
     const QByteArray &content,
     const QString &contentType)
 {
+    NM_FUNCTION;
+    
     d->mBinaryContent = content;
     d->mContentType = contentType;
     d->mTextContent.clear();
@@ -353,6 +417,8 @@
  */
 const QByteArray &NmMessagePart::binaryContent() const
 {
+    NM_FUNCTION;
+    
     return d->mBinaryContent;
 }
 
@@ -364,6 +430,8 @@
    */      
 void NmMessagePart::setAttachmentName(const QString &filePath)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(filePath);
 }
 
@@ -373,6 +441,8 @@
  */
 QString NmMessagePart::attachmentName() const
 {
+    NM_FUNCTION;
+    
     // Look first from Content-Type param "name"
     QString content = contentType();
     int ptr = content.indexOf(NmContentTypeParamName);
@@ -400,6 +470,8 @@
  */
 const NmMessagePart *NmMessagePart::findContentPart(const QString &contentType) const
 {
+    NM_FUNCTION;
+    
     const NmMessagePart *ret = NULL;
 
     if (!d->mContentType.isEmpty() && d->mContentType.startsWith(contentType)) {
@@ -417,6 +489,8 @@
  */
 NmMessagePart *NmMessagePart::findContentPart(const QString &contentType)
 {
+    NM_FUNCTION;
+    
     NmMessagePart *ret = NULL;
 
     if (!d->mContentType.isEmpty() && d->mContentType.startsWith(contentType)) {
@@ -436,6 +510,8 @@
  */
 void NmMessagePart::appendAttachments(QList<NmMessagePart*> &attachments) const
 {
+    NM_FUNCTION;
+    
     QList<NmMessagePart*> messageParts = childParts();
 
     int messagePartCount = messageParts.count();
--- a/emailservices/nmclientapi/inc/nmapimessagebody_p.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/inc/nmapimessagebody_p.h	Wed Jun 23 17:00:39 2010 +0100
@@ -17,7 +17,7 @@
 #ifndef NMAPIMESSAGEBODY_P_H_
 #define NMAPIMESSAGEBODY_P_H_
 
-#include <QString>;
+#include <QString>
 
 namespace EmailClientApi
 {
--- a/emailservices/nmclientapi/inc/nmapiprivateheaders.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/inc/nmapiprivateheaders.h	Wed Jun 23 17:00:39 2010 +0100
@@ -21,6 +21,6 @@
 #include "nmmailbox.h"
 #include "nmmessage.h"
 #include "nmfolder.h"
-#include "nmmessagePart.h"
+#include "nmmessagepart.h"
 
 #endif // NMAPIPRIVATEHEADERS_H
--- a/emailservices/nmclientapi/src/nmapidatapluginfactory.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapidatapluginfactory.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include "nmdataplugininterface.h"
 #include "nmapidatapluginfactory.h"
 
@@ -48,7 +50,7 @@
  */
 NmApiDataPluginFactory::NmApiDataPluginFactory()
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -56,6 +58,8 @@
  */
 NmApiDataPluginFactory::~NmApiDataPluginFactory()
 {
+    NM_FUNCTION;
+    
     if (mPlugin) {
         delete mPlugin;
         mPlugin = NULL;
@@ -72,6 +76,8 @@
  */
 NmApiDataPluginFactory *NmApiDataPluginFactory::instance()
 {
+    NM_FUNCTION;
+    
     if (!mInstance) {
         mInstance = new NmApiDataPluginFactory();
     }
@@ -84,6 +90,8 @@
  */
 void NmApiDataPluginFactory::releaseInstance(NmApiDataPluginFactory *&instance)
 {
+    NM_FUNCTION;
+    
     //can't have passed out instances if we don't have any
     if (mInstance) {
         if (instance == mInstance) {
@@ -103,6 +111,8 @@
  */
 NmDataPluginInterface *NmApiDataPluginFactory::interfaceInstance()
 {
+    NM_FUNCTION;
+    
     if (!mPlugin) {
         mPlugin = loadPlugin();
     }
@@ -114,6 +124,8 @@
  */
 QObject *NmApiDataPluginFactory::loadPlugin()
 {
+    NM_FUNCTION;
+    
     if (!mPluginLoader) {
         const QString KPluginDirectory = "c:\\resource\\plugins";
         QDir pluginDir = QDir(KPluginDirectory);
@@ -135,6 +147,8 @@
 
 QObject *NmApiDataPluginFactory::plugin()
 {
+    NM_FUNCTION;
+    
     if (!mPlugin) {
         mPlugin = loadPlugin();
     }
--- a/emailservices/nmclientapi/src/nmapiemailaddress.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapiemailaddress.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include <nmapiemailaddress.h>
 #include "nmapiemailaddress_p.h"
 
@@ -26,7 +28,7 @@
 NmApiEmailAddress::NmApiEmailAddress(const NmApiEmailAddress &envelope) :
     d(envelope.d)
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -34,6 +36,8 @@
  */
 NmApiEmailAddress::NmApiEmailAddress()
 {
+    NM_FUNCTION;
+    
     d = new NmApiEmailAddressPrivate();
 }
 
@@ -42,7 +46,7 @@
  */
 NmApiEmailAddress::~NmApiEmailAddress()
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -50,6 +54,8 @@
  */
 NmApiEmailAddress &NmApiEmailAddress::operator=(const NmApiEmailAddress &addr)
 {
+    NM_FUNCTION;
+    
     if (this != &addr) {
         d = addr.d;
     }
@@ -61,6 +67,8 @@
  */
 bool NmApiEmailAddress::operator==(const NmApiEmailAddress &addr)
 {
+    NM_FUNCTION;
+    
     bool retVal = false;
     if (this->d == addr.d) {
         retVal = true;
@@ -73,6 +81,8 @@
  */
 QString NmApiEmailAddress::displayName() const
 {
+    NM_FUNCTION;
+    
     return d->displayName;
 }
 
@@ -81,6 +91,8 @@
  */
 QString NmApiEmailAddress::address() const
 {
+    NM_FUNCTION;
+    
     return d->address;
 }
 
@@ -89,6 +101,8 @@
  */
 void NmApiEmailAddress::setDisplayName(const QString &displayName)
 {
+    NM_FUNCTION;
+    
     d->displayName = displayName;
 }
 
@@ -97,6 +111,8 @@
  */
 void NmApiEmailAddress::setAddress(const QString &address)
 {
+    NM_FUNCTION;
+    
     d->address = address;
 }
 }
--- a/emailservices/nmclientapi/src/nmapiemailservice.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapiemailservice.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include <nmapiemailservice.h>
 #include "nmapiengine.h"
 
@@ -30,7 +32,7 @@
 NmApiEmailService::NmApiEmailService(QObject *parent) :
     QObject(parent), mEngine(NULL), mIsRunning(false)
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -38,6 +40,8 @@
  */
 NmApiEmailService::~NmApiEmailService()
 {
+    NM_FUNCTION;
+    
     if (mEngine) {
         uninitialise();
     }
@@ -52,6 +56,8 @@
     const quint64 envelopeId,
     EmailClientApi::NmApiMessageEnvelope &envelope)
 {
+    NM_FUNCTION;
+    
     if (!mEngine) {
         return false;
     }
@@ -63,6 +69,8 @@
  */
 bool NmApiEmailService::getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo)
 {
+    NM_FUNCTION;
+    
     if (!mEngine) {
         return false;
     }
@@ -75,6 +83,8 @@
  */
 void NmApiEmailService::initialise()
 {
+    NM_FUNCTION;
+    
     if (!mEngine) {
         mEngine = NmApiEngine::instance();
     }
@@ -93,6 +103,8 @@
  */
 void NmApiEmailService::uninitialise()
 {
+    NM_FUNCTION;
+    
     NmApiEngine::releaseInstance(mEngine);
     mIsRunning = false;
 }
@@ -102,6 +114,8 @@
  */
 bool NmApiEmailService::isRunning() const
 {
+    NM_FUNCTION;
+    
     return mIsRunning;
 }
 
--- a/emailservices/nmclientapi/src/nmapiengine.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapiengine.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,7 @@
  *
  */
 
+#include "emailtrace.h"
 
 #include <nmapicommonheader.h>
 
@@ -43,6 +44,8 @@
 NmApiEngine::NmApiEngine() :
     mFactory(NULL)
 {
+    NM_FUNCTION;
+    
     mFactory = NmApiDataPluginFactory::instance();
 }
 
@@ -51,6 +54,8 @@
  */
 NmApiEngine::~NmApiEngine()
 {
+    NM_FUNCTION;
+    
     NmApiDataPluginFactory::releaseInstance(mFactory);
 }
 
@@ -63,6 +68,8 @@
  */
 NmApiEngine *NmApiEngine::instance()
 {
+    NM_FUNCTION;
+    
     if (!mInstance) {
         mInstance = new NmApiEngine();
     }
@@ -75,6 +82,8 @@
  */
 void NmApiEngine::startCollectingEvents()
 {
+    NM_FUNCTION;
+    
     QObject *plugin = mFactory->plugin();
     if(plugin){
         connect(plugin, SIGNAL(messageEvent(NmMessageEvent, NmId, QList<NmId> , NmId)), this,
@@ -94,6 +103,8 @@
  */
 void NmApiEngine::mailboxChangedArrived(NmMailboxEvent mailboxEvent, const QList<NmId> &mailboxIds)
 {
+    NM_FUNCTION;
+    
     NmApiMessage message;
     message.objectType = EMailbox;
     switch (mailboxEvent) {
@@ -138,6 +149,8 @@
     const QList<NmId> &messageIds,
     const NmId &mailboxId)
 {
+    NM_FUNCTION;
+    
     NmApiMessage message;
     message.objectType = EMessage;
     switch (messageEvent) {
@@ -175,6 +188,8 @@
  */
 void NmApiEngine::releaseInstance(NmApiEngine *&instance)
 {
+    NM_FUNCTION;
+    
     //can't have passed out instances if we don't have any
     if (mInstance) {
         if (instance == mInstance) {
@@ -196,6 +211,8 @@
  */
 void NmApiEngine::listMailboxes(QList<EmailClientApi::NmApiMailbox> &mailboxList)
 {
+    NM_FUNCTION;
+    
     QList<NmMailbox*> mailboxFromPlugin;
 
     NmDataPluginInterface *instance =  mFactory->interfaceInstance();
@@ -219,6 +236,8 @@
  */
 void NmApiEngine::listFolders(const quint64 mailboxId, QList<EmailClientApi::NmApiFolder> &folderList)
 {
+    NM_FUNCTION;
+    
     QList<NmFolder*> folderFromPlugin;
     NmDataPluginInterface *instance = mFactory->interfaceInstance();
     if (instance) {
@@ -243,6 +262,8 @@
 void NmApiEngine::listEnvelopes(const quint64 mailboxId, const quint64 folderId, 
                     QList<EmailClientApi::NmApiMessageEnvelope> &messageEnvelopeList)
 {
+    NM_FUNCTION;
+    
     QList<NmMessage*> messages;
     NmDataPluginInterface *instance = mFactory->interfaceInstance();
     if (instance) {
@@ -287,6 +308,8 @@
     const quint64 envelopeId,
     EmailClientApi::NmApiMessageEnvelope &envelope)
 {
+    NM_FUNCTION;
+    
     //flag indicating that envelope with given id was found
     bool found = false;
     NmDataPluginInterface *instance = mFactory->interfaceInstance();
@@ -327,6 +350,8 @@
  */
 bool NmApiEngine::getMailboxById(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailbox)
 {
+    NM_FUNCTION;
+    
     //flag indicating that mailbox with given id was found
     bool found = false;
     NmDataPluginInterface *instance = mFactory->interfaceInstance();
--- a/emailservices/nmclientapi/src/nmapienvelopelisting.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapienvelopelisting.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,7 @@
  *
  */
 
+#include "emailtrace.h"
 
 #include <nmapienvelopelisting.h>
 #include "nmapienvelopelisting_p.h"
@@ -36,6 +37,8 @@
     const quint64 mailboxId) :
     NmApiMessageTask(parent)
 {
+    NM_FUNCTION;
+    
     mListingPrivate = new NmApiEnvelopeListingPrivate(this);
     mListingPrivate->mailboxId = mailboxId;
     mListingPrivate->folderId = folderId;
@@ -47,6 +50,8 @@
  */
 NmApiEnvelopeListing::~NmApiEnvelopeListing()
 {
+    NM_FUNCTION;
+    
     if (mListingPrivate->mIsRunning) {
         mListingPrivate->releaseEngine();
     }
@@ -67,6 +72,8 @@
  */
 bool NmApiEnvelopeListing::start()
 {
+    NM_FUNCTION;
+    
     bool result = false;
 
     if (mListingPrivate->mIsRunning) {
@@ -101,6 +108,8 @@
  */
 void NmApiEnvelopeListing::cancel()
 {
+    NM_FUNCTION;
+    
     if (mListingPrivate->mIsRunning) {
         mListingPrivate->mIsRunning = false;
         mListingPrivate->releaseEngine();
@@ -120,6 +129,8 @@
  */
 bool NmApiEnvelopeListing::getEnvelopes(QList<EmailClientApi::NmApiMessageEnvelope> &envelopes)
 {
+    NM_FUNCTION;
+    
     envelopes.clear();
 
     bool result = false;
@@ -140,6 +151,8 @@
  */
 bool NmApiEnvelopeListing::isRunning() const
 {
+    NM_FUNCTION;
+    
     return mListingPrivate->mIsRunning;
 }
 
--- a/emailservices/nmclientapi/src/nmapienvelopelisting_p.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapienvelopelisting_p.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -14,6 +14,9 @@
  * Description:
  *
  */
+
+#include "emailtrace.h"
+
 #include "nmapiengine.h"
 #include "nmapienvelopelisting_p.h"
 
@@ -27,11 +30,13 @@
 NmApiEnvelopeListingPrivate::NmApiEnvelopeListingPrivate(QObject *parent) :
     QObject(parent), mEngine(NULL)
 {
-
+    NM_FUNCTION;
 }
 
 NmApiEnvelopeListingPrivate::~NmApiEnvelopeListingPrivate()
 {
+    NM_FUNCTION;
+    
     releaseEngine();
 }
 
@@ -44,6 +49,8 @@
  */
 bool NmApiEnvelopeListingPrivate::initializeEngine()
 {
+    NM_FUNCTION;
+    
     mEngine = NmApiEngine::instance();
     return mEngine ? true : false;
 }
@@ -55,6 +62,8 @@
  */
 void NmApiEnvelopeListingPrivate::releaseEngine()
 {
+    NM_FUNCTION;
+    
     NmApiEngine::releaseInstance(mEngine);
 }
 
@@ -68,6 +77,8 @@
  */
 qint32 NmApiEnvelopeListingPrivate::grabEnvelopes()
 {
+    NM_FUNCTION;
+    
     if(!mEngine){
         return -1;
     }
--- a/emailservices/nmclientapi/src/nmapieventnotifier.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapieventnotifier.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include <QList>
 #include <QVariant>
 #include <QString>
@@ -35,6 +37,8 @@
     NmApiMessageTask(parent)
 
 {
+    NM_FUNCTION;
+    
     //set timer
     mNmApiEventNotifierPrivate = new NmApiEventNotifierPrivate(this);
     mNmApiEventNotifierPrivate->mEmitSignals = new QTimer(this);
@@ -49,6 +53,8 @@
  */
 NmApiEventNotifier::~NmApiEventNotifier()
 {
+    NM_FUNCTION;
+    
     if (mNmApiEventNotifierPrivate->mIsRunning) {
         mNmApiEventNotifierPrivate->releaseEngine();
     }
@@ -61,6 +67,8 @@
  */
 bool NmApiEventNotifier::start()
 {
+    NM_FUNCTION;
+    
     bool result = false;
 
     if (mNmApiEventNotifierPrivate->mIsRunning) {
@@ -93,6 +101,8 @@
  */
 void NmApiEventNotifier::cancel()
 {
+    NM_FUNCTION;
+    
     mNmApiEventNotifierPrivate->cancel();
     emit canceled();
 }
@@ -102,6 +112,8 @@
  */
 bool NmApiEventNotifier::isRunning() const
 {
+    NM_FUNCTION;
+    
     return mNmApiEventNotifierPrivate->mIsRunning;
 }
 
@@ -113,6 +125,8 @@
  */
 void NmApiEventNotifier::sendEventsFromBuffer()
 {
+    NM_FUNCTION;
+    
     qRegisterMetaType<EmailClientApi::NmApiMailboxEvent> ("EmailClientApi::NmApiMailboxEvent");
     qRegisterMetaType<EmailClientApi::NmApiMessageEvent> ("EmailClientApi::NmApiMessageEvent");
     NmApiMessage events;
--- a/emailservices/nmclientapi/src/nmapieventnotifier_p.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapieventnotifier_p.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include "nmapiengine.h"
 #include "nmapieventnotifier_p.h"
 
@@ -28,7 +30,7 @@
 NmApiEventNotifierPrivate::NmApiEventNotifierPrivate(QObject *parent) :
     QObject(parent), mEmitSignals(NULL), mEngine(NULL), mIsRunning(false)
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -36,7 +38,7 @@
  */
 NmApiEventNotifierPrivate::~NmApiEventNotifierPrivate()
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -49,6 +51,8 @@
  */
 bool NmApiEventNotifierPrivate::initializeEngine()
 {
+    NM_FUNCTION;
+    
     if (!mEngine) {
         mEngine = NmApiEngine::instance();
     }
@@ -63,6 +67,8 @@
  */
 void NmApiEventNotifierPrivate::releaseEngine()
 {
+    NM_FUNCTION;
+    
     if (mIsRunning) {
         cancel();
     }
@@ -80,11 +86,15 @@
  */
 void NmApiEventNotifierPrivate::emailStoreEvent(const NmApiMessage &events)
 {
+    NM_FUNCTION;
+    
     mBufferOfEvents << events;
 }
 
 void NmApiEventNotifierPrivate::cancel()
 {
+    NM_FUNCTION;
+    
     if (!mIsRunning) {
         return;
     }
--- a/emailservices/nmclientapi/src/nmapifolder.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapifolder.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include <nmapifolder.h>
 #include "nmapifolder_p.h"
 
@@ -26,6 +28,8 @@
  */
 NmApiFolder::NmApiFolder()
 {
+    NM_FUNCTION;
+    
     d = new NmApiFolderPrivate();
 }
 
@@ -35,7 +39,7 @@
 NmApiFolder::NmApiFolder(const NmApiFolder &nmApiFolder)
 : d(nmApiFolder.d)
 {
-    
+    NM_FUNCTION;
 }
 
 /*!
@@ -43,7 +47,7 @@
  */
 NmApiFolder::~NmApiFolder()
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -51,6 +55,8 @@
  */
 NmApiFolder &NmApiFolder::operator=(const NmApiFolder &folder)
 {
+    NM_FUNCTION;
+    
     if (this != &folder) {
         d = folder.d;
     }
@@ -62,6 +68,8 @@
  */
 bool NmApiFolder::operator==(const NmApiFolder &folder)
 {
+    NM_FUNCTION;
+    
     bool returnValue = false;
     if (d == folder.d) {
         returnValue = true;
@@ -74,6 +82,8 @@
  */
 quint64 NmApiFolder::id() const
 {
+    NM_FUNCTION;
+    
     return d->id;
 }
 
@@ -82,6 +92,8 @@
  */
 QString NmApiFolder::name() const
 {
+    NM_FUNCTION;
+    
     return d->name;
 }
 
@@ -90,6 +102,8 @@
  */
 EmailClientApi::NmApiEmailFolderType NmApiFolder::folderType() const
 {
+    NM_FUNCTION;
+    
     return d->folderType;
 }
 
@@ -98,6 +112,8 @@
  */
 void NmApiFolder::setName(const QString& name)
 {
+    NM_FUNCTION;
+    
     d->name = name;
 }
 
@@ -106,6 +122,8 @@
  */
 void NmApiFolder::setId(quint64 id)
 {
+    NM_FUNCTION;
+    
     d->id = id;
 }
 
@@ -114,6 +132,8 @@
  */
 void NmApiFolder::setFolderType(EmailClientApi::NmApiEmailFolderType folderType)
 {
+    NM_FUNCTION;
+    
     d->folderType = folderType;
 }
 
@@ -122,6 +142,8 @@
  */
 void NmApiFolder::setParentFolderId(quint64 parentId)
 {
+    NM_FUNCTION;
+    
     d->parentId = parentId;
 }
 
@@ -130,6 +152,8 @@
  */
 void NmApiFolder::setChildFolderIds(QList<quint64> &childFolderIds)
 {
+    NM_FUNCTION;
+    
     d->childFolderIds = childFolderIds;
 }
 
@@ -139,6 +163,8 @@
  */
 void NmApiFolder::getChildFolderIds(QList<quint64> &childFolderIds)
 {
+    NM_FUNCTION;
+    
     childFolderIds = d->childFolderIds;
 }
 
@@ -148,6 +174,8 @@
  */
 quint64 NmApiFolder::parentFolderId() const
 {
+    NM_FUNCTION;
+    
     return d->parentId;
 }
 }
--- a/emailservices/nmclientapi/src/nmapifolderlisting.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapifolderlisting.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,7 @@
  *
  */
 
+#include "emailtrace.h"
 
 #include <nmapifolderlisting.h>
 #include "nmapifolderlisting_p.h"
@@ -35,6 +36,8 @@
 NmApiFolderListing::NmApiFolderListing(QObject *parent, const quint64 &nmMailboxId) :
     NmApiMessageTask(parent)
 {
+    NM_FUNCTION;
+    
     mFolderListing = new NmApiFolderListingPrivate(this);
     mFolderListing->mIsRunning = false;
     mFolderListing->mMailboxId = nmMailboxId;
@@ -45,6 +48,8 @@
  */
 NmApiFolderListing::~NmApiFolderListing()
 {
+    NM_FUNCTION;
+    
     if (mFolderListing->mIsRunning) {
         mFolderListing->releaseEngine();
     }
@@ -59,6 +64,8 @@
  */
 bool NmApiFolderListing::getFolders(QList<EmailClientApi::NmApiFolder> &folders)
 {
+    NM_FUNCTION;
+    
     folders.clear();
     if (!mFolderListing->mIsRunning || mFolderListing->mFolders.isEmpty()) {
         return false;
@@ -83,6 +90,8 @@
  */
 bool NmApiFolderListing::start()
 {
+    NM_FUNCTION;
+    
     if (mFolderListing->mIsRunning) {
         return true;
     }
@@ -111,6 +120,8 @@
  */
 void NmApiFolderListing::cancel()
 {
+    NM_FUNCTION;
+    
     if (!mFolderListing->mIsRunning) {
         return;
     }
@@ -127,6 +138,8 @@
  */
 bool NmApiFolderListing::isRunning() const
 {
+    NM_FUNCTION;
+    
     return mFolderListing->mIsRunning;
 }
 
--- a/emailservices/nmclientapi/src/nmapifolderlisting_p.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapifolderlisting_p.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -14,6 +14,9 @@
  * Description:
  *
  */
+
+#include "emailtrace.h"
+
 #include "nmapiengine.h"
 #include "nmapifolderlisting_p.h"
 
@@ -28,7 +31,7 @@
 NmApiFolderListingPrivate::NmApiFolderListingPrivate(QObject *parent) :
     QObject(parent), mEngine(NULL)
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -36,6 +39,8 @@
  */
 NmApiFolderListingPrivate::~NmApiFolderListingPrivate()
 {
+    NM_FUNCTION;
+    
     releaseEngine();
 }
 
@@ -48,6 +53,8 @@
  */
 bool NmApiFolderListingPrivate::initializeEngine()
 {
+    NM_FUNCTION;
+    
     if (!mEngine) {
         mEngine = NmApiEngine::instance();
     }
@@ -62,6 +69,8 @@
  */
 void NmApiFolderListingPrivate::releaseEngine()
 {
+    NM_FUNCTION;
+    
     NmApiEngine::releaseInstance(mEngine);
 }
 
@@ -75,6 +84,8 @@
  */
 qint32 NmApiFolderListingPrivate::grabFolders()
 {
+    NM_FUNCTION;
+    
     if (!mEngine) {
         return -1;
     }
--- a/emailservices/nmclientapi/src/nmapimailbox.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapimailbox.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include <nmapimailbox.h>
 #include "nmapimailbox_p.h"
 
@@ -28,6 +30,8 @@
  */
 NmApiMailbox::NmApiMailbox()
 {
+    NM_FUNCTION;
+    
     d = new NmApiMailboxPrivate();
 }
 
@@ -37,7 +41,7 @@
 NmApiMailbox::NmApiMailbox(const NmApiMailbox &nmApiMailbox)
 : d(nmApiMailbox.d)
 {
-    
+    NM_FUNCTION;
 }
 
 /*!
@@ -45,7 +49,7 @@
  */
 NmApiMailbox::~NmApiMailbox()
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -53,6 +57,8 @@
  */
 NmApiMailbox &NmApiMailbox::operator=(const NmApiMailbox &mailbox)
 {
+    NM_FUNCTION;
+    
     if (this != &mailbox) {
         d = mailbox.d;
     }
@@ -64,6 +70,8 @@
  */
 bool NmApiMailbox::operator==(const NmApiMailbox &mailbox)
 {
+    NM_FUNCTION;
+    
     bool returnValue = false;
     if (d == mailbox.d) {
         returnValue = true;
@@ -76,6 +84,8 @@
  */
 quint64 NmApiMailbox::id() const
 {
+    NM_FUNCTION;
+    
     return d->id;
 }
 
@@ -84,6 +94,8 @@
  */
 QString NmApiMailbox::address() const
 {
+    NM_FUNCTION;
+    
     return d->address;
 }
 
@@ -92,6 +104,8 @@
  */
 QString NmApiMailbox::name() const
 {
+    NM_FUNCTION;
+    
     return d->name;
 }
 
@@ -100,6 +114,8 @@
  */
 void NmApiMailbox::setId(quint64 id)
 {
+    NM_FUNCTION;
+    
     d->id = id;
 }
 
@@ -108,6 +124,8 @@
  */
 void NmApiMailbox::setAddress(const QString &address)
 {
+    NM_FUNCTION;
+    
     d->address = address;
 }
 
@@ -116,6 +134,8 @@
  */
 void NmApiMailbox::setName(const QString &name)
 {
+    NM_FUNCTION;
+    
     d->name = name;
 }
 
--- a/emailservices/nmclientapi/src/nmapimailboxlisting.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapimailboxlisting.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include <nmapimailboxlisting.h>
 
 #include <QObject>
@@ -37,6 +39,8 @@
 NmApiMailboxListing::NmApiMailboxListing(QObject *parent) :
     NmApiMessageTask(parent)
 {
+    NM_FUNCTION;
+    
     mNmApiMailboxListingPrivate = new NmApiMailboxListingPrivate(this);
     mNmApiMailboxListingPrivate->mIsRunning = false;
 }
@@ -46,6 +50,8 @@
  */
 NmApiMailboxListing::~NmApiMailboxListing()
 {
+    NM_FUNCTION;
+    
     if (mNmApiMailboxListingPrivate->mIsRunning) {
         mNmApiMailboxListingPrivate->releaseEngine();
     }
@@ -63,6 +69,8 @@
  */
 bool NmApiMailboxListing::getMailboxes(QList<EmailClientApi::NmApiMailbox> &mailboxes)
 {
+    NM_FUNCTION;
+    
     mailboxes.clear();
 
     bool result = false;
@@ -101,6 +109,8 @@
  */
 bool NmApiMailboxListing::start()
 {
+    NM_FUNCTION;
+    
     bool result = false;
     if (mNmApiMailboxListingPrivate->mIsRunning) {
         result = true;
@@ -133,6 +143,8 @@
  */
 void NmApiMailboxListing::cancel()
 {
+    NM_FUNCTION;
+    
     if (mNmApiMailboxListingPrivate->mIsRunning) {
 
         mNmApiMailboxListingPrivate->mIsRunning = false;
@@ -150,6 +162,8 @@
  */
 bool NmApiMailboxListing::isRunning() const
 {
+    NM_FUNCTION;
+    
     return mNmApiMailboxListingPrivate->mIsRunning;
 }
 
--- a/emailservices/nmclientapi/src/nmapimailboxlisting_p.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapimailboxlisting_p.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -14,6 +14,9 @@
  * Description:
  *
  */
+
+#include "emailtrace.h"
+
 #include "nmapiengine.h"
 #include "nmapimailboxlisting_p.h"
 
@@ -24,12 +27,12 @@
 NmApiMailboxListingPrivate::NmApiMailboxListingPrivate(QObject *parent) :
     QObject(parent), mNmApiEngine(NULL)
 {
-
+    NM_FUNCTION;
 }
 
 NmApiMailboxListingPrivate::~NmApiMailboxListingPrivate()
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -42,6 +45,8 @@
  */
 bool NmApiMailboxListingPrivate::initializeEngine()
 {
+    NM_FUNCTION;
+    
     if (!mNmApiEngine) {
         mNmApiEngine = NmApiEngine::instance();
     }
@@ -56,6 +61,8 @@
  */
 void NmApiMailboxListingPrivate::releaseEngine()
 {
+    NM_FUNCTION;
+    
     NmApiEngine::releaseInstance(mNmApiEngine);
 }
 
@@ -69,6 +76,8 @@
  */
 qint32 NmApiMailboxListingPrivate::grabMailboxes()
 {
+    NM_FUNCTION;
+    
     if (!mNmApiEngine) {
         return -1;
     }
--- a/emailservices/nmclientapi/src/nmapimessagebody.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapimessagebody.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include <nmapimessagebody.h>
 #include "nmapimessagebody_p.h"
 
@@ -26,6 +28,8 @@
  */
 NmApiMessageBody::NmApiMessageBody()
 {
+    NM_FUNCTION;
+    
     d = new NmApiMessageBodyPrivate();
 }
 
@@ -34,7 +38,7 @@
  */
 NmApiMessageBody::NmApiMessageBody(const NmApiMessageBody &apiMessageBody) : d(apiMessageBody.d)
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -42,6 +46,8 @@
  */
 NmApiMessageBody& NmApiMessageBody::operator=(const NmApiMessageBody &apiMessageBody)
 {
+    NM_FUNCTION;
+    
 	if (this != &apiMessageBody) 
 	{
 		d = apiMessageBody.d;
@@ -54,6 +60,8 @@
  */    
 bool NmApiMessageBody::operator==(const NmApiMessageBody &apiMessageBody)
 {
+    NM_FUNCTION;
+    
     bool retVal = false;
     if (this->d == apiMessageBody.d)
     {
@@ -67,13 +75,15 @@
  */
 NmApiMessageBody::~NmApiMessageBody()
 {
-
+    NM_FUNCTION;
 }
 /*!
    getter for total size of message body in bytes
  */
 quint64 NmApiMessageBody::totalSize() const
 {
+    NM_FUNCTION;
+    
     return d->totalSize;
 }
 
@@ -82,6 +92,8 @@
  */
 quint64 NmApiMessageBody::fetchedSize() const
 {
+    NM_FUNCTION;
+    
     return d->fetchedSize;
 }
 
@@ -90,6 +102,8 @@
  */
 QString NmApiMessageBody::content() const
 {
+    NM_FUNCTION;
+    
     return d->content;
 }
 
@@ -98,6 +112,8 @@
  */
 void NmApiMessageBody::setTotalSize(quint64 size)
 {
+    NM_FUNCTION;
+    
     d->totalSize = size;
 }
 
@@ -106,6 +122,8 @@
  */
 void NmApiMessageBody::setFetchedSize(quint64 size)
 {
+    NM_FUNCTION;
+    
     d->fetchedSize = size;
 }
 
@@ -114,6 +132,8 @@
  */
 void NmApiMessageBody::setContent(const QString& content)
 {
+    NM_FUNCTION;
+    
     d->content = content;
 }
 }
--- a/emailservices/nmclientapi/src/nmapimessageenvelope.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapimessageenvelope.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include <QString>
 #include <QDateTime>
 
@@ -32,7 +34,7 @@
 NmApiMessageEnvelope::NmApiMessageEnvelope(const NmApiMessageEnvelope &envelope) :
     d(envelope.d)
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -40,6 +42,8 @@
  */
 NmApiMessageEnvelope::NmApiMessageEnvelope()
 {
+    NM_FUNCTION;
+    
     d = new NmApiMessageEnvelopePrivate();
 }
 
@@ -48,7 +52,7 @@
  */
 NmApiMessageEnvelope::~NmApiMessageEnvelope()
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -56,6 +60,8 @@
  */
 NmApiMessageEnvelope &NmApiMessageEnvelope::operator=(const NmApiMessageEnvelope &envelope)
 {
+    NM_FUNCTION;
+    
     if (this != &envelope) {
         d = envelope.d;
     }
@@ -67,6 +73,8 @@
  */
 bool NmApiMessageEnvelope::operator==(const NmApiMessageEnvelope &envelope)
 {
+    NM_FUNCTION;
+    
     bool retVal = false;
     if (this->d == envelope.d) {
         retVal = true;
@@ -79,6 +87,8 @@
  */
 quint64 NmApiMessageEnvelope::id() const
 {
+    NM_FUNCTION;
+    
     return d->id;
 }
 
@@ -87,6 +97,8 @@
  */
 quint64 NmApiMessageEnvelope::parentFolder() const
 {
+    NM_FUNCTION;
+    
     return d->parentFolder;
 }
 
@@ -95,6 +107,8 @@
  */
 QString NmApiMessageEnvelope::subject() const
 {
+    NM_FUNCTION;
+    
     return d->subject;
 }
 
@@ -103,6 +117,8 @@
  */
 QString NmApiMessageEnvelope::sender() const
 {
+    NM_FUNCTION;
+    
     return d->sender;
 }
 
@@ -111,6 +127,8 @@
  */
 void NmApiMessageEnvelope::getToRecipients(QList<EmailClientApi::NmApiEmailAddress> &toRecipients)
 {
+    NM_FUNCTION;
+    
     toRecipients = d->toRecipients;
 }
 
@@ -119,6 +137,8 @@
  */
 void NmApiMessageEnvelope::getCcRecipients(QList<EmailClientApi::NmApiEmailAddress> &ccRecipients)
 {
+    NM_FUNCTION;
+    
     ccRecipients = d->ccRecipients;
 }
 
@@ -127,6 +147,8 @@
  */
 QDateTime NmApiMessageEnvelope::sentTime() const
 {
+    NM_FUNCTION;
+    
     return d->sentTime;
 }
 
@@ -135,6 +157,8 @@
  */
 bool NmApiMessageEnvelope::isRead() const
 {
+    NM_FUNCTION;
+    
     return d->read;
 }
 
@@ -143,6 +167,8 @@
  */
 bool NmApiMessageEnvelope::hasAttachments() const
 {
+    NM_FUNCTION;
+    
     return d->attachments;
 }
 
@@ -151,6 +177,8 @@
  */
 bool NmApiMessageEnvelope::isForwarded() const
 {
+    NM_FUNCTION;
+    
     return d->forwarded;
 }
 
@@ -159,6 +187,8 @@
  */
 bool NmApiMessageEnvelope::isReplied() const
 {
+    NM_FUNCTION;
+    
     return d->replied;
 }
 
@@ -167,6 +197,8 @@
  */
 QString NmApiMessageEnvelope::contentType() const
 {
+    NM_FUNCTION;
+    
     return d->contentType;
 }
 
@@ -175,6 +207,8 @@
  */
 void NmApiMessageEnvelope::getPlainTextBody(EmailClientApi::NmApiMessageBody &body)
 {
+    NM_FUNCTION;
+    
     body.setContent(d->plainText);
     body.setFetchedSize(d->fetchedSize);
     body.setTotalSize(d->totalSize);
@@ -185,6 +219,8 @@
  */
 void NmApiMessageEnvelope::setId(quint64 id)
 {
+    NM_FUNCTION;
+    
     d->id = id;
 }
 
@@ -193,6 +229,8 @@
  */
 void NmApiMessageEnvelope::setParentFolder(quint64 parentFolder)
 {
+    NM_FUNCTION;
+    
     d->parentFolder = parentFolder;
 }
 
@@ -201,6 +239,8 @@
  */
 void NmApiMessageEnvelope::setSubject(const QString &subject)
 {
+    NM_FUNCTION;
+    
     d->subject = subject;
 }
 
@@ -209,6 +249,8 @@
  */
 void NmApiMessageEnvelope::setSender(const QString &sender)
 {
+    NM_FUNCTION;
+    
     d->sender = sender;
 }
 
@@ -218,6 +260,8 @@
 void NmApiMessageEnvelope::setToRecipients(
     const QList<EmailClientApi::NmApiEmailAddress> &toRecipients)
 {
+    NM_FUNCTION;
+    
     d->toRecipients = toRecipients;
 }
 
@@ -227,6 +271,8 @@
 void NmApiMessageEnvelope::setCcRecipients(
     const QList<EmailClientApi::NmApiEmailAddress> &ccRecipients)
 {
+    NM_FUNCTION;
+    
     d->ccRecipients = ccRecipients;
 }
 
@@ -235,6 +281,8 @@
  */
 void NmApiMessageEnvelope::setSentTime(QDateTime sentTime)
 {
+    NM_FUNCTION;
+    
     d->sentTime = sentTime;
 }
 
@@ -243,6 +291,8 @@
  */
 void NmApiMessageEnvelope::setIsRead(bool isRead)
 {
+    NM_FUNCTION;
+    
     d->read = isRead;
 }
 
@@ -251,6 +301,8 @@
  */
 void NmApiMessageEnvelope::setHasAttachments(bool hasAttachments)
 {
+    NM_FUNCTION;
+    
     d->attachments = hasAttachments;
 }
 
@@ -259,6 +311,8 @@
  */
 void NmApiMessageEnvelope::setIsForwarded(bool isForwarded)
 {
+    NM_FUNCTION;
+    
     d->forwarded = isForwarded;
 }
 
@@ -267,6 +321,8 @@
  */
 void NmApiMessageEnvelope::setIsReplied(bool isReplied)
 {
+    NM_FUNCTION;
+    
     d->replied = isReplied;
 }
 
@@ -275,6 +331,8 @@
  */
 void NmApiMessageEnvelope::setContentType(const QString &contentType)
 {
+    NM_FUNCTION;
+    
     d->contentType = contentType;
 }
 
@@ -283,6 +341,8 @@
  */
 void NmApiMessageEnvelope::setPlainText(const QString &plainText)
 {
+    NM_FUNCTION;
+    
     d->plainText = plainText;
 }
 
@@ -291,6 +351,8 @@
  */
 void NmApiMessageEnvelope::setTotalSize(quint64 totalSize)
 {
+    NM_FUNCTION;
+    
     d->totalSize = totalSize;
 }
 
@@ -299,6 +361,8 @@
  */
 void NmApiMessageEnvelope::setFetchedSize(quint64 fetchedSize)
 {
+    NM_FUNCTION;
+    
     d->fetchedSize = fetchedSize;
 }
 
@@ -307,6 +371,8 @@
  */
 QString NmApiMessageEnvelope::plainText() const
 {
+    NM_FUNCTION;
+    
     return d->plainText;
 }
 
@@ -315,6 +381,8 @@
  */
 quint64 NmApiMessageEnvelope::totalSize() const
 {
+    NM_FUNCTION;
+    
     return d->totalSize;
 }
 
@@ -323,6 +391,8 @@
  */
 quint64 NmApiMessageEnvelope::fetchedSize() const
 {
+    NM_FUNCTION;
+    
     return d->fetchedSize;
 }
 }
--- a/emailservices/nmclientapi/src/nmapimessagetask.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapimessagetask.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include <nmapimessagetask.h>
 
 /*!
@@ -23,6 +25,7 @@
 NmApiMessageTask::NmApiMessageTask(QObject *parent)
 : QObject(parent)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -30,6 +33,6 @@
  */
 NmApiMessageTask::~NmApiMessageTask()
 {
-
+    NM_FUNCTION;
 }
 
--- a/emailservices/nmclientapi/src/nmapitypesconverter.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmclientapi/src/nmapitypesconverter.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include "nmapitypesconverter.h"
 
 #include <nmapicommonheader.h>
@@ -26,6 +28,8 @@
  */
 EmailClientApi::NmApiMailbox NmToApiConverter::NmMailbox2NmApiMailbox(const NmMailbox &mailbox)
 {
+    NM_FUNCTION;
+    
     EmailClientApi::NmApiMailbox api_mailbox;
     api_mailbox.setId(mailbox.id().id());
     api_mailbox.setName(mailbox.name());
@@ -39,6 +43,8 @@
  */
 EmailClientApi::NmApiFolder NmToApiConverter::NmFolder2NmApiFolder(const NmFolder &folder)
 {
+    NM_FUNCTION;
+    
     EmailClientApi::NmApiFolder api_folder;
 
     api_folder.setParentFolderId(folder.parentId().id());
@@ -54,6 +60,8 @@
 EmailClientApi::NmApiMessageEnvelope NmToApiConverter::NmMessageEnvelope2NmApiMessageEnvelope(
     const NmMessageEnvelope &envelope)
 {
+    NM_FUNCTION;
+    
     EmailClientApi::NmApiMessageEnvelope api_env;
     
     QList<NmAddress> to = envelope.toRecipients();
@@ -84,6 +92,8 @@
 QList<EmailClientApi::NmApiEmailAddress> NmToApiConverter::NmAddress2QString(
     const QList<NmAddress> &addresses)
 {
+    NM_FUNCTION;
+    
     QList<EmailClientApi::NmApiEmailAddress> nmAddresses;
     for (int i = 0; i < addresses.count(); i++) {
         EmailClientApi::NmApiEmailAddress addr;
--- a/emailservices/nmregister/inc/nmmailboxregisterinterface_p.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmregister/inc/nmmailboxregisterinterface_p.h	Wed Jun 23 17:00:39 2010 +0100
@@ -22,13 +22,7 @@
 //  INCLUDES
 #include <QObject>
 #include <qmobilityglobal.h>
-
-#ifdef Q_OS_SYMBIAN
 #include <xqserviceprovider.h>
-#else
-#include <QVariant>
-#endif
-
 
 //  FORWARD DECLARATIONS
 class QString;
@@ -40,12 +34,7 @@
 
 QTM_USE_NAMESPACE
 
-
-#ifdef Q_OS_SYMBIAN
 class NmMailboxRegisterInterfacePrivate : public XQServiceProvider
-#else
-class NmMailboxRegisterInterfacePrivate : public QObject
-#endif
 {
     Q_OBJECT
 
@@ -68,6 +57,8 @@
     bool pushWidgetToHomescreen(quint64 a, QString accountIconName);
     
     QString formLaunchUri(quint64 accountId) const;
+    
+    bool loadMenuClientService();
 
 private: 
     QServiceManager* mManager;
--- a/emailservices/nmregister/nmregister.pro	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmregister/nmregister.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -21,7 +21,6 @@
 MOBILITY = serviceframework
 TARGET = nmregister
 QT += core
-#RESOURCES += nmregister.qrc
 LIBS += -lxqservice \
         -lnmailuiengine \
         -leuser \
@@ -35,10 +34,6 @@
 pluginDep.path = $$QT_PLUGINS_BASE_DIR
 DEPLOYMENT += pluginDep
 
-#addFiles.sources += ./resources/nmregister.xml
-#addFiles.path = xmldata
-#DEPLOYMENT += addFiles
-
 BLD_INF_RULES.prj_exports += "resource/nmregister.xml 			z:/private/2002DD16/nmregister.xml"
 BLD_INF_RULES.prj_exports += "rom/nmregister.iby		CORE_APP_LAYER_IBY_EXPORT_PATH(nmregister.iby)"
 BLD_INF_RULES.prj_exports += "rom/nmregisterlanguage.iby 		LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(nmregisterlanguage.iby)"
@@ -57,5 +52,4 @@
 INCLUDEPATH += ../../inc
 
 DEPENDPATH += .
-#commented out until MCL has nmregister files in place here: epoc32/include/platform/qt/translations/
-#TRANSLATIONS = nmregister.ts
+TRANSLATIONS = nmregister.ts
--- a/emailservices/nmregister/rom/nmregister.iby	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmregister/rom/nmregister.iby	Wed Jun 23 17:00:39 2010 +0100
@@ -21,6 +21,6 @@
 #include <bldvariant.hrh>
 
 file=ABI_DIR\BUILD_DIR\nmregister.dll                         SHARED_LIB_DIR\nmregister.dll
-data=\epoc32\data\z\resource\qt\plugins\nmregister.qtplugin   resource\qt\plugins\nmregister.qtplugin
+data=ZRESOURCE\qt\plugins\nmregister.qtplugin   RESOURCE_FILES_DIR\qt\plugins\nmregister.qtplugin
 data=ZPRIVATE\2002DD16\nmregister.xml      					  private\2002DD16\nmregister.xml
 #endif  // __NMREGISTER_IBY__
--- a/emailservices/nmregister/src/nmmailboxregisterinterface.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmregister/src/nmmailboxregisterinterface.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include <qservicemanager.h>
 #include <qserviceinterfacedescriptor.h>
 #include <HbIcon>
@@ -25,284 +27,320 @@
 #include "nmmailboxregisterinterface_p.h" 
 
 //mandatory keys 
-const QString hsItemName          ("item:name"); 
-const QString hsitemLaunchUri     ("item:launchuri"); 
-const QString hsitemPublisherId   ("item:publisherId"); 
+const QString hsItemName("item:name");
+const QString hsitemLaunchUri("item:launchuri");
+const QString hsitemPublisherId("item:publisherId");
 //not mandatory 
-const QString hsItemWidgetUri     ("widget:uri"); 
-const QString hsItemDescription   ("item:description"); 
+const QString hsItemWidgetUri("widget:uri");
+const QString hsItemDescription("item:description");
 //for icon - not mandatory 
-const QString hsIconFileName      ("icon:filename");//to display specific icon from file 
-const QString hsIconName          ("icon:name");// HbIcon 
-const QString hsIconApplicationId ("icon:applicationid"); // icon from associated application 
+const QString hsIconFileName("icon:filename");//to display specific icon from file 
+const QString hsIconName("icon:name");// HbIcon 
+const QString hsIconApplicationId("icon:applicationid"); // icon from associated application 
 
 //Custom for nmHsWidgets
 //NmHsWidgetParamAccountId is used to identify what email account will be monitored by 
 //the registered hs widget
-const QString NmHsWidgetParamAccountId     ("widgetparam:accountId");
+const QString NmHsWidgetParamAccountId("widgetparam:accountId");
 //same as above but for pushing the widget to homescreen
-const QString NmHsAccountId       ("accountId");
+const QString NmHsAccountId("accountId");
 //NmHsWidgetParamAccountIconName is used to identify mailbox icon in application library
-const QString NmHsWidgetParamAccountIconName     ("widgetparam:accountIconName");
+const QString NmHsWidgetParamAccountIconName("widgetparam:accountIconName");
 //same as above but for pushing the widget to homescreen
-const QString NmHsAccountIconName  ("accountIconName");
+const QString NmHsAccountIconName("accountIconName");
 //This is used to identify nmhswidget in homescreen
-const QString NmHsWidget          ("nmhswidget");
+const QString NmHsWidget("nmhswidget");
 
 //parameter values
-const QString NmPublisherName     ("NmMailboxRegisterInterface");
-const QString NmLaunchUri         ("appto://0x200255BA?activityname=EmailInboxView&accountId=");
+const QString NmPublisherName("NmMailboxRegisterInterface");
+const QString NmLaunchUri("appto://0x200255BA?activityname=EmailInboxView&accountId=");
 //URI for the defined service
 const QLatin1String interfaceUri("com.nokia.symbian.IEmailRegisterAccount");
 
 /** Localization file name*/
 const QString KNmRegisterLocFileName = "nmregister_";
 /** Localization file location*/
-const QString KNmRegisterLocLocation = "z:/resource/qt/translations/";
+const QString KNmRegisterLocLocation = "/translations/";
 
 /*!
-    Constructor
-*/
+ Constructor
+ */
 NmMailboxRegisterInterface::NmMailboxRegisterInterface(QObject *parent) :
-    QObject(parent), m_d( new NmMailboxRegisterInterfacePrivate(this) )
-    {
-    }
+    QObject(parent), m_d(new NmMailboxRegisterInterfacePrivate(this))
+{
+    NM_FUNCTION;
+}
 
 /*!
-    Destructor
-*/
+ Destructor
+ */
 NmMailboxRegisterInterface::~NmMailboxRegisterInterface()
-    {
+{
+    NM_FUNCTION;
+    
     delete m_d;
-    }
+}
 
 /*!
-    registerNewMailbox
-*/
-bool NmMailboxRegisterInterface::registerNewMailbox(quint64 accountId, 
-        QString accountName, QString accountIconName)
-    {
-    return m_d->registerNewMailbox( accountId, accountName, accountIconName );
-    }
+ registerNewMailbox
+ */
+bool NmMailboxRegisterInterface::registerNewMailbox(
+    quint64 accountId,
+    QString accountName,
+    QString accountIconName)
+{
+    NM_FUNCTION;
+    
+    return m_d->registerNewMailbox(accountId, accountName, accountIconName);
+}
 
 /*!
-    updateMailboxName
-*/
-bool NmMailboxRegisterInterface::updateMailboxName(quint64 accountId, 
-        QString newName)
-    {
-    return m_d->updateMailboxName( accountId, newName );
-    }
-
+ updateMailboxName
+ */
+bool NmMailboxRegisterInterface::updateMailboxName(quint64 accountId, QString newName)
+{
+    NM_FUNCTION;
+    
+    return m_d->updateMailboxName(accountId, newName);
+}
 
 /*!
-    unregisterMailbox
-*/
+ unregisterMailbox
+ */
 bool NmMailboxRegisterInterface::unregisterMailbox(quint64 accountId)
-    {
-    return m_d->unregisterMailbox( accountId );
-    }
+{
+    NM_FUNCTION;
+    
+    return m_d->unregisterMailbox(accountId);
+}
 
-
-
-
+/*!
+ Constructor
+ */
+NmMailboxRegisterInterfacePrivate::NmMailboxRegisterInterfacePrivate(QObject *parent) :
+    XQServiceProvider(interfaceUri, parent), 
+    mManager(new QServiceManager()), 
+    mService(0),
+    mTranslator(new QTranslator())
+{
+    NM_FUNCTION;
+}
 
 /*!
-    Constructor
-*/
-NmMailboxRegisterInterfacePrivate::NmMailboxRegisterInterfacePrivate(QObject *parent) :
-    XQServiceProvider(interfaceUri, parent ), 
-    mManager(0),
-    mService(0),
-    mTranslator(0)
-    {
-    //commented out until MCL has nmregister files in place here: epoc32/include/platform/qt/translations/
-    /*mTranslator = new QTranslator();
-    QString lang = QLocale::system().name();
-    bool loadSucceed = mTranslator->load(KNmRegisterLocFileName + lang, KNmRegisterLocLocation);
-    qDebug() << "NmMailboxRegisterInterfacePrivate mTranslator->load loadSucceed:"<<loadSucceed;
-    QCoreApplication::installTranslator(mTranslator);*/
+ loadMenuClientService()
+ Loads the Menu client service to mService. 
+ \return true if mService exists or is succesfully loaded, otherwise false.
+ */
+bool NmMailboxRegisterInterfacePrivate::loadMenuClientService()
+{
+    if (mService){ 
+        return true; //service is already loaded
+    }
     
-    mManager = new QServiceManager();
     QServiceFilter filter("com.nokia.symbian.IMenuClient");
     QList<QServiceInterfaceDescriptor> interfaces = mManager->findInterfaces(filter);
-    mService = mManager->loadInterface(interfaces.first()); 
+    if(interfaces.isEmpty()){
+        return false; //no maching interfaces available
     }
+    
+    mService = mManager->loadInterface(interfaces.first());
+    if(!mService){
+        return false; //loading interface failed
+    }
+    
+    return true; //succesfully loaded the service
+}
 
 /*!
-    Destructor
-*/
+ Destructor
+ */
 NmMailboxRegisterInterfacePrivate::~NmMailboxRegisterInterfacePrivate()
-    {
-    if(mTranslator){
-        delete mTranslator;
-        mTranslator = NULL;
+{
+    NM_FUNCTION;
+
+    delete mTranslator;
+    mTranslator = NULL;
+
+    delete mService;
+    mService = NULL;
+
+    delete mManager;
+    mManager = NULL;
+}
+
+bool NmMailboxRegisterInterfacePrivate::registerNewMailbox(
+    quint64 accountId,
+    QString accountName,
+    QString accountIconName)
+{
+    NM_FUNCTION;
+	
+    if(!loadMenuClientService()){
+        NM_ERROR(1,"loadService() failed!");
+        return false; 
     }
-    if (mService) 
-        {
-        delete mService;
-        }
-    if (mManager) 
-        {
-        delete mManager;
-        }
+    
+    //localization
+    QString lang = QLocale::system().name();
+    bool loadSucceed = mTranslator->load(KNmRegisterLocFileName + lang, KNmRegisterLocLocation);
+    QCoreApplication::installTranslator(mTranslator);
+    
+    //check that accountIconName is valid otherwise pass default mailbox icon
+    HbIcon mailBoxIcon(accountIconName);
+    if (mailBoxIcon.pixmap().height() == 0) {
+        mailBoxIcon = NmIcons::getIcon(NmIcons::NmIconDefaultMailbox);
+        accountIconName = mailBoxIcon.iconName();
     }
 
+    QMap<QString, QVariant> map;
+    //------------------------------
+    map[hsItemName] = accountName;
+    map[hsitemLaunchUri] = formLaunchUri(accountId);
+    map[hsitemPublisherId] = NmPublisherName;
+    map[hsItemWidgetUri] = NmHsWidget;
+    map[hsItemDescription] = hbTrId("txt_mail_widget_dblist_preview_of_recent_mail");
+    map[hsIconFileName] = accountIconName;
+    // to add widget params that are mapped to widgets properties
+    map[NmHsWidgetParamAccountId] = QString::number(accountId);
+    map[NmHsWidgetParamAccountIconName] = accountIconName;
+    //------------------------------
 
-bool NmMailboxRegisterInterfacePrivate::registerNewMailbox(quint64 accountId,
-        QString accountName, QString accountIconName)
-    {
-    //check that accountIconName is valid otherwise pass default mailbox icon
-    HbIcon mailBoxIcon(accountIconName);
-    if(mailBoxIcon.pixmap().height() == 0){
-        mailBoxIcon = NmIcons::getIcon(NmIcons::NmIconDefaultMailbox);
-        accountIconName = mailBoxIcon.iconName();
+    bool retVal(false);
+    bool ret(false);
+    ret = QMetaObject::invokeMethod( mService,"add",
+        Qt::DirectConnection,
+        Q_RETURN_ARG(bool, retVal),
+        Q_ARG(QVariantMap, map));
+
+    //Push the registered widget also to homescreen right away
+    bool pushRetVal = pushWidgetToHomescreen(accountId, accountIconName);
+
+    return (retVal && ret && pushRetVal);
+}
+
+bool NmMailboxRegisterInterfacePrivate::updateMailboxName(quint64 accountId, QString newName)
+{
+    NM_FUNCTION;
+
+    if(!loadMenuClientService()){
+    	NM_ERROR(1,"loadService() failed!");
+        return false; 
     }
     
     QMap<QString, QVariant> map;
     //------------------------------
-    map[hsItemName]        = accountName;
-    map[hsitemLaunchUri]   = formLaunchUri(accountId);
+    map[hsitemLaunchUri] = formLaunchUri(accountId);
     map[hsitemPublisherId] = NmPublisherName;
-    map[hsItemWidgetUri]   = NmHsWidget;
-    //commented out until MCL has nmregister files in place here: epoc32/include/platform/qt/translations/
-    //map[hsItemDescription] = hbTrId("txt_mail_widget_dblist_preview_of_recent_mail");
-    map[hsItemDescription] = "test description for widget";
-    map[hsIconFileName]    = accountIconName;
-    // to add widget params that are mapped to widgets properties
-    map[NmHsWidgetParamAccountId]   = QString::number(accountId);
-    map[NmHsWidgetParamAccountIconName]   = accountIconName;
+    map[hsItemWidgetUri] = NmHsWidget;
+    map[NmHsWidgetParamAccountId] = QString::number(accountId);
     //------------------------------
-    
+
+    QList<QVariantMap> list; //list of items that mach the query
     bool retVal(false);
+    bool ret(false);
+    ret = QMetaObject::invokeMethod(mService, "getList", 
+        Qt::DirectConnection, 
+        Q_RETURN_ARG(QList<QVariantMap> , list),
+        Q_ARG(QVariantMap, map));
+
+    //Normally there should be only one instance, but just in case
+    while (!list.isEmpty()) {
+        //update the account name
+        list.first()[hsItemName] = newName;
+        //commit changes
+        ret = QMetaObject::invokeMethod( mService,"add",
+            Qt::DirectConnection,
+            Q_RETURN_ARG(bool, retVal),
+            Q_ARG(QVariantMap, list.first()));
+        list.removeFirst();
+    }
+    //if either invoke or "getList" or "add" return failure
+    return (retVal && ret);
+}
+
+bool NmMailboxRegisterInterfacePrivate::unregisterMailbox(quint64 accountId)
+{
+    NM_FUNCTION;
+
+    if(!loadMenuClientService()){
+    	NM_ERROR(1,"loadService() failed!");
+        return false; 
+    }
     
-    bool ret = QMetaObject::invokeMethod(  mService,"add",
-                    Qt::DirectConnection,
-                    Q_RETURN_ARG(bool, retVal),
-                    Q_ARG(QVariantMap, map)); 
+    QMap<QString, QVariant> map;
+    //------------------------------
+    map[hsitemLaunchUri] = formLaunchUri(accountId);
+    map[hsitemPublisherId] = NmPublisherName;
+    map[hsItemWidgetUri] = NmHsWidget;
+    map[NmHsWidgetParamAccountId] = QString::number(accountId);
+    //------------------------------
 
-    //Push the registered widget also to homescreen right away
-    bool pushRetVal = pushWidgetToHomescreen(accountId, accountIconName);
-    
-    return (retVal && ret && pushRetVal);
+    QList<QVariantMap> list; //list of items that mach the query
+    bool retVal(false);
+    bool ret(false);
+    ret = QMetaObject::invokeMethod(mService, "getList", 
+        Qt::DirectConnection, 
+        Q_RETURN_ARG(QList<QVariantMap> , list), 
+        Q_ARG(QVariantMap, map));
+
+    //Normally there should be only one instance, but just in case
+    //Otherwise there will be ghost instances in the application list
+    while (!list.isEmpty()) {
+
+        //commit changes
+        ret = QMetaObject::invokeMethod( mService,"remove",
+            Qt::DirectConnection,
+            Q_RETURN_ARG(bool, retVal),
+            Q_ARG(QVariantMap, list.first()));
+        list.removeFirst();
     }
 
-bool NmMailboxRegisterInterfacePrivate::updateMailboxName(quint64 accountId,
-        QString newName)
-    {
-    QMap<QString, QVariant> map;
-     //------------------------------
-     map[hsitemLaunchUri]   = formLaunchUri(accountId);
-     map[hsitemPublisherId] = NmPublisherName;
-     map[hsItemWidgetUri]   = NmHsWidget;
-     map[NmHsWidgetParamAccountId]   = QString::number(accountId);
-     //------------------------------
-     
-     QList<QVariantMap> list; //list of items that mach the query
-     bool retVal(false);
-     bool ret = QMetaObject::invokeMethod(  mService,"getList",
-                     Qt::DirectConnection,
-                     Q_RETURN_ARG(QList<QVariantMap>, list),
-                     Q_ARG(QVariantMap, map)); 
-
-     
-     //Normally there should be only one instance, but just in case
-     while( !list.isEmpty() ) 
-         {  
-         //update the account name
-         list.first()[hsItemName] = newName;
-         //commit changes
-         ret = QMetaObject::invokeMethod(  mService,"add",
-                         Qt::DirectConnection,
-                         Q_RETURN_ARG(bool, retVal),
-                         Q_ARG(QVariantMap, list.first()));  
-         list.removeFirst();
-         }
-     //if either invoke or "getList" or "add" return failure
-     return (retVal && ret);
-    }
+    return (retVal && ret);
+}
 
-bool NmMailboxRegisterInterfacePrivate::unregisterMailbox(quint64 accountId)
-    {
-    
-    QMap<QString, QVariant> map;
-     //------------------------------
-     map[hsitemLaunchUri]   = formLaunchUri(accountId);
-     map[hsitemPublisherId] = NmPublisherName;
-     map[hsItemWidgetUri]   = NmHsWidget;
-     map[NmHsWidgetParamAccountId]     = QString::number(accountId);
-     //------------------------------
-     
-     QList<QVariantMap> list; //list of items that mach the query
-     bool retVal(false);
-     bool ret = QMetaObject::invokeMethod(  mService,"getList",
-                     Qt::DirectConnection,
-                     Q_RETURN_ARG(QList<QVariantMap>, list),
-                     Q_ARG(QVariantMap, map)); 
-    
+bool NmMailboxRegisterInterfacePrivate::pushWidgetToHomescreen(
+    quint64 accountId,
+    QString accountIconName)
+{
+    NM_FUNCTION;
     
-    //Normally there should be only one instance, but just in case
-    //Otherwise there will be ghost instances in the application list
-     while( !list.isEmpty() ) 
-         {  
-
-         //commit changes
-         ret = QMetaObject::invokeMethod(  mService,"remove",
-                         Qt::DirectConnection,
-                         Q_RETURN_ARG(bool, retVal),
-                         Q_ARG(QVariantMap, list.first()));  
-         list.removeFirst();
-         }
-
-     return (retVal && ret);
-    }
-
-bool NmMailboxRegisterInterfacePrivate::pushWidgetToHomescreen( quint64 accountId, QString accountIconName )
-    {
     // load plugin
     QServiceManager manager;
     QServiceFilter filter("com.nokia.symbian.IHomeScreenClient");
     filter.setServiceName("hshomescreenclientplugin");
     QList<QServiceInterfaceDescriptor> interfaces = manager.findInterfaces(filter);
-    
-    if(interfaces.isEmpty()) 
-        {
-        QServiceManager::Error errori = manager.error();
+
+    if (interfaces.isEmpty()) {
         return false;
-        }
-    QObject* service = manager.loadInterface( interfaces.first() );
-    if(!service){qDebug() << "service is null ";}
-    
+    }
+    QObject* service = manager.loadInterface(interfaces.first());
+    if (!service) {
+        NM_ERROR(1,"service is null ");
+        return false;
+    }
+
     //--------------------------------
     QVariantHash map;
     map[NmHsAccountId] = QString::number(accountId);
     map[NmHsAccountIconName] = accountIconName;
     //--------------------------------
-    
+
     // invoke function synchronously
     bool retVal(false);
-    bool ret = QMetaObject::invokeMethod(  service, "addWidget",
-                    Qt::DirectConnection,
-                    Q_RETURN_ARG(bool, retVal),
-                    Q_ARG(QString, NmHsWidget),
-                    Q_ARG(QVariantHash, map));
-   
-    if(!ret){
-        qDebug()<< "method invoke failed!";
-    }
-    if(!retVal){
-        qDebug() << "addWidget() failed!!";
-    }
-    
-    if(service)
-        {
-        delete service;
-        }
-    
+    bool ret(false);
+    ret = QMetaObject::invokeMethod( service, "addWidget",
+        Qt::DirectConnection,
+        Q_RETURN_ARG(bool, retVal),
+        Q_ARG(QString, NmHsWidget),
+        Q_ARG(QVariantHash, map));
+
+    delete service;
+    service = NULL;
+
     return (retVal && ret);
-    }
+}
 
 QString NmMailboxRegisterInterfacePrivate::formLaunchUri(quint64 accountId) const
-    {
+{
     return NmLaunchUri + QString::number(accountId);
-    }
+}
--- a/emailservices/nmregister/src/nmmailboxregisterinterfaceplugin.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmregister/src/nmmailboxregisterinterfaceplugin.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
 *
 */
 
+#include "emailtrace.h"
+
 #include <qserviceinterfacedescriptor.h>
 #include <qabstractsecuritysession.h>
 #include <qservicecontext.h>
@@ -30,17 +32,23 @@
                                                 QServiceContext *context,
                                                 QAbstractSecuritySession *session)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(context);
     Q_UNUSED(session);
-
+    
     if (descriptor.interfaceName() == QLatin1String("com.nokia.symbian.IEmailRegisterAccount")) {
-        return new NmMailboxRegisterInterface(this);
+        QT_TRY{
+            return new NmMailboxRegisterInterface(this);
+        }QT_CATCH(...){
+            return 0;
+        }
     } else {
         return 0;
     }
 }
 
-Q_EXPORT_PLUGIN2(hsmenucontentpublishplugin, NmMailboxRegisterInterfacePlugin)
+Q_EXPORT_PLUGIN2(nmregister, NmMailboxRegisterInterfacePlugin)
 
 #ifdef COVERAGE_MEASUREMENT
 #pragma CTC ENDSKIP
Binary file emailservices/nmutilities/data/2001E277.txt has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/data/icons/aol.svg	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="44" height="44" viewBox="0 0 44 44">
+<rect fill="none" height="44" width="44"/>
+<circle cx="16.782" cy="22.024" fill="#0360A8" r="9.291"/>
+<path d="M4.518,17.73c0.18,0.019,0.272-0.093,0.379-0.323c0.119-0.258,0.648-1.375,0.735-1.551 c0.231-0.471,1.167-1.821,1.349-2.031c0.863-1.013,1.889-1.956,3.134-2.73c1.509-0.926,3.344-1.63,5.262-1.864 c0.462-0.061,1.577-0.099,1.793-0.087c0.427,0.012,1.587,0.132,1.617,0.131c0.085,0.004,0.271-0.014,0.313-0.167 c0.016-0.052-0.005-0.125-0.032-0.156c-0.004-0.004-0.012-0.015-0.014-0.02c-0.019-0.028-0.09-0.087-0.104-0.098 c-0.138-0.105-1.564-0.922-1.657-0.977c-1.035-0.593-9.261-5.346-9.288-5.362C7.279,2.08,6.6,1.943,6.048,2.021 c-0.405,0.057-0.777,0.255-1.045,0.55C4.74,2.853,4.545,3.249,4.441,3.717C4.385,3.978,4.356,4.3,4.356,4.615 c0,0.485-0.01,12.065-0.006,12.406C4.353,17.416,4.326,17.697,4.518,17.73z" fill="#0360A8"/>
+<path d="M19.096,34.852c-0.078-0.121-0.215-0.131-0.438-0.109c-0.053,0-0.107,0.014-0.155,0.018 c-1.094,0.143-2.195,0.131-3.269-0.012c-1.696-0.223-3.345-0.786-4.828-1.652c-1.494-0.877-2.82-2.066-3.885-3.531 c-0.253-0.356-0.496-0.729-0.715-1.111C5.504,27.93,4.97,26.734,4.94,26.669c-0.065-0.136-0.055-0.131-0.143-0.278 c-0.042-0.06-0.091-0.101-0.154-0.117c-0.062-0.017-0.1-0.012-0.135-0.004c-0.079,0.026-0.097,0.045-0.124,0.135 c-0.005,0.029-0.009,0.113-0.017,0.193c-0.002,0.029-0.004,0.135-0.007,0.262c-0.005,0.205-0.003,0.16-0.003,0.355 c0,0.165,0,0.328,0,0.495c0,0.181,0,0.358,0,0.537c0,0.106,0,0.219,0,0.333c0,0.466,0,0.938,0.005,1.411c0,0.725,0,1.446,0,2.174 c0,1.194,0,2.388,0.003,3.58c0,1.196,0,2.392,0,3.584c0,0.034,0,0.065,0,0.103c0,1.418,0.623,2.315,1.571,2.524 c0.376,0.08,0.797,0.06,1.25-0.088c0.256-0.078,0.525-0.199,0.798-0.354c0.427-0.244,10.373-5.979,10.896-6.285 c0.016-0.004,0.068-0.045,0.122-0.097C19.067,35.061,19.154,34.964,19.096,34.852z" fill="#0360A8"/>
+<path d="M26.605,30.391c-0.17-0.162-0.008-0.394,0.256-0.738c0.143-0.188,0.679-0.938,0.773-1.09 c0.336-0.537,0.648-1.09,0.912-1.662c0.123-0.264,0.232-0.531,0.326-0.807c0.456-1.345,0.786-2.753,0.786-4.181 c-0.015-1.726-0.251-3.33-0.929-5.03c-0.158-0.406-0.66-1.395-0.722-1.507c-0.223-0.418-0.538-0.869-0.884-1.364 c-0.282-0.362-0.24-0.553-0.137-0.604c0.021-0.012,0.078-0.031,0.152-0.009c0.03,0.009,0.09,0.021,0.192,0.077 c0.071,0.033,0.205,0.105,0.325,0.174c0.135,0.081,1.1,0.656,1.195,0.708c1.027,0.604,2.023,1.21,3.054,1.812 c1.036,0.596,6.225,3.678,6.251,3.693c0.722,0.426,1.178,0.953,1.373,1.472c0.143,0.379,0.154,0.779,0.031,1.16 c-0.111,0.366-0.349,0.724-0.701,1.044c-0.199,0.184-0.44,0.35-0.715,0.506c-0.422,0.242-10.662,6.021-10.969,6.189 C26.891,30.393,26.738,30.503,26.605,30.391z" fill="#0360A8"/>
+<path d="M15.184,40.294c0,0.92,0.72,1.646,1.634,1.646c0.895,0,1.644-0.752,1.644-1.646 c0-0.938-0.706-1.647-1.644-1.647C15.918,38.646,15.184,39.387,15.184,40.294z M15.435,40.275c0-0.77,0.624-1.393,1.383-1.393 c0.759,0,1.382,0.637,1.382,1.424c0,0.771-0.623,1.396-1.382,1.396C16.069,41.704,15.435,41.051,15.435,40.275z" fill="#0360A8"/>
+<path d="M17.127,40.645l-0.215-0.31l0.05-0.008c0.289-0.031,0.464-0.224,0.464-0.515 c0-0.293-0.201-0.441-0.592-0.441c0,0-0.479,0-0.532,0v1.816h0.301c0-0.059-0.004-0.84-0.004-0.84l0.026,0.006l0.529,0.834 c0,0,0.25,0.006,0.327,0.004C17.432,41.111,17.127,40.645,17.127,40.645z M16.592,40.145v-0.518c0.044,0,0.209,0.005,0.209,0.005 c0.241,0,0.286,0.077,0.286,0.222c0,0.071-0.027,0.295-0.366,0.295C16.721,40.148,16.624,40.145,16.592,40.145z" fill="#0360A8"/>
+</svg>
\ No newline at end of file
Binary file emailservices/nmutilities/data/nmutilities.confml has changed
--- a/emailservices/nmutilities/inc/emailmailboxinfo_p.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmutilities/inc/emailmailboxinfo_p.h	Wed Jun 23 17:00:39 2010 +0100
@@ -63,11 +63,6 @@
      */
     QString mTempIcon;
     QString mTempName;
-
-    /*! 
-         information about success or failure during resource file load
-     */
-    bool mIsResourceLoaded;
     
     /*!
          Map of already imported branding keys
--- a/emailservices/nmutilities/nmutilities.pro	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmutilities/nmutilities.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -26,8 +26,9 @@
 MOBILITY += systeminfo
 
 INCLUDEPATH += inc \
+               ../../inc \
                ../../../inc \
-               $$MW_LAYER_SYSTEMINCLUDE 
+               $$MW_LAYER_SYSTEMINCLUDE
 
 DEPENDPATH += src \
               inc \
@@ -73,12 +74,28 @@
 }
 
 #creating rcc file from qrc
-system(rcc -binary data/email_brand.qrc -o data/email_brand.rcc)
+#system(rcc -binary data/email_brand.qrc -o data/email_brand.rcc)
+#RESOURCES += data/email_brand.qrc
+#"data/email_brand.rcc                  /epoc32/data/Z/resource/apps/email_brand.rcc" \
 
 # Build.inf rules  
 BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
                              "rom/nmutilities.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(nmutilities.iby)" \
-                             "data/email_brand.rcc                  /epoc32/data/Z/resource/apps/email_brand.rcc" \
+                             "data/icons/gmail.svg                  /epoc32/release/winscw/udeb/z/resource/apps/gmail.svg" \
+                             "data/icons/gmail.svg                  /epoc32/release/winscw/urel/z/resource/apps/gmail.svg" \
+                             "data/icons/gmail.svg                  /epoc32/data/z/resource/apps/gmail.svg" \
+                             "data/icons/microsoft.svg              /epoc32/release/winscw/udeb/z/resource/apps/microsoft.svg" \
+                             "data/icons/microsoft.svg              /epoc32/release/winscw/urel/z/resource/apps/microsoft.svg" \
+                             "data/icons/microsoft.svg              /epoc32/data/z/resource/apps/microsoft.svg" \
+                             "data/icons/ovi.svg                    /epoc32/release/winscw/udeb/z/resource/apps/ovi.svg" \
+                             "data/icons/ovi.svg                    /epoc32/release/winscw/urel/z/resource/apps/ovi.svg" \
+                             "data/icons/ovi.svg                    /epoc32/data/z/resource/apps/ovi.svg" \
+                             "data/icons/yahoo.svg                  /epoc32/release/winscw/udeb/z/resource/apps/yahoo.svg" \
+                             "data/icons/yahoo.svg                  /epoc32/release/winscw/urel/z/resource/apps/yahoo.svg" \
+                             "data/icons/yahoo.svg                  /epoc32/data/z/resource/apps/yahoo.svg" \
+                             "data/icons/aol.svg                    /epoc32/release/winscw/udeb/z/resource/apps/aol.svg" \
+                             "data/icons/aol.svg                    /epoc32/release/winscw/urel/z/resource/apps/aol.svg" \
+                             "data/icons/aol.svg                    /epoc32/data/z/resource/apps/aol.svg" \
                              "data/2001E277.txt                     /epoc32/release/winscw/udeb/z/private/10202be9/2001E277.txt" \
                              "data/2001E277.txt                     /epoc32/release/winscw/urel/z/private/10202be9/2001E277.txt" \
                              "data/2001E277.txt                     /epoc32/data/z/private/10202be9/2001E277.txt" \
--- a/emailservices/nmutilities/rom/nmutilities.iby	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmutilities/rom/nmutilities.iby	Wed Jun 23 17:00:39 2010 +0100
@@ -20,5 +20,10 @@
 #include <bldvariant.hrh>
 
 file=ABI_DIR\BUILD_DIR\nmutilities.dll SHARED_LIB_DIR\nmutilities.dll   PAGED
+data=DATAZ_\APP_BITMAP_DIR\ovi.svg     APP_BITMAP_DIR\ovi.svg 
+data=DATAZ_\APP_BITMAP_DIR\gmail.svg   APP_BITMAP_DIR\gmail.svg 
+data=DATAZ_\APP_BITMAP_DIR\microsoft.svg    APP_BITMAP_DIR\microsoft.svg 
+data=DATAZ_\APP_BITMAP_DIR\yahoo.svg   APP_BITMAP_DIR\yahoo.svg 
+data=DATAZ_\APP_BITMAP_DIR\aol.svg   APP_BITMAP_DIR\aol.svg 
 
 #endif // __NMUTILITIES_IBY__
--- a/emailservices/nmutilities/src/emailmailboxinfo.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmutilities/src/emailmailboxinfo.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include "emailmailboxinfo.h"
 #include "emailmailboxinfo_p.h"
 
@@ -23,6 +25,8 @@
  */
 EmailMailboxInfo::EmailMailboxInfo()
 {
+    NM_FUNCTION;
+    
     d = EmailMailboxInfoPrivate::getInstance();
 }
 
@@ -31,6 +35,8 @@
  */
 EmailMailboxInfo::~EmailMailboxInfo()
 {
+    NM_FUNCTION;
+    
     EmailMailboxInfoPrivate::releaseInstance(d);
 }
 
@@ -41,6 +47,8 @@
  */
 QString EmailMailboxInfo::mailboxIcon(const QVariant &identifier) const
 {
+    NM_FUNCTION;
+    
     return d->icon(identifier);
 }
 
@@ -51,6 +59,8 @@
  */
 QString EmailMailboxInfo::mailboxName(const QVariant &identifier) const
 {
+    NM_FUNCTION;
+    
     return d->name(identifier);
 }
 
--- a/emailservices/nmutilities/src/emailmailboxinfo_p.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailservices/nmutilities/src/emailmailboxinfo_p.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
  *
  */
 
+#include "emailtrace.h"
+
 #include "emailmailboxinfo_p.h"
 #include "nmutilitiescommonheaders.h"
 #include "nmcenrepkeys.h"
@@ -44,28 +46,23 @@
      private constructor
  */
 EmailMailboxInfoPrivate::EmailMailboxInfoPrivate() :
-    QObject(NULL), 
-	mIsResourceLoaded(false)
+    QObject(NULL)
 {
+    NM_FUNCTION;
+    
     XQSettingsManager manager;
     XQCentralRepositorySettingsKey rccKey(EMAIL_CENREP, RCC_PATH);
 
     XQCentralRepositorySettingsKey wlbKey(EMAIL_CENREP, WLB_BRAND_NAME);
 
-    mWlbDomainName = manager.readItemValue(wlbKey, XQSettingsManager::TypeString).value<QString> ();
-
-    QString pathToRcc =
-        manager.readItemValue(rccKey, XQSettingsManager::TypeString).value<QString> ();
-    if (!mIsResourceLoaded) {
-        mIsResourceLoaded = QResource::registerResource(pathToRcc);
-    }
+    mWlbDomainName = manager.readItemValue(wlbKey, XQSettingsManager::TypeString).value<QString> ();    
 }
 /*!
      private destructor
  */
 EmailMailboxInfoPrivate::~EmailMailboxInfoPrivate()
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -74,6 +71,8 @@
  */
 EmailMailboxInfoPrivate* EmailMailboxInfoPrivate::getInstance()
 {
+    NM_FUNCTION;
+    
     if (!mSelf) {
         mSelf = new EmailMailboxInfoPrivate();
     }
@@ -87,6 +86,8 @@
  */
 void EmailMailboxInfoPrivate::releaseInstance(EmailMailboxInfoPrivate *&instance)
 {
+    NM_FUNCTION;
+    
     if (instance) {
         mReferenceCount--;
         instance = NULL;
@@ -104,6 +105,8 @@
  */
 QString EmailMailboxInfoPrivate::name(const QVariant &identifier)
 {
+    NM_FUNCTION;
+    
     QString returnValue = "";
     QString domainName = "";
     if (identifier.canConvert<QString> ()) {
@@ -127,10 +130,16 @@
  */
 QString EmailMailboxInfoPrivate::icon(const QVariant &identifier)
 {
+    NM_FUNCTION;
+    
     QString returnValue = "";
     QString domainName = "";
     if (identifier.canConvert<QString> ()) {
         domainName = identifier.value<QString> ();
+        int delimIndex = domainName.lastIndexOf('@');
+        if(delimIndex >= 0) {
+            domainName = domainName.mid(delimIndex + 1);
+        }
     }
 
     if (domainName.length() > 0){
@@ -147,6 +156,8 @@
  */
 void EmailMailboxInfoPrivate::processCenRepRecords(const QString &brandingId)
 {
+    NM_FUNCTION;
+    
     bool found = false;
     QString name;
     QString icon;
@@ -198,13 +209,13 @@
 
             if (regExp.exactMatch(brandingId)) { //match
                 found = true;
-                icon = ":/" + cenRepRecord.at(3);
+                icon = "z:/resource/apps/" + cenRepRecord.at(3) + ".svg";
                 name = cenRepRecord.at(2);
                 break;
             }
         }
     }
-    if (!found || !mIsResourceLoaded) {
+    if (!found ) { 
         //get default icon and name
         icon = "qtg_large_email";
         QStringList domain = brandingId.split(".");
@@ -222,6 +233,8 @@
  */
 quint8 EmailMailboxInfoPrivate::getCurrentCountryL() const
 {
+    NM_FUNCTION;
+    
     CTzLocalizer* localizer = CTzLocalizer::NewLC();
 
     CTzLocalizedCity* city = localizer->GetFrequentlyUsedZoneCityL(
@@ -246,6 +259,8 @@
  */
 bool EmailMailboxInfoPrivate::verifyTimeZone() const
 {
+    NM_FUNCTION;
+    
     quint8 timeZone = 0;
     bool retVal = false;
     TRAPD(err, timeZone = getCurrentCountryL());
@@ -262,6 +277,8 @@
  */
 void EmailMailboxInfoPrivate::verifyMailAccountName(QString &brandingName) const
 {
+    NM_FUNCTION;
+    
     QSystemNetworkInfo *networkInfo = new QSystemNetworkInfo();
     QString currentMCC = networkInfo->currentMobileCountryCode();
 
--- a/emailuis/nmailcpplugin/src/nmsettingsplugin.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailcpplugin/src/nmsettingsplugin.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
 *
 */
 
+#include "emailtrace.h"
+
 #include <cpsettingformentryitemdataimpl.h>
 #include <HbApplication>
 #include <QTranslator>
@@ -39,6 +41,8 @@
 NmSettingsPlugin::NmSettingsPlugin()
 : mTranslator(0)
 {
+    NM_FUNCTION;
+    
     mTranslator = new QTranslator();
     QString lang = QLocale::system().name();
     QString appName = "mail_";
@@ -52,6 +56,8 @@
 */
 NmSettingsPlugin::~NmSettingsPlugin()
 {
+    NM_FUNCTION;
+    
     delete mTranslator;
 }
 
@@ -67,6 +73,8 @@
 CpSettingFormItemData *NmSettingsPlugin::createSettingFormItemData(
     CpItemDataHelper &itemDataHelper) const
 {
+    NM_FUNCTION;
+    
     HbIcon icon("qtg_large_email");
 
     return new NmSettingsViewFactory(itemDataHelper,
--- a/emailuis/nmailui/conf/nmeditorview.docml	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/conf/nmeditorview.docml	Wed Jun 23 17:00:39 2010 +0100
@@ -1,117 +1,122 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.0">
+<hbdocument version="1.1">
     <widget name="editorview" type="HbView">
         <widget name="content" role="HbView:widget" type="HbWidget">
             <widget name="scrollArea" plugin="nmailuiwidgetsplugin" type="NmBaseViewScrollArea">
                 <widget name="scrollAreaContents" role="HbScrollArea:contents" type="HbWidget">
                     <widget name="container" type="HbWidget">
-                        <widget name="HeaderLayout" type="HbWidget">
-                            <widget name="ToHorizontalLayout" type="HbWidget">
-                                <widget name="EditorHeaderToLabel" type="HbLabel">
-                                    <sizehint height="5un" type="PREFERRED" width="10un"/>
-                                    <sizehint height="5un" type="MINIMUM" width="1.89552un"/>
-                                    <string locid="txt_mail_editor_to" name="plainText" value="To:"/>
-                                    <fontspec name="fontSpec" role="Secondary" textheight="23.45"/>
+                        <widget name="containerContents" type="HbWidget">
+                            <widget name="editorToField" type="HbWidget">
+                                <widget name="editorToLabel" type="HbLabel">
+                                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="7.46un" type="FIXED" width="12.5un"/>
+                                    <string locid="txt_mail_editor_to" name="plainText"/>
+                                    <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+                                </widget>
+                                <widget name="editorToEdit" plugin="nmailuiwidgetsplugin" type="NmRecipientLineEdit"/>
+                                <widget name="editorToButton" type="HbPushButton">
+                                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="7.46un" type="FIXED" width="9.5un"/>
                                 </widget>
-                                <widget name="EditorHeaderToEdit" plugin="nmailuiwidgetsplugin" type="NmRecipientLineEdit">
-                                    <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-                                    <sizehint height="5un" type="PREFERRED" width="8.26269un"/>
-                                    <sizehint height="5un" type="MINIMUM" width="0un"/>
-                                    <fontspec name="fontSpec" role="Secondary" textheight="3.5un"/>
-                                    <integer name="maxRows" value="256"/>
-                                    <string name="alignment" value="AlignAbsolute"/>
-                                    <string name="text" value=""/>
-                                </widget>
-                                <widget name="EditorHeaderToButton" type="HbPushButton">
+                                <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
+                                    <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                                    <linearitem itemname="editorToLabel"/>
+                                    <linearitem itemname="editorToEdit"/>
+                                    <linearitem itemname="editorToButton"/>
+                                </layout>
+                            </widget>
+                            <widget name="editorCcField" type="HbWidget">
+                                <widget name="editorCcLabel" type="HbLabel">
                                     <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-                                    <sizehint height="5un" type="FIXED" width="9.5un"/>
-                                    <sizehint height="5un" type="MINIMUM" width="9.5un"/>
-                                    <sizehint height="5un" type="MAXIMUM" width="9.5un"/>
-                                    <string name="text" value=""/>
+                                    <sizehint height="7.46un" type="FIXED" width="12.5un"/>
+                                    <string locid="txt_mail_editor_cc" name="plainText"/>
+                                    <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
                                 </widget>
-                                <real name="z" value="0"/>
-                                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
-                                <sizehint height="5un" type="MINIMUM" width="23.8806un"/>
-                                <layout orientation="Horizontal" spacing="1un" type="linear">
-                                    <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0un"/>
-                                    <linearitem itemname="EditorHeaderToLabel"/>
-                                    <linearitem itemname="EditorHeaderToEdit"/>
-                                    <linearitem itemname="EditorHeaderToButton"/>
+                                <widget name="editorCcEdit" plugin="nmailuiwidgetsplugin" type="NmRecipientLineEdit"/>
+                                <widget name="editorCcButton" type="HbPushButton">
+                                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="7.46un" type="FIXED" width="9.5un"/>
+                                </widget>
+                                <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
+                                    <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                                    <linearitem itemname="editorCcLabel"/>
+                                    <linearitem itemname="editorCcEdit"/>
+                                    <linearitem itemname="editorCcButton"/>
                                 </layout>
                             </widget>
-                            <widget name="EditorHeaderRecipientGB" type="HbGroupBox">
-                                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
-                                <bool name="collapsable" value="FALSE"/>
-                                <bool name="collapsed" value="FALSE"/>
-                                <fontspec name="fontSpec" role="Secondary" textheight="23.45"/>
+                            <widget name="editorBccField" type="HbWidget">
+                                <widget name="editorBccLabel" type="HbLabel">
+                                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="7.46un" type="FIXED" width="12.5un"/>
+                                    <string locid="txt_mail_editor_bcc" name="plainText"/>
+                                    <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+                                </widget>
+                                <widget name="editorBccEdit" plugin="nmailuiwidgetsplugin" type="NmRecipientLineEdit"/>
+                                <widget name="editorBccButton" type="HbPushButton">
+                                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="7.46un" type="FIXED" width="9.5un"/>
+                                </widget>
+                                <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
+                                    <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                                    <linearitem itemname="editorBccLabel"/>
+                                    <linearitem itemname="editorBccEdit"/>
+                                    <linearitem itemname="editorBccButton"/>
+                                </layout>
                             </widget>
-                            <widget name="SubjectHorizontalLayout" type="HbWidget">
-                                <widget name="EditorHeaderSubjectLabel" type="HbLabel">
-                                    <sizehint height="5un" type="PREFERRED" width="11un"/>
-                                    <string locid="txt_mail_editor_subject" name="plainText" value="Subject:"/>
-                                    <fontspec name="fontSpec" role="Secondary" textheight="23.45"/>
+                            <widget name="editorSubjectField" type="HbWidget">
+                                <widget name="editorSubjectLabel" type="HbLabel">
+                                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="7.46un" type="FIXED" width="12.5un"/>
+                                    <string locid="txt_mail_editor_subject" name="plainText"/>
+                                    <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
                                 </widget>
-                                <widget name="EditorHeaderSubjectEdit" plugin="nmailuiwidgetsplugin" type="NmHtmlLineEdit">
-                                    <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-                                    <sizehint height="5un" type="PREFERRED" width="8.26269un"/>
-                                    <sizehint height="5un" type="MINIMUM" width="0un"/>
-                                    <fontspec name="fontSpec" role="Secondary" textheight="3.5un"/>
-                                    <integer name="maxRows" value="256"/>
-                                    <string name="alignment" value="AlignAbsolute"/>
-                                    <string name="text" value=""/>
-                                </widget>
-                                <widget name="labelPriorityIcon" type="HbLabel">
+                                <widget name="editorSubjectEdit" plugin="nmailuiwidgetsplugin" type="NmRecipientLineEdit"/>
+                                <widget name="editPriorityIcon" type="HbLabel">
                                     <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
                                     <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-                                    <sizehint height="5un" type="MINIMUM" width="0un"/>
-                                    <sizehint height="5un" type="MAXIMUM" width="0un"/>
+                                    <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
+                                </widget>
+                                <widget name="editFollowUpIcon" type="HbLabel">
+                                    <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                                    <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                    <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
                                 </widget>
-                                <real name="z" value="0"/>
-                                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
-                                <sizehint height="5un" type="MINIMUM" width="23.8806un"/>
-                                <layout orientation="Horizontal" spacing="0un" type="linear">
-                                    <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0un"/>
-                                    <linearitem itemname="EditorHeaderSubjectLabel"/>
-                                    <linearitem itemname="EditorHeaderSubjectEdit"/>
-                                    <linearitem itemname="labelPriorityIcon"/>
+                                <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
+                                    <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                                    <linearitem itemname="editorSubjectLabel"/>
+                                    <linearitem itemname="editorSubjectEdit"/>
+                                    <linearitem itemname="editPriorityIcon" spacing="0.5un"/>
+                                    <linearitem itemname="editFollowUpIcon"/>
                                 </layout>
                             </widget>
                             <widget name="attachmentListWidget" plugin="nmailuiwidgetsplugin" type="NmAttachmentListWidget">
-                                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="MinimumExpanding" verticalStretch="0"/>
-                                <sizehint height="0.1un" type="MINIMUM" width="25.6194un"/>
-                                <contentsmargins bottom="var(hb-param-margin-gene-middle-vertical)" left="0un" right="0un" top="0un"/>
-                                <sizehint height="0.1un" type="MAXIMUM"/>
+                                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                            </widget>
+                            <widget name="BodyTextEdit" plugin="nmailuiwidgetsplugin" type="NmEditorTextEdit">
+                                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+                                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+                                <string name="plainText"/>
                             </widget>
-                            <real name="z" value="1"/>
-                            <sizepolicy horizontalPolicy="Minimum" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
-                            <sizehint height="18un" type="MINIMUM" width="53.73134un"/>
-                            <sizehint height="200un" type="MAXIMUM" width="2504062.01158un"/>
-                            <layout orientation="Vertical" spacing="1un" type="linear">
-                                <contentsmargins bottom="0un" left="0un" right="0un" top="var(hb-param-margin-gene-top)"/>
-                                <linearitem itemname="ToHorizontalLayout"/>
-                                <linearitem itemname="EditorHeaderRecipientGB"/>
-                                <linearitem itemname="SubjectHorizontalLayout"/>
+                            <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
+                                <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="var(hb-param-margin-gene-top)"/>
+                                <linearitem itemname="editorToField"/>
+                                <linearitem itemname="editorCcField"/>
+                                <linearitem itemname="editorBccField"/>
+                                <linearitem itemname="editorSubjectField"/>
                                 <linearitem itemname="attachmentListWidget"/>
+                                <linearitem itemname="BodyTextEdit"/>
                             </layout>
                         </widget>
-                        <widget name="BodyTextEdit" plugin="nmailuiwidgetsplugin" type="NmEditorTextEdit">
-                            <real name="z" value="2"/>
-                            <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
-                            <contentsmargins bottom="0un" left="1un" right="1un" top="0un"/>
-                            <fontspec name="fontSpec" role="Secondary" textheight="3.5un"/>
-                            <string name="plainText" value=""/>
-                        </widget>
                         <real name="z" value="0"/>
                         <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
                         <sizehint height="23.8806un" type="PREFERRED" width="23.8806un"/>
+                        <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
                         <layout type="anchor">
-                            <anchoritem dst="HeaderLayout" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
-                            <anchoritem dst="HeaderLayout" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
-                            <anchoritem dst="HeaderLayout" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
-                            <anchoritem dst="BodyTextEdit" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
-                            <anchoritem dst="BodyTextEdit" dstEdge="TOP" spacing="0un" src="HeaderLayout" srcEdge="BOTTOM"/>
-                            <anchoritem dst="BodyTextEdit" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
-                            <anchoritem dst="BodyTextEdit" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                            <anchoritem dst="containerContents" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                            <anchoritem dst="containerContents" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                            <anchoritem dst="containerContents" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                            <anchoritem dst="containerContents" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
                         </layout>
                     </widget>
                     <real name="z" value="0"/>
@@ -124,8 +129,6 @@
                         <anchoritem dst="container" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
                     </layout>
                 </widget>
-                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
             </widget>
             <layout type="anchor">
                 <anchoritem dst="scrollArea" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
@@ -134,9 +137,9 @@
                 <anchoritem dst="scrollArea" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
             </layout>
         </widget>
-        <string name="title" value=""/>
+        <string name="title"/>
     </widget>
-    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+    <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
         <uistate name="Common ui state" sections="#common"/>
     </metadata>
 </hbdocument>
--- a/emailuis/nmailui/conf/nmmessagelistview.docml	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/conf/nmmessagelistview.docml	Wed Jun 23 17:00:39 2010 +0100
@@ -21,15 +21,11 @@
                 <bool name="collapsable" value="FALSE"/>
             </widget>
             <widget name="syncIcon" type="HbLabel">
-                <real name="z" value="6"/>
-                <sizehint type="PREFERRED" width="expr(var(hb-param-graphic-size-primary-small) )"/>
-            </widget>
-            <widget name="folderLabel" type="HbLabel">
-                <real name="z" value="5"/>
+                <enums name="alignment" value="AlignAbsolute|AlignLeft|AlignVCenter|AlignJustify|AlignHCenter|AlignLeading"/>
+                <real name="z" value="7"/>
+                <sizehint height="expr(var(hb-param-graphic-size-primary-small) )" type="PREFERRED" width="expr(var(hb-param-graphic-size-primary-small) )"/>
+                <sizehint height="expr(var(hb-param-graphic-size-primary-small) )" type="MINIMUM" width="expr(var(hb-param-graphic-size-primary-small) )"/>
                 <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
-                <sizehint type="PREFERRED" width="45.97015un"/>
-                <string name="plainText" value="Folder"/>
-                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
             </widget>
             <real name="z" value="0"/>
             <layout type="anchor">
@@ -43,10 +39,6 @@
                 <anchoritem dst="MessageTreeList" dstEdge="TOP" spacing="0un" src="labelGroupBox" srcEdge="BOTTOM"/>
                 <anchoritem dst="MessageTreeList" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
                 <anchoritem dst="MessageTreeList" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
-                <anchoritem dst="folderLabel" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
-                <anchoritem dst="folderLabel" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
-                <anchoritem dst="folderLabel" dstEdge="BOTTOM" spacing="0un" src="labelGroupBox" srcEdge="BOTTOM"/>
-                <anchoritem dst="folderLabel" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="syncIcon" srcEdge="LEFT"/>
                 <anchoritem dst="syncIcon" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
                 <anchoritem dst="syncIcon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
                 <anchoritem dst="syncIcon" dstEdge="BOTTOM" spacing="0un" src="labelGroupBox" srcEdge="BOTTOM"/>
--- a/emailuis/nmailui/conf/nmmessagesearchlistview.docml	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/conf/nmmessagesearchlistview.docml	Wed Jun 23 17:00:39 2010 +0100
@@ -1,62 +1,60 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.0">
+<hbdocument version="1.1">
     <widget name="NmMessageListView" type="HbView">
         <widget name="content" role="HbView:widget" type="HbWidget">
             <widget name="MessageTreeList" type="HbTreeView">
                 <real name="z" value="4"/>
                 <sizehint height="67.7612un" type="PREFERRED"/>
             </widget>
-            <widget name="MessageListNoMessages" type="HbLabel">
-                <real name="z" value="5"/>
-                <string locid="txt_mail_dblist_no_messages" name="plainText"/>
-            </widget>
             <widget name="SearchBarContainer" type="HbWidget">
                 <widget name="LineEdit" type="HbLineEdit">
-                    <real name="z" value="10"/>
-                    <sizehint type="PREFERRED" width="51.04478un"/>
-                    <string name="text" value="" />
+                    <fontspec name="fontSpec" role="Primary" textheight="26.8"/>
                 </widget>
                 <widget name="PushButton" type="HbPushButton">
-                    <real name="z" value="11"/>
-                    <sizehint type="PREFERRED" width="18.50746un"/>
-                    <string name="text" locid="txt_mail_list_search" />
+                    <sizehint type="MINIMUM" width="9un"/>
                 </widget>
                 <real name="z" value="8"/>
-                <sizehint height="8un" type="PREFERRED" width="54.62687un"/>
                 <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
-                <sizehint height="4un" type="MINIMUM"/>
-                <sizehint height="15un" type="MAXIMUM"/>
+                <sizehint height="9.25un" type="PREFERRED" />
+                <sizehint height="9.25un" type="MINIMUM" />
                 <layout orientation="Horizontal" type="linear">
                     <linearitem itemname="LineEdit"/>
                     <linearitem itemname="PushButton"/>
                 </layout>
             </widget>
-            <widget name="InfoLabel" type="HbLabel">
-                <real name="z" value="9"/>
-                <string name="plainText" value="Label"/>
-                <sizehint height="4.62687un" type="PREFERRED" width="53.8806un"/>
-                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Minimum" verticalStretch="0"/>
+            <widget name="LabelGroupBox" type="HbGroupBox">
+                <real name="z" value="3"/>
+                <sizepolicy horizontalPolicy="MinimumExpanding" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                <sizehint height="6un" type="PREFERRED" width="52un"/>
+                <bool name="collapsable" value="FALSE"/>
+            </widget>
+            <widget name="MessageListNoMessages" type="HbLabel">
+                <enums name="textWrapping" value="TextWordWrap"/>
+                <enums name="alignment" value="AlignLeft|AlignVCenter|AlignHCenter|AlignLeading"/>
+                <real name="z" value="10"/>
+                <sizehint height="15.22388un" type="PREFERRED" width="43.73134un"/>
+                <string locid="txt_mail_dblist_no_messages_matched_your_search" name="plainText" value="No messages matched your search. Try another search term. "/>
             </widget>
             <real name="z" value="0"/>
             <layout type="anchor">
-                <anchoritem dst="InfoLabel" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
-                <anchoritem dst="InfoLabel" dstEdge="TOP" spacing="0" src="SearchBarContainer" srcEdge="BOTTOM"/>
-                <anchoritem dst="InfoLabel" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="LabelGroupBox" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
+                <anchoritem dst="LabelGroupBox" dstEdge="TOP" spacing="0.5un" src="SearchBarContainer" srcEdge="BOTTOM"/>
+                <anchoritem dst="LabelGroupBox" dstEdge="RIGHT" spacing="0" src="" srcEdge="RIGHT"/>
                 <anchoritem dst="MessageTreeList" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
-                <anchoritem dst="MessageTreeList" dstEdge="TOP" spacing="0un" src="InfoLabel" srcEdge="BOTTOM"/>
+                <anchoritem dst="MessageTreeList" dstEdge="TOP" spacing="0un" src="LabelGroupBox" srcEdge="BOTTOM"/>
                 <anchoritem dst="MessageTreeList" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
                 <anchoritem dst="MessageTreeList" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
-                <anchoritem dst="MessageListNoMessages" dstEdge="LEFT" spacing="12.14925un" src="" srcEdge="LEFT"/>
-                <anchoritem dst="MessageListNoMessages" dstEdge="TOP" spacing="10un" src="MessageTreeList" srcEdge="TOP"/>
-                <anchoritem dst="MessageListNoMessages" dstEdge="RIGHT" spacing="-11.82089un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="MessageListNoMessages" dstEdge="LEFT" spacing="4.77612un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="MessageListNoMessages" dstEdge="TOP" spacing="2.54478un" src="LabelGroupBox" srcEdge="BOTTOM"/>
+                <anchoritem dst="MessageListNoMessages" dstEdge="RIGHT" spacing="-5.22388un" src="" srcEdge="RIGHT"/>
                 <anchoritem dst="SearchBarContainer" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
                 <anchoritem dst="SearchBarContainer" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
                 <anchoritem dst="SearchBarContainer" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
             </layout>
         </widget>
-        <string name="title" value="View"/>
+        <string name="title" value="Search"/>
     </widget>
-    <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+    <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
         <uistate name="Common ui state" sections="#common"/>
         <dummydata objectName="MessageTreeList" section="#common" value="0"/>
     </metadata>
--- a/emailuis/nmailui/inc/nmactionresponse.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmactionresponse.h	Wed Jun 23 17:00:39 2010 +0100
@@ -44,7 +44,8 @@
     NmActionResponseCommandRemoveAttachment,
     NmActionResponseCommandOpenAttachment,
     NmActionResponseCommandSearch,
-    NmActionResponseCommandSwitchFolder
+    NmActionResponseCommandSwitchFolder,
+    NmActionResponseCommandSettings
 };
 
 
--- a/emailuis/nmailui/inc/nmapplication.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmapplication.h	Wed Jun 23 17:00:39 2010 +0100
@@ -30,6 +30,7 @@
 class HbAction;
 class NmUiExtensionManager;
 class NmSendServiceInterface;
+class NmUriServiceInterface;
 class NmMailboxServiceInterface;
 class NmViewerServiceInterface;
 class NmViewerViewNetManager;
@@ -37,6 +38,7 @@
 class NmAttachmentManager;
 class NmSettingsViewLauncher;
 class NmUiEffects;
+class HbMessageBox;
 
 class NmApplication : public QObject
 {
@@ -50,20 +52,21 @@
     NmViewerViewNetManager &networkAccessManager();
     QSize screenSize();
     bool eventFilter(QObject *obj, QEvent *event);
-
+    bool updateVisibilityState();
 
 public slots:
+    void prepareForPopView();
     void popView();
     void exitApplication();
     void delayedExitApplication();
     void handleOperationCompleted(const NmOperationCompletionEvent &event);
     void viewReady();
+    void launchSettings(HbAction* action);
     
 private:
     void createMainWindow();
     void pushView(NmBaseView *view);
     void resetViewStack();
-    void launchSettings(const NmId &mailboxId);
 
 private:
     HbMainWindow *mMainWindow;              // Not owned
@@ -74,16 +77,19 @@
     NmUiExtensionManager *mExtensionManager;// Owned
     NmSendServiceInterface *mSendServiceInterface;       // Owned
     NmSendServiceInterface *mSendServiceInterface2;      // Owned
+    NmUriServiceInterface *mUriServiceInterface;         // Owned
     NmMailboxServiceInterface *mMailboxServiceInterface; // Owned
     NmViewerServiceInterface *mViewerServiceInterface;   // Owned
     NmMailboxListModel *mMbListModel;       // Not owned
     NmUiViewId mServiceViewId;
     NmViewerViewNetManager *mNetManager;    // Owned
-    bool mForegroundService;	
+    bool mForegroundService;
     NmUiEffects *mEffects;                  // Owned
     NmAttachmentManager *mAttaManager;      // Owned
     NmSettingsViewLauncher* mSettingsViewLauncher; // Owned
     bool mViewReady;
+    NmId mLastOperationMailbox;
+    HbMessageBox *mQueryDialog;             // Owned
 };
 
 #endif // NMAPPLICATION_H
--- a/emailuis/nmailui/inc/nmattachmentmanager.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmattachmentmanager.h	Wed Jun 23 17:00:39 2010 +0100
@@ -26,6 +26,7 @@
 class NmUiEngine;
 class NmOperation;
 class NmAttachmentFetchObserver;
+class NmMessage;
 
 class NmAttachmentManager : public QObject
 {
@@ -38,6 +39,15 @@
             const NmId &folderId, 
             const NmId &messageId, 
             const NmId &messagePartId);
+    bool fetchAttachments(
+            const NmId &mailboxId, 
+            const NmId &folderId, 
+            const NmId &messageId,
+            QList<NmId> &messagePartIds);
+    void fetchAllMessageParts(
+            const NmId &mailboxId, 
+            const NmId &folderId, 
+            const NmId &messageId);
     bool isFetching() const;
     NmId partIdUnderFetch() const;
     int progressValue() const;
@@ -47,12 +57,15 @@
     
 private slots:
     void changeProgress(int value);
-    void attachmentFetchCompleted(int result);
+    void completeAttachmentFetch(int result);
+    void completeMessageFetch(int result);
     
 private:
     NmUiEngine &mUiEngine;
     QPointer<NmOperation> mFetchOperation;      // Not owned
+    QPointer<NmOperation> mMsgFetchOperation;      // Not owned
     NmAttachmentFetchObserver *mFetchObserver;  // Not owned
+    NmMessage *mFetchMsg;
     NmId mAttaId;
     int mProgressValue;
     bool mIsFetching;
--- a/emailuis/nmailui/inc/nmattachmentpicker.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmattachmentpicker.h	Wed Jun 23 17:00:39 2010 +0100
@@ -20,12 +20,6 @@
 
 #include <QObject>
 
-#define IMAGE_FETCHER_INTERFACE "Image"
-#define AUDIO_FETCHER_INTERFACE "com.nokia.services.media.Music"
-
-#define IMAGE_FETCHER_OPERATION "fetch(QVariantMap,QVariant)"
-#define AUDIO_FETCHER_OPERATION "fetch(QString)"
-
 class XQAiwRequest;
 
 /**
@@ -44,14 +38,18 @@
     void fetchImage();
     void fetchAudio();    
     void fetchVideo();
-    void fetchOther();       
+    void fetchOther();  
+    void fetchCameraStill();
+    void fetchCameraVideo();
 
 signals:
     void attachmentsFetchOk(const QVariant& fileNames);
     void attachmentsFetchError(int errorCode, const QString& errorMessage);
     
 private:   
-    void fetch(const QString& interface, const QString& operation); 
+    void fetch(const QString& interface, const QString& operation, 
+        const QList<QVariant>* args = 0); 
+    void fetchFromCamera(int mode);
     
 private:
     XQAiwRequest *mRequest;    
--- a/emailuis/nmailui/inc/nmbaseview.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmbaseview.h	Wed Jun 23 17:00:39 2010 +0100
@@ -35,11 +35,12 @@
 	Q_OBJECT
 public:
     NmBaseView(NmUiStartParam* startParam,
+               NmApplication &application,
                QGraphicsItem *parent = 0);
     virtual ~NmBaseView();
     virtual void reloadViewContents(NmUiStartParam* startParam) = 0;
     virtual NmUiViewId nmailViewId() const = 0;
-    virtual bool okToExitView();
+    virtual void okToExitView();
     virtual void aboutToExitView();
     virtual void viewReady();
     virtual void handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event);
@@ -54,7 +55,8 @@
     virtual void loadViewLayout() = 0;
 
 protected:
-    NmUiStartParam* mStartParam;   // Owned
+    NmUiStartParam *mStartParam;   // Owned
+    NmApplication &mApplication;
 };
 
 
--- a/emailuis/nmailui/inc/nmeditorcontent.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmeditorcontent.h	Wed Jun 23 17:00:39 2010 +0100
@@ -45,8 +45,7 @@
                     QNetworkAccessManager &manager);
     virtual ~NmEditorContent();
 
-    void setMessageData(const NmMessage &message, 
-                        NmMessageEnvelope *replyMsgEnvelope=0);
+    void setMessageData(const NmMessage &originalMessage);
     NmEditorTextEdit* editor() const;
     NmEditorHeader* header() const;
 
--- a/emailuis/nmailui/inc/nmeditorheader.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmeditorheader.h	Wed Jun 23 17:00:39 2010 +0100
@@ -24,7 +24,6 @@
 enum
 {
     EEditorToLine=0,
-    EEditorGroupBoxRecipient,
     EEditorCcLine,
     EEditorBccLine,
     EEditorSubjectLine,
@@ -40,21 +39,20 @@
 class NmRecipientField;
 class NmAttachmentList;
 
-class NmEditorHeader : public HbWidget
+class NmEditorHeader : public QObject
 {
 Q_OBJECT
 
 public:
-    NmEditorHeader(HbDocumentLoader *documentLoader, QGraphicsItem *parent=0);
+    NmEditorHeader(HbDocumentLoader *documentLoader);
     virtual ~NmEditorHeader();
-    int headerHeight() const;
-    NmHtmlLineEdit* subjectField() const;
-    NmRecipientLineEdit* toField() const;
-    NmRecipientLineEdit* ccField() const;
-    NmRecipientLineEdit* bccField() const;
+    qreal headerHeight() const;
+    NmHtmlLineEdit* subjectEdit() const;
+    NmRecipientLineEdit* toEdit() const;
+    NmRecipientLineEdit* ccEdit() const;
+    NmRecipientLineEdit* bccEdit() const;
     void setPriority(NmMessagePriority priority=NmMessagePriorityNormal);
     void setPriority(NmActionResponseCommand prio=NmActionResponseCommandNone);
-    void setGroupBoxCollapsed( bool collapsed );
     void addAttachment(const QString &fileName, const QString &fileSize, const NmId &nmid);
     void removeAttachment(const QString &fileName);
     void removeAttachment(const NmId &nmid);
@@ -64,12 +62,11 @@
         const NmId &msgPartId,
         const QString &fileSize,
         int result);
+    void setFieldVisibility(bool isVisible);
 
 private:
     void loadWidgets();
-    void rescaleHeader();
     void createConnections();
-    HbWidget* createRecipientGroupBoxContentWidget();
 
 signals:
     void headerHeightChanged(int);
@@ -77,34 +74,33 @@
     void attachmentLongPressed(NmId attachmentPartId, QPointF point);
 
 public slots:
+	void sendDelayedHeaderHeightChanged();
     void sendHeaderHeightChanged();
     void editorContentChanged();
-    void groupBoxExpandCollapse();
     void attachmentActivated(int arrayIndex);
     void attachmentLongPressed(int arrayIndex, QPointF point);
 
 private:
     HbDocumentLoader* mDocumentLoader;  // Not owned
-    int mHeaderHeight;
-    HbLabel *mSubjectLabel;
-    HbLabel *mPriorityIconLabel;
+    qreal mHeaderHeight;
+    HbLabel *mPriorityIcon; // Not owned
+    HbLabel *mFollowUpIcon; // Not owned
     bool mIconVisible;
-    NmRecipientLineEdit *mToEdit;
-    NmHtmlLineEdit *mSubjectEdit;
+    NmRecipientLineEdit *mToEdit; // Not owned
+    NmRecipientLineEdit *mCcEdit; // Not owned
+    NmRecipientLineEdit *mBccEdit; // Not owned
+    NmHtmlLineEdit *mSubjectEdit; // Not owned
     bool mRecipientFieldsEmpty;
-
-    // Recipient GroupBox related
-    HbGroupBox *mGroupBoxRecipient;          // Owned
-    HbWidget *mGroupBoxRecipientContent;     // Not owned
-    QGraphicsLinearLayout *mGbVerticalLayout;// Not owned
-    QGraphicsLinearLayout *mCcFieldLayout;   // Not owned
-    QGraphicsLinearLayout *mBccFieldLayout;  // Not owned
-
-    NmRecipientField *mToField;    // owned
+    QGraphicsLinearLayout *mLayout; // Not owned
+    NmAttachmentList *mAttachmentList; // Not owned
+    NmRecipientField *mToField;    // Not owned
     NmRecipientField *mCcField;    // Not owned
+    HbWidget *mCcWidget;    // Not owned
     NmRecipientField *mBccField;   // Not owned
-
-    NmAttachmentList *mAttachmentList;
+    HbWidget *mBccWidget;    // Not owned
+    HbWidget *mSubjectWidget;    // Not owned
+    QGraphicsLinearLayout *mSubjectLayout; // Not owned
+    bool mCcBccFieldVisible;
 };
 
 #endif /* NMEDITORHEADER_H_ */
--- a/emailuis/nmailui/inc/nmeditortextdocument.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmeditortextdocument.h	Wed Jun 23 17:00:39 2010 +0100
@@ -19,7 +19,7 @@
 #ifndef NMEDITORTEXTDOCUMENT_H_
 #define NMEDITORTEXTDOCUMENT_H_
 
-#include <qtextdocument>
+#include <QTextDocument>
 
 class QNetworkAccessManager;
 class QNetworkReply;
--- a/emailuis/nmailui/inc/nmeditorview.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmeditorview.h	Wed Jun 23 17:00:39 2010 +0100
@@ -23,6 +23,7 @@
 #include "nmbaseview.h"
 #include "nmactionobserver.h"
 #include "nmactionresponse.h"
+#include "nmattachmentfetchobserver.h"
 
 class QGraphicsLinearLayout;
 class HbTextEdit;
@@ -41,11 +42,14 @@
 class NmOperation;
 class NmMessageCreationOperation;
 class NmAddAttachmentsOperation;
-class NmCheckOutboxOperation;
 class NmAttachmentPicker;
+class HbMessageBox;
+class NmAttachmentManager;
 
 
-class NmEditorView : public NmBaseView, public NmActionObserver
+class NmEditorView : public NmBaseView,
+                     public NmActionObserver,
+                     public NmAttachmentFetchObserver
 {
     Q_OBJECT
 
@@ -54,6 +58,7 @@
     NmEditorView(NmApplication &application,
                  NmUiStartParam* startParam,
                  NmUiEngine &uiEngine,
+                 NmAttachmentManager &attaManager,
                  QGraphicsItem *parent = 0);
     ~NmEditorView();
 
@@ -63,7 +68,7 @@
     void reloadViewContents(NmUiStartParam* startParam);
     NmUiViewId nmailViewId() const;
     HbWidget* scrollAreaContents();
-    bool okToExitView();
+    void okToExitView();
     void aboutToExitView();
     void viewReady();
 
@@ -73,12 +78,16 @@
     void createOptionsMenu();
     void setButtonsDimming(bool enabled);
     void attachmentLongPressed(NmId attachmentPartId, QPointF point);
-
+    void invalidAddressQuery(HbAction* action);
+    void okToExitQuery(HbAction* action);
 
 public: // From NmActionObserver
 
     void handleActionCommand(NmActionResponse &menuResponse);
 
+public: // From NmAttachmentFetchObserver
+    void progressChanged(int value);
+    void fetchCompleted(int result);
 
 private slots:
 
@@ -90,21 +99,24 @@
 
     void allAttachmentsAdded(int result);
     void attachmentRemoved(int result);
-    void outboxChecked(int result);
     void removeAttachmentTriggered();
     void handleSendOperationCompleted();
     void openAttachmentTriggered();  
     void onAttachmentReqCompleted(const QVariant &value);
+    void onAttachmentsFetchError(int errorCode, const QString& errorMessage);
+    void switchCcBccFieldVisibility();
+	void fetchProgressDialogCancelled();
 
 private:
 
     void loadViewLayout();
     void setMailboxName();
-    void setMessageData();
+    void fetchProgressDialogShow();
+    void fetchMessageIfNeeded();
     void startMessageCreation(NmUiEditorStartMode startMode);
     void startSending();
+    void finalizeSending();
     void createToolBar();
-    QPointF viewCoordinateToEditCoordinate(QPointF orgPoint);
     void updateMessageWithEditorContents();
     void fillEditorWithMessageContents();
     void initializeVKB();
@@ -115,20 +127,15 @@
     QString addressListToString(const QList<NmAddress> &list) const;
     void enableToolBarAttach(bool enable);
 
-
 public slots:
 
-    void sendMousePressEventToScroll(QGraphicsSceneMouseEvent *event);
-    void sendMouseReleaseEventToScroll(QGraphicsSceneMouseEvent *event);
-    void sendMouseMoveEventToScroll(QGraphicsSceneMouseEvent *event);
-    void sendLongPressGesture(const QPointF &point);
-    void contextButton(NmActionResponse &result);
-
+    void sendProgressDialogCancelled();
 
 private: // Data
 
     NmApplication &mApplication;
     NmUiEngine &mUiEngine;
+    NmAttachmentManager  &mAttaManager;
     HbDocumentLoader *mDocumentLoader;  // Owned
     QObjectList mWidgetList;            // Owned
     NmBaseViewScrollArea *mScrollArea;  // Not owned
@@ -136,6 +143,7 @@
     NmEditorTextEdit *mEditWidget;      // Not owned
     NmEditorHeader *mHeaderWidget;      // Not owned
     NmMessage *mMessage;                // Owned
+    QGraphicsLinearLayout *mLayout;
     NmEditorContent *mContentWidget;    // Owned
     HbMenu *mPrioritySubMenu;           // Owned
     HbMenu *mAttachmentListContextMenu; // Owned
@@ -144,11 +152,12 @@
     QPointer<NmMessageCreationOperation> mMessageCreationOperation;  // Not owned
     QPointer<NmAddAttachmentsOperation> mAddAttachmentOperation;     // Not owned 
     QPointer<NmOperation> mRemoveAttachmentOperation;                // Not owned 
-    QPointer<NmCheckOutboxOperation> mCheckOutboxOperation;          // Not owned 
 
-    HbProgressDialog *mWaitDialog; // Owned.
-    
-    NmAttachmentPicker* mAttachmentPicker;    // Owned    
+    HbProgressDialog *mWaitDialog;         // Owned.    
+    HbMessageBox* mQueryDialog;            // Owned
+    NmAttachmentPicker* mAttachmentPicker; // Owned    
+    bool mCcBccFieldVisible;
+    QPointer<HbProgressDialog> mServiceSendingDialog; // Owned.
 };
 
 
--- a/emailuis/nmailui/inc/nmmailboxlistview.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmmailboxlistview.h	Wed Jun 23 17:00:39 2010 +0100
@@ -55,8 +55,6 @@
 public slots:
     void itemActivated(const QModelIndex &index);
     void openSelectedMailBox();
-    void showItemContextMenu(HbAbstractViewItem *item, const QPointF &coords);
-    void contextButton(NmActionResponse &result);
 
 private slots:
     void refreshList();
--- a/emailuis/nmailui/inc/nmmessagelistview.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmmessagelistview.h	Wed Jun 23 17:00:39 2010 +0100
@@ -35,6 +35,7 @@
 class NmActionResponse;
 class NmMessageListModelItem;
 class HbIconItem;
+class HbGroupBox;
 
 class NmMessageListView : public NmBaseView, public NmActionObserver
 {
@@ -45,12 +46,14 @@
         NmUiStartParam *startParam,
         NmUiEngine &uiEngine,
         NmMailboxListModel &mailboxListModel,
-        NmMessageListModel &messageListModel,
+        NmMessageListModel *messageListModel,
         HbDocumentLoader *documentLoader,
         QGraphicsItem *parent = 0);
     ~NmMessageListView();
     NmUiViewId nmailViewId() const;
     void viewReady();
+    NmFolderType folderType();
+    void okToExitView();
     
 public: // From NmActionObserver
     void handleActionCommand(NmActionResponse &menuResponse);
@@ -58,7 +61,6 @@
 public slots:
     void reloadViewContents(NmUiStartParam *startParam);
     void refreshList();
-    void contextButton(NmActionResponse &result);
     
 private slots:
     void showItemContextMenu(HbAbstractViewItem *index, const QPointF &coords);
@@ -68,9 +70,10 @@
     void itemsAdded(const QModelIndex &parent, int start, int end);
     void itemsRemoved();
     void showNoMessagesText();
+    void hideNoMessagesText();
     void handleSyncStateEvent(NmSyncState syncState, const NmId & mailboxId);
     void handleConnectionEvent(NmConnectState connectState, const NmId &mailboxId);
-    void folderSelected(NmId mailbox, NmId folder);
+    void folderSelected();
     
 private:
     void loadViewLayout();
@@ -85,16 +88,19 @@
     QObjectList mWidgetList;
     NmUiEngine &mUiEngine;
     NmMailboxListModel &mMailboxListModel;
-    NmMessageListModel &mMessageListModel;
+    NmMessageListModel *mMessageListModel;  // Not owned
     HbDocumentLoader *mDocumentLoader;      // Owned
     HbMenu *mItemContextMenu;               // Owned
     NmMessageListModelItem *mLongPressedItem;  // Not owned
     HbLabel *mNoMessagesLabel;              // Not owned
-    HbLabel *mFolderLabel;                  // Not owned
+    HbGroupBox *mFolderLabel;               // Not owned
     HbLabel *mSyncIcon;                     // Not owned
     QModelIndex mActivatedIndex;
     bool mViewReady;
     NmFolderType mCurrentFolderType;
+    bool mSettingsLaunched;
+    NmId mSelectedFolderId;
+    NmId mSelectedMailboxId;
 };
 
 #endif /* NMMESSAGELISTVIEW_H_ */
--- a/emailuis/nmailui/inc/nmmessagelistviewitem.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmmessagelistviewitem.h	Wed Jun 23 17:00:39 2010 +0100
@@ -53,6 +53,7 @@
     void setFontsUnread();
     void setFonts(const QColor &colorRole, HbFontSpec &spekki);
     void getFontSizes();    
+    QString senderFieldText(const NmMessageEnvelope &envelope);
 
 private:
     HbTextItem *mSender;                   // Owned
--- a/emailuis/nmailui/inc/nmmessagesearchlistview.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmmessagesearchlistview.h	Wed Jun 23 17:00:39 2010 +0100
@@ -24,6 +24,7 @@
 
 class HbAbstractViewItem;
 class HbDocumentLoader;
+class HbGroupBox;
 class HbLabel;
 class HbLineEdit;
 class HbMenu;
@@ -32,8 +33,8 @@
 
 class NmActionResponse;
 class NmApplication;
+class NmMessageListModel;
 class NmMessageListModelItem;
-class NmMessageSearchListModel;
 class NmUiEngine;
 class NmUiStartParam;
 
@@ -47,7 +48,7 @@
     NmMessageSearchListView(NmApplication &application,
                             NmUiStartParam *startParam,
                             NmUiEngine &uiEngine,
-                            NmMessageSearchListModel &searchListModel,
+                            NmMessageListModel &msglistModel,
                             HbDocumentLoader *documentLoader,
                             QGraphicsItem *parent = 0);
     ~NmMessageSearchListView();
@@ -79,17 +80,18 @@
     void initTreeView();
     void setViewTitle();
     void noMessagesLabelVisibility(bool visible);
+    void updateSearchResultCountInfo();
     void setSearchInputMode(NmSearchInputMode mode);
 
 
 public slots:
 
     void reloadViewContents(NmUiStartParam *startParam);
-    void contextButton(NmActionResponse &result);
 
 
 private slots:
 
+    void criteriaChanged(QString text);
     void showItemContextMenu(HbAbstractViewItem *index, const QPointF &coords);
     void itemActivated(const QModelIndex &index);
     void handleSelection();
@@ -98,19 +100,19 @@
     void refreshList();
     void toggleSearch();
     void handleSearchComplete();
-    void criteriaChanged(QString text);
+
 
 private: // Data
 
     NmApplication &mApplication;
     NmUiEngine &mUiEngine;
-    NmMessageSearchListModel &mSearchListModel;
+    NmMessageListModel &mMsgListModel;
     HbDocumentLoader *mDocumentLoader; // Owned
     QObjectList mWidgetList;
     HbMenu *mItemContextMenu; // Owned
     HbTreeView *mMessageListWidget; // Not owned
+    HbGroupBox *mInfoLabel; // Not owned
     HbLabel *mNoMessagesLabel; // Not owned
-    HbLabel *mInfoLabel; // Not owned
     HbLineEdit *mLineEdit; // Not owned
     HbPushButton *mPushButton; // Not owned
     NmMessageListModelItem *mLongPressedItem; // Not owned
--- a/emailuis/nmailui/inc/nmrecipientfield.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmrecipientfield.h	Wed Jun 23 17:00:39 2010 +0100
@@ -25,17 +25,13 @@
 class NmRecipientLineEdit;
 class HbPushButton;
 class HbIconItem;
+class HbDocumentLoader;
 
-class NmRecipientField : public HbWidget
+class NmRecipientField : public QObject
 {
     Q_OBJECT
 public:
-    NmRecipientField(
-    HbLabel *label,
-    NmRecipientLineEdit *edit,
-    HbPushButton *button,
-    QGraphicsItem *parent = 0);
-    NmRecipientField(const QString &labelString = "", QGraphicsItem *parent = 0);
+    NmRecipientField(QObject *parent, HbDocumentLoader &docLoader, const QString &objPrefix);
     virtual ~NmRecipientField();
     qreal height();
     void createConnections();
@@ -58,12 +54,12 @@
 #endif
 
 private:
-    QGraphicsLinearLayout *mLayoutHorizontal;
-    HbLabel *mLabel;
-    NmRecipientLineEdit *mRecipientsEditor;
-    HbPushButton *mLaunchContactsPickerButton;
-    HbIconItem *mAddButtonIcon;
-    bool mOwned;
+    HbDocumentLoader &mDocumentLoader;
+    const QString mObjectPrefix;
+    HbWidget *mWidget; // Not owned
+    HbLabel *mLabel; // Not owned
+    NmRecipientLineEdit *mRecipientsEditor; // Not owned
+    HbPushButton *mLaunchContactsPickerButton; // Not owned
 };
 
 #endif   // NMRECIPIENTFIELD_H_
--- a/emailuis/nmailui/inc/nmuieffects.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmuieffects.h	Wed Jun 23 17:00:39 2010 +0100
@@ -55,7 +55,7 @@
 
 private:
     HbMainWindow &mMainWindow;
-    QGraphicsPixmapItem *mSendAnimationScreenShot; // Owned
+    QGraphicsPixmapItem *mSendAnimationScreenShot; // Not owned.
     bool mDoSendAnimation;
 };
 
--- a/emailuis/nmailui/inc/nmuiheaders.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmuiheaders.h	Wed Jun 23 17:00:39 2010 +0100
@@ -90,7 +90,6 @@
 #include <xqservicerequest.h>
 #include <qtcontacts.h>
 #include <qmobilityglobal.h>
-#include <mobcntmodel.h>
 #include <xqserviceutil.h>
 #include <xqappmgr.h>
 #include <xqserviceipcmarshal.h>
@@ -106,14 +105,12 @@
 #include <nmmailboxlistmodel.h>
 #include <nmmessagelistmodel.h>
 #include <nmmessagelistmodelitem.h>
-#include <nmmessagesearchlistmodel.h>
 #include <nmmessage.h>
 #include <nmaddress.h>
 #include <nmoperation.h>
 #include <nmmessagecreationoperation.h>
 #include <nmaddattachmentsoperation.h>
 #include <nmicons.h>
-#include <nmcheckoutboxoperation.h>
 #include <emailmailboxinfo.h>
 #include <email_services_api.h>
 
@@ -147,6 +144,7 @@
 #include "nmrecipientlineedit.h"
 #include "nmstoreenvelopesoperation.h"
 #include "nmsendserviceinterface.h"
+#include "nmuriserviceinterface.h"
 #include "nmmailboxselectiondialog.h"
 #include "nmuidocumentloader.h"
 #include "nmmailboxserviceinterface.h"
--- a/emailuis/nmailui/inc/nmuiviewids.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmuiviewids.h	Wed Jun 23 17:00:39 2010 +0100
@@ -185,6 +185,16 @@
     {
         mMailboxId = mailboxId;
     }
+    
+    inline void setFolderId(NmId folderId) 
+    {
+        mFolderId = folderId;
+    }
+    
+    inline void setMessageId(NmId messageId) 
+    {
+        mMessageId = messageId;
+    }
 
 private: // Data
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/inc/nmuriserviceinterface.h	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2010 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: NMail Application service interface used for interfacing between
+*              QT highway and other applications
+*
+*/
+
+#ifndef NMURISERVICEINTERFACE_H_
+#define NMURISERVICEINTERFACE_H_
+
+//  INCLUDES
+#include <QObject>
+#include <QVariant>
+
+#ifdef Q_OS_SYMBIAN
+#include <xqserviceprovider.h>
+#else
+#define NM_WINS_ENV
+#endif
+
+//  FORWARD DECLARATIONS
+class NmDataManager;
+class NmMailboxListModel;
+class NmUiEngine;
+class NmApplication;
+class NmUiStartParam;
+class NmMailboxSelectionDialog;
+class NmId;
+class HbView;
+class NmAddress;
+
+class NmUriServiceInterface
+#ifndef NM_WINS_ENV
+    : public XQServiceProvider
+#else
+    : public QObject
+#endif
+{
+    Q_OBJECT
+
+public:
+
+    NmUriServiceInterface( QObject *parent,
+                           NmUiEngine &mailboxListModel,
+                           NmApplication* application);
+    virtual ~NmUriServiceInterface();
+
+public slots:
+
+    bool view(const QString& uri);
+    void selectionDialogClosed(NmId &mailboxId);
+
+private:
+
+    void launchEditorView(NmId mailboxId);
+    void cancelService();
+
+private: // Data
+
+    NmApplication *mApplication; // Not owned
+    NmUiEngine &mUiEngine;
+    int mAsyncReqId;
+    NmUiStartParam *mStartParam;
+    NmMailboxSelectionDialog *mSelectionDialog;
+    HbView *mCurrentView;
+};
+
+#endif /* NMURISERVICEINTERFACE_H_ */
+
+// End of file.
--- a/emailuis/nmailui/inc/nmutilities.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmutilities.h	Wed Jun 23 17:00:39 2010 +0100
@@ -27,6 +27,7 @@
 class QFile;
 class XQSharableFile;
 class NmOperationCompletionEvent;
+class HbMessageBox;
 
 /*!
 	UI utilities class
@@ -63,12 +64,12 @@
 
     static void displayErrorNote(QString noteText); 
 
-    static bool displayQuestionNote(QString noteText);
+    static HbMessageBox* displayQuestionNote(QString noteText,
+                                             QObject* receiver = 0,
+                                             const char* member = 0);
     
     static void displayWarningNote(QString noteText);
 
-    static bool displayOperationCompletionNote(const NmOperationCompletionEvent &event);
-
     static QString createReplyHeader(const NmMessageEnvelope &env);
 };
 
--- a/emailuis/nmailui/inc/nmviewerview.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmviewerview.h	Wed Jun 23 17:00:39 2010 +0100
@@ -61,6 +61,7 @@
     void reloadViewContents(NmUiStartParam* startParam);
     NmUiViewId nmailViewId() const;
     NmMailViewerWK* webView();
+    NmMessage* message();
     void viewReady();
     void aboutToExitView();
     
@@ -77,7 +78,6 @@
     void fetchMessage();
     void openAttachment(int index);
 	void createOptionsMenu();
-	void deleteButton(HbAction* result);
 
 private slots:
     void setMessageData();
@@ -96,6 +96,7 @@
     void fetchCompleted(int result);
 
 private:
+    void deleteMessage();
     void loadMessage();
     void loadViewLayout();
     QString formatMessage();
@@ -104,6 +105,10 @@
     void setMailboxName();
     void createToolBar();
     void setAttachmentList();
+    void createAndShowWaitDialog();
+    void setWebViewWidth(int width);
+    void setWebViewHeighth(int height);
+    void handleMouseEvent(QGraphicsSceneMouseEvent *event, bool pressed);
 
 private:
     NmApplication &mApplication;
@@ -135,8 +140,6 @@
     NmAttachmentListWidget *mAttaWidget;      // Not owned
     bool mViewReady;
     bool mWaitNoteCancelled;
-    HbAction* mOkAction;                        //owned
-    HbAction* mCancelAction;                    //owned
 };
 
 #endif /* NMVIEWERVIEW_H_ */
--- a/emailuis/nmailui/inc/nmviewerviewnetmanager.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmviewerviewnetmanager.h	Wed Jun 23 17:00:39 2010 +0100
@@ -23,18 +23,20 @@
 
 class QNetworkRequest;
 class NmViewerView;
+class NmUiEngine;
 
 class NmViewerViewNetManager : public QNetworkAccessManager
 {
     Q_OBJECT
 public:
-    NmViewerViewNetManager();
+    NmViewerViewNetManager(NmUiEngine &uiEngine);
     ~NmViewerViewNetManager();
     void setView(NmViewerView *viewerView);
     QNetworkReply *createRequest(Operation op, const QNetworkRequest &request,
                                  QIODevice *outgoingData);
 
 private:
+	NmUiEngine &mUiEngine;
 	NmViewerView *mMessageView;    // Not owned
 
 };
--- a/emailuis/nmailui/inc/nmviewerviewnetreply.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmviewerviewnetreply.h	Wed Jun 23 17:00:39 2010 +0100
@@ -20,12 +20,20 @@
 #define NMVIEWERVIEWNETREPLY_H_
 
 #include <QNetworkReply>
+#include "nmcommon.h"
+
+class NmOperation;
+class NmMessage;
+class NmUiEngine;
 
 class NmViewerViewNetReply : public QNetworkReply
 {
     Q_OBJECT
 public:
-    NmViewerViewNetReply(QVariant data);
+    NmViewerViewNetReply(QVariant data, NmUiEngine &uiEngine);
+    NmViewerViewNetReply(QVariant data, NmUiEngine &uiEngine, 
+            const NmId &mailboxId, const NmId &folderId, const NmId &messageId, 
+            const NmId &messagePartId);
     ~NmViewerViewNetReply();
     void setOriginalRequest(const QNetworkRequest &request);
     qint64 readData(char *data, qint64 maxlen);
@@ -36,9 +44,17 @@
 
 public slots:
     void signalReady();
+    void fetchCompleted(int result);
+    void fetchCancelled();
 
 private:
     QByteArray mDataArray;
+    NmUiEngine &mUiEngine;
+    NmId mMailboxId;
+    NmId mFolderId;
+    NmId mMessageId;
+    NmId mMessagePartId;
+    NmOperation *mOperation;
     qint64 mReadIndex;
 };
 
--- a/emailuis/nmailui/inc/nmviewerwebview.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/inc/nmviewerwebview.h	Wed Jun 23 17:00:39 2010 +0100
@@ -20,25 +20,39 @@
 
 #include <QGraphicsWebView>
 
+#include "nmcommon.h"
+
 class NmViewerView;
 class NmMessage;
 
 class QMouseEvent;
 
+class NmMailViewerWkContentItem
+{
+public:
+    NmMailViewerWkContentItem() 
+        : mData(0), mPartId(0), mIsFetched(false) {}
+    NmMailViewerWkContentItem(QVariant data, NmId partId, bool isFetched) 
+        : mData(data), mPartId(partId), mIsFetched(isFetched) {}
+    QVariant mData;
+    NmId     mPartId;
+    bool     mIsFetched;
+};
+
 class NmMailViewerWK : public QGraphicsWebView
 {
     Q_OBJECT
 public:
 	NmMailViewerWK();
 	~NmMailViewerWK();
-    virtual QVariant loadResource ( int type, const QUrl & name );
+    virtual QVariant loadResource (int type, const QUrl &name, NmId &partId, bool &isFetched);
     void setParentView(NmViewerView *parentView);
-    void addContent(QString key, QVariant val);
+    void addContent(QString key, QVariant val, NmId partId, bool isFetched);
     void sendMousePressEvent(QGraphicsSceneMouseEvent *event);
     void sendMouseReleaseEvent(QGraphicsSceneMouseEvent *event);
 
 private:
-    QMap<QString,QVariant> mContent;
+    QMap<QString,NmMailViewerWkContentItem> mContent;
     NmViewerView *mParentView;      // Not owned
 };
 
--- a/emailuis/nmailui/nmailui.pro	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/nmailui.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -47,7 +47,7 @@
     LIBS += -lxqservice \
         -lxqserviceutil \
         -lqtcontacts \
-        -lmobcntmodel
+        -lfmfiledialog
 }
 
 HEADERS += inc/nmeditorcontent.h \
@@ -76,6 +76,7 @@
     inc/nmuidef.h \
     inc/nmrecipientfield.h \
     inc/nmsendserviceinterface.h \
+    inc/nmuriserviceinterface.h \
     inc/nmmailboxselectiondialog.h \
     inc/nmuidocumentloader.h \
     inc/nmmailboxserviceinterface.h \
@@ -107,6 +108,7 @@
     src/nmuiextensionmanager.cpp \
     src/nmrecipientfield.cpp \
     src/nmsendserviceinterface.cpp \
+    src/nmuriserviceinterface.cpp \
     src/nmmailboxselectiondialog.cpp \
     src/nmuidocumentloader.cpp \
     src/nmmailboxserviceinterface.cpp \
--- a/emailuis/nmailui/service_conf.xml	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/service_conf.xml	Wed Jun 23 17:00:39 2010 +0100
@@ -13,6 +13,12 @@
     <customproperty key="aiw_action_icon">qtg_large_email</customproperty>
   </interface>
   <interface>
+    <name>com.nokia.symbian.IUriView</name>
+    <version>1.0</version>
+    <description>Uri interface</description>
+    <customproperty key="schemes">mailto</customproperty>
+  </interface>
+  <interface>
     <name>com.nokia.symbian.IEmailMessageSend</name>
     <version>1.0</version>
     <description>Send interface</description>
--- a/emailuis/nmailui/src/main.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/main.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -23,6 +23,8 @@
 */
 int main(int argc, char *argv[])
 {
+    NM_FUNCTION;
+    
     HbApplication app(argc, argv);
  
     // Load the translation file.
--- a/emailuis/nmailui/src/nmapplication.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmapplication.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -47,21 +47,25 @@
 mEffects(NULL),
 mAttaManager(NULL),
 mSettingsViewLauncher(NULL),
-mViewReady(false)
+mViewReady(false),
+mQueryDialog(NULL)
 {
+    NM_FUNCTION;
+
+    // TEMPORARY WORKAROUND TO PREVENT PANIC User panic 66, where there is
+    // a PushL call to cleanup stack without any TRAP.
+#ifdef Q_OS_SYMBIAN
+    TRAP_IGNORE(mUiEngine = NmUiEngine::instance());
+#else
+    mUiEngine = NmUiEngine::instance();
+#endif
+
     // Create network access manager and cache for application use.
-    mNetManager = new NmViewerViewNetManager();
+    mNetManager = new NmViewerViewNetManager(*mUiEngine);
     QNetworkDiskCache *cache = new QNetworkDiskCache();
     cache->setCacheDirectory(QDesktopServices::storageLocation(QDesktopServices::CacheLocation));
     mNetManager->setCache(cache);
 
-    // TEMPORARY WORKAROUND TO PREVENT PANIC User panic 66, where there is
-    // a PushL call to cleanup stack without any TRAP.
-    #ifdef Q_OS_SYMBIAN
-    TRAP_IGNORE(mUiEngine = NmUiEngine::instance());
-    #else
-    mUiEngine = NmUiEngine::instance();
-    #endif
     createMainWindow();
 
     // attachment manager can be shared between viewer and editor, ownership in application class
@@ -72,6 +76,8 @@
             new NmSendServiceInterface(NmSendServiceName, NULL, *mUiEngine, this);
     mSendServiceInterface2 =
             new NmSendServiceInterface(emailFullServiceNameSend, NULL, *mUiEngine, this);
+    mUriServiceInterface =
+        new NmUriServiceInterface(NULL, *mUiEngine, this);
     mMailboxServiceInterface =
             new NmMailboxServiceInterface(NULL, *mUiEngine, this);
     mViewerServiceInterface =
@@ -86,9 +92,17 @@
 */
 NmApplication::~NmApplication()
 {
+    NM_FUNCTION;
+
+    if (mQueryDialog){
+        delete mQueryDialog;
+        mQueryDialog=NULL;
+    }
+    
 #ifndef NM_WINS_ENV
 	delete mSendServiceInterface;
 	delete mSendServiceInterface2;
+	delete mUriServiceInterface;
 	delete mMailboxServiceInterface;
 	delete mViewerServiceInterface;
 #endif
@@ -107,9 +121,10 @@
     delete mNetManager;
     mNetManager=NULL;
     }
+    // Effects needs to be deleted before MainWindow.
+    delete mEffects;
     delete mMainWindow;
     delete mAttaManager;
-    delete mEffects;
     delete mSettingsViewLauncher;
 }
 
@@ -118,15 +133,10 @@
 */
 void NmApplication::createMainWindow()
 {
-    NMLOG("nmailui: createMainWindow enter");
+    NM_FUNCTION;
 
 #ifndef NM_WINS_ENV
     bool service = XQServiceUtil::isService();
-    if (service && !XQServiceUtil::isEmbedded()) {
-        // If started as service, keep it hidden until everything is initialised
-        // In embedded mode, the client app should not get hidden
-        XQServiceUtil::toBackground(true);
-    }
 #else
     bool service = false;
 #endif
@@ -150,12 +160,16 @@
     // Create view stack
     mViewStack = new QStack<NmBaseView*>;
 
-    // Create back action and connect it to popView()
+    // Create back action and connect it to prepareForPopView()
     if (mMainWindow) {
         mBackAction = new HbAction(Hb::BackNaviAction,this);
-        connect(mBackAction, SIGNAL(triggered()), this, SLOT(popView()));
+        connect(mBackAction, SIGNAL(triggered()), this, SLOT(prepareForPopView()));
+
         // Show mainwindow
-        mMainWindow->show();
+        // Services will active it when the view is ready
+        if (!service) {
+            mMainWindow->show();
+        }
     }
 
     // async operation completion related notifications
@@ -173,8 +187,8 @@
     }
 
     // Start to filter main window events to get "end key" event in all possible situations. Using
-    // event() is not enough to catch the event as it is only called if the view widget has the 
-    // focus. Note: if key capturing (xqkeycapture.h) is required it is probably best to implement 
+    // event() is not enough to catch the event as it is only called if the view widget has the
+    // focus. Note: if key capturing (xqkeycapture.h) is required it is probably best to implement
     // an own QMainWindow class and do the capturing there, not in the views.
     mMainWindow->installEventFilter(this);
 }
@@ -185,6 +199,8 @@
 */
 void NmApplication::viewReady()
 {
+    NM_FUNCTION;
+
     mViewReady = true;
     if (!mViewStack->isEmpty()) {
     	NmBaseView *currentView = mViewStack->top();
@@ -200,21 +216,23 @@
 */
 bool NmApplication::eventFilter(QObject *obj, QEvent *event)
 {
+    NM_FUNCTION;
+
     bool consumed = false;
-    
+
     if (obj && obj == mMainWindow && event && event->type() == QEvent::KeyPress) {
         QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
-        
+
         if (keyEvent->key() == Qt::Key_No) { // end key, the "red" key
-            
+
             // exit application if no pending operations are on-going
         }
     }
-    
+
     if (!consumed) {
         consumed = QObject::eventFilter(obj, event);
     }
-    
+
     return consumed;
 }
 
@@ -223,9 +241,10 @@
 */
 void NmApplication::pushView(NmBaseView *newView)
 {
-    NMLOG("nmailui: pushView enter");
+    NM_FUNCTION;
+
     if (newView) {
-        NMLOG("nmailui: view exists");
+        NM_COMMENT("nmailui: view exists");
         newView->setNavigationAction(mBackAction);
 
         // Store view to be hidden
@@ -241,7 +260,7 @@
 		}
 
         // activate new view
-    	NMLOG("nmailui: addView");
+    	NM_COMMENT("nmailui: addView");
         mMainWindow->addView(newView);
         mViewStack->push(newView);
         mMainWindow->setCurrentView(newView);
@@ -254,12 +273,32 @@
         }
 
         // hide old view
-        NMLOG("nmailui: removeView");
+        NM_COMMENT("nmailui: removeView");
         if (hideView){
             mMainWindow->removeView(hideView);
         }
 
-        NMLOG("nmailui: pushView done");
+        NM_COMMENT("nmailui: pushView done");
+    }
+}
+
+/*!
+    Ask from view that is it ok to pop view. This kind of 2-phase popView is needed
+    because view may show query dialog for user response.
+ */
+void NmApplication::prepareForPopView()
+{
+    if (mViewStack->size() > 0) {
+        // Get view pointer
+        NmBaseView *view = mViewStack->top();
+
+        // View will call/signal popView if exitting is ok.
+        view->okToExitView();
+    }
+    // If the view stack is now empty quit the app
+    // This happens also when the app has been started as a service
+    else if (mViewStack->size() == 0) {
+        exitApplication();
     }
 }
 
@@ -268,65 +307,64 @@
 */
 void NmApplication::popView()
 {
-    NMLOG("nmailui: popView enter");
+    NM_FUNCTION;
+
     if (mViewStack->size() > 0) {
         // Get view pointer
         NmBaseView *view = mViewStack->top();
 
         // ask view if it's ok to exit
-        if (view->okToExitView()) {
-            NmUiViewId topViewId = view->nmailViewId();
+        NmUiViewId topViewId = view->nmailViewId();
 
-            // Prepare for send animation if returing from editor and message has been sent.
-            if (topViewId == NmUiViewMessageEditor && mUiEngine->isSendingMessage()) {
-                mEffects->prepareEffect(NmUiEffects::NmEditorSendMessageAnimation);
-            }
-            mViewStack->pop();
-            // Call custom exit function
-            view->aboutToExitView();
-            // Remove view from stack.
-            mMainWindow->removeView(view);
+        // Prepare for send animation if returing from editor and message has been sent.
+        if (topViewId == NmUiViewMessageEditor && mUiEngine->isSendingMessage()) {
+            mEffects->prepareEffect(NmUiEffects::NmEditorSendMessageAnimation);
+        }
+        mViewStack->pop();
+        // Call custom exit function
+        view->aboutToExitView();
+        // Remove view from stack.
+        mMainWindow->removeView(view);
 
-            // if we were in editor and sent a message, pop viewer from stack first
-            // so we can go straight to mail list
-            if (!mViewStack->isEmpty() && topViewId == NmUiViewMessageEditor &&
-                mUiEngine->isSendingMessage() &&
-                mViewStack->top()->nmailViewId() == NmUiViewMessageViewer) {
-                NmBaseView *tmpView = mViewStack->pop();
-                mMainWindow->removeView(tmpView);
-                delete tmpView;
-                tmpView = NULL;
-            }
+        // if we were in editor and sent a message, pop viewer from stack first
+        // so we can go straight to mail list
+        if (!mViewStack->isEmpty() && topViewId == NmUiViewMessageEditor &&
+            mUiEngine->isSendingMessage() &&
+            mViewStack->top()->nmailViewId() == NmUiViewMessageViewer) {
+            NmBaseView *tmpView = mViewStack->pop();
+            mMainWindow->removeView(tmpView);
+            delete tmpView;
+            tmpView = NULL;
+        }
 
-            if (!mViewStack->isEmpty()) {
-                // Activate next view in stack
-                NmBaseView *showView = mViewStack->top();
-                mMainWindow->addView(showView);
-                mMainWindow->setCurrentView(showView);
-                // Store activated view id
-                mActiveViewId=showView->nmailViewId();
-                // Perform send animation if requested.
-                mEffects->startEffect(NmUiEffects::NmEditorSendMessageAnimation);
-            }
+        if (!mViewStack->isEmpty()) {
+            // Activate next view in stack
+            NmBaseView *showView = mViewStack->top();
+            mMainWindow->addView(showView);
+            mMainWindow->setCurrentView(showView);
+            // Store activated view id
+            mActiveViewId=showView->nmailViewId();
+            // Perform send animation if requested.
+            mEffects->startEffect(NmUiEffects::NmEditorSendMessageAnimation);
+        }
 
-            delete view;
-            view = NULL;
+        delete view;
+        view = NULL;
 
 #ifndef NM_WINS_ENV
-            // If view was started as service, move the app now
-            // to the background, unless it was started when the app
-            // was already in foreground..
-            if (mServiceViewId == topViewId) {
-                mServiceViewId = NmUiViewNone;
+        // If view was started as service, move the app now
+        // to the background, unless it was started when the app
+        // was already in foreground..
+        if (mServiceViewId == topViewId) {
+            mServiceViewId = NmUiViewNone;
 
-                // if started as embedded, do not hide the app
-		        if (!XQServiceUtil::isEmbedded() &&
-		            !mForegroundService) {
-		            XQServiceUtil::toBackground(true);
-                }
+            // if started as embedded, do not hide the app
+            if (!XQServiceUtil::isEmbedded() &&
+                !mForegroundService) {
+                XQServiceUtil::toBackground(true);
             }
+        }
 #endif
-        }
     }
 
     // If the view stack is now empty quit the app
@@ -341,7 +379,8 @@
 */
 void NmApplication::resetViewStack()
 {
-    NMLOG("nmailui: resetViewStack enter");
+    NM_FUNCTION;
+
     if (mViewStack && !mViewStack->isEmpty()) {
 	    int viewCount = mViewStack->count();
         // Pop and destroy all views
@@ -361,13 +400,12 @@
 */
 void NmApplication::enterNmUiView(NmUiStartParam* startParam)
 {
+    NM_FUNCTION;
+
     // Check the validity of start parameter object
     if (startParam) {
 
         if (startParam->service() && mMainWindow) {
-			// Store the visibility state when the service was launched
-			mForegroundService = mMainWindow->isVisible();
-
 			// When the message list is started as a service previous views are removed
 			// from the stack. Open editors are not closed.
 			// Also if the view is same than the new one, keep it open (reload the content).
@@ -378,7 +416,7 @@
 			    if (topId!=NmUiViewMessageEditor &&
 			        topId!=NmUiViewMailboxList &&
 			        topId!=startParam->viewId()) {
-			        popView();
+			        prepareForPopView();
 			    }
 			    else {
 			        // Editor or mailbox list in the top. Stop the loop.
@@ -412,7 +450,7 @@
                         mViewStack->top()->nmailViewId()==NmUiViewMessageEditor) {
                         break;
                     }
-                    NmMessageListModel &messageListModel = mUiEngine->messageListModel(
+                    NmMessageListModel *messageListModel = &mUiEngine->messageListModel(
                                                 startParam->mailboxId(), startParam->folderId());
                     NmMessageListView *msgList =new NmMessageListView(
                     		*this, startParam, *mUiEngine, *mMbListModel, messageListModel,
@@ -424,31 +462,27 @@
                 {
                     // Check the topmost view. If it is an editor, do not open
                     // a new mail search list view.
-                    if (startParam->service() && !mViewStack->isEmpty() && 
+                    if (startParam->service() && !mViewStack->isEmpty() &&
                         mViewStack->top()->nmailViewId() == NmUiViewMessageEditor) {
                         break;
                     }
 
-                    NmMessageListModel &messageListModel =
-                        mUiEngine->messageListModel(startParam->mailboxId(),
-                                                    startParam->folderId());
-
-                    NmMessageSearchListModel &searchListModel =
-                        mUiEngine->messageSearchListModel(&messageListModel);
+                    NmMessageListModel &model =
+                        mUiEngine->messageListModelForSearch(startParam->mailboxId());
 
                     NmMessageSearchListView *searchListView = new NmMessageSearchListView(
-                        *this, startParam, *mUiEngine, searchListModel,
+                        *this, startParam, *mUiEngine, model,
                         new HbDocumentLoader(mMainWindow));
 
                     pushView(searchListView);
                 }
                 break;
                 case NmUiViewMessageViewer:
-                    pushView(new NmViewerView(*this, startParam, *mUiEngine, 
+                    pushView(new NmViewerView(*this, startParam, *mUiEngine,
                             mMainWindow, *mAttaManager));
                     break;
                 case NmUiViewMessageEditor:
-                    pushView(new NmEditorView(*this, startParam, *mUiEngine));
+                    pushView(new NmEditorView(*this, startParam, *mUiEngine, *mAttaManager));
                     break;
                 default:
                     // Reset view stack and exit application
@@ -473,12 +507,15 @@
 */
 void NmApplication::exitApplication()
 {
-	NMLOG("NmApplication::exitApplication");
+    NM_FUNCTION;
+
 #ifndef NM_WINS_ENV
     delete mSendServiceInterface;
     mSendServiceInterface = NULL;
     delete mSendServiceInterface2;
     mSendServiceInterface2 = NULL;
+    delete mUriServiceInterface;
+    mUriServiceInterface = NULL;
     delete mMailboxServiceInterface;
     mMailboxServiceInterface = NULL;
     delete mViewerServiceInterface;
@@ -494,7 +531,8 @@
 */
 void NmApplication::delayedExitApplication()
 {
-    NMLOG("NmApplication::delayedExitApplication");
+    NM_FUNCTION;
+
     // Exit the application in the next event loop
     QTimer::singleShot(0, this, SLOT(exitApplication()));
 }
@@ -504,6 +542,8 @@
 */
 HbMainWindow* NmApplication::mainWindow()
 {
+    NM_FUNCTION;
+
     return mMainWindow;
 }
 
@@ -512,6 +552,8 @@
 */
 NmUiExtensionManager& NmApplication::extManager()
 {
+    NM_FUNCTION;
+
     return *mExtensionManager;
 }
 
@@ -520,6 +562,8 @@
 */
 NmViewerViewNetManager& NmApplication::networkAccessManager()
 {
+    NM_FUNCTION;
+
     return *mNetManager;
 }
 
@@ -528,6 +572,8 @@
 */
 QSize NmApplication::screenSize()
 {
+    NM_FUNCTION;
+
     QSize ret(0,0);
     if (mMainWindow){
         HbDeviceProfile currentP = HbDeviceProfile::current();
@@ -561,28 +607,68 @@
 */
 void NmApplication::handleOperationCompleted(const NmOperationCompletionEvent &event)
 {
-    bool openSettings = NmUtilities::displayOperationCompletionNote(event);
-    if(openSettings) {
-        launchSettings(event.mMailboxId);
+    NM_FUNCTION;
+
+    if(event.mCompletionCode != NmNoError && event.mCompletionCode != NmCancelError) {
+        if(event.mOperationType == Synch && event.mCompletionCode == NmAuthenticationError) {
+            mLastOperationMailbox=event.mMailboxId;
+            if (mQueryDialog){
+                delete mQueryDialog;
+                mQueryDialog=NULL;
+            }
+            mQueryDialog = NmUtilities::displayQuestionNote(hbTrId("txt_mail_dialog_address_or_password_incorrect"),
+                                                    this, SLOT(launchSettings(HbAction*)));                        
+        }
+        if(event.mOperationType == Synch && event.mCompletionCode == NmServerConnectionError) {
+            mLastOperationMailbox=event.mMailboxId;
+            if (mQueryDialog){
+                delete mQueryDialog;
+                mQueryDialog=NULL;
+            }
+            mQueryDialog = NmUtilities::displayQuestionNote(hbTrId("txt_mail_dialog_server_settings_incorrect"),
+                                                    this, SLOT(launchSettings(HbAction*)));                
+        }
+        // following applies to all operation/event types
+        if(event.mCompletionCode == NmConnectionError) {
+            NmUtilities::displayWarningNote(hbTrId("txt_mail_dialog_mail_connection_error"));
+        }
     }
 }
 
 /*!
     launches settings view of the specified mailbox
 */
-void NmApplication::launchSettings(const NmId &mailboxId)
+void NmApplication::launchSettings(HbAction* action)
 {
-    // create settingslauncher if doesn't exist
-    if(!mSettingsViewLauncher) {
-        mSettingsViewLauncher = new NmSettingsViewLauncher();
-        }
+    NM_FUNCTION;
+    
+    // Check whether yes button was pressed
+    if (mQueryDialog&& action == mQueryDialog->actions().at(0)) {
+        // create settingslauncher if doesn't exist
+        if(!mSettingsViewLauncher) {
+            mSettingsViewLauncher = new NmSettingsViewLauncher();
+            }
+    
+        if(mSettingsViewLauncher) {
+            // mailboxname required
+            NmMailboxMetaData *mailboxMetaData = mUiEngine->mailboxById(mLastOperationMailbox); // no ownership
+            if( mailboxMetaData ) {
+                // launch
+                mSettingsViewLauncher->launchSettingsView(mLastOperationMailbox, mailboxMetaData->name());
+            }
+        }     
+    }    
+}
 
-    if(mSettingsViewLauncher) {
-        // mailboxname required
-        NmMailboxMetaData *mailboxMetaData = mUiEngine->mailboxById(mailboxId); // no ownership
-        if( mailboxMetaData ) {
-            // launch
-            mSettingsViewLauncher->launchSettingsView(mailboxId, mailboxMetaData->name());
-        }
-    }
+/*!
+	Stores the visibility state, e.g. when the service was launched.
+	\return true if the app was visible
+*/
+bool NmApplication::updateVisibilityState()
+{
+    // At the moment there is no good way to check the foreground state
+    QWindowSurface *surface = mMainWindow->windowSurface();
+	mForegroundService = (surface != NULL);
+	NM_COMMENT(QString("NmApplication::updateVisibilityState fg=%1").arg(mForegroundService));
+	return mForegroundService;
 }
--- a/emailuis/nmailui/src/nmattachmentlist.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmattachmentlist.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -28,6 +28,8 @@
 NmAttachmentList::NmAttachmentList(NmAttachmentListWidget &listWidget)
 : mListWidget(listWidget)
 {
+    NM_FUNCTION;
+    
     updateLayout();
 }
 
@@ -36,6 +38,8 @@
 */
 NmAttachmentList::~NmAttachmentList()
 { 
+    NM_FUNCTION;
+    
     clearList();
 }
 
@@ -47,6 +51,8 @@
     const QString &fileSize,
     const NmId &attachmentPartId)
 {
+    NM_FUNCTION;
+    
     QString displayName = fullNameToDisplayName(fullFileName);
     mFullFileName.append(fullFileName);
     mDisplayFileName.append(displayName);
@@ -67,6 +73,8 @@
 void NmAttachmentList::setAttachmentPartId(const QString fullFileName, 
                                            const NmId &attachmentPartId)
 {
+    NM_FUNCTION;
+    
     for (int i=0; i<count(); ++i) {
         if (mFullFileName.at(i) == fullFileName && mAttachmentPartId.at(i).id() == 0) {
             mAttachmentPartId.replace(i, attachmentPartId);
@@ -79,6 +87,8 @@
 */
 void NmAttachmentList::setAttachmentSize(const NmId &attachmentPartId, const QString &size)
 {
+    NM_FUNCTION;
+    
     for (int i=0; i<count(); ++i) {
         if (mAttachmentPartId.at(i) == attachmentPartId) {
             mFileSize.replace(i, size);
@@ -92,6 +102,8 @@
 */
 void NmAttachmentList::removeAttachment(int arrayIndex)
 {
+    NM_FUNCTION;
+    
     if (arrayIndex < count()) {
         // Remove UI
         mListWidget.removeAttachment(arrayIndex);
@@ -108,6 +120,8 @@
 */
 QString NmAttachmentList::getFullFileNameByIndex(int arrayIndex)
 {
+    NM_FUNCTION;
+    
 	QString result;
 	
     if ( arrayIndex >= 0 && arrayIndex < mFullFileName.count() ) {
@@ -121,6 +135,8 @@
 */
 void NmAttachmentList::removeAttachment(const QString &fullFileName)
 {
+    NM_FUNCTION;
+    
     for (int i=0; i<count(); ++i) {
         if (mFullFileName.at(i) == fullFileName) {
             removeAttachment(i);
@@ -133,6 +149,8 @@
 */
 void NmAttachmentList::removeAttachment(const NmId &attachmentPartId)
 {
+    NM_FUNCTION;
+    
     for (int i=0; i<count(); ++i) {
         if (mAttachmentPartId.at(i) == attachmentPartId) {
             removeAttachment(i);
@@ -145,6 +163,8 @@
 */
 void NmAttachmentList::clearList()
 {
+    NM_FUNCTION;
+    
     for (int i=count()-1; i>=0; --i) {
         // Remove from UI
         mListWidget.removeAttachment(i);
@@ -161,6 +181,8 @@
 */
 NmAttachmentListWidget& NmAttachmentList::listWidget()
 {
+    NM_FUNCTION;
+    
     return mListWidget;
 }
 
@@ -169,6 +191,8 @@
 */
 int NmAttachmentList::count()
 {
+    NM_FUNCTION;
+    
     return mFullFileName.count();
 }
 
@@ -177,6 +201,8 @@
 */
 NmId NmAttachmentList::nmIdByIndex(int listIndex)
 {
+    NM_FUNCTION;
+    
     return mAttachmentPartId.at(listIndex);
 }
 
@@ -185,6 +211,8 @@
 */
 int NmAttachmentList::indexByNmId(const NmId &id)
 {
+    NM_FUNCTION;
+    
     for (int i=0; i<count(); ++i) {
         if (mAttachmentPartId.at(i) == id) {
             return i;
@@ -198,6 +226,8 @@
 */
 QString NmAttachmentList::fullNameToDisplayName(const QString &fullName)
 {
+    NM_FUNCTION;
+    
     return fullName.section('\\', -1);
 }
 
@@ -206,6 +236,8 @@
 */
 void NmAttachmentList::updateLayout()
 {
+    NM_FUNCTION;
+    
     // Fix this when progress bar is used
     mListWidget.setMaximumHeight(count() * 56); 
     QTimer::singleShot(1, this, SLOT(delayedLayoutChangeInfo()));
@@ -216,6 +248,8 @@
 */
 void NmAttachmentList::delayedLayoutChangeInfo()
 {
+    NM_FUNCTION;
+    
     emit attachmentListLayoutChanged();
 }
 
--- a/emailuis/nmailui/src/nmattachmentmanager.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmattachmentmanager.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -30,12 +30,13 @@
 NmAttachmentManager::NmAttachmentManager(NmUiEngine &uiEngine) :
     mUiEngine(uiEngine),
     mFetchOperation(NULL),
+    mMsgFetchOperation(NULL),
     mFetchObserver(NULL),
     mAttaId(0),
     mProgressValue(0),
     mIsFetching(false)
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -43,7 +44,9 @@
 */
 NmAttachmentManager::~NmAttachmentManager()
 {
-    // cancel fetch
+    NM_FUNCTION;
+    
+    // fetch operation deleted in cancel fetch
     cancelFetch();
 }
 
@@ -57,6 +60,7 @@
         const NmId &messageId, 
         const NmId &messagePartId)
 {
+    NM_FUNCTION;
     // cancel old fetch operation, Does nothing if fetch not ongoing
     cancelFetch();
 
@@ -67,7 +71,7 @@
         mAttaId = messagePartId;
         mIsFetching = true;
         QObject::connect(mFetchOperation, SIGNAL(operationCompleted(int)),
-                this, SLOT(attachmentFetchCompleted(int)));
+                this, SLOT(completeAttachmentFetch(int)));
         
         QObject::connect(mFetchOperation, SIGNAL(operationProgressChanged(int)),
                 this, SLOT(changeProgress(int)));
@@ -77,10 +81,94 @@
 }
 
 /*!
+    Fetch attachments to a message. 
+    Set observer with setObserver method to get process and complete events
+    
+    \return bool true if fetch started, otherwise false.
+*/
+bool NmAttachmentManager::fetchAttachments(
+        const NmId &mailboxId, 
+        const NmId &folderId, 
+        const NmId &messageId,
+        QList<NmId> &messagePartIds)
+{
+    NM_FUNCTION;
+    bool result = false;
+    // cancel old fetch operation, Does nothing if fetch not ongoing
+    cancelFetch();
+    
+    if (messagePartIds.count() > 0) {
+        mFetchOperation = mUiEngine.fetchMessageParts(
+            mailboxId,
+            folderId,
+            messageId,
+            messagePartIds);
+        
+        if (mFetchOperation) {
+            mAttaId = 0;
+            mIsFetching = true;
+            QObject::connect(mFetchOperation, SIGNAL(operationCompleted(int)),
+                    this, SLOT(completeAttachmentFetch(int)));
+            
+            QObject::connect(mFetchOperation, SIGNAL(operationProgressChanged(int)),
+                    this, SLOT(changeProgress(int)));
+        
+            result = true;
+        }
+    }
+    return result;
+}
+
+/*!
+    Fetch all message parts to a message. Fetches also message part data structure,
+    if not fetched already.
+      If earlier fetch operation exist it is cancelled and deleted.
+    Set observer with setObserver method to get process and complete events
+*/
+void NmAttachmentManager::fetchAllMessageParts(
+        const NmId &mailboxId, 
+        const NmId &folderId, 
+        const NmId &messageId)
+{
+    NM_FUNCTION;
+    mFetchMsg = mUiEngine.message(mailboxId,folderId,messageId);
+    
+    // Check if we have part data structure.    
+    if (mFetchMsg->childParts().count() == 0 &&
+        mFetchMsg->fetchedSize() < mFetchMsg->size()) {
+
+        // cancel old fetch operation, Does nothing if fetch not ongoing
+        cancelFetch();
+        
+        // Fetch the message.
+        mMsgFetchOperation = mUiEngine.fetchMessage(
+            mFetchMsg->envelope().mailboxId(),
+            mFetchMsg->envelope().folderId(),
+            mFetchMsg->envelope().messageId());
+        
+        mAttaId = 0;
+        mIsFetching = true;
+
+        if (mMsgFetchOperation) {
+            QObject::connect(mMsgFetchOperation,
+                    SIGNAL(operationCompleted(int)),
+                    this,
+                    SLOT(completeMessageFetch(int)));
+        }
+        
+    }
+    else {
+        completeMessageFetch(NmNoError);
+    }
+}
+
+/*!
     Retruns true if fetch operation is ongoing
 */
 bool NmAttachmentManager::isFetching() const
 {
+    NM_FUNCTION;
+    
     return mIsFetching;
 }
 
@@ -89,6 +177,8 @@
 */
 NmId NmAttachmentManager::partIdUnderFetch() const
 {
+    NM_FUNCTION;
+    
     return mAttaId;
 }
 
@@ -97,9 +187,13 @@
 */
 void NmAttachmentManager::cancelFetch()
 {
+    NM_FUNCTION;
     if (mFetchOperation && mFetchOperation->isRunning()) { 
         mFetchOperation->cancelOperation();
     }
+    if (mMsgFetchOperation && mMsgFetchOperation->isRunning()) {
+        mMsgFetchOperation->cancelOperation();
+    }
     mIsFetching = false;
     mAttaId = 0;
     mProgressValue = 0;
@@ -110,6 +204,8 @@
 */
 void NmAttachmentManager::changeProgress(int value)
 {
+    NM_FUNCTION;
+    
     if (mFetchObserver && value > mProgressValue) {
         mProgressValue = value;
         mFetchObserver->progressChanged(value);
@@ -119,8 +215,10 @@
 /*!
     Used by message part fetch operation
 */
-void NmAttachmentManager::attachmentFetchCompleted(int result)
+void NmAttachmentManager::completeAttachmentFetch(int result)
 {
+    NM_FUNCTION;
+    
     if (mFetchObserver) {
         mFetchObserver->fetchCompleted(result);
     }
@@ -130,10 +228,68 @@
 }
 
 /*!
+    Used by message fetch operation
+*/
+void NmAttachmentManager::completeMessageFetch(int result)
+{
+    NM_FUNCTION;
+    
+    if (result == NmNoError) {
+        
+        // Reload message
+        mFetchMsg = mUiEngine.message(
+            mFetchMsg->envelope().mailboxId(),
+            mFetchMsg->envelope().folderId(),
+            mFetchMsg->envelope().messageId());
+        
+        if (mFetchMsg) {
+            QList<NmId> partIds;
+            NmMessagePart *part;
+            foreach (part, mFetchMsg->childParts()) {
+                if (part->size() > part->fetchedSize()) {
+                    partIds.append(part->partId());
+                }
+            }
+            if (partIds.count() > 0) {
+                mMsgFetchOperation = NULL;
+                fetchAttachments(
+                    mFetchMsg->envelope().mailboxId(),
+                    mFetchMsg->envelope().folderId(),
+                    mFetchMsg->envelope().messageId(),
+                    partIds);
+                
+                if (mFetchOperation) {
+                    mAttaId = 0;
+                    mIsFetching = true;
+                    QObject::connect(mFetchOperation, SIGNAL(operationCompleted(int)),
+                            this, SLOT(completeAttachmentFetch(int)));
+                    
+                    QObject::connect(mFetchOperation, SIGNAL(operationProgressChanged(int)),
+                            this, SLOT(changeProgress(int)));
+                
+                    result = true;
+                }
+            }
+            else {
+                mFetchObserver->fetchCompleted(NmNoError);
+            }
+        }
+        else {
+            mFetchObserver->fetchCompleted(NmNotFoundError);
+        }
+    }
+    else {
+        mFetchObserver->fetchCompleted(result);
+    }
+}
+
+/*!
     Sets fetch observer
 */
 void NmAttachmentManager::setObserver(NmAttachmentFetchObserver *observer)
 {
+    NM_FUNCTION;
+    
     mFetchObserver = observer;
     // send progress event wheng observer changes if fetch ongoing 
     // to get progress bar updating
@@ -147,6 +303,8 @@
 */
 void NmAttachmentManager::clearObserver()
 {
+    NM_FUNCTION;
+    
     mFetchObserver = NULL;
 }
 
@@ -155,6 +313,8 @@
 */
 int NmAttachmentManager::progressValue() const
 {
+    NM_FUNCTION;
+    
     return mProgressValue;
 }
 
--- a/emailuis/nmailui/src/nmattachmentpicker.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmattachmentpicker.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,8 +15,11 @@
 *
 */
 
+#include <fmfiledialog.h>
+#include <xqaiwdecl.h>
 #include "nmuiheaders.h"
-
+const int NmAttachmentPickerStillMode = 0;
+const int NmAttachmentPickerVideoMode = 1;
 
 /*!
     \class NmAttachmentPicker
@@ -30,6 +33,7 @@
     QObject(parent),
     mRequest(NULL)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -37,6 +41,8 @@
 */
 NmAttachmentPicker::~NmAttachmentPicker()
 {
+    NM_FUNCTION;
+    
     delete mRequest;
 }
 
@@ -45,7 +51,9 @@
 */
 void NmAttachmentPicker::fetchImage()
 {
-    fetch(IMAGE_FETCHER_INTERFACE, IMAGE_FETCHER_OPERATION);
+    NM_FUNCTION;
+    
+    fetch(XQI_IMAGE_FETCH, XQOP_IMAGE_FETCH);
 }
 
 /*!
@@ -53,7 +61,9 @@
 */
 void NmAttachmentPicker::fetchAudio()
 {
-    fetch(AUDIO_FETCHER_INTERFACE, AUDIO_FETCHER_OPERATION);    
+    NM_FUNCTION;
+    
+    fetch(XQI_MUSIC_FETCH, XQOP_MUSIC_FETCH);    
 }
 
 /*!
@@ -61,7 +71,8 @@
 */
 void NmAttachmentPicker::fetchVideo()
 {
-
+    NM_FUNCTION;
+    fetch(XQI_VIDEO_FETCH, XQOP_VIDEO_FETCH);
 }
 
 /*!
@@ -69,22 +80,82 @@
 */
 void NmAttachmentPicker::fetchOther()
 {
+    NM_FUNCTION;
+    
+    QString path;
+    path = FmFileDialog::getSaveFileName(0, hbTrId("txt_mail_dialog_select_file"));
+    
+    if(!path.isEmpty()) {
+        QString temp = QDir::toNativeSeparators(path);
+        emit attachmentsFetchOk(QVariant(temp));    
+    }
+}
 
+/*!
+    Send request to retrieve image from camera
+*/
+void NmAttachmentPicker::fetchCameraStill()
+{
+    NM_FUNCTION;
+    fetchFromCamera(NmAttachmentPickerStillMode);
+}
+
+/*!
+    Send request to retrieve video from camera
+*/
+void NmAttachmentPicker::fetchCameraVideo()
+{
+    NM_FUNCTION;
+    fetchFromCamera(NmAttachmentPickerVideoMode);
 }
 
 /*!
+    Send request to retrieve image/video from camera
+*/
+void NmAttachmentPicker::fetchFromCamera(int mode)
+{
+    NM_FUNCTION;
+
+    int cameraIndex = 0;            //primary camera
+    int quality = 0;                //default
+    bool allowModeSwitch = false;   //not allowed to change
+    bool allowCameraSwitch = true;  //allow changes
+    bool allowQualityChange = true; //allow changes
+    
+    QVariantMap parameters;
+    parameters.insert(XQCAMERA_INDEX, cameraIndex);
+    parameters.insert(XQCAMERA_QUALITY, quality);
+    parameters.insert(XQCAMERA_MODE_SWITCH, allowModeSwitch);
+    parameters.insert(XQCAMERA_INDEX_SWITCH, allowCameraSwitch);
+    parameters.insert(XQCAMERA_QUALITY_CHANGE, allowQualityChange); 
+ 
+    QList<QVariant> args;
+    args << mode;
+    args << parameters;
+    
+    fetch(XQI_CAMERA_CAPTURE, "capture(int,QVariantMap)", &args);
+}
+/*!
     Construct & send appmgr request to start appropriate picker   
+    param <interface> the interface to be connected to
+    param <operation> the operation of the interface
+    param <args> the arguments that needed by the operation
 */
 void NmAttachmentPicker::fetch(const QString& interface, 
-    const QString& operation)
+    const QString& operation, const QList<QVariant>* args)
 {
+    NM_FUNCTION;
+    
     delete mRequest;
     mRequest = NULL;
     XQApplicationManager appMgr;
     mRequest = appMgr.create(interface, operation, true);
-
+   
     if (mRequest) {
         mRequest->setSynchronous(false);
+        if (args) {
+            mRequest->setArguments(*args);
+        }
         connect(mRequest, SIGNAL(requestOk(const QVariant&)),
                 this, SIGNAL(attachmentsFetchOk(const QVariant&)));
 
--- a/emailuis/nmailui/src/nmbaseview.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmbaseview.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -27,10 +27,13 @@
     Constructor
 */
 NmBaseView::NmBaseView(NmUiStartParam* startParam,
+                       NmApplication &application,
                        QGraphicsItem *parent)
 : HbView(parent),
-mStartParam(startParam)
+mStartParam(startParam),
+mApplication(application)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -38,16 +41,21 @@
 */
 NmBaseView::~NmBaseView()
 {
+    NM_FUNCTION;
+    
     delete mStartParam;
 }
 
 /*!
-    Is it ok to exit current view. Function is called when exiting the view. 
-    Views can override this function and return false to stay in current view. 
+    Is it ok to exit current view. Function is called when exiting the view.
+    Views can override this function and deside are they going to signal popView
+    or not. For example based on the user query. 
 */
-bool NmBaseView::okToExitView()
+void NmBaseView::okToExitView()
 {
-    return true;
+	NM_FUNCTION;
+	
+	mApplication.popView();
 }
 
 /*!
@@ -57,6 +65,7 @@
 */
 void NmBaseView::aboutToExitView()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -65,7 +74,8 @@
     if it makes sense to construct items after main view is shown. 
 */
 void NmBaseView::viewReady()
-{    
+{
+    NM_FUNCTION;
 }
 
 /*!
@@ -74,6 +84,7 @@
 */
 void NmBaseView::aboutToChangeOrientation()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -82,6 +93,8 @@
 */
 void NmBaseView::orientationChanged(Qt::Orientation orientation)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(orientation);
 }
 
@@ -91,6 +104,8 @@
 */
 void NmBaseView::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(event);
 }
 
@@ -100,6 +115,8 @@
 */
 void NmBaseView::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(event);
 }
 
@@ -110,6 +127,8 @@
 */
 void NmBaseView::handleMouseMoveEvent(QGraphicsSceneMouseEvent *event)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(event);
 }
 
--- a/emailuis/nmailui/src/nmeditorcontent.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmeditorcontent.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -20,9 +20,6 @@
 // Layout
 static const char *NMUI_EDITOR_BODY = "BodyTextEdit";
 
-static const double Un = 6.66;
-static const double HeaderAreaMarginsTotal = 3 * Un;
-
 /*!
     Constructor
 */
@@ -38,14 +35,14 @@
     mEditorWidget(NULL),
     mBackgroundScrollArea((NmBaseViewScrollArea*)parent)
 {
-    mBackgroundScrollArea->setLongPressEnabled(true);
+    NM_FUNCTION;
 
     // Add header area handling widget into layout
-    mHeaderWidget = new NmEditorHeader(documentLoader, this);
+    mHeaderWidget = new NmEditorHeader(documentLoader);
 
     // Get pointer to body text area handling widget
     mEditorWidget = qobject_cast<NmEditorTextEdit *>(documentLoader->findWidget(NMUI_EDITOR_BODY));
-
+    
     // Set body editor to use NmEditorTextDocument
     NmEditorTextDocument *textDocument = new NmEditorTextDocument(manager);
     mEditorWidget->setDocument(textDocument); 
@@ -68,6 +65,8 @@
 */
 NmEditorContent::~NmEditorContent()
 {
+    NM_FUNCTION;
+    
    delete mHeaderWidget;
 }
 
@@ -76,34 +75,16 @@
     present, reply header is generated and set to editor. Reply
     envelope ownership is not transferred here.
  */
-void NmEditorContent::setMessageData(const NmMessage &message,
-                                     NmMessageEnvelope *replyMsgEnvelope)
+void NmEditorContent::setMessageData(const NmMessage &originalMessage)
 {
-    // Check which part is present. Html or plain text part
-    const NmMessagePart *htmlPart = message.htmlBodyPart();
-    const NmMessagePart *plainPart = message.plainTextBodyPart();
-
-    QList<NmMessagePart*> parts;
-    message.attachmentList(parts);
-    NmMessagePart* attachmentHtml = NULL;
+    NM_FUNCTION;
+    // Check which part is present. Html or plain text part. We use the original message parts.
+    const NmMessagePart *htmlPart = originalMessage.htmlBodyPart();
 
-    foreach(NmMessagePart* part, parts) {
-        if (part->contentDescription().startsWith( NmContentDescrAttachmentHtml )) {
-                attachmentHtml = part;
-            }
-        }
-    
-    if (htmlPart) {	    
-        // Html part was present, set it to HbTextEdit
-        // This will generate contentsChanged() event which is used to
-        // set new height for the editor widget and content.
-        if(attachmentHtml){
-            QString htmlText = htmlPart->textContent() + attachmentHtml->textContent();
-            emit setHtml(htmlText);
-        } 
-        else{
-            emit setHtml(htmlPart->textContent());    
-        }
+    const NmMessagePart *plainPart = originalMessage.plainTextBodyPart();
+
+    if (htmlPart) {
+        emit setHtml(htmlPart->textContent());    
         mMessageBodyType = HTMLText;
     }
     else if (plainPart) {
@@ -112,11 +93,11 @@
         mMessageBodyType = PlainText;
     }
     
-    // Original message text to editor content fiel
-    if (replyMsgEnvelope && mEditorWidget) {          
+    // We create the "reply" header (also for forward message)
+    if (mEditorWidget) {          
         QTextCursor cursor = mEditorWidget->textCursor();
         cursor.setPosition(0);
-        cursor.insertHtml(NmUtilities::createReplyHeader(*replyMsgEnvelope));
+        cursor.insertHtml(NmUtilities::createReplyHeader(originalMessage.envelope()));
     }
 }  
 
@@ -126,15 +107,16 @@
  */
 void NmEditorContent::setEditorContentHeight()
 {
+    NM_FUNCTION;
+    
 	const QSizeF reso = HbDeviceProfile::current().logicalSize();
-    qreal containerHeight =
-        mEditorWidget->contentHeight() + mHeaderWidget->headerHeight() + HeaderAreaMarginsTotal;
+    qreal containerHeight = mEditorWidget->contentHeight() + mHeaderWidget->headerHeight();
     if (containerHeight < reso.height()) {
         //Currently content height is too long because Chrome hiding is not supported.
         //Fix this when Chrome works.
         containerHeight = reso.height();
         qreal bodyContentHeight =
-            reso.height() - mHeaderWidget->headerHeight() - HeaderAreaMarginsTotal;
+            reso.height() - mHeaderWidget->headerHeight();
         mEditorWidget->setPreferredHeight(bodyContentHeight);
         mEditorWidget->setMaximumHeight(bodyContentHeight);
     }
@@ -148,6 +130,8 @@
  */
 void NmEditorContent::createConnections()
 {
+    NM_FUNCTION;
+    
     // Body edit widget is also interested about bg scroll position change
     connect(mBackgroundScrollArea, SIGNAL(scrollPositionChanged(QPointF)),
             mEditorWidget, SLOT(updateScrollPosition(QPointF)));
@@ -167,6 +151,8 @@
  */
 NmEditorTextEdit* NmEditorContent::editor() const
 {
+    NM_FUNCTION;
+    
     return mEditorWidget;
 }
 
@@ -175,6 +161,8 @@
  */
 NmEditorHeader* NmEditorContent::header() const
 {
+    NM_FUNCTION;
+    
     return mHeaderWidget;
 }
 
--- a/emailuis/nmailui/src/nmeditorheader.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmeditorheader.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -11,48 +11,48 @@
 *
 * Contributors:
 *
-* Description: Message editor header widget
+* Description: Message editor header container class. Collects the header widgets.
 *
 */
 
 #include "nmuiheaders.h"
 
 // Layout
-static const char *NMUI_EDITOR_TO_LABEL = "EditorHeaderToLabel";
-static const char *NMUI_EDITOR_TO_EDIT = "EditorHeaderToEdit";
-static const char *NMUI_EDITOR_TO_BUTTON = "EditorHeaderToButton";
-static const char *NMUI_EDITOR_RECIPIENT_GB = "EditorHeaderRecipientGB";
-static const char *NMUI_EDITOR_SUBJECT_LABEL = "EditorHeaderSubjectLabel";
-static const char *NMUI_EDITOR_SUBJECT_EDIT = "EditorHeaderSubjectEdit";
-static const char *NMUI_EDITOR_PRIORITY_ICON = "labelPriorityIcon";
+// These match to the defintions in nmeditorview.docml
+static const char *NMUI_EDITOR_CONTAINER = "containerContents";
+static const char *NMUI_EDITOR_SUBJECT_FIELD = "editorSubjectField";
+static const char *NMUI_EDITOR_SUBJECT_EDIT = "editorSubjectEdit";
+static const char *NMUI_EDITOR_CC_FIELD = "editorCcField";
+static const char *NMUI_EDITOR_BCC_FIELD = "editorBccField";
+static const char *NMUI_EDITOR_PRIORITY_ICON = "editPriorityIcon";
+static const char *NMUI_EDITOR_FOLLOWUP_ICON = "editFollowUpIcon";
 static const char *NMUI_EDITOR_ATTACHMENT_LIST = "attachmentListWidget";
+static const char *NMUI_EDITOR_PREFIX_TO = "editorTo";
+static const char *NMUI_EDITOR_PREFIX_CC = "editorCc";
+static const char *NMUI_EDITOR_PREFIX_BCC = "editorBcc";
 
-// Following constants are removed when header fields will offer these
-static const double Un = 6.66;
-static const double FieldHeightWhenSecondaryFont = 5 * Un;
-static const int GroupBoxTitleHeight = 42;
-static const double Margin = 2 * Un;
-static const double HeaderAreaMarginsTotal = 3 * Un;
-static const double IconFieldWidth = 5 * Un;
+static const int MaxRows = 10000;
 
 static const int nmLayoutSystemWaitTimer = 10;
 
 /*!
     Constructor
 */
-NmEditorHeader::NmEditorHeader(HbDocumentLoader *documentLoader, QGraphicsItem *parent) :
-    HbWidget(parent),
+NmEditorHeader::NmEditorHeader(HbDocumentLoader *documentLoader) :
     mDocumentLoader(documentLoader),
     mHeaderHeight(0),
-    mSubjectLabel(NULL),
     mIconVisible(false),
     mSubjectEdit(NULL),
     mRecipientFieldsEmpty(true),
-    mGroupBoxRecipient(NULL),
-    mAttachmentList(NULL)
+    mAttachmentList(NULL),
+    mToField(NULL),
+    mCcField(NULL),
+    mBccField(NULL),
+    mCcBccFieldVisible(false)
 {
+    NM_FUNCTION;
+    
     loadWidgets();
-    rescaleHeader();
     createConnections();
 }
 
@@ -61,10 +61,7 @@
 */
 NmEditorHeader::~NmEditorHeader()
 {
-    if (mAttachmentList) {
-        mAttachmentList->clearList();
-        delete mAttachmentList;
-    }
+    NM_FUNCTION;
 }
 
 /*!
@@ -72,38 +69,58 @@
 */
 void NmEditorHeader::loadWidgets()
 {
-    // To: field objects
-    HbLabel *toLabel = qobject_cast<HbLabel *>
-        (mDocumentLoader->findWidget(NMUI_EDITOR_TO_LABEL));
-    NmRecipientLineEdit *toEdit = qobject_cast<NmRecipientLineEdit *>
-        (mDocumentLoader->findWidget(NMUI_EDITOR_TO_EDIT));
-    HbPushButton *toButton = qobject_cast<HbPushButton *>
-        (mDocumentLoader->findWidget(NMUI_EDITOR_TO_BUTTON));
-    mToField = new NmRecipientField(toLabel, toEdit, toButton);
+    NM_FUNCTION;
+	
+    // Load widgets from docml and construct handlers. Those widgets that are not shown by default
+    // are hidden and removed from the layout at this phase.    
+    HbWidget *contentWidget =
+        qobject_cast<HbWidget *>(mDocumentLoader->findWidget(NMUI_EDITOR_CONTAINER));
+    mLayout = static_cast<QGraphicsLinearLayout *>(contentWidget->layout());
+
+    // base class QObject takes the deleting responsibility
+    mToField = new NmRecipientField(this, *mDocumentLoader, NMUI_EDITOR_PREFIX_TO);
+    mCcField = new NmRecipientField(this, *mDocumentLoader, NMUI_EDITOR_PREFIX_CC);
+    mBccField = new NmRecipientField(this, *mDocumentLoader, NMUI_EDITOR_PREFIX_BCC);
 
-    // Create recipient group box which includes cc and bcc fields
-    mGroupBoxRecipient = qobject_cast<HbGroupBox *>
-        (mDocumentLoader->findWidget(NMUI_EDITOR_RECIPIENT_GB));
-    // Ownership is transfered
-    mGroupBoxRecipient->setContentWidget(createRecipientGroupBoxContentWidget());
-    mGroupBoxRecipient->setHeading(hbTrId("txt_mail_subhead_ccbcc"));
-    mGroupBoxRecipient->setCollapsable(true);
-    mGroupBoxRecipient->setCollapsed(true);
+    // Cc field is not shown by default. It needs to be both hidden and removed from the layout.
+	mCcWidget = qobject_cast<HbWidget *>(mDocumentLoader->findWidget(NMUI_EDITOR_CC_FIELD));
+    mCcWidget->hide();
+    mLayout->removeItem(mCcWidget);
+    
+    // Bcc field is not shown by default. It needs to be both hidden and removed from the layout.
+    mBccWidget = qobject_cast<HbWidget *>(mDocumentLoader->findWidget(NMUI_EDITOR_BCC_FIELD));
+    mBccWidget->hide();
+    mLayout->removeItem(mBccWidget);
 
+    mSubjectWidget =
+        qobject_cast<HbWidget *>(mDocumentLoader->findWidget(NMUI_EDITOR_SUBJECT_FIELD));
+    mSubjectLayout = static_cast<QGraphicsLinearLayout *>(mSubjectWidget->layout());
+    
     // Add Subject: field
-    mSubjectLabel = qobject_cast<HbLabel *>
-        (mDocumentLoader->findWidget(NMUI_EDITOR_SUBJECT_LABEL));
     mSubjectEdit = qobject_cast<NmHtmlLineEdit *>
         (mDocumentLoader->findWidget(NMUI_EDITOR_SUBJECT_EDIT));
+    mSubjectEdit->setMaxRows(MaxRows);
 
     // Add attachment list
     NmAttachmentListWidget *attachmentList = qobject_cast<NmAttachmentListWidget *>
         (mDocumentLoader->findWidget(NMUI_EDITOR_ATTACHMENT_LIST));
     // Create attachment list handling object
     mAttachmentList = new NmAttachmentList(*attachmentList);
+    mAttachmentList->setParent(this); // ownership changes
+    attachmentList->hide();
+    mLayout->removeItem(attachmentList);
 
-    mPriorityIconLabel = qobject_cast<HbLabel *>
+    // Add priority icon
+    mPriorityIcon = qobject_cast<HbLabel *>
         (mDocumentLoader->findWidget(NMUI_EDITOR_PRIORITY_ICON));
+    mPriorityIcon->hide();
+    mSubjectLayout->removeItem(mPriorityIcon);
+
+    // follow-up icon is not yet supported
+    HbLabel *followUpIcon = qobject_cast<HbLabel *>
+        (mDocumentLoader->findWidget(NMUI_EDITOR_FOLLOWUP_ICON));
+    followUpIcon->hide();
+    mSubjectLayout->removeItem(followUpIcon);
 }
 
 /*!
@@ -111,6 +128,8 @@
 */
 void NmEditorHeader::createConnections()
 {
+    NM_FUNCTION;
+    
     // Signals for checking if the recipient fields have text.
     connect(mToField, SIGNAL(textChanged(const QString &)),
             this, SLOT(editorContentChanged()));
@@ -121,16 +140,12 @@
 
     // Signals for handling the recipient field expanding
     connect(mToField, SIGNAL(textChanged(const QString &)),
-            this, SLOT(sendHeaderHeightChanged()));
+            this, SLOT(sendDelayedHeaderHeightChanged()));
     connect(mCcField, SIGNAL(textChanged(const QString &)),
-            this, SLOT(sendHeaderHeightChanged()));
+            this, SLOT(sendDelayedHeaderHeightChanged()));
     connect(mBccField, SIGNAL(textChanged(const QString &)),
-            this, SLOT(sendHeaderHeightChanged()));
-    connect(mSubjectEdit, SIGNAL(contentsChanged()), this, SLOT(sendHeaderHeightChanged()));
-
-    // Signal for handling the recipient group box expanding/collapsing
-    connect(mGroupBoxRecipient, SIGNAL(toggled(bool)),
-            this, SLOT(groupBoxExpandCollapse()));
+            this, SLOT(sendDelayedHeaderHeightChanged()));
+    connect(mSubjectEdit, SIGNAL(contentsChanged()), this, SLOT(sendDelayedHeaderHeightChanged()));
 
     // Signals for handling the attachment list
     connect(&mAttachmentList->listWidget(), SIGNAL(itemActivated(int)),
@@ -142,40 +157,73 @@
 }
 
 /*!
-    Function can be used to rescale the header area.
+   Show or hide recipient field
 */
-void NmEditorHeader::rescaleHeader()
+void NmEditorHeader::setFieldVisibility(bool isVisible)
 {
+	if ( mCcBccFieldVisible != isVisible ) {
+		mCcBccFieldVisible = isVisible;
+		if (mCcBccFieldVisible) {
+            mLayout->insertItem(1, mBccWidget);
+			mLayout->insertItem(1, mCcWidget);
+			mCcWidget->show();
+            mBccWidget->show();
+		}
+		else {
+            mCcWidget->hide();
+            mBccWidget->hide();
+			mLayout->removeItem(mCcWidget);
+			mLayout->removeItem(mBccWidget);
+		}
+
+		QTimer::singleShot(
+		    nmLayoutSystemWaitTimer * 2, this, SLOT(sendDelayedHeaderHeightChanged()));
+	}
 }
 
 /*!
     Return the height of the whole header widget.
-    (Should find beter way to get the height of the header area.)
  */
-int NmEditorHeader::headerHeight() const
+qreal NmEditorHeader::headerHeight() const
 {
-    qreal toHeight = mToField->height();
-    qreal subjectHeight = mSubjectEdit->geometry().height() + Margin;
+    NM_FUNCTION;
+
+    // get the layout's vertical spacing
+    qreal spacing = 0;
+    HbStyle().parameter("hb-param-margin-gene-middle-vertical", spacing);
 
-    // When called first time, height is wrongly 'Margin'
-    if (toHeight == Margin) {
-        toHeight = FieldHeightWhenSecondaryFont;
-        subjectHeight = FieldHeightWhenSecondaryFont;
+    // calculate the height
+    qreal height = 0;
+    
+    height += mToField->height(); // returns widget's geometry height
+    height += spacing;
+    
+    if (mCcBccFieldVisible) {
+        height += mCcField->height(); // returns widget's geometry height
+        height += spacing;
+        
+        height += mBccField->height(); // returns widget's geometry height
+        height += spacing;
     }
 
-    // Recipient GroupBox
-    qreal recipientGroupBoxHeight = GroupBoxTitleHeight;
-    if (!mGroupBoxRecipient->isCollapsed()) {
-        recipientGroupBoxHeight +=
-            mGroupBoxRecipientContent->geometry().height() + HeaderAreaMarginsTotal;
+    height += mSubjectWidget->geometry().height();
+    height += spacing;
+
+    if (mAttachmentList->listWidget().isVisible()) {
+        height += mAttachmentList->listWidget().geometry().height();
+        height += spacing;
     }
 
-    qreal attHeight = 0;
-    if (mAttachmentList && mAttachmentList->count() > 0) {
-        attHeight = mAttachmentList->listWidget().geometry().height();
-    }
+    return height;
+}
 
-    return (int)(toHeight + recipientGroupBoxHeight + subjectHeight + attHeight);
+/*!
+    Send signal to inform that one of the recipient fields height has been changed.
+ */
+void NmEditorHeader::sendDelayedHeaderHeightChanged()
+{
+    NM_FUNCTION;
+	QTimer::singleShot(nmLayoutSystemWaitTimer * 5, this, SLOT(sendHeaderHeightChanged()));
 }
 
 /*!
@@ -183,17 +231,7 @@
  */
 void NmEditorHeader::sendHeaderHeightChanged()
 {
-    // Adjust field heights
-    mToField->editor()->setPreferredHeight(
-        mToField->editor()->document()->size().height() + Margin);
-    mCcField->editor()->setPreferredHeight(
-        mCcField->editor()->document()->size().height() + Margin);
-    mBccField->editor()->setPreferredHeight(
-        mBccField->editor()->document()->size().height() + Margin);
-    mSubjectEdit->setPreferredHeight(
-        mSubjectEdit->document()->size().height() + Margin);
-
-    int hHeight = headerHeight();
+    qreal hHeight = headerHeight();
     if (mHeaderHeight != hHeight) {
         mHeaderHeight = hHeight;
         emit headerHeightChanged(mHeaderHeight);
@@ -201,43 +239,42 @@
 }
 
 /*!
-    This slot is called when group box state is changed. Timer is used to give some time
-    for layout system so that header hight can be recalculated correctly
+    Return pointer to to edit
  */
-void NmEditorHeader::groupBoxExpandCollapse()
+NmRecipientLineEdit* NmEditorHeader::toEdit() const
 {
-    QTimer::singleShot(nmLayoutSystemWaitTimer, this, SLOT(sendHeaderHeightChanged()));
-}
-
-/*!
-    Return pointer to to field
- */
-NmRecipientLineEdit* NmEditorHeader::toField() const
-{
+    NM_FUNCTION;
+    
     return mToField->editor();
 }
 
 /*!
-    Return pointer to cc field
+    Return pointer to cc edit
  */
-NmRecipientLineEdit* NmEditorHeader::ccField() const
+NmRecipientLineEdit* NmEditorHeader::ccEdit() const
 {
+    NM_FUNCTION;
+    
     return mCcField->editor();
 }
 
 /*!
-    Return pointer to bcc field
+    Return pointer to bcc edit
  */
-NmRecipientLineEdit* NmEditorHeader::bccField() const
+NmRecipientLineEdit* NmEditorHeader::bccEdit() const
 {
+    NM_FUNCTION;
+    
     return mBccField->editor();
 }
 
 /*!
     Return pointer to subject field
  */
-NmHtmlLineEdit* NmEditorHeader::subjectField() const
+NmHtmlLineEdit* NmEditorHeader::subjectEdit() const
 {
+    NM_FUNCTION;
+    
     return mSubjectEdit;
 }
 
@@ -247,6 +284,8 @@
 */
 void NmEditorHeader::editorContentChanged()
 {
+    NM_FUNCTION;
+    
     bool recipientsFieldsEmpty = true;
     if (mToField->text().length()) {
         recipientsFieldsEmpty = false;
@@ -264,43 +303,12 @@
 }
 
 /*!
-    This function create content widget for recipient group box.
-    When AD offers groupBox content widget handling. This function
-    need to be changed to use AD/docml
- */
-HbWidget* NmEditorHeader::createRecipientGroupBoxContentWidget()
-{
-    mGroupBoxRecipientContent = new HbWidget();
-
-    // Create layout for the widget
-    mGbVerticalLayout = new QGraphicsLinearLayout(Qt::Vertical,mGroupBoxRecipientContent);
-    mCcFieldLayout = new QGraphicsLinearLayout(Qt::Horizontal, mGbVerticalLayout);
-    mBccFieldLayout = new QGraphicsLinearLayout(Qt::Horizontal, mGbVerticalLayout);
-
-    // Add Cc: field into widget
-    mCcField = new NmRecipientField(hbTrId("txt_mail_editor_cc"));
-    if (mCcField) {
-        mCcField->setObjectName("lineEditCcField");
-        mGbVerticalLayout->insertItem(EEditorCcLine, mCcField );
-    }
-
-    // Add Bcc: field into widget
-    mBccField = new NmRecipientField(hbTrId("txt_mail_editor_bcc"));
-    if (mBccField){
-        mBccField->setObjectName("lineEditBccField");
-        mGbVerticalLayout->insertItem(EEditorBccLine, mBccField);
-    }
-    mGbVerticalLayout->setContentsMargins(0,0,0,0);
-
-    mGroupBoxRecipientContent->setLayout(mGbVerticalLayout);
-    return mGroupBoxRecipientContent;
-}
-
-/*!
     Sets the icon for priority
  */
 void NmEditorHeader::setPriority(NmMessagePriority priority)
 {
+    NM_FUNCTION;
+    
     switch (priority) {
     case NmMessagePriorityHigh:
         setPriority(NmActionResponseCommandPriorityHigh);
@@ -319,48 +327,41 @@
  */
 void NmEditorHeader::setPriority(NmActionResponseCommand prio)
 {
+    NM_FUNCTION;
+    
     switch(prio) {
     case NmActionResponseCommandPriorityHigh:
         if (!mIconVisible) {
             mIconVisible = true;
-            mPriorityIconLabel->setMaximumWidth(IconFieldWidth);
-            mSubjectEdit->setMaximumWidth(mSubjectEdit->geometry().width() - IconFieldWidth);
+            // icon widget is just after the subject line edit (see docml)
+            mSubjectLayout->insertItem(2, mPriorityIcon);
+            mPriorityIcon->show();
         }
-        mPriorityIconLabel->setIcon(
+        mPriorityIcon->setIcon(
             NmIcons::getIcon(NmIcons::NmIconPriorityHigh));
         break;
     case NmActionResponseCommandPriorityLow:
         if (!mIconVisible) {
             mIconVisible = true;
-            mPriorityIconLabel->setMaximumWidth(IconFieldWidth);
-            mSubjectEdit->setMaximumWidth(mSubjectEdit->geometry().width() - IconFieldWidth);
+            // icon widget is just after the subject line edit (see docml)
+            mSubjectLayout->insertItem(2, mPriorityIcon);
+            mPriorityIcon->show();
         }
-        mPriorityIconLabel->setIcon(
+        mPriorityIcon->setIcon(
             NmIcons::getIcon(NmIcons::NmIconPriorityLow));
         break;
     default:
         if (mIconVisible) {
             mIconVisible = false;
             HbIcon emptyIcon;
-            mPriorityIconLabel->setIcon(emptyIcon);
-            mPriorityIconLabel->setMaximumWidth(0);
-            mSubjectEdit->setMaximumWidth(mSubjectEdit->geometry().width() + IconFieldWidth);
+            mPriorityIcon->setIcon(emptyIcon);
+            mSubjectLayout->removeItem(mPriorityIcon);
+            mPriorityIcon->hide();
         }
         break;
     }
     // Update subject field height because row amount might have been changed.
-    // Done with delayed timer so that layout system has finished before.
-    QTimer::singleShot(nmLayoutSystemWaitTimer, this, SLOT(sendHeaderHeightChanged()));
-    // This second call will set new position for body if subject field height has been changed.
-    QTimer::singleShot(nmLayoutSystemWaitTimer * 2, this, SLOT(sendHeaderHeightChanged()));
-}
-
-/*!
- * \brief Sets the groupbox to be expanded or collapsed. 
- */
-void NmEditorHeader::setGroupBoxCollapsed( bool collapsed )
-{
-    mGroupBoxRecipient->setCollapsed( collapsed );
+    QTimer::singleShot(nmLayoutSystemWaitTimer * 3, this, SLOT(sendDelayedHeaderHeightChanged()));
 }
 
 /*!
@@ -369,7 +370,14 @@
 void NmEditorHeader::addAttachment(
     const QString &fileName, const QString &fileSize, const NmId &nmid)
 {
+    NM_FUNCTION;
+    
     mAttachmentList->insertAttachment(fileName, fileSize, nmid);
+    if (!mAttachmentList->listWidget().isVisible()) {
+        // attachment list is inserted just before the body widget (see docml).
+        mLayout->insertItem(mLayout->count() - 1, &mAttachmentList->listWidget());
+        mAttachmentList->listWidget().show();
+    }
     sendHeaderHeightChanged();
 }
 
@@ -379,7 +387,13 @@
  */
 void NmEditorHeader::removeAttachment(const QString &fileName)
 {
+    NM_FUNCTION;
+    
     mAttachmentList->removeAttachment(fileName);
+    if (mAttachmentList->count() == 0) {
+        mAttachmentList->listWidget().hide();
+        mLayout->removeItem(&mAttachmentList->listWidget());
+    }
     sendHeaderHeightChanged();
 }
 
@@ -389,6 +403,8 @@
  */
 void NmEditorHeader::removeAttachment(const NmId &nmid)
 {
+    NM_FUNCTION;
+    
     mAttachmentList->removeAttachment(nmid);
     sendHeaderHeightChanged();
 }
@@ -402,6 +418,8 @@
     const QString &fileSize,
     int result)
 {
+    NM_FUNCTION;
+    
     if (result == NmNoError) {
         // Attachment adding succesful, set message part id and size for attachment
         mAttachmentList->setAttachmentPartId(fileName, msgPartId);
@@ -414,6 +432,8 @@
  */
 void NmEditorHeader::launchAttachment(const NmId &itemId)
 {
+    NM_FUNCTION;
+    
     attachmentActivated(mAttachmentList->indexByNmId(itemId));
 }
 
@@ -422,6 +442,8 @@
  */
 void NmEditorHeader::attachmentActivated(int arrayIndex)
 {
+    NM_FUNCTION;
+    
     QFile launchFile(mAttachmentList->getFullFileNameByIndex(arrayIndex));
     if (NmUtilities::openFile( launchFile ) == NmNotFoundError) {
         NmUtilities::displayErrorNote(hbTrId("txt_mail_dialog_unable_to_open_attachment_file_ty")); 
@@ -433,6 +455,8 @@
  */
 void NmEditorHeader::attachmentLongPressed(int arrayIndex, QPointF point)
 {
+    NM_FUNCTION;
+    
     // Remove selected attachment
     emit attachmentLongPressed(mAttachmentList->nmIdByIndex(arrayIndex), point);
 }
--- a/emailuis/nmailui/src/nmeditortextdocument.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmeditortextdocument.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -31,6 +31,8 @@
 NmEditorTextDocument::NmEditorTextDocument(QNetworkAccessManager &manager) :
     mManager(manager)
 {
+    NM_FUNCTION;
+    
     connect(&mManager, SIGNAL(finished(QNetworkReply*)),
         this, SLOT(replyFinished(QNetworkReply*)));
 }
@@ -40,6 +42,8 @@
 */
 NmEditorTextDocument::~NmEditorTextDocument()
 {
+    NM_FUNCTION;
+    
     foreach(QNetworkReply *reply, mReplyList) {
         if(reply) {
             reply->abort();
@@ -53,6 +57,8 @@
 */
 void NmEditorTextDocument::replyFinished(QNetworkReply *reply)
 {
+    NM_FUNCTION;
+    
     if(reply) {
         if(reply->error() == QNetworkReply::NoError) {
             QPixmap image;
@@ -71,6 +77,8 @@
 */
 QVariant NmEditorTextDocument::loadResource(int type, const QUrl &name)
 {
+    NM_FUNCTION;
+    
     QVariant retVal;
     
     if(type == QTextDocument::ImageResource) {    
--- a/emailuis/nmailui/src/nmeditorview.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmeditorview.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -38,10 +38,12 @@
     NmApplication &application,
     NmUiStartParam* startParam,
     NmUiEngine &uiEngine,
+    NmAttachmentManager &attaManager,
     QGraphicsItem *parent)
-    : NmBaseView(startParam, parent),
+    : NmBaseView(startParam, application, parent),
       mApplication(application),
       mUiEngine(uiEngine),
+      mAttaManager(attaManager),
       mDocumentLoader(NULL),
       mScrollArea(NULL),
       mEditWidget(NULL),
@@ -52,10 +54,14 @@
       mMessageCreationOperation(NULL),
       mAddAttachmentOperation(NULL),
       mRemoveAttachmentOperation(NULL),
-      mCheckOutboxOperation(NULL),
       mWaitDialog(NULL),
-      mAttachmentPicker(NULL)
+      mQueryDialog(NULL),
+      mAttachmentPicker(NULL),
+      mCcBccFieldVisible(false),
+      mServiceSendingDialog(NULL)
 {
+    NM_FUNCTION;
+    
     mDocumentLoader	= new HbDocumentLoader();
     // Set object name
     setObjectName("NmEditorView");
@@ -70,6 +76,8 @@
 */
 NmEditorView::~NmEditorView()
 {
+    NM_FUNCTION;
+    
     if (mRemoveAttachmentOperation && mRemoveAttachmentOperation->isRunning()) {
         mRemoveAttachmentOperation->cancelOperation();
     }
@@ -79,9 +87,6 @@
     if (mMessageCreationOperation && mMessageCreationOperation->isRunning()) {
         mMessageCreationOperation->cancelOperation();
     }
-    if (mCheckOutboxOperation && mCheckOutboxOperation->isRunning()) {
-        mCheckOutboxOperation->cancelOperation();
-    }
     delete mMessage;
     mWidgetList.clear();
     delete mDocumentLoader;
@@ -93,7 +98,10 @@
         delete mAttachmentListContextMenu;
     }
     delete mWaitDialog;
+    delete mQueryDialog;
     delete mAttachmentPicker;    
+    mAttaManager.clearObserver();
+    mAttaManager.cancelFetch();
 }
 
 /*!
@@ -101,6 +109,8 @@
 */
 void NmEditorView::loadViewLayout()
 {
+    NM_FUNCTION;
+    
     mPrioritySubMenu = NULL;
 
     // Use document loader to load the view
@@ -141,6 +151,8 @@
 */
 void NmEditorView::reloadViewContents(NmUiStartParam* startParam)
 {
+    NM_FUNCTION;
+    
     // Check start parameter validity.
     if (startParam&&startParam->viewId()==NmUiViewMessageEditor) {
         // Delete existing start parameter data
@@ -152,10 +164,10 @@
         // editor with new start parameters.
         // ..
         // Reload editor with new message data
-        setMessageData();
+        fetchMessageIfNeeded();
     }
     else {
-        NMLOG("nmailui: Invalid editor start parameter");
+        NM_ERROR(1,"nmailui: Invalid editor start parameter");
         // Unused start parameter needs to be deleted
         delete startParam;
         startParam = NULL;
@@ -169,6 +181,8 @@
 */
 void NmEditorView::orientationChanged(Qt::Orientation orientation)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(orientation);
     // Adjust content height
     QTimer::singleShot(NmOrientationTimer, this, SLOT(adjustViewDimensions()));
@@ -180,6 +194,8 @@
 */
 void NmEditorView::adjustViewDimensions()
 {
+    NM_FUNCTION;
+    
     if (mScrollAreaContents) {
         const QSize reso = mApplication.screenSize();
         mScrollAreaContents->setMinimumWidth(reso.width());
@@ -192,6 +208,8 @@
 */
 NmUiViewId NmEditorView::nmailViewId() const
 {
+    NM_FUNCTION;
+    
     return NmUiViewMessageEditor;
 }
 
@@ -200,55 +218,87 @@
 */
 HbWidget* NmEditorView::scrollAreaContents()
 {
+    NM_FUNCTION;
+    
     return mScrollAreaContents;
 }
 
 /*
-   Query user if we want to exit the editor
+   Launch dialog for query user if we want to exit the editor
 */
-bool NmEditorView::okToExitView()
+void NmEditorView::okToExitView()
 {
+    NM_FUNCTION;
+    
+    NmEditorHeader *header = mContentWidget->header();
+    
     bool okToExit = true;
-
-    NmEditorHeader *header = mContentWidget->header();
     
     // show the query if the message has not been sent
     if (mMessage && header) {
         // see if editor has any content
-        int toTextLength = 0;
-        if (header->toField()) {
-            toTextLength = header->toField()->text().length();
-        }
-        
-        int ccTextLength = 0;
-        if (header->ccField()) {
-            ccTextLength = header->ccField()->text().length();
-        }
-
-        int bccTextLength = 0;
-        if (header->bccField()) {
-            bccTextLength = header->bccField()->text().length();
-        }
-        
         int subjectLength = 0;
-        if (header->subjectField()) {
-            subjectLength = header->subjectField()->text().length();
+        if (header->subjectEdit()) {
+            subjectLength = header->subjectEdit()->text().length();
         }
         
         QList<NmMessagePart*> attachmentList;
         mMessage->attachmentList(attachmentList);
                     
-        okToExit = (toTextLength == 0 && ccTextLength == 0 && bccTextLength == 0 && 
-            subjectLength == 0 && mContentWidget->editor()->document()->isEmpty() &&
-            attachmentList.count() < 1);
+        okToExit = (subjectLength == 0 && mContentWidget->editor()->document()->isEmpty());
 
         // content exists, verify exit from user
         if (!okToExit) {
-            okToExit = NmUtilities::displayQuestionNote(hbTrId("txt_mail_dialog_delete_message"));
+            if (mQueryDialog) {
+                delete mQueryDialog;
+                mQueryDialog = 0;
+            }
+            // Launch query dialog.
+            mQueryDialog = 
+                NmUtilities::displayQuestionNote(hbTrId("txt_mail_dialog_save_message_to_drafts"),
+                                                            this,
+                                                            SLOT(okToExitQuery(HbAction*)));
         }
     }
+    
+    // no need to query anything, just exit.
+    if(okToExit) {
+        QMetaObject::invokeMethod(&mApplication,
+                                  "popView",
+                                  Qt::QueuedConnection);
+    }
+}
 
-    return okToExit;
+/*!
+    Handle the user selection is it ok to exit.
+*/
+void NmEditorView::okToExitQuery(HbAction* action)
+{
+    NM_FUNCTION;
+    
+    HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
+    // The first action in dialogs action list is for the "Yes"-button.
+    if (action == dlg->actions().at(0)) {
+        
+        // Save message to drafts
+        QList<NmOperation *> preliminaryOperations;
+        if (mAddAttachmentOperation && mAddAttachmentOperation->isRunning()) {
+            preliminaryOperations.append(mAddAttachmentOperation);
+        }
+        if (mRemoveAttachmentOperation && mRemoveAttachmentOperation->isRunning()) {
+            preliminaryOperations.append(mRemoveAttachmentOperation);
+        }
+        // ownership of mMessage is transferred
+        // NmOperations are automatically deleted after completion
+        mUiEngine.saveDraftMessage(mMessage, preliminaryOperations);
+        mMessage = NULL;
+        preliminaryOperations.clear();
+    }    
+    
+    // Close the view
+    QMetaObject::invokeMethod(&mApplication,
+                              "popView",
+                              Qt::QueuedConnection);
 }
 
 /*!
@@ -258,39 +308,8 @@
 */
 void NmEditorView::aboutToExitView()
 {
-    if (mStartParam && mStartParam->service() && mUiEngine.isSendingMessage()) {
-        // The application was started as a service and is about to close.
-        // A message is still being sent and in order to make sure that the
-        // send operation is not cancelled, let us display a modal wait dialog.
-
-        // When the send operation is completed, the dialog is automatically
-        // closed.
-        connect(&mUiEngine, SIGNAL(sendOperationCompleted()),
-                this, SLOT(handleSendOperationCompleted()));
-
-        // Close and delete the previous wait dialog if one exists.
-        if (mWaitDialog) {
-            mWaitDialog->close();
-            delete mWaitDialog;
-        }
-
-        // Construct and setup the wait dialog.
-        mWaitDialog = new HbProgressDialog();
-        mWaitDialog->setText(hbTrId("txt_mail_shareui_sending_please_wait"));
-
-        if (!XQServiceUtil::isEmbedded()) {
-            // Hide the application.
-            XQServiceUtil::toBackground(true);
-        }
-
-        // Display the wait dialog.
-        mWaitDialog->setModal(false);
-        mWaitDialog->setBackgroundFaded(false);
-        mWaitDialog->show();
-        delete mWaitDialog;
-        mWaitDialog = NULL;
-    }
-
+    NM_FUNCTION;
+    
     // These operations need to be stopped before message can be deleted
     if (mAddAttachmentOperation && mAddAttachmentOperation->isRunning()) {
         mAddAttachmentOperation->cancelOperation();
@@ -301,10 +320,8 @@
 
     if (mMessage) { // this is NULL if sending is started
         // Delete message from drafts
-        NmId mailboxId = mMessage->envelope().mailboxId();
-        NmId folderId = mMessage->envelope().folderId();
-        NmId msgId = mMessage->envelope().messageId();
-        mUiEngine.removeMessage(mailboxId, folderId, msgId);
+        mUiEngine.removeDraftMessage(mMessage);
+        mMessage = NULL;
     }
 }
 
@@ -313,17 +330,8 @@
 */
 void NmEditorView::viewReady()
 {
-    // Connect signals from background scroll area
-    connect(mScrollArea, SIGNAL(handleMousePressEvent(QGraphicsSceneMouseEvent*)),
-            this, SLOT(sendMousePressEventToScroll(QGraphicsSceneMouseEvent*)));
-    connect(mScrollArea, SIGNAL(handleMouseReleaseEvent(QGraphicsSceneMouseEvent*)),
-            this, SLOT(sendMouseReleaseEventToScroll(QGraphicsSceneMouseEvent*)));
-    connect(mScrollArea, SIGNAL(handleMouseMoveEvent(QGraphicsSceneMouseEvent*)),
-            this, SLOT(sendMouseMoveEventToScroll(QGraphicsSceneMouseEvent*)));
-
-    connect(mScrollArea, SIGNAL(handleLongPressGesture(const QPointF &)),
-                this, SLOT(sendLongPressGesture(const QPointF &)));
-
+    NM_FUNCTION;
+    
     // Connect options menu about to show to create options menu function
     // Menu needs to be create "just-in-time"
     connect(menu(), SIGNAL(aboutToShow()), this, SLOT(createOptionsMenu()));
@@ -348,38 +356,96 @@
             this, SLOT(attachmentLongPressed(NmId, QPointF)));
     
     // Set message data
-    setMessageData();
+    fetchMessageIfNeeded();
 }
 
 /*!
-    Find message data based on start parameters.  Method is called
-    when editor is started. If message data is found it means that
-    operation is forward or reply message.
+    If entering editor for forwarding or replying, use attachment manager
+    to check that we have all message parts fetched. Also show dialog for
+    fetching progress.
 */
-void NmEditorView::setMessageData()
+void NmEditorView::fetchMessageIfNeeded()
 {
-    // Check the outbox.
-    if (mCheckOutboxOperation && mCheckOutboxOperation->isRunning()) {
-        mCheckOutboxOperation->cancelOperation();
-        NMLOG("NmEditorView::setMessageData old mCheckOutboxOperation running");
-    }
-	
-    mCheckOutboxOperation = mUiEngine.checkOutbox(mStartParam->mailboxId());
+    NM_FUNCTION;
     
-    if (mCheckOutboxOperation) {
-        connect(mCheckOutboxOperation, SIGNAL(operationCompleted(int)),
-                this, SLOT(outboxChecked(int)));
+    if (mStartParam->editorStartMode() == NmUiEditorForward ||
+        mStartParam->editorStartMode() == NmUiEditorReply ||
+        mStartParam->editorStartMode() == NmUiEditorReplyAll) {
+        
+        fetchProgressDialogShow();
+        mAttaManager.clearObserver();
+        mAttaManager.setObserver(this);
+        mAttaManager.fetchAllMessageParts(
+            mStartParam->mailboxId(),
+            mStartParam->folderId(),
+            mStartParam->messageId());
     }
     else {
-        startMessageCreation( mStartParam->editorStartMode() );
+        startMessageCreation(mStartParam->editorStartMode());
     }
 }
 
 /*!
+    Slot. Called when attachments fetch progress changes.
 */
+void NmEditorView::progressChanged(int value)
+{
+    NM_FUNCTION;
+    
+    Q_UNUSED(value);
+}
+
+/*!
+    Slot. Called when attachments fetch is completed. We can start
+    message creation. 
+*/
+void NmEditorView::fetchCompleted(int result)
+{
+    NM_FUNCTION;
+    
+    if (result == NmNoError) {
+        startMessageCreation(mStartParam->editorStartMode());
+    }
+    else {
+        mWaitDialog->close();
+        QMetaObject::invokeMethod(&mApplication, "popView", Qt::QueuedConnection);
+    }
+}
+
+void NmEditorView::fetchProgressDialogShow()
+{
+    NM_FUNCTION;
+    
+    delete mWaitDialog;
+    mWaitDialog = NULL;
+    // Create new wait dialog and set it to me modal with dimmed background
+    mWaitDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
+    mWaitDialog->setModal(true);
+    mWaitDialog->setBackgroundFaded(true);
+    connect(mWaitDialog, SIGNAL(cancelled()), this, SLOT(fetchProgressDialogCancelled()));
+    mWaitDialog->setText(hbTrId("txt_mail_dialog_loading_mail_content"));
+    // Display wait dialog
+    mWaitDialog->show();
+}
+
+/*!
+    This is called by mFetchProgressDialog when the note is cancelled
+ */
+void NmEditorView::fetchProgressDialogCancelled()
+{
+    NM_FUNCTION;
+    
+    if (mAttaManager.isFetching()) {
+        mAttaManager.cancelFetch();
+        mAttaManager.clearObserver();
+    }
+    QMetaObject::invokeMethod(&mApplication, "popView", Qt::QueuedConnection);
+}
+
 void NmEditorView::startMessageCreation(NmUiEditorStartMode startMode)
 {
-    NMLOG("NmEditorView::startMessageCreation ");
+    NM_FUNCTION;
+    
     NmId mailboxId = mStartParam->mailboxId();
     NmId folderId = mStartParam->folderId();
     NmId msgId = mStartParam->messageId();
@@ -415,6 +481,8 @@
 */
 void NmEditorView::startSending()
 {
+    NM_FUNCTION;
+    
     // The message contents should be verified
     updateMessageWithEditorContents();
     
@@ -424,26 +492,95 @@
         NmUtilities::getRecipientsFromMessage(*mMessage, invalidAddresses, NmUtilities::InvalidAddress);
     }
     
-    bool okToSend = true;
     if (invalidAddresses.count() > 0) {
         
         // invalid addresses found, verify send from user
         QString noteText = hbTrId("txt_mail_dialog_invalid_mail_address_send");
         // set the first failing address to the note
         noteText = noteText.arg(invalidAddresses.at(0).address());
-        okToSend = NmUtilities::displayQuestionNote(noteText);
+        
+        if (mQueryDialog) {
+            delete mQueryDialog;
+            mQueryDialog = 0;
+        }
+        // Launch query dialog. Pressing "yes" will finalize the sending.
+        mQueryDialog = NmUtilities::displayQuestionNote(noteText,
+                                                        this,
+                                                        SLOT(invalidAddressQuery(HbAction*)));
     }
+    else {
+        // no need to ask anything, just send
+        finalizeSending();
+    }
+}
+
+/*!
+    Send the message after all checks have been done.
+*/
+void NmEditorView::finalizeSending()
+{
+    NM_FUNCTION;
     
-    if (okToSend) {
-        QList<NmOperation *> preliminaryOperations;
+    QList<NmOperation *> preliminaryOperations;
+    if (mAddAttachmentOperation && mAddAttachmentOperation->isRunning()) {
         preliminaryOperations.append(mAddAttachmentOperation);
+    }
+    if (mRemoveAttachmentOperation && mRemoveAttachmentOperation->isRunning()) {
         preliminaryOperations.append(mRemoveAttachmentOperation);
-        // ownership of mMessage is transferred
-        // NmOperations are automatically deleted after completion
-        mUiEngine.sendMessage(mMessage, preliminaryOperations);
-        mMessage = NULL;
-        preliminaryOperations.clear();
-        mApplication.popView();
+    }
+    // ownership of mMessage is transferred
+    // NmOperations are automatically deleted after completion
+    mUiEngine.sendMessage(mMessage, preliminaryOperations);
+    mMessage = NULL;
+    preliminaryOperations.clear();
+
+#ifndef NM_WINS_ENV
+    bool service = XQServiceUtil::isService();
+#else
+    bool service = false;
+#endif
+
+    // If sending is started as a service, progress dialog needs to be shown
+    // so long that sending is finished otherwise we can close pop current view.
+    if (service && mUiEngine.isSendingMessage()) {
+        connect(&mUiEngine, SIGNAL(sendOperationCompleted()),
+            this, SLOT(handleSendOperationCompleted()), Qt::UniqueConnection);
+
+        // Construct and setup the wait dialog.
+        mServiceSendingDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
+        mServiceSendingDialog->setAttribute(Qt::WA_DeleteOnClose);
+        mServiceSendingDialog->setText(hbTrId("txt_mail_shareui_sending_please_wait"));
+        connect(mServiceSendingDialog, SIGNAL(cancelled()),
+            this, SLOT(sendProgressDialogCancelled()));
+
+#ifndef NM_WINS_ENV
+        if (!XQServiceUtil::isEmbedded()) {
+            // Hide the application.
+            XQServiceUtil::toBackground(true);
+        }
+#endif
+         // Display the wait dialog.
+         mServiceSendingDialog->setModal(true);
+         mServiceSendingDialog->setBackgroundFaded(true);
+         mServiceSendingDialog->show();
+    } else {
+        // Must use delayed editor view destruction so that query dialog
+        // (which has signaled this) gets time to complete.
+        QMetaObject::invokeMethod(&mApplication, "popView", Qt::QueuedConnection);
+    }
+}
+
+/*!
+    Handle the user selection for invalid address query which was started by startSending.
+*/
+void NmEditorView::invalidAddressQuery(HbAction* action)
+{
+    NM_FUNCTION;
+
+    HbMessageBox *dlg = static_cast<HbMessageBox*>(sender());
+    // The first action in dialogs action list is for the "Yes"-button.
+    if (action == dlg->actions().at(0)) {
+        finalizeSending();
     }
 }
 
@@ -452,9 +589,16 @@
 */
 void NmEditorView::messageCreated(int result)
 {
+    NM_FUNCTION;
+    
     delete mMessage;
     mMessage = NULL;
 
+    // Close wait dialog here
+    if (mWaitDialog) {
+        mWaitDialog->close();
+    }
+    
     if (result == NmNoError && mMessageCreationOperation) {
         NmUiEditorStartMode startMode = mStartParam->editorStartMode();
         
@@ -473,6 +617,8 @@
 */
 void NmEditorView::updateMessageWithEditorContents()
 {
+    NM_FUNCTION;
+    
     if (mMessage) {
         if (mContentWidget && mContentWidget->editor()) {
             NmMessagePart* bodyPart = mMessage->htmlBodyPart();
@@ -485,34 +631,34 @@
             }
         }
         if (mContentWidget && mContentWidget->header() ) {
-            if (mContentWidget->header()->subjectField()) {
+            if (mContentWidget->header()->subjectEdit()) {
                 mMessage->envelope().setSubject(
-                    mContentWidget->header()->subjectField()->text());
+                    mContentWidget->header()->subjectEdit()->text());
             }
-            if (mContentWidget->header()->toField()) {
+            if (mContentWidget->header()->toEdit()) {
                 QString toFieldText =
-                    mContentWidget->header()->toField()->text();
+                    mContentWidget->header()->toEdit()->text();
 
                 // This verification of zero length string isn't needed
                 // after list of addresses
                 if (toFieldText.length() > 0) {
-                    mMessage->envelope().setToRecipients(mContentWidget->header()->toField()->emailAddressList());  
+                    mMessage->envelope().setToRecipients(mContentWidget->header()->toEdit()->emailAddressList());  
                 }
             }
-            if (mContentWidget->header()->ccField()) {
+            if (mContentWidget->header()->ccEdit()) {
                 QString ccFieldText =
-                    mContentWidget->header()->ccField()->text();
+                    mContentWidget->header()->ccEdit()->text();
 
                 if (ccFieldText.length() > 0) {
-                    mMessage->envelope().setCcRecipients(mContentWidget->header()->ccField()->emailAddressList());      
+                    mMessage->envelope().setCcRecipients(mContentWidget->header()->ccEdit()->emailAddressList());      
                 }
             }
-            if (mContentWidget->header()->bccField()) {
+            if (mContentWidget->header()->bccEdit()) {
                 QString bccFieldText =
-                    mContentWidget->header()->bccField()->text();
+                    mContentWidget->header()->bccEdit()->text();
 
                 if (bccFieldText.length() > 0) {
-                    mMessage->envelope().setBccRecipients(mContentWidget->header()->bccField()->emailAddressList());  
+                    mMessage->envelope().setBccRecipients(mContentWidget->header()->bccEdit()->emailAddressList());  
                 }
             }
         }
@@ -526,6 +672,8 @@
 */
 void NmEditorView::fillEditorWithMessageContents()
 {
+    NM_FUNCTION;
+    
     if (!mMessage || !mContentWidget) {
         return;
     }
@@ -559,14 +707,14 @@
         bccAddressesString = addressListToString(messageEnvelope.bccRecipients());
     }
 
-    mContentWidget->header()->toField()->setPlainText(toAddressesString);
-    mContentWidget->header()->ccField()->setPlainText(ccAddressesString);
-    mContentWidget->header()->bccField()->setPlainText(bccAddressesString);
+    mContentWidget->header()->toEdit()->setPlainText(toAddressesString);
+    mContentWidget->header()->ccEdit()->setPlainText(ccAddressesString);
+    mContentWidget->header()->bccEdit()->setPlainText(bccAddressesString);
 
     if (ccAddressesString.length() || bccAddressesString.length()) {
         // Since cc or/and bcc recipients exist, expand the group box to display
         // the addresses by expanding the group box.
-        mContentWidget->header()->setGroupBoxCollapsed(false);
+        mContentWidget->header()->setFieldVisibility(true);
     }
 
     // Set subject.
@@ -574,20 +722,12 @@
         QString *subject = mStartParam->subject();
 
         if (subject) {
-            mContentWidget->header()->subjectField()->setPlainText(*subject);
+            mContentWidget->header()->subjectEdit()->setPlainText(*subject);
         }
     }
     else {
-        // If a message is taken from the outbox, no subject formatting is done.
-        NmId notUsed(0);
-
-        if (mCheckOutboxOperation &&
-            mCheckOutboxOperation->getMessageId(notUsed)) {
-            editorStartMode = NmUiEditorCreateNew;
-        }
-
         // Construct the subject field.
-        mContentWidget->header()->subjectField()->setPlainText(
+        mContentWidget->header()->subjectEdit()->setPlainText(
             addSubjectPrefix(editorStartMode, messageEnvelope.subject()));
     }
 
@@ -595,58 +735,39 @@
     mHeaderWidget->setPriority(messageEnvelope.priority());
     
     // Set the message body.
-    // Fetch plain text part form message store.
-    NmMessagePart *plainPart = mMessage->plainTextBodyPart();
-
-    if (plainPart) {
-        mUiEngine.contentToMessagePart(mMessage->envelope().mailboxId(),
-                                       mMessage->envelope().folderId(),
-                                       mMessage->envelope().messageId(),
-                                       *plainPart);
-    }
-
-    // Fetch html part form message store.
-    NmMessagePart *htmlPart = mMessage->htmlBodyPart();
-
-    if (htmlPart) {
-        mUiEngine.contentToMessagePart(mMessage->envelope().mailboxId(),
-                                       mMessage->envelope().folderId(),
-                                       mMessage->envelope().messageId(),
-                                       *htmlPart);
-    }
-
-    // Fetch attachment.html part form message store if such exists.
-    QList<NmMessagePart*> parts;
-    mMessage->attachmentList(parts);
-    NmMessagePart *attachmentHtml = NULL;
-
-    foreach(NmMessagePart *part, parts) {
-        if (part->contentDescription().startsWith(NmContentDescrAttachmentHtml)) {
-            attachmentHtml = part;
-        }
-    }
-
-    if (attachmentHtml) {
-        mUiEngine.contentToMessagePart(mMessage->envelope().mailboxId(),
-                                       mMessage->envelope().folderId(),
-                                       mMessage->envelope().messageId(),
-                                       *attachmentHtml);
-    }
-
-    // Set content data
     if (editorStartMode==NmUiEditorReply||
         editorStartMode==NmUiEditorReplyAll||
         editorStartMode==NmUiEditorForward){
-        // Pass envelope ptr only when needed for reaply header creation
+
+        // Use the body from the original message.
         NmMessage *originalMessage = mUiEngine.message(mStartParam->mailboxId(), 
                                                        mStartParam->folderId(), 
                                                        mStartParam->messageId());
-        mContentWidget->setMessageData(*mMessage, &originalMessage->envelope()); 
+
+        if (originalMessage) {
+            NmMessagePart *plainPart = originalMessage->plainTextBodyPart();
+
+            if (plainPart) {
+                mUiEngine.contentToMessagePart(originalMessage->envelope().mailboxId(),
+                                               originalMessage->envelope().folderId(),
+                                               originalMessage->envelope().messageId(),
+                                               *plainPart);
+            }
+
+            NmMessagePart *htmlPart = originalMessage->htmlBodyPart();
+
+            if (htmlPart) {
+                mUiEngine.contentToMessagePart(originalMessage->envelope().mailboxId(),
+                                               originalMessage->envelope().folderId(),
+                                               originalMessage->envelope().messageId(),
+                                               *htmlPart);
+            }
+
+            mContentWidget->setMessageData(*originalMessage);
+        }
+
         delete originalMessage;
-    }
-    else{
-        // Reply header not needed, do not pass envelope ptr
-        mContentWidget->setMessageData(*mMessage);     
+        originalMessage = NULL;
     }
     
     // Get list of attachments from the message and set those into UI attachment list
@@ -681,6 +802,8 @@
 */
 void NmEditorView::createToolBar()
 {
+    NM_FUNCTION;
+    
     HbToolBar *tb = toolBar();
     NmUiExtensionManager &extMngr = mApplication.extManager();
     if (tb && &extMngr && mStartParam) {
@@ -713,10 +836,21 @@
                     connect(actionMusic, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchAudio()));
                     
                     HbAction* actionVideo = 
-                        extension->addAction(hbTrId("txt_mail_list_video"), extension, SLOT(close()));                
+                        extension->addAction(hbTrId("txt_mail_list_video"), extension, SLOT(close()));
+                    connect(actionVideo, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchVideo()));
+                    
                     HbAction* actionOther = 
                         extension->addAction(hbTrId("txt_mail_list_other"), extension, SLOT(close()));
+                    connect(actionOther, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchOther()));
+                    
+                    HbAction* actionCameraStill = 
+                       extension->addAction(hbTrId("txt_mail_list_new_photo"), extension, SLOT(close()));
+                    connect(actionCameraStill, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchCameraStill()));
             
+                    HbAction* actionCameraVideo = 
+                        extension->addAction(hbTrId("txt_mail_list_new_video"), extension, SLOT(close()));
+                    connect(actionCameraVideo, SIGNAL(triggered()), mAttachmentPicker, SLOT(fetchCameraVideo()));
+                                        
                     list[i]->setToolBarExtension(extension);
                 }
             }            
@@ -730,11 +864,23 @@
 */
 void NmEditorView::createOptionsMenu()
 {
-    if (!mPrioritySubMenu) {
+    NM_FUNCTION;
+    
+    menu()->clearActions();
+
+	// Create CC/BCC options menu object
+    if (mCcBccFieldVisible) {
+        menu()->addAction(hbTrId("txt_mail_opt_hide_cc_bcc"), this, SLOT(switchCcBccFieldVisibility()));
+    }
+    else {
+        menu()->addAction(hbTrId("txt_mail_opt_show_cc_bcc"), this, SLOT(switchCcBccFieldVisibility()));
+    }
+
+	// Create Priority options menu object
+	if (!mPrioritySubMenu) {
         mPrioritySubMenu = new HbMenu();
     }
     mPrioritySubMenu->clearActions();
-    menu()->clearActions();
     NmActionRequest request(this, NmActionOptionsMenu, NmActionContextViewEditor,
             NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
             mStartParam->messageId());
@@ -750,11 +896,31 @@
 }
 
 /*!
+    Show or hide Cc field
+*/
+void NmEditorView::switchCcBccFieldVisibility()
+{
+    NM_FUNCTION;
+    
+    if (mCcBccFieldVisible) {
+    	mCcBccFieldVisible = false;
+    }
+    else {
+    	mCcBccFieldVisible = true;
+    }
+    mHeaderWidget->setFieldVisibility( mCcBccFieldVisible );
+
+    QTimer::singleShot(NmOrientationTimer, this, SLOT(sendHeaderHeightChanged()));
+}
+
+/*!
     handleActionCommand. From NmActionObserver, extension manager calls this
     call to handle menu command in the UI.
 */
 void NmEditorView::handleActionCommand(NmActionResponse &actionResponse)
 {
+    NM_FUNCTION;
+    
     NmActionResponseCommand responseCommand = actionResponse.responseCommand();
     
     // Handle options menu
@@ -766,8 +932,7 @@
         case NmActionResponseCommandSendMail: {
             // Just in case send mail would be somehow accessible during message creation or
             // outobox checking
-            if ((!mCheckOutboxOperation || !mCheckOutboxOperation->isRunning()) 
-                && (!mMessageCreationOperation || !mMessageCreationOperation->isRunning())) {
+            if (!mMessageCreationOperation || !mMessageCreationOperation->isRunning()) {
                 startSending();
             }
             break;
@@ -776,75 +941,47 @@
             break;
         }
     }
+    else if (actionResponse.menuType() == NmActionContextMenu) {
+        switch (responseCommand) {
+        case NmActionResponseCommandRemoveAttachment: {
+            removeAttachmentTriggered();
+            break;
+        }
+        case NmActionResponseCommandOpenAttachment: {
+            openAttachmentTriggered();
+            break;
+        }
+        default:
+            break;
+        }
+    }
 }
 
 /*!
-    This function converts background scroll area coordinate point into
-    body text editor coordinate point.
+    Slot. Cancelled sending progress dialog.
 */
-QPointF NmEditorView::viewCoordinateToEditCoordinate(QPointF orgPoint)
-{
-    QPointF contentWidgetPos = mScrollAreaContents->pos();
-    qreal y = orgPoint.y() - mHeaderWidget->headerHeight();
-    y -= contentWidgetPos.y();
-    qreal x = orgPoint.x() - contentWidgetPos.x();
-    return QPointF(x, y);
-}
-
-/*!
-   Send mouse press event to body edit widget
-*/
-void NmEditorView::sendMousePressEventToScroll(QGraphicsSceneMouseEvent *event)
-{
-    if (event && mEditWidget && mHeaderWidget) {
-        event->setPos(viewCoordinateToEditCoordinate(event->pos()));
-        event->setAccepted(true);
-        mEditWidget->sendMousePressEvent(event);
-    }
-}
-
-/*!
-   Send mouse release event to body edit widget
-*/
-void NmEditorView::sendMouseReleaseEventToScroll(QGraphicsSceneMouseEvent *event)
+void NmEditorView::sendProgressDialogCancelled()
 {
-    if (event&& mEditWidget && mHeaderWidget) {
-        event->setPos(viewCoordinateToEditCoordinate(event->pos()));
-        event->setAccepted(true);
-        mEditWidget->sendMouseReleaseEvent(event);
+    // Needs to be called before closing the application otherwise nmail panics
+    // in destruction.
+    QGraphicsScene *graphicsScene = scene();
+    if (graphicsScene) {
+        graphicsScene->clearFocus();
     }
-}
 
-/*!
-   Send mouse move event to body edit widget
-*/
-void NmEditorView::sendMouseMoveEventToScroll(QGraphicsSceneMouseEvent *event)
-{
-    if (event&& mEditWidget && mHeaderWidget) {
-        event->setPos(viewCoordinateToEditCoordinate(event->pos()));
-        event->setAccepted(true);
-        mEditWidget->sendMouseMoveEvent(event);
-    }
+    // Must use delayed editor view destruction so that dialog
+    // gets time to complete, closes also nmail.
+    QMetaObject::invokeMethod(&mApplication, "popView", Qt::QueuedConnection);
 }
 
-void NmEditorView::sendLongPressGesture(const QPointF &point)
-{
-    if (mEditWidget && mHeaderWidget) {
-        QPointF scenePos = mEditWidget->scenePos();
-        QPointF newPoint = QPointF(point.x()-scenePos.x(), point.y()-scenePos.y());
-        if(mEditWidget->contains(newPoint)) {
-            mEditWidget->sendLongPressEvent(point);
-        }
-    }
-}
-
-
 /*!
    Sets all toolbar and VKB buttons dimmed state. All actions that have the
    availability condition NmSendable set, will be enabled/disabled.
 */
 void NmEditorView::setButtonsDimming(bool enabled)
 {
+    NM_FUNCTION;
+    
     // Set the toolbar action states
     HbToolBar *tb = toolBar();
     if (tb) {
@@ -878,6 +1015,8 @@
 */
 void NmEditorView::initializeVKB()
 {
+    NM_FUNCTION;
+    
     NmActionRequest request(this, NmActionVKB, NmActionContextViewEditor,
          NmActionContextDataNone, mStartParam->mailboxId(), mStartParam->folderId() );
     NmUiExtensionManager &extMngr = mApplication.extManager();
@@ -898,13 +1037,13 @@
             // editors that show the button in VKB.
             HbEditorInterface editorInterface(mContentWidget->editor());
             editorInterface.addAction(list[i]);
-            HbEditorInterface toEditorInterface(mContentWidget->header()->toField());
+            HbEditorInterface toEditorInterface(mContentWidget->header()->toEdit());
             toEditorInterface.addAction(list[i]);
-            HbEditorInterface ccEditorInterface(mContentWidget->header()->ccField());
+            HbEditorInterface ccEditorInterface(mContentWidget->header()->ccEdit());
             ccEditorInterface.addAction(list[i]);
-            HbEditorInterface bccEditorInterface(mContentWidget->header()->bccField());
+            HbEditorInterface bccEditorInterface(mContentWidget->header()->bccEdit());
             bccEditorInterface.addAction(list[i]);
-            HbEditorInterface subjectEditorInterface(mContentWidget->header()->subjectField());
+            HbEditorInterface subjectEditorInterface(mContentWidget->header()->subjectEdit());
             subjectEditorInterface.addAction(list[i]);
         }
     }
@@ -915,6 +1054,8 @@
 */
 void NmEditorView::setMailboxName()
 {
+    NM_FUNCTION;
+    
     if (mStartParam){
         NmMailboxMetaData *meta = mUiEngine.mailboxById(mStartParam->mailboxId());
         if (meta){
@@ -929,6 +1070,8 @@
 */
 QString NmEditorView::addSubjectPrefix( NmUiEditorStartMode startMode, const QString &subject )
 {
+    NM_FUNCTION;
+    
     QString newSubject(subject.trimmed());
     
     if (startMode == NmUiEditorReply || startMode == NmUiEditorReplyAll || 
@@ -974,6 +1117,8 @@
 */
 void NmEditorView::onAttachmentReqCompleted(const QVariant &value)
 {
+    NM_FUNCTION;
+    
     //temporary fix for music picker back button:
     //it shouldn't emit requestOk signal when nothing is selected
 	if (value.canConvert<QStringList>()) {
@@ -984,6 +1129,17 @@
     }
 }
 
+/*!
+    This slot is called when 'attachment picker' request has been unsuccesfull
+    Parameter 'errorCode' is the error code returned by the service
+    Parameter 'errorMessage' is the error message returned by the service
+*/
+void NmEditorView::onAttachmentsFetchError(int errorCode, const QString& errorMessage)
+{
+    NM_FUNCTION;
+    NM_COMMENT(QString("Error code: %1").arg(errorCode));
+    NM_COMMENT(QString("Error message: %1").arg(errorMessage));
+}
 
 /*!
     Closes the wait dialog if one exists.
@@ -994,24 +1150,36 @@
 */
 void NmEditorView::handleSendOperationCompleted()
 {
-    if (mWaitDialog) {
-        mWaitDialog->close();
+    NM_FUNCTION;
+
+    if (mServiceSendingDialog) {
+        mServiceSendingDialog->close();
     }
+
+    // Needs to be called before closing the application otherwise nmail panics
+    // in destruction.
+    QGraphicsScene *graphicsScene = scene();
+    if (graphicsScene) {
+        graphicsScene->clearFocus();
+    }
+
+    // Must use delayed editor view destruction so that dialog
+    // gets time to complete, closes also nmail.
+    QMetaObject::invokeMethod(&mApplication, "popView", Qt::QueuedConnection);
 }
 
-
 /*!
     Add list of attachments
 */
 void NmEditorView::addAttachments(const QStringList& fileNames) 
 {
-    NMLOG("NmEditorView::addAttachments");
-
+    NM_FUNCTION;
+    
     // Add attachment name into UI
     foreach (QString fileName, fileNames)  {
         // At this phase attachment size and nmid are not known
         mHeaderWidget->addAttachment(fileName, QString("0"), NmId(0));
-        NMLOG(fileName);
+        NM_COMMENT(fileName);
     }
     //  Cancel previous operation if it's not running.
     if (mAddAttachmentOperation) {
@@ -1045,6 +1213,8 @@
 */
 void NmEditorView::attachmentLongPressed(NmId attachmentPartId, QPointF point)
 {
+    NM_FUNCTION;
+    
     // Store id of the attachment to be removed into member.
     // It is used by removeAttachmentTriggered later if 'remove' selected.
     mSelectedAttachment = attachmentPartId;
@@ -1068,28 +1238,7 @@
     // Add menu position check here, so that it does not go outside of the screen
     QPointF menuPos(point.x(),point.y());
     mAttachmentListContextMenu->setPreferredPos(menuPos);
-    mAttachmentListContextMenu->open(this, SLOT(contextButton(NmActionResponse&)));
-}
-
-/*!
-    Slot. Signaled when menu option is selected
-*/
-void NmEditorView::contextButton(NmActionResponse &result)
-{
-    if (result.menuType() == NmActionContextMenu) {
-        switch (result.responseCommand()) {
-        case NmActionResponseCommandRemoveAttachment: {
-            removeAttachmentTriggered();
-            break;
-        }
-        case NmActionResponseCommandOpenAttachment: {
-            openAttachmentTriggered();
-            break;
-        }
-        default:
-            break;
-        }
-    }
+    mAttachmentListContextMenu->open();
 }
 
 /*!
@@ -1098,6 +1247,8 @@
 */
 void NmEditorView::oneAttachmentAdded(const QString &fileName, const NmId &msgPartId, int result)
 {
+    NM_FUNCTION;
+    
     if (result == NmNoError && mMessage) {
         // Need to get the message again because new attachment part has been added.
         NmId mailboxId = mMessage->envelope().mailboxId();
@@ -1128,7 +1279,7 @@
     }
     else {
         // Attachment adding failed. Show an error note and remove from UI attachment list.
-        NMLOG(QString("nmailui: attachment adding into message failed: %1").arg(fileName));
+        NM_ERROR(1,QString("nmailui: attachment adding into message failed: %1").arg(fileName));
         mHeaderWidget->removeAttachment(fileName);
     }
 }
@@ -1139,6 +1290,8 @@
 */
 void NmEditorView::allAttachmentsAdded(int result)
 {
+    NM_FUNCTION;
+    
     enableToolBarAttach(true);
     if (result != NmNoError) {
         NmUtilities::displayWarningNote(hbTrId("txt_mail_dialog_unable_to_add_attachment"));
@@ -1146,48 +1299,12 @@
 }
 
 /*!
-    This is signalled by mCheckOutboxOperation when the operation is complete.
-*/
-void NmEditorView::outboxChecked(int result)
-{
-    bool messageInOutbox = false;
-    
-    if (result == NmNoError && mCheckOutboxOperation) {
-
-        NmId messageId;
-        messageInOutbox = mCheckOutboxOperation->getMessageId(messageId);
-        
-        if (messageInOutbox) {
-            delete mMessage;
-            mMessage = NULL;
-
-            mMessage = mUiEngine.message(
-                mStartParam->mailboxId(), 
-                mUiEngine.standardFolderId(
-                    mStartParam->mailboxId(), NmFolderOutbox), 
-                messageId);
-            
-            fillEditorWithMessageContents();
-            
-            if (mMessage) {
-                NmUtilities::displayWarningNote(
-                    hbTrId("txt_mail_dialog_sending failed").arg(
-                        NmUtilities::truncate(
-                            mMessage->envelope().subject(), 20)));
-            }
-        }
-    }
-
-    if (!messageInOutbox) {
-        startMessageCreation(mStartParam->editorStartMode());
-    }
-}
-
-/*!
    Sets priority for the message object that is being edited 
 */
 void NmEditorView::setPriority(NmActionResponseCommand priority)
 {
+    NM_FUNCTION;
+    
     mHeaderWidget->setPriority(priority);
 
     if (mMessage) {
@@ -1213,6 +1330,8 @@
 */
 QString NmEditorView::addressListToString(const QList<NmAddress*> &list) const
 {
+    NM_FUNCTION;
+    
     QString addressesString;
     QList<NmAddress*>::const_iterator i = list.constBegin();
     
@@ -1239,6 +1358,8 @@
 */
 QString NmEditorView::addressListToString(const QList<NmAddress> &list) const
 {
+    NM_FUNCTION;
+    
     QString addressesString;
     QList<NmAddress>::const_iterator i = list.constBegin();
     
@@ -1260,6 +1381,8 @@
 */
 void NmEditorView::removeAttachmentTriggered()
 {
+    NM_FUNCTION;
+    
     // Cancel will delete previous operation
     if (mRemoveAttachmentOperation) {
         if (!mRemoveAttachmentOperation->isRunning()) {
@@ -1285,6 +1408,8 @@
  */
 void NmEditorView::attachmentRemoved(int result)
 {
+    NM_FUNCTION;
+    
     // It is not desided yet what to do if operation fails
     Q_UNUSED(result);
     
@@ -1306,6 +1431,8 @@
 */
 void NmEditorView::openAttachmentTriggered()
 {
+    NM_FUNCTION;
+    
     mHeaderWidget->launchAttachment(mSelectedAttachment);
 }
 
@@ -1314,6 +1441,8 @@
 */
 void NmEditorView::enableToolBarAttach(bool enable)
 {
+    NM_FUNCTION;
+    
     HbToolBar *tb = toolBar();
     if (tb) {
         QList<QAction *> toolbarList = tb->actions();
--- a/emailuis/nmailui/src/nmmailboxlistview.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmmailboxlistview.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -37,7 +37,7 @@
     NmMailboxListModel &mailboxListModel,
     HbDocumentLoader *documentLoader,
     QGraphicsItem *parent)
-: NmBaseView(startParam,parent),
+: NmBaseView(startParam, application, parent),
 mApplication(application),
 mMailboxListWidget(NULL),
 mUiEngine(uiEngine),
@@ -46,6 +46,8 @@
 mDocumentLoader(documentLoader),
 mViewReady(false)
 {
+    NM_FUNCTION;
+    
     // Load view layout
     loadViewLayout();
     
@@ -58,6 +60,8 @@
 */
 NmMailboxListView::~NmMailboxListView()
 {
+    NM_FUNCTION;
+    
     delete mDocumentLoader;
     mWidgetList.clear();
     if (mItemContextMenu){
@@ -71,6 +75,8 @@
 */
 void NmMailboxListView::loadViewLayout()
 {
+    NM_FUNCTION;
+    
     // Use document loader to load the view
     bool ok = false;
     setObjectName(QString(NMUI_MAILBOX_LIST_VIEW));
@@ -90,25 +96,22 @@
         mMailboxListWidget = qobject_cast<HbListView *>
             (mDocumentLoader->findWidget(NMUI_MAILBOX_LIST_WIDGET));
         if (mMailboxListWidget) {
-            NMLOG("nmailui: mailboxlistview: List object loaded");
+            NM_COMMENT("nmailui: mailboxlistview: list object loaded");
             // Set item prototype.
             mMailboxListWidget->setItemPrototype(new NmMailboxListViewItem(this));
             mMailboxListWidget->setItemRecycling(true);
             QObject::connect(mMailboxListWidget,
                     SIGNAL(activated(const QModelIndex &)),
                 this, SLOT(itemActivated(const QModelIndex &)));
-            QObject::connect(mMailboxListWidget,
-                    SIGNAL(longPressed(HbAbstractViewItem*, const QPointF&)),
-                this, SLOT(showItemContextMenu(HbAbstractViewItem*,const QPointF&)));
             mMailboxListWidget->setClampingStyle(HbScrollArea::BounceBackClamping);
             mMailboxListWidget->setFrictionEnabled(true);
         }
         else {
-            NMLOG("nmailui: mailboxlistview: List object loading failed");
+            NM_ERROR(1,"nmailui: mailboxlistview: list object loading failed");
         }
     }
     else {
-         NMLOG("nmailui: mailboxlistview: Reasource loading failed");
+         NM_ERROR(1,"nmailui: mailboxlistview: resource loading failed");
     }
 }
 
@@ -117,6 +120,8 @@
 */
 void NmMailboxListView::viewReady()
 {
+    NM_FUNCTION;
+    
     if (!mViewReady){
         // Set title
         setTitle(hbTrId("txt_mail_title_mail"));
@@ -133,6 +138,8 @@
 */
 void NmMailboxListView::reloadViewContents(NmUiStartParam* startParam)
 {
+    NM_FUNCTION;
+    
     // Check start parameter validity.
     if (startParam&&startParam->viewId()==NmUiViewMailboxList) {
         // Delete existing start parameter data
@@ -144,7 +151,7 @@
         refreshList();
     }
     else {
-        NMLOG("nmailui: mailboxlistview: Invalid start parameter");
+        NM_ERROR(1,"nmailui: mailboxlistview: invalid start parameter");
         // Unused start parameter needs to be deleted
         delete startParam;
         startParam = NULL;
@@ -156,6 +163,8 @@
 */
 NmUiViewId NmMailboxListView::nmailViewId() const
 {
+    NM_FUNCTION;
+    
     return NmUiViewMailboxList;
 }
 
@@ -164,6 +173,8 @@
 */
 void NmMailboxListView::refreshList()
 {
+    NM_FUNCTION;
+    
 	if (mMailboxListWidget) {
         mMailboxListWidget->setModel(&mListModel);
 	}
@@ -174,6 +185,8 @@
 */
 void NmMailboxListView::itemActivated(const QModelIndex &index)
 {
+    NM_FUNCTION;
+    
     mActivatedIndex = index;
     QMetaObject::invokeMethod(this, "openSelectedMailBox", Qt::QueuedConnection);
 }
@@ -184,6 +197,8 @@
 */
 void NmMailboxListView::openSelectedMailBox()
 {
+    NM_FUNCTION;
+    
     // Get mailbox meta data
     NmMailboxMetaData *mailbox =
         mListModel.data(mActivatedIndex, Qt::DisplayRole).value<NmMailboxMetaData*>();
@@ -197,77 +212,14 @@
 }
 
 /*!
-    showItemContextMenu. Functions starts fetching item context menu objects
-    from extension. Menu is displayed in view callback funtion.
-*/
-void NmMailboxListView::showItemContextMenu(HbAbstractViewItem *item, const QPointF &coords)
-{
-    if (mItemContextMenu&&item){
-        // Clear previous items from context menu
-        mItemContextMenu->clearActions();
-        // Get mailbox meta data
-        NmMailboxMetaData *mailbox =
-            mListModel.data(item->modelIndex(), Qt::DisplayRole).value<NmMailboxMetaData*>();
-        NmId mailboxId(0);
-        if (mailbox) {
-            mailboxId = mailbox->id();
-        }
-        // Fetch items from extension based on item
-        NmActionRequest request(this, NmActionContextMenu, NmActionContextViewNone,
-        		NmActionContextDataMailbox, mailboxId);
-        NmUiExtensionManager &extMngr = mApplication.extManager();
-        QList<NmAction*> list;
-        extMngr.getActions(request, list);
-        for (int i=0;i<list.count();i++) {
-            mItemContextMenu->addAction(list[i]);
-        }
-        // Display menu
-        if (mMailboxListWidget){
-            mMailboxListWidget->setCurrentIndex(item->modelIndex());
-            mItemContextMenu->setObjectName("MailboxItemContextMenu");
-            mItemContextMenu->setPreferredPos(coords);
-            mItemContextMenu->open(this, SLOT(contextButton(NmActionResponse&)));
-        }
-    }
-}
-
-/*!
-    Slot. Signaled when menu option is selected
-*/
-void NmMailboxListView::contextButton(NmActionResponse &result)
-{
-    // Handle context menu commands here
-    if (result.menuType()==NmActionContextMenu){
-        switch (result.responseCommand()){
-            case NmActionResponseCommandOpen:{
-                // Check that given start response has mailbox and folder id's
-                if (result.mailboxId()!=0){
-                    // Use standard folder id inbox if folder has not been specified
-                    NmId folderId = result.folderId();
-                    if (folderId==0){
-                        folderId=mUiEngine.standardFolderId(result.mailboxId(),
-                                                            NmFolderInbox);
-                    }
-                    NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageList,
-                                                                    result.mailboxId(),
-                                                                    folderId);
-                    mApplication.enterNmUiView(startParam);
-                    }
-                }
-                break;
-            default:
-                break;
-        }
-    }
-}
-
-/*!
     handleActionCommand. From NmMenuObserver, extension manager calls this
     call to handle menu command in the UI.
 */
 
 void NmMailboxListView::handleActionCommand(NmActionResponse &actionResponse)
 {
+    NM_FUNCTION;
+    
     // Handle context menu commands here
     Q_UNUSED(actionResponse);
 }
--- a/emailuis/nmailui/src/nmmailboxlistviewitem.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmmailboxlistviewitem.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -17,6 +17,9 @@
 
 #include "nmuiheaders.h"
 
+const QString NmMailboxListViewItemIcon = "MailboxListViewMailboxIcon";
+const QString NmMailboxListViewItemName = "MailboxListViewMailboxName";
+
 /*!
     \class NmMailboxListViewItem
     \brief Mailbox list view item inherited from HbListViewItem
@@ -29,6 +32,7 @@
 : HbListViewItem(parent),
 mLayout(NULL)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -36,6 +40,7 @@
 */
 NmMailboxListViewItem::~NmMailboxListViewItem()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -43,6 +48,8 @@
 */
 HbListViewItem* NmMailboxListViewItem::createItem()
 {
+    NM_FUNCTION;
+    
     return new NmMailboxListViewItem(*this);
 }
 
@@ -51,22 +58,35 @@
 */
 void NmMailboxListViewItem::updateChildItems()
 {
+    NM_FUNCTION;
+    
     // To create primitives
     HbListViewItem::updateChildItems();
 
+    EmailMailboxInfo mailboxInfo;
+    
     NmMailboxMetaData *mailbox =
             modelIndex().data(Qt::DisplayRole).value<NmMailboxMetaData*>();
-    if (mailbox){
+    
+    HbLabel *textLabel = findChild<HbLabel *>(NmMailboxListViewItemName);
+    HbLabel *icon = findChild<HbLabel *>(NmMailboxListViewItemIcon);
+    
+    if (mailbox && !textLabel && !icon){
         mLayout = new QGraphicsLinearLayout(Qt::Horizontal, 0);
         mLayout->setContentsMargins(0,0,0,0);
 
         HbLabel *mbIcon = new HbLabel();
-        mbIcon->setObjectName("MailboxListViewMailboxIcon");
-        mbIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconDefaultMailbox));
+        mbIcon->setParent(this);
+        mbIcon->setObjectName(NmMailboxListViewItemIcon);
+        
+        QString domainName = mailbox->address();
+        QString iconName = mailboxInfo.mailboxIcon(domainName);
+        mbIcon->setIcon(HbIcon(iconName));
         mbIcon->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
 
         HbLabel *mbName = new HbLabel();
-        mbName->setObjectName("MailboxListViewMailboxName");
+        mbName->setParent(this);
+        mbName->setObjectName(NmMailboxListViewItemName);
         mbName->setPlainText(mailbox->name());
         mbName->setAlignment(Qt::AlignVCenter);
         mbName->setFontSpec(HbFontSpec(HbFontSpec::Primary));
@@ -77,6 +97,17 @@
         mLayout->setItemSpacing(0,0);
 
         setLayout(mLayout); // Ownership is transferred
+    } else if (mailbox) {
+        
+        if (textLabel) {
+            textLabel->setPlainText(mailbox->name());
+        }
+        
+        QString iconName = mailboxInfo.mailboxIcon(mailbox->address());
+        if (icon && !iconName.isEmpty()) {
+            icon->setIcon(HbIcon(iconName));
+        }
+        
     }
 }
 
@@ -85,6 +116,8 @@
 */
 bool NmMailboxListViewItem::canSetModelIndex(const QModelIndex &index)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(index);
     return true;
 }
@@ -94,6 +127,8 @@
 */
 void NmMailboxListViewItem::polishEvent()
 {
+    NM_FUNCTION;
+    
     QGraphicsWidget::polishEvent();
 }
 
@@ -105,6 +140,8 @@
     const QStyleOptionGraphicsItem *option,
     QWidget *widget)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(option);
     Q_UNUSED(widget);
     Q_UNUSED(painter);
--- a/emailuis/nmailui/src/nmmailboxselectiondialog.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmmailboxselectiondialog.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -42,6 +42,8 @@
       mParent(parent),
       mMailboxId(0)
 {
+    NM_FUNCTION;
+    
     // No implementation required.
 }
 
@@ -51,6 +53,8 @@
 */
 NmMailboxSelectionDialog::~NmMailboxSelectionDialog()
 {
+    NM_FUNCTION;
+    
     delete mContentItemModel;
     delete mMailboxListView;
     delete mMailboxSelectionDialog;
@@ -63,7 +67,8 @@
 */
 void NmMailboxSelectionDialog::open()
 {
-    NMLOG("NmMailboxSelectionDialog::exec()");
+    NM_FUNCTION;
+    
     mMailboxId = 0;
 
     // Initialize the UI and fetch the mailbox items into the list.
@@ -79,12 +84,14 @@
  */
 void NmMailboxSelectionDialog::dialogClosed(HbAction *action)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(action);
-    
+
     // Store the ID of the selected mailbox into the given argument.
-    NMLOG(QString("NmMailboxSelectionDialog::dialogClosed() return %1").
+    NM_COMMENT(QString("NmMailboxSelectionDialog::dialogClosed() return %1").
         arg(mMailboxId.id()));
-    
+
     emit selectionDialogClosed(mMailboxId);
 }
 
@@ -96,8 +103,8 @@
 */
 bool NmMailboxSelectionDialog::initializeUi()
 {
-    NMLOG("NmMailboxSelectionDialog::initializeUi()");
-
+    NM_FUNCTION;
+    
     // Use the document loader to load the widgets.
     HbDocumentLoader documentLoader;
     bool documentLoaded = false;
@@ -118,7 +125,7 @@
     }
 
     if (!mMailboxSelectionDialog || !mMailboxListView) {
-        NMLOG("NmMailboxSelectionDialog::initializeUi(): Failed to load widgets!");
+        NM_ERROR(1,"NmMailboxSelectionDialog::initializeUi(): Failed to load widgets!");
         return false;
     }
 
@@ -153,7 +160,8 @@
 */
 bool NmMailboxSelectionDialog::populateListItems()
 {
-    NMLOG("NmMailboxSelectionDialog::populateListItems()");
+    NM_FUNCTION;
+    
     const int count = mMailboxListModel.rowCount();
 
     if (!mContentItemModel || count == 0) {
@@ -164,13 +172,14 @@
     NmMailboxMetaData *metaData = NULL;
     QStandardItem *item = NULL;
 
+    EmailMailboxInfo mailboxInfo;
     for (int i = 0; i < count; ++i) {
         metaData = mailboxMetaData(i);
 
         if (metaData) {
-            // Implement the branded icons when possible.
-            const HbIcon &mailboxIcon =
-                NmIcons::getIcon(NmIcons::NmIconDefaultMailbox);
+            QString domainName = metaData->address();
+            QString iconName = mailboxInfo.mailboxIcon(domainName);
+			HbIcon mailboxIcon( iconName );
 
             // Construct the item and append it into the list.
             item = new QStandardItem(mailboxIcon.qicon(), metaData->name());
@@ -190,6 +199,8 @@
 */
 NmMailboxMetaData *NmMailboxSelectionDialog::mailboxMetaData(int index) const
 {
+    NM_FUNCTION;
+    
     QVariant mailbox = mMailboxListModel.data(mMailboxListModel.index(index, 0));
     NmMailboxMetaData *mailboxMetaData = mailbox.value<NmMailboxMetaData*>();
     return mailboxMetaData;
@@ -203,6 +214,8 @@
 */
 void NmMailboxSelectionDialog::itemActivated(QModelIndex index)
 {
+    NM_FUNCTION;
+    
     const int rowIndex = index.row();
     NmMailboxMetaData *metaData = mailboxMetaData(rowIndex);
 
--- a/emailuis/nmailui/src/nmmailboxserviceinterface.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmmailboxserviceinterface.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -53,6 +53,7 @@
 */
 NmMailboxServiceInterface::~NmMailboxServiceInterface()
 {
+    NM_FUNCTION;
 }
 
 
@@ -63,7 +64,7 @@
 */
 void NmMailboxServiceInterface::displayInboxByMailboxId(QVariant data)
 {
-    NMLOG("NmMailboxServiceInterface::displayInboxByMailboxId()");
+    NM_FUNCTION;
 
 #ifndef NM_WINS_ENV
 
@@ -72,6 +73,9 @@
 
     mAsyncReqId = setCurrentRequestAsync();
 
+    // Make sure that app stays background if user presses back in message list view
+    bool visible = mApplication->updateVisibilityState();
+
     // Verify that the ID matches one of the existing mailboxes.
     if (mailboxExistsById(mailboxNmId)) {
 
@@ -80,6 +84,8 @@
 
         // Bring the application to the foreground.
         XQServiceUtil::toBackground(false);
+        HbMainWindow *mainWindow = mApplication->mainWindow();
+        mainWindow->show();
 
         // Launch the message list view.
         NmUiStartParam *startParam =
@@ -99,7 +105,7 @@
         // No mailbox found with the given ID.
 
         // if started as embedded, do not hide the app
-		if (!XQServiceUtil::isEmbedded()) {
+		if (!XQServiceUtil::isEmbedded() && !visible) {
 			XQServiceUtil::toBackground(true);
 		}
 
@@ -122,7 +128,7 @@
 */
 bool NmMailboxServiceInterface::mailboxExistsById(const NmId &mailboxId) const
 {
-    NMLOG("NmMailboxServiceInterface::mailboxExistsById()");
+    NM_FUNCTION;
 
     const NmMailboxListModel& mailboxListModel = mUiEngine.mailboxListModel();
     int mailboxCount = mailboxListModel.rowCount();
--- a/emailuis/nmailui/src/nmmessagelistview.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmmessagelistview.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -19,12 +19,13 @@
 static const char *NMUI_MESSAGE_LIST_VIEW = "NmMessageListView";
 static const char *NMUI_MESSAGE_LIST_TREE_LIST = "MessageTreeList";
 static const char *NMUI_MESSAGE_LIST_NO_MESSAGES = "MessageListNoMessages";
-static const char *NMUI_MESSAGE_LIST_FOLDER_LABEL = "folderLabel";
-static const char *NMUI_MESSAGE_LIST_SYNC_ICON = "syncIcon";
+static const char *NMUI_MESSAGE_LIST_FOLDER_LABEL = "labelGroupBox";
+// Old sync icon implementation commented out but preserved so it could be put back if need be
+// static const char *NMUI_MESSAGE_LIST_SYNC_ICON = "syncIcon";
 
 #include "nmuiheaders.h"
 
-/*!
+/*! 
 	\class NmMessageListView
 	\brief Message list view
 */
@@ -37,10 +38,10 @@
     NmUiStartParam* startParam,
     NmUiEngine &uiEngine,
     NmMailboxListModel &mailboxListModel,
-    NmMessageListModel &messageListModel,
+    NmMessageListModel *messageListModel,
     HbDocumentLoader *documentLoader,
     QGraphicsItem *parent)
-: NmBaseView(startParam, parent),
+: NmBaseView(startParam, application, parent),
 mApplication(application),
 mMessageListWidget(NULL),
 mUiEngine(uiEngine),
@@ -53,12 +54,17 @@
 mFolderLabel(NULL),
 mSyncIcon(NULL),
 mViewReady(false),
-mCurrentFolderType(NmFolderInbox)
+mCurrentFolderType(NmFolderInbox),
+mSettingsLaunched(false)
 {
+    NM_FUNCTION;
+
     // Load view layout
     loadViewLayout();
     // Init tree view
     initTreeView();
+    // set title
+    setMailboxName();
     // Set folder name
     setFolderName();
 }
@@ -68,6 +74,8 @@
 */
 NmMessageListView::~NmMessageListView()
 {
+    NM_FUNCTION;
+
     delete mDocumentLoader;
     mWidgetList.clear();
     if (mItemContextMenu){
@@ -81,6 +89,8 @@
 */
 void NmMessageListView::loadViewLayout()
 {
+    NM_FUNCTION;
+
     // Use document loader to load the view
     bool ok = false;
     setObjectName(QString(NMUI_MESSAGE_LIST_VIEW));
@@ -97,32 +107,42 @@
         // Get message list widget
         mMessageListWidget = qobject_cast<HbTreeView *>
             (mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_TREE_LIST));
+
         if (mMessageListWidget) {
-            NMLOG("nmailui: List object loaded");
+            NM_COMMENT("nmailui: list object loaded");
+
             // Set item prototype.
             mMessageListWidget->setItemPrototype(new NmMessageListViewItem());
+
+            // Set the list widget properties.
             mMessageListWidget->setItemRecycling(true);
             mMessageListWidget->contentWidget()->setProperty("indentation", 0);
             mMessageListWidget->setScrollDirections(Qt::Vertical);
             mMessageListWidget->setClampingStyle(HbScrollArea::BounceBackClamping);
             mMessageListWidget->setFrictionEnabled(true);
+
+            // Enable animations to display an email as soon as it is added to
+            // the list.
+            mMessageListWidget->setEnabledAnimations(HbAbstractItemView::Appear &
+                                                     HbAbstractItemView::Expand);
         }
         else {
-            NMLOG("nmailui: List object loading failed");
+            NM_ERROR(1,"nmailui: list object loading failed");
         }
+
         mNoMessagesLabel = qobject_cast<HbLabel *>
             (mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_NO_MESSAGES));
         if (mNoMessagesLabel) {
             mNoMessagesLabel->hide();
         }
         else{
-            NMLOG("nmailui: (no messages) object loading failed");
+            NM_ERROR(1,"nmailui: (no messages) object loading failed");
         }
 
-        // Create folder label and set inbox text for it
-        mFolderLabel = qobject_cast<HbLabel *>(mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_FOLDER_LABEL));
+        mFolderLabel = qobject_cast<HbGroupBox *>(mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_FOLDER_LABEL));
 
-        mSyncIcon = qobject_cast<HbLabel *>(mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_SYNC_ICON));
+        // Disable the old sync icon implementation for the time being (commment out loading the icon here)
+        //mSyncIcon = qobject_cast<HbLabel *>(mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_SYNC_ICON));
         if (mSyncIcon) {
             mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconOffline));
         }
@@ -140,7 +160,7 @@
         menu()->addAction(dummy);
     }
     else {
-        NMLOG("nmailui: Resource loading failed");
+        NM_ERROR(1,"nmailui: resource loading failed");
     }
 }
 
@@ -149,6 +169,8 @@
 */
 void NmMessageListView::viewReady()
 {
+    NM_FUNCTION;
+
     if (!mViewReady){
         // Set mailbox name to title pane
         setMailboxName();
@@ -158,6 +180,37 @@
         QMetaObject::invokeMethod(this, "refreshList", Qt::QueuedConnection);
         mViewReady=true;
     }
+    mSettingsLaunched = false;
+}
+
+/*!
+    Getter for currently displayed folder type
+*/
+NmFolderType NmMessageListView::folderType()
+{
+    NM_FUNCTION;
+
+    return mCurrentFolderType;
+}
+
+/*!
+    okToExitView. Message list view determines whether it is
+    ok to exit view and calls mapplication popview.
+*/
+void NmMessageListView::okToExitView()
+{
+    NM_FUNCTION;
+
+    // Close view if current folder is inbox
+    if (mCurrentFolderType==NmFolderInbox){
+        mApplication.popView();
+    }
+    // Switch to inbox
+    else{
+        mSelectedMailboxId=mStartParam->mailboxId();
+        mSelectedFolderId=mUiEngine.standardFolderId(mSelectedMailboxId,NmFolderInbox);
+        QMetaObject::invokeMethod(this, "folderSelected", Qt::QueuedConnection);
+    }
 }
 
 /*!
@@ -165,6 +218,8 @@
 */
 void NmMessageListView::initTreeView()
 {
+    NM_FUNCTION; 
+
     // Get mailbox widget pointer and set parameters
     if (mMessageListWidget){
         QObject::connect(mMessageListWidget,
@@ -186,6 +241,8 @@
 */
 void NmMessageListView::reloadViewContents(NmUiStartParam* startParam)
 {
+    NM_FUNCTION;
+
     // Check start parameter validity, message view cannot
     // be updated if given parameter is zero.
     if (startParam&&startParam->viewId()==NmUiViewMessageList&&
@@ -196,26 +253,26 @@
         // Store new start parameter data
         mStartParam=startParam;
         // Update the model with new parameters
-        mUiEngine.messageListModel(startParam->mailboxId(), startParam->folderId());
+        mMessageListModel = &mUiEngine.messageListModel(startParam->mailboxId(), startParam->folderId());
         refreshList();
         // Refresh the mailboxname
         setMailboxName();
-        // Show message list if it is hidden
-        mMessageListWidget->show();
     }
     else {
-        NMLOG("nmailui: Invalid message list start parameter");
+        NM_ERROR(1,"nmailui: invalid message list start parameter");
         // Unused start parameter needs to be deleted
         delete startParam;
     }
 }
 
-
+ 
 /*!
     Return view id
 */
 NmUiViewId NmMessageListView::nmailViewId() const
 {
+    NM_FUNCTION;
+
     return NmUiViewMessageList;
 }
 
@@ -224,8 +281,10 @@
 */
 void NmMessageListView::refreshList()
 {
-    NmId mailboxId = mMessageListModel.currentMailboxId();
-    if (mSyncIcon && mailboxId == mMessageListModel.currentMailboxId()) {
+    NM_FUNCTION;
+
+    NmId mailboxId = mMessageListModel->currentMailboxId();
+    if (mSyncIcon && mailboxId == mMessageListModel->currentMailboxId()) {
         if (mUiEngine.syncState(mailboxId) == Synchronizing) {
             mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconSynching));
         }
@@ -239,26 +298,49 @@
         }
     }
 
+    // In each refresh, e.g. in folder change the UI signals
+    // lower layer about the folder that has been opened.
+    if (mStartParam){
+        mUiEngine.updateActiveFolder(mailboxId, mStartParam->folderId());
+    }
+
+    // Set item model to message list widget
     if (mMessageListWidget) {
-        mMessageListWidget->setModel(static_cast<QStandardItemModel*>(&mMessageListModel));
-        QObject::connect(&mMessageListModel, SIGNAL(rowsInserted(const QModelIndex&,int,int)),
+        mMessageListWidget->setModel(static_cast<QStandardItemModel*>(mMessageListModel));
+        QObject::connect(mMessageListModel, SIGNAL(rowsInserted(const QModelIndex&,int,int)),
                 this, SLOT(itemsAdded(const QModelIndex&,int,int)));
-        QObject::connect(&mMessageListModel, SIGNAL(rowsRemoved(const QModelIndex&,int,int)),
+        QObject::connect(mMessageListModel, SIGNAL(rowsRemoved(const QModelIndex&,int,int)),
                 this, SLOT(itemsRemoved()));
-        QObject::connect(&mMessageListModel, SIGNAL(setNewParam(NmUiStartParam*)),
+        QObject::connect(mMessageListModel, SIGNAL(setNewParam(NmUiStartParam*)),
                 this, SLOT(reloadViewContents(NmUiStartParam*)));
 
-        if (mMessageListModel.rowCount()==0){
+        if (mMessageListModel->rowCount()==0){
             showNoMessagesText();
         }
+        else{
+            hideNoMessagesText();
+        }
     }
 }
 
+/*!
+    Sync state event handling
+*/
 void NmMessageListView::handleSyncStateEvent(NmSyncState syncState, const NmId & mailboxId)
 {
-    if (mSyncIcon && mailboxId == mMessageListModel.currentMailboxId()) {
+    NM_FUNCTION;
+
+    if (mSyncIcon && mailboxId == mMessageListModel->currentMailboxId()) {
         if (syncState == Synchronizing) {
             mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconSynching));
+            // before first sync inbox id might be zero
+            if (mStartParam->folderId() == 0) {
+                // after sync inbox id should be updated to correct value
+                NmId folderId = mUiEngine.standardFolderId(
+                    mStartParam->mailboxId(),
+                    NmFolderInbox);
+                mStartParam->setFolderId(folderId);
+            }
         }
         else {
             if (mUiEngine.connectionState(mailboxId) == Connected) {
@@ -276,7 +358,9 @@
 */
 void NmMessageListView::handleConnectionEvent(NmConnectState connectState, const NmId &mailboxId)
 {
-    if (mSyncIcon && mailboxId == mMessageListModel.currentMailboxId() && mUiEngine.syncState(mailboxId) != Synchronizing) {
+    NM_FUNCTION;
+
+    if (mSyncIcon && mailboxId == mMessageListModel->currentMailboxId() && mUiEngine.syncState(mailboxId) != Synchronizing) {
         if (connectState == Connected) {
             mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconOnline));
         }
@@ -286,95 +370,63 @@
     }
 }
 
-/*!
+/*! 
     folder selection handling within current mailbox
 */
-void NmMessageListView::folderSelected(NmId mailbox, NmId folder)
+void NmMessageListView::folderSelected()
 {
-    // Reloas view contents with new startparams
-    if (mStartParam){
-        NmUiStartParam* startParam = new NmUiStartParam(NmUiViewMessageList,mailbox,folder);
-        // Hide message lis for redraw
-        mMessageListWidget->hide();
+    NM_FUNCTION;
+
+    // Reload view contents with new startparams if mailbox or folder
+    // id is different than current values.
+    if (mStartParam && (mStartParam->mailboxId()!=mSelectedMailboxId||
+                        mStartParam->folderId()!=mSelectedFolderId)){
+        // Create start params
+        NmUiStartParam* startParam = new NmUiStartParam(NmUiViewMessageList,
+                                                        mSelectedMailboxId,
+                                                        mSelectedFolderId);
+        // Store active folder type
+        mCurrentFolderType = mUiEngine.folderTypeById(startParam->mailboxId(),startParam->folderId());
         // Reload view, ownership of the startparams is passed and old startparams
         // are deleted within reloadViewContents function
         reloadViewContents(startParam);
         //Set folder text to status bar
         setFolderName();
-        // Store active folder type
-        mCurrentFolderType = NmFolderInbox;
     }
 }
 
 
 /*!
-    Long keypress handling
+    Long keypress handling 
 */
 void NmMessageListView::showItemContextMenu(HbAbstractViewItem *listViewItem, const QPointF &coords)
 {
-    // Store long press item for later use with response
-    mLongPressedItem = mMessageListModel.data(
-            listViewItem->modelIndex(), Qt::DisplayRole).value<NmMessageListModelItem*>();
-    if (mItemContextMenu && mLongPressedItem && mLongPressedItem->itemType() ==
-        NmMessageListModelItem::NmMessageItemMessage) {
+    NM_FUNCTION;
 
-        // Clear previous items from context menu
-        mItemContextMenu->clearActions();
-        NmUiExtensionManager &extMngr = mApplication.extManager();
-        QList<NmAction*> list;
-        // Fetch items from extension based on item
-        NmMessageEnvelope *envelope = mLongPressedItem->envelopePtr();
-        if (envelope){
-            NmActionRequest request(this, NmActionContextMenu, NmActionContextViewMessageList,
-                    NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
-                    envelope->messageId(),QVariant::fromValue(envelope));
-            extMngr.getActions(request, list);
-        }
-        else{
-            NmActionRequest request(this, NmActionContextMenu, NmActionContextViewMessageList,
-                    NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
-                    envelope->messageId());
-            extMngr.getActions(request, list);
-        }
-        for (int i=0;i<list.count();i++) {
-            mItemContextMenu->addAction(list[i]);
-        }
-        mItemContextMenu->setPreferredPos(coords);
-        mItemContextMenu->open(this, SLOT(contextButton(NmActionResponse&)));
-    }
-}
+    if (listViewItem) {
+        // Store long press item for later use with response
+        mLongPressedItem = mMessageListModel->data(
+                listViewItem->modelIndex(), Qt::DisplayRole).value<NmMessageListModelItem*>();
+        if (mItemContextMenu && mLongPressedItem && mLongPressedItem->itemType() ==
+            NmMessageListModelItem::NmMessageItemMessage) {
 
-/*!
-    Slot. Signaled when menu option is selected
-*/
-void NmMessageListView::contextButton(NmActionResponse &result)
-{
-    // Handle context menu commands here
-    if (result.menuType()==NmActionContextMenu){
-        switch (result.responseCommand()){
-           case NmActionResponseCommandOpen:{
-               if (mLongPressedItem){
-                   NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
-                       mStartParam->mailboxId(), mStartParam->folderId(),
-                       mLongPressedItem->envelope().messageId());
-                   mApplication.enterNmUiView(startParam);
-                   mLongPressedItem=NULL;
-                   }
-               }
-               break;
-           //temporary solution..
-           case NmActionResponseCommandForward:{
-                if (mLongPressedItem){
-                   NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor,
-                       mStartParam->mailboxId(), mStartParam->folderId(),
-                       mLongPressedItem->envelope().messageId());
-                   mApplication.enterNmUiView(startParam);
-                   mLongPressedItem=NULL;
-                   }
-               }
-               break;
-           default:
-               break;
+            // Clear previous items from context menu
+            mItemContextMenu->clearActions();
+            NmUiExtensionManager &extMngr = mApplication.extManager();
+            QList<NmAction*> list;
+            // Fetch items from extension based on item
+            NmMessageEnvelope *envelope = mLongPressedItem->envelopePtr();
+            if (envelope){
+                NmActionRequest request(this, NmActionContextMenu, NmActionContextViewMessageList,
+                        NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
+                        envelope->messageId(),QVariant::fromValue(envelope));
+                extMngr.getActions(request, list);
+                for (int i=0;i<list.count();i++) {
+                    mItemContextMenu->addAction(list[i]);
+                }
+			    mItemContextMenu->setPreferredPos(coords);
+                mItemContextMenu->open();
+            }
         }
     }
 }
@@ -385,6 +437,8 @@
 */
 void NmMessageListView::itemActivated(const QModelIndex &index)
 {
+    NM_FUNCTION;
+
     mActivatedIndex = index;
     QMetaObject::invokeMethod(this, "handleSelection", Qt::QueuedConnection);
 }
@@ -395,8 +449,10 @@
 */
 void NmMessageListView::handleSelection()
 {
+    NM_FUNCTION;
+
     // Do expand/collapse for title divider items
-    NmMessageListModelItem* modelItem = mMessageListModel.data(
+    NmMessageListModelItem* modelItem = mMessageListModel->data(
             mActivatedIndex, Qt::DisplayRole).value<NmMessageListModelItem*>();
     if (modelItem && modelItem->itemType()==
         NmMessageListModelItem::NmMessageItemTitleDivider) {
@@ -408,8 +464,9 @@
             mMessageListWidget->setExpanded(mActivatedIndex, false);
             modelItem->setExpanded(false);
         }
-    } 
-    if (modelItem && modelItem->itemType() == NmMessageListModelItem::NmMessageItemMessage)
+    }
+    if (modelItem && modelItem->itemType() == NmMessageListModelItem::NmMessageItemMessage
+        && !mSettingsLaunched)
     {
         NmFolderType folderType = mUiEngine.folderTypeById(mStartParam->mailboxId(),
                                   mStartParam->folderId());
@@ -417,15 +474,15 @@
             NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor,
                 mStartParam->mailboxId(), mStartParam->folderId(),
                 modelItem->envelope().messageId(),NmUiEditorFromDrafts);
-            mApplication.enterNmUiView(startParam);            
+            mApplication.enterNmUiView(startParam);
         }
         else if (folderType!=NmFolderOutbox){
             NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
                 mStartParam->mailboxId(), mStartParam->folderId(),
                 modelItem->envelope().messageId());
-            mApplication.enterNmUiView(startParam);        
+            mApplication.enterNmUiView(startParam);
         }
-    }    
+    }
 }
 
 
@@ -436,6 +493,8 @@
 */
 void NmMessageListView::createOptionsMenu()
 {
+    NM_FUNCTION;
+
     menu()->clearActions();
     NmActionRequest request(this, NmActionOptionsMenu, NmActionContextViewMessageList,
     		NmActionContextDataNone, mStartParam->mailboxId(), mStartParam->folderId() );
@@ -453,6 +512,8 @@
 */
 void NmMessageListView::handleActionCommand(NmActionResponse &actionResponse)
 {
+    NM_FUNCTION;
+
     // Handle context menu commands here
     if (actionResponse.menuType() == NmActionOptionsMenu) {
         switch (actionResponse.responseCommand()) {
@@ -471,11 +532,17 @@
                 break;
             }
             case NmActionResponseCommandMailboxDeleted: {
-                mApplication.popView();
+                mApplication.prepareForPopView();
 				break;
             }
             case NmActionResponseCommandSwitchFolder: {
-                folderSelected(actionResponse.mailboxId(), actionResponse.folderId());
+                mSelectedFolderId=actionResponse.folderId();
+                mSelectedMailboxId=actionResponse.mailboxId();
+                QMetaObject::invokeMethod(this, "folderSelected", Qt::QueuedConnection);
+                break;
+            }
+            case NmActionResponseCommandSettings: {
+                mSettingsLaunched = true;
                 break;
             }
             default: {
@@ -483,6 +550,25 @@
             }
         }
     }
+
+    // Handle context menu commands here
+    else if (actionResponse.menuType()==NmActionContextMenu){
+        switch (actionResponse.responseCommand()){
+           case NmActionResponseCommandOpen:{
+               if (mLongPressedItem){
+                   NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
+                       mStartParam->mailboxId(), mStartParam->folderId(),
+                       mLongPressedItem->envelope().messageId());
+                   mApplication.enterNmUiView(startParam);
+                   mLongPressedItem=NULL;
+                   }
+               }
+               break;
+           default:
+               break;
+        }
+    }
+
     // Handle toolbar commands here
     else if ( actionResponse.menuType() == NmActionToolbar ) {
         if ( actionResponse.responseCommand() == NmActionResponseCommandNewMail ) {
@@ -491,7 +577,7 @@
                 if (mUiEngine.isSendingMessage()) {
                     // sending is ongoing so just show a note
                     QString noteText = hbTrId("txt_mail_dialog_still_sending");
-                    
+
                     // get message subject from the message being sent
                     const NmMessage *message = mUiEngine.messageBeingSent();
                     if (message) {
@@ -544,6 +630,8 @@
 */
 void NmMessageListView::setMailboxName()
 {
+    NM_FUNCTION;
+
     if (mStartParam){
         NmMailboxMetaData *meta = mUiEngine.mailboxById(mStartParam->mailboxId());
         if (meta){
@@ -559,6 +647,8 @@
 */
 void NmMessageListView::createToolBar()
 {
+    NM_FUNCTION;
+
     HbToolBar *tb = toolBar();
     if (!tb) {
         return;
@@ -582,71 +672,94 @@
 */
 void NmMessageListView::setFolderName()
 {
-    if (mStartParam && mFolderLabel) {
-        switch (mUiEngine.folderTypeById(mStartParam->mailboxId(),
-                mStartParam->folderId())) {
+    NM_FUNCTION;
+
+    if (mStartParam&&mFolderLabel){
+        switch (mCurrentFolderType) {
         case NmFolderOutbox:
             {
-            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_outbox"));
+            mFolderLabel->setHeading(hbTrId("txt_mail_subhead_outbox"));
             }
             break;
         case NmFolderDrafts:
             {
-            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_drafts"));
+            mFolderLabel->setHeading(hbTrId("txt_mail_subhead_drafts"));
             }
             break;
         case NmFolderSent:
             {
-            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_sent_items"));
+            mFolderLabel->setHeading(hbTrId("txt_mail_subhead_sent_items"));
             }
             break;
         case NmFolderDeleted:
             {
-            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_deleted_items"));
+            mFolderLabel->setHeading(hbTrId("txt_mail_subhead_deleted_items"));
             }
             break;
         case NmFolderInbox:
         default:
             {
-            mFolderLabel->setPlainText(hbTrId("txt_mail_subhead_inbox"));
+            mFolderLabel->setHeading(hbTrId("txt_mail_subhead_inbox"));
             }
             break;
         }
     }
 }
 
+
 /*!
-    Observe items added
+    Handles the addition of a new item. Makes sure the message list widget is
+    visible and keeps the scroll position on the top of the list.
+
+    \param parent Not used.
+    \param start 
+    \param end Not used.
 */
 void NmMessageListView::itemsAdded(const QModelIndex &parent, int start, int end)
 {
-    NMLOG("nmailui: NmMessageListView::itemsAdded");
+    NM_FUNCTION;
+
     Q_UNUSED(parent);
     Q_UNUSED(end);
+
+    // If "no messages" label is shown, hide it and display the message list
+    // widget.
     if (mNoMessagesLabel && mNoMessagesLabel->isVisible()) {
         mNoMessagesLabel->hide();
         mMessageListWidget->show();
     }
-    if (0 == start && mMessageListWidget) {
+
+    // Make sure the top of the list is kept visible by scrolling back to the
+    // top if necessary.
+    if (start == 0 && mMessageListWidget) {
         QList<HbAbstractViewItem*> items = mMessageListWidget->visibleItems();
+
         if (items.count()) {
             QModelIndex index = items.at(0)->modelIndex();
-            if (1 == index.row()) {
-                QModelIndex previous = mMessageListWidget->modelIterator()->previousIndex(index);
+
+            while (index.row() > 0) {
+                QModelIndex previous =
+                    mMessageListWidget->modelIterator()->previousIndex(index);
+
                 if (previous.isValid()) {
                     mMessageListWidget->scrollTo(previous);
                 }
+
+                index = previous;
             }
         }
     }
 }
 
+
 /*!
     Observe items removed
 */
 void NmMessageListView::itemsRemoved()
 {
-    if (mNoMessagesLabel && mMessageListModel.rowCount() == 0){
+    NM_FUNCTION;
+
+    if (mMessageListModel && mMessageListModel->rowCount() == 0){
         showNoMessagesText();
     }
 }
@@ -656,8 +769,24 @@
 */
 void NmMessageListView::showNoMessagesText()
 {
-    if (mNoMessagesLabel) {
+    NM_FUNCTION;
+
+    if (mNoMessagesLabel&&mMessageListWidget) {
         mMessageListWidget->hide();
         mNoMessagesLabel->show();
     }
 }
+
+/*!
+    Hide "(no messages)" text at the middle of the screen.
+*/
+void NmMessageListView::hideNoMessagesText()
+{
+    NM_FUNCTION;
+
+    if (mNoMessagesLabel&&mMessageListWidget) {
+        mNoMessagesLabel->hide();
+        mMessageListWidget->show();
+    }
+}
+
--- a/emailuis/nmailui/src/nmmessagelistviewitem.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmmessagelistviewitem.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -21,7 +21,7 @@
     \brief list view item for message list view
 */
 
-static const qreal NmItemLineOpacity = 0.4;
+static const int NmFolderTypeRole = Qt::UserRole+1; 
 
 /*!
     Constructor
@@ -39,6 +39,7 @@
     mSecondarySize(0),
     mTinySize(0)    
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -46,13 +47,15 @@
 */
 NmMessageListViewItem::~NmMessageListViewItem()
 {
-
+    NM_FUNCTION;
 }
 
 /*!
 */
 HbTreeViewItem *NmMessageListViewItem::createItem()
 {
+    NM_FUNCTION;
+    
     return new NmMessageListViewItem(*this);
 }
 
@@ -62,6 +65,8 @@
 */
 bool NmMessageListViewItem::canSetModelIndex(const QModelIndex &index) const
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(index);
     // This item class can handle all items in message list
     return true;
@@ -73,6 +78,8 @@
 */
 void NmMessageListViewItem::updateChildItems()
 {
+    NM_FUNCTION;
+    
     // Get model pointer
     NmMessageListModelItem *msgModelItem = modelIndex().data(
             Qt::DisplayRole).value<NmMessageListModelItem*>();
@@ -97,6 +104,8 @@
 */
 void NmMessageListViewItem::createMessageItemLayout()
 { 
+    NM_FUNCTION;
+    
     getFontSizes();
     // Create sender label and set name from widgetml
     if (!mSender){
@@ -146,14 +155,11 @@
 void NmMessageListViewItem::setContentsToMessageItem(const NmMessageEnvelope &envelope, 
                                                      bool dividersActive)
 {
+    NM_FUNCTION;
+    
     // member variables are created in previous function
     // sender
-    QString displayName = envelope.sender().displayName();
-    if (displayName.length()) {
-        mSender->setText(NmUtilities::cleanupDisplayName(displayName));
-    } else {
-        mSender->setText(envelope.sender().address());            
-    }
+    mSender->setText(senderFieldText(envelope));
     // time
     HbExtendedLocale locale = HbExtendedLocale::system();
     QDate sentLocalDate = envelope.sentTime().toLocalTime().date();
@@ -236,27 +242,44 @@
     const QStyleOptionGraphicsItem *option,
     QWidget *widget)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(option);
     Q_UNUSED(widget);
     Q_UNUSED(painter);
 }
 
+/*!
+    setFontsUnread
+*/
 void  NmMessageListViewItem::setFontsUnread()
 {    
+    NM_FUNCTION;
+    
     static QColor colorRole = HbColorScheme::color("qtc_list_item_title_normal");
     HbFontSpec spekki(HbFontSpec::Primary);
     setFonts(colorRole, spekki);
 }
 
+/*!
+    setFontsRead
+*/
 void  NmMessageListViewItem::setFontsRead()
 {
+    NM_FUNCTION;
+    
     static QColor colorRole = HbColorScheme::color("qtc_list_item_content_normal");
     HbFontSpec spekki(HbFontSpec::Secondary);
     setFonts(colorRole, spekki);
 }
 
+/*!
+    getFontSizes.
+*/
 void  NmMessageListViewItem::getFontSizes()
 {
+    NM_FUNCTION;
+    
     // Get font sizes from style  
     qreal currentSize;
     HbStyle mystyle;
@@ -274,9 +297,14 @@
     } 
 }
 
+/*!
+    setFonts.
+*/
 void  NmMessageListViewItem::setFonts(const QColor &colorRole, 
         HbFontSpec &spekki)
 {
+    NM_FUNCTION;
+    
     // Change sizes explicitly since css is overwritten in polish now.    
     if (mSender && mSubject && mTime) {
         
@@ -300,3 +328,61 @@
     }
 }
 
+/*!
+    senderFieldText. Function returns sender field text from
+    envelope based on currently used function
+*/
+QString NmMessageListViewItem::senderFieldText(const NmMessageEnvelope &envelope)
+{
+    NM_FUNCTION;
+    
+    QString ret;  
+    QVariant folderType = modelIndex().data(
+            NmFolderTypeRole).value<QVariant>();
+    switch (folderType.toInt()) {
+        // Outbox, drafts and sent folder, sender name is 
+        // replaced with first recipient from to/cc list
+        case NmFolderOutbox:
+        case NmFolderDrafts:
+        case NmFolderSent:
+        {
+            QList<NmAddress>& toRecipients = envelope.toRecipients();
+            QList<NmAddress>& ccRecipients = envelope.ccRecipients();
+            NmAddress addressToUse;
+            bool foundAddress(false);
+            if (toRecipients.count()){
+                addressToUse=toRecipients[0];
+                foundAddress=true;
+            }
+            else if (ccRecipients.count()) {
+                addressToUse=ccRecipients[0]; 
+                foundAddress=true;         
+            }
+            if (foundAddress){
+                QString displayName = addressToUse.displayName();
+                if (displayName.length()) {
+                    ret += NmUtilities::cleanupDisplayName(displayName);
+                } 
+                else {
+                    ret += addressToUse.address();                    
+                }               
+            }
+            
+        }
+        break;    
+        // All other folders will show sender display name
+        default: 
+        {
+            QString displayName = envelope.sender().displayName();
+            if (displayName.length()) {
+                ret += NmUtilities::cleanupDisplayName(displayName);
+            } 
+            else {
+                ret += envelope.sender().address();                    
+            }
+        }
+        break;
+    }
+    return ret;
+}
+
--- a/emailuis/nmailui/src/nmmessagesearchlistview.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmmessagesearchlistview.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -19,7 +19,7 @@
 static const char *NMUI_MESSAGE_SEARCH_LIST_VIEW = "NmMessageListView";
 static const char *NMUI_MESSAGE_SEARCH_LIST_TREE_LIST = "MessageTreeList";
 static const char *NMUI_MESSAGE_SEARCH_LIST_NO_MESSAGES = "MessageListNoMessages";
-static const char *NMUI_MESSAGE_SEARCH_LIST_INFO_LABEL = "InfoLabel";
+static const char *NMUI_MESSAGE_SEARCH_LIST_INFO_LABEL = "LabelGroupBox";
 static const char *NMUI_MESSAGE_SEARCH_LIST_LINE_EDIT = "LineEdit";
 static const char *NMUI_MESSAGE_SEARCH_LIST_PUSH_BUTTON = "PushButton";
 
@@ -40,24 +40,26 @@
     NmApplication &application,
     NmUiStartParam* startParam,
     NmUiEngine &uiEngine,
-    NmMessageSearchListModel &searchListModel,
+    NmMessageListModel &msgListModel,
     HbDocumentLoader *documentLoader,
     QGraphicsItem *parent)
-: NmBaseView(startParam, parent),
+: NmBaseView(startParam, application, parent),
   mApplication(application),
   mUiEngine(uiEngine),
-  mSearchListModel(searchListModel),
+  mMsgListModel(msgListModel),
   mDocumentLoader(documentLoader),
   mItemContextMenu(NULL),
   mMessageListWidget(NULL),
+  mInfoLabel(NULL),
   mNoMessagesLabel(NULL),
-  mInfoLabel(NULL),
   mLineEdit(NULL),
   mPushButton(NULL),
   mLongPressedItem(NULL),
   mViewReady(false),
   mSearchInProgress(false)
 {
+    NM_FUNCTION;
+    
     loadViewLayout();
     initTreeView();
 }
@@ -68,6 +70,8 @@
 */
 NmMessageSearchListView::~NmMessageSearchListView()
 {
+    NM_FUNCTION;
+    
     delete mDocumentLoader;
 
     mWidgetList.clear();
@@ -89,6 +93,8 @@
 */
 NmUiViewId NmMessageSearchListView::nmailViewId() const
 {
+    NM_FUNCTION;
+    
     return NmUiViewMessageSearchList;
 }
 
@@ -100,6 +106,8 @@
 */
 void NmMessageSearchListView::viewReady()
 {
+    NM_FUNCTION;
+    
     if (!mViewReady){
         // Set the mailbox name to the title pane.
         setViewTitle();
@@ -125,6 +133,8 @@
 */
 void NmMessageSearchListView::handleActionCommand(NmActionResponse &actionResponse)
 {
+    NM_FUNCTION;
+    
     // Handle options menu commands here.
     if (actionResponse.menuType() == NmActionOptionsMenu) {
         switch (actionResponse.responseCommand()) {
@@ -133,7 +143,7 @@
                 break;
             }
             case NmActionResponseCommandMailboxDeleted: {
-                mApplication.popView();
+                mApplication.prepareForPopView();
                 break;
             }
             default: {
@@ -141,6 +151,17 @@
             }
         }
     }
+    // Handle context menu commands here.
+    if (actionResponse.menuType() == NmActionContextMenu) {
+        if (mLongPressedItem){
+            NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
+                mStartParam->mailboxId(), mLongPressedItem->envelope().folderId(),
+                mLongPressedItem->envelope().messageId());
+
+            mApplication.enterNmUiView(startParam);
+            mLongPressedItem = NULL;
+       }
+    }
 }
 
 
@@ -151,6 +172,8 @@
 */
 void NmMessageSearchListView::loadViewLayout()
 {
+    NM_FUNCTION;
+    
     // Use the document loader to load the view layout.
     bool ok(false);
     setObjectName(QString(NMUI_MESSAGE_SEARCH_LIST_VIEW));
@@ -170,36 +193,41 @@
             mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_TREE_LIST));
 
         if (mMessageListWidget) {
-            NMLOG("NmMessageSearchListView: Message list widget loaded.");
+            NM_COMMENT("NmMessageSearchListView: message list widget loaded");
 
             // Set the item prototype.
             mMessageListWidget->setItemPrototype(new NmMessageListViewItem());
+
+            // Set the list widget properties.
             mMessageListWidget->setItemRecycling(true);
             mMessageListWidget->contentWidget()->setProperty("indentation", 0);
             mMessageListWidget->setScrollDirections(Qt::Vertical);
             mMessageListWidget->setClampingStyle(HbScrollArea::BounceBackClamping);
             mMessageListWidget->setFrictionEnabled(true);
+
+            // We want the search results to appear one by one.
+            mMessageListWidget->setEnabledAnimations(HbAbstractItemView::Appear &
+                                                     HbAbstractItemView::Expand);
         }
 
-        // Load the "no messages" label.
+        // Load the info label.
+        mInfoLabel = qobject_cast<HbGroupBox *>(
+            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_INFO_LABEL));
+
+        if (mInfoLabel) {
+            NM_COMMENT("NmMessageSearchListView: info label loaded");
+            mInfoLabel->hide();
+        }
+
+        // Load the no messages label.
         mNoMessagesLabel = qobject_cast<HbLabel *>(
             mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_NO_MESSAGES));
 
         if (mNoMessagesLabel) {
-            NMLOG("NmMessageSearchListView: \"No messages\" label loaded.");
+            NMLOG("NmMessageSearchListView: No messages label loaded.");
             mNoMessagesLabel->hide();
         }
 
-        // Load the info label.
-        mInfoLabel = qobject_cast<HbLabel *>(
-            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_INFO_LABEL));
-
-        if (mInfoLabel) {
-            NMLOG("NmMessageSearchListView: Info label loaded.");
-            mInfoLabel->setPlainText(hbTrId("txt_mail_subhead_inbox"));
-            mInfoLabel->hide();
-        }
-
         // Load the search panel.
         mLineEdit = qobject_cast<HbLineEdit *>(
             mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_LINE_EDIT));
@@ -219,7 +247,7 @@
         }
     }
     else {
-        NMLOG("NmMessageSearchListView: Failed to load widgets from XML!");
+        NM_ERROR(1, "NmMessageSearchListView: failed to load widgets from XML");
     }
 }
 
@@ -229,6 +257,8 @@
 */
 void NmMessageSearchListView::initTreeView()
 {
+    NM_FUNCTION;
+    
     // Get the mailbox widget pointer and set the parameters.
     if (mMessageListWidget) {
         connect(mMessageListWidget, SIGNAL(activated(const QModelIndex &)),
@@ -242,7 +272,7 @@
     }
 
     // Clear the previous content if any.
-    mSearchListModel.clearSearchResults();
+    mMsgListModel.clear();
 }
 
 
@@ -251,6 +281,8 @@
 */
 void NmMessageSearchListView::setViewTitle()
 {
+    NM_FUNCTION;
+    
     if (mStartParam){
         NmMailboxMetaData *meta = mUiEngine.mailboxById(mStartParam->mailboxId());
 
@@ -270,6 +302,8 @@
 */
 void NmMessageSearchListView::noMessagesLabelVisibility(bool visible)
 {
+    NM_FUNCTION;
+    
     if (visible) {
         // Hide the message list widget and display the "no messages" label.
         if (mMessageListWidget) {
@@ -294,12 +328,50 @@
 
 
 /*!
+    Updates the search result count information. If the message list does not
+    contain any items, a "no messages" label is displayed. Otherwise the result
+    count in the information label is updated according to the number of
+    messages in the list.
+*/
+void NmMessageSearchListView::updateSearchResultCountInfo()
+{
+    NM_FUNCTION;
+
+    const int resultCount = mMsgListModel.rowCount();
+
+    if (resultCount) {
+        if (mInfoLabel) {
+            // Display the result count on the info label.
+            QString resultsString(hbTrId("txt_mail_list_search_results").arg(resultCount));
+            mInfoLabel->setHeading(resultsString);
+
+            if (!mInfoLabel->isVisible()) {
+                mInfoLabel->show();
+            }
+        }
+    }
+    else {
+        // No search results!
+        if (mInfoLabel && mInfoLabel->isVisible()) {
+            mInfoLabel->hide();
+        }
+
+        // Display the "no messages" label and highlight the search term.
+        noMessagesLabelVisibility(true);
+    }
+    
+}
+
+
+/*!
     Sets the mode for the search input.
 
     \param mode The mode to set.
 */
 void NmMessageSearchListView::setSearchInputMode(NmSearchInputMode mode)
 {
+    NM_FUNCTION;
+    
     if (!mLineEdit) {
         // No line edit widget!
         return;
@@ -332,10 +404,9 @@
 */
 void NmMessageSearchListView::reloadViewContents(NmUiStartParam *startParam)
 {
-    // Check the start parameter's validity; message view cannot be updated if
-    // the given parameter is zero.
-    if (startParam&&startParam->viewId() == NmUiViewMessageSearchList &&
-        startParam->folderId() != 0) {
+    NM_FUNCTION;
+    
+    if (startParam && startParam->viewId() == NmUiViewMessageSearchList) {
         // Delete the existing start parameter data.
         delete mStartParam;
         mStartParam = NULL;
@@ -344,10 +415,7 @@
         mStartParam = startParam;
 
         // Update the model with new parameters.
-        NmMessageListModel &messageListModel =
-            mUiEngine.messageListModel(startParam->mailboxId(),
-                                       startParam->folderId());
-        mSearchListModel.setSourceModel(&messageListModel);
+        mUiEngine.messageListModelForSearch(startParam->mailboxId());
         refreshList();
 
         // Refresh the mailbox name.
@@ -356,26 +424,52 @@
     else {
         // Invalid start parameter data! Unused start parameter needs to be
         // deleted.
-        NMLOG("NmMessageSearchListView: Invalid message list start parameter!");
+        NM_ERROR(1, "NmMessageSearchListView: invalid message list start parameter");
         delete startParam;
     }
 }
 
 
 /*!
+    Called when text is changed in the edit field. If there is no search term
+    in the edit field, the search button is dimmed and disabled. If the field
+    contains text, the button can be clicked.
+    
+    \param text The text in the field after the modification.
+*/
+void NmMessageSearchListView::criteriaChanged(QString text) 
+{
+    NM_FUNCTION;
+    NM_COMMENT(QString("NmMessageSearchListView::criteriaChanged %1").arg(text));
+    
+    // Check if the button should be disabled/enabled.
+    bool enabled = mPushButton->isEnabled();
+
+    if (!enabled && !text.isEmpty()) {
+        mPushButton->setEnabled(true);
+    }
+    else if (enabled && text.isEmpty()) {
+        mPushButton->setEnabled(false);
+    }
+}
+
+
+/*!
     Displays the item context menu. This method gets called if an item on the
     list is long pressed.
 */
 void NmMessageSearchListView::showItemContextMenu(
     HbAbstractViewItem *listViewItem, const QPointF &coords)
 {
+    NM_FUNCTION;
+    
     // Store long press item for later use with response.
     mLongPressedItem = 
-        mSearchListModel.data(listViewItem->modelIndex(),
-                              Qt::DisplayRole).value<NmMessageListModelItem*>();
+        mMsgListModel.data(listViewItem->modelIndex(),
+                           Qt::DisplayRole).value<NmMessageListModelItem*>();
 
-    if (mItemContextMenu && mLongPressedItem && mLongPressedItem->itemType() ==
-        NmMessageListModelItem::NmMessageItemMessage) {
+    if (mItemContextMenu && mLongPressedItem &&
+        mLongPressedItem->itemType() == NmMessageListModelItem::NmMessageItemMessage) {
         // Clear the previous menu actions.
         mItemContextMenu->clearActions();
         NmUiExtensionManager &extMngr = mApplication.extManager();
@@ -385,16 +479,10 @@
         NmMessageEnvelope *envelope = mLongPressedItem->envelopePtr();
 
         if (envelope){
-            NmActionRequest request(this, NmActionContextMenu, NmActionContextViewMessageList,
-                NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
-                envelope->messageId(),QVariant::fromValue(envelope));
-
-            extMngr.getActions(request, list);
-        }
-        else{
-            NmActionRequest request(this, NmActionContextMenu, NmActionContextViewMessageList,
-                NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
-                envelope->messageId());
+            NmActionRequest request(this, NmActionContextMenu,
+                NmActionContextViewMessageSearchList, NmActionContextDataMessage,
+                mStartParam->mailboxId(), envelope->folderId(),
+                envelope->messageId(), QVariant::fromValue(envelope));
 
             extMngr.getActions(request, list);
         }
@@ -402,37 +490,12 @@
         for (int i(0); i < list.count(); ++i) {
             mItemContextMenu->addAction(list[i]);
         }
+
         mItemContextMenu->setPreferredPos(coords);
-        mItemContextMenu->open(this, SLOT(contextButton(NmActionResponse&)));
+        mItemContextMenu->open();
     }
 }
 
-/*!
-    Slot. Signaled when menu option is selected
-*/
-void NmMessageSearchListView::contextButton(NmActionResponse &result)
-{
-// Handle context menu commands here.
-    if (result.menuType() == NmActionContextMenu){
-        switch (result.responseCommand()) {
-           case NmActionResponseCommandOpen: {
-               if (mLongPressedItem){
-                   NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
-                       mStartParam->mailboxId(), mStartParam->folderId(),
-                       mLongPressedItem->envelope().messageId());
-
-                   mApplication.enterNmUiView(startParam);
-                   mLongPressedItem = NULL;
-               }
-
-               break;
-           }
-           default: {
-               break;
-           }
-        }
-    }
-}
 
 /*!
     Stores the given index and forwards the call to handleSelection(). This
@@ -442,36 +505,22 @@
 */
 void NmMessageSearchListView::itemActivated(const QModelIndex &index)
 {
+    NM_FUNCTION;
+    
     mActivatedIndex = index;
     QMetaObject::invokeMethod(this, "handleSelection", Qt::QueuedConnection);
 }
 
-/*!
-    Called when text is changed in the edit field
-    
-    \param text new text entered in the field
- */
-void NmMessageSearchListView::criteriaChanged(QString text) 
-{
-    NMLOG(QString("NmMessageSearchListView::criteriaChanged %1").arg(text));
-    
-    // Check when button should be disabled/enabled
-    bool enabled = mPushButton->isEnabled();
-    if (!enabled && !text.isEmpty()) {
-		mPushButton->setEnabled(true);
-    }
-    else if (enabled && text.isEmpty()) {
-		mPushButton->setEnabled(false);
-    }
-}
 
 /*!
     If the selected item is a message, will open the message.
 */
 void NmMessageSearchListView::handleSelection()
 {
+    NM_FUNCTION;
+    
     // Do expand/collapse for title divider items
-    NmMessageListModelItem* modelItem = mSearchListModel.data(
+    NmMessageListModelItem* modelItem = mMsgListModel.data(
         mActivatedIndex, Qt::DisplayRole).value<NmMessageListModelItem*>();
 
     if (modelItem &&
@@ -484,7 +533,7 @@
 
         // Open the message.
         NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageViewer,
-            mStartParam->mailboxId(), mStartParam->folderId(),
+            mStartParam->mailboxId(), modelItem->envelope().folderId(),
             modelItem->envelope().messageId());
 
         mApplication.enterNmUiView(startParam);
@@ -498,13 +547,19 @@
 */
 void NmMessageSearchListView::itemsAdded(const QModelIndex &parent, int start, int end)
 {
-    NMLOG("nmailui: NmMessageSearchListView::itemsAdded()");
-
+    NM_FUNCTION;
+    
     Q_UNUSED(parent);
     Q_UNUSED(end);
 
-    // Display the message list widget if not visible.
-    noMessagesLabelVisibility(false);
+    // The search is an asynchronous operation. If a user stops the search, it
+    // might take a short while before the search is actually stopped and during
+    // this time it is possible that messages matching the search are added.
+    // Therefore, update the result count info if items are added after the
+    // search has been stopped by the user.
+    if (!mSearchInProgress) {
+        updateSearchResultCountInfo();
+    }
 
     if (!start && mMessageListWidget) {
         QList<HbAbstractViewItem*> items = mMessageListWidget->visibleItems();
@@ -512,12 +567,15 @@
         if (items.count()) {
             QModelIndex index = items.at(0)->modelIndex();
 
-            if (1 == index.row()) {
-                QModelIndex previous = mMessageListWidget->modelIterator()->previousIndex(index);
+            while (index.row() > 0) {
+                QModelIndex previous =
+                    mMessageListWidget->modelIterator()->previousIndex(index);
 
                 if (previous.isValid()) {
                     mMessageListWidget->scrollTo(previous);
                 }
+
+                index = previous;
             }
         }
     }
@@ -525,13 +583,16 @@
 
 
 /*!
-    This method gets called when an item is removed from the list. If the list
-    contains no items, "no messages" label is displayed.
+    This method gets called when an item is removed from the list. If the
+    search has completed (or stopped), the search result count information is
+    updated according to the number of messages in the list.
 */
 void NmMessageSearchListView::itemsRemoved()
 {
-    if (mSearchListModel.searchResultCount() == 0) {
-        noMessagesLabelVisibility(true);
+    NM_FUNCTION;
+    
+    if (!mSearchInProgress) {
+        updateSearchResultCountInfo();
     }
 }
 
@@ -541,23 +602,21 @@
 */
 void NmMessageSearchListView::refreshList()
 {
+    NM_FUNCTION;
+    
     if (mMessageListWidget) {
         // Set the model.
-        NmMessageListModel &messageListModel =
-            mUiEngine.messageListModel(mStartParam->mailboxId(),
-                                       mStartParam->folderId());
-        mSearchListModel.setSourceModel(&messageListModel);
         mMessageListWidget->setModel(
-            static_cast<QSortFilterProxyModel*>(&mSearchListModel));
+            static_cast<QStandardItemModel*>(&mMsgListModel));
 
         // Connect the signals.
-        connect(&mSearchListModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)),
+        connect(&mMsgListModel, SIGNAL(rowsInserted(const QModelIndex&, int, int)),
                 this, SLOT(itemsAdded(const QModelIndex&, int, int)), Qt::UniqueConnection);
 
-        connect(&mSearchListModel, SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
+        connect(&mMsgListModel, SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
                 this, SLOT(itemsRemoved()), Qt::UniqueConnection);
 
-        connect(&messageListModel, SIGNAL(setNewParam(NmUiStartParam*)),
+        connect(&mMsgListModel, SIGNAL(setNewParam(NmUiStartParam*)),
                 this, SLOT(reloadViewContents(NmUiStartParam*)), Qt::UniqueConnection);
 
     }
@@ -575,6 +634,8 @@
 */
 void NmMessageSearchListView::toggleSearch()
 {
+    NM_FUNCTION;
+    
     if (mSearchInProgress) {
         // Search is in progress - do cancel.
         mUiEngine.cancelSearch(mStartParam->mailboxId());
@@ -585,7 +646,7 @@
         mSearchInProgress = true;
     
         // Clear previous results if any.
-        mSearchListModel.clearSearchResults();
+        mMsgListModel.clear();
 
         connect(&mUiEngine, SIGNAL(searchComplete()),
                 this, SLOT(handleSearchComplete()), Qt::UniqueConnection);
@@ -605,7 +666,7 @@
 
         // Display the info label.
         if (mInfoLabel) {
-            mInfoLabel->setPlainText(hbTrId("txt_mail_list_searching"));
+            mInfoLabel->setHeading(hbTrId("txt_mail_list_searching"));
             mInfoLabel->show();
         }
 
@@ -624,7 +685,8 @@
 */
 void NmMessageSearchListView::handleSearchComplete()
 {
-    NMLOG("NmMessageSearchListView::handleSearchComplete()");
+    NM_FUNCTION;
+    
     mSearchInProgress = false;
     
     // Change the push button text.
@@ -632,38 +694,17 @@
         mPushButton->setIcon(HbIcon("qtg_mono_search"));
     }
 
-    const int resultCount = mSearchListModel.searchResultCount();
+    // Display the search result count.
+    updateSearchResultCountInfo();
 
-    if (resultCount == 1) {
-        // For some reason when the result count is only 1, the search list
-        // will not display the found message. Until the underlying reason for
-        // this bug is found, let us use the following solution to fix this
-        // issue.
-        refreshList();
-    }
+    const int resultCount = mMsgListModel.rowCount();
 
     if (resultCount) {
-        if (mInfoLabel) {
-            // Display the result count on the info label.
-            QString resultsString(hbTrId("txt_mail_list_search_results"));
-            resultsString.arg(resultCount);
-            mInfoLabel->setPlainText(resultsString);
-
-            if (!mInfoLabel->isVisible()) {
-                mInfoLabel->show();
-            }
-        }
-
         // Undim the search input.
         setSearchInputMode(NmNormalMode);
     }
     else {
-        // No search results!
-        if (mInfoLabel && mInfoLabel->isVisible()) {
-            mInfoLabel->hide();
-        }
-
-        // Display the "no messags" label and highlight the search term.
+        // Highlight the search field.
         noMessagesLabelVisibility(true);
         setSearchInputMode(NmHighlightedMode);
     }
--- a/emailuis/nmailui/src/nmrecipientfield.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmrecipientfield.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -17,87 +17,52 @@
 
 #include "nmuiheaders.h"
 
-static const double Un = 6.66;
-static const double Margin = 2 * Un;
+static const QString ContactsServiceName = "com.nokia.services.phonebookservices";
+static const QString ContactsInterfaceName = "Fetch";
+static const QString ContactsOperationName = "fetch(QString,QString,QString)";
+
 static const int MaxRows = 10000;
-static const double LabelFieldWidth = 10 * Un + Un;
-static const double ButtonWidth = 9.5 * Un;
-static const double FieldHeight = 5 * Un;
-static const char *ContactsServiceName = "com.nokia.services.phonebookservices";
-static const char *ContactsInterfaceName = "Fetch";
-static const char *ContactsOperationName = "fetch(QString,QString,QString)";
 
 /*!
-   Constructor
+   widget is created using AD/docml
 */
 NmRecipientField::NmRecipientField(
-    HbLabel *label,
-    NmRecipientLineEdit *edit,
-    HbPushButton *button,
-    QGraphicsItem *parent):
-    HbWidget(parent),
-    mLabel(label),
-    mRecipientsEditor(edit),
-    mLaunchContactsPickerButton(button),
-    mOwned(false)
-{
-    mLaunchContactsPickerButton->setIcon(NmIcons::getIcon(NmIcons::NmIconContacts));
-    createConnections();
-}
-
-
-/*!
-   Constructor for 'Cc:' and 'Bcc:' fields. This can be removed when groupBox content
-   widget is created using AD/docml
-*/
-NmRecipientField::NmRecipientField(const QString &labelString, QGraphicsItem *parent):
-    HbWidget(parent),
+        QObject *parent, HbDocumentLoader &docLoader, const QString &objPrefix):
+    QObject(parent),
+    mDocumentLoader(docLoader),
+    mObjectPrefix(objPrefix),
     mLabel(NULL),
     mRecipientsEditor(NULL),
-    mLaunchContactsPickerButton(NULL),
-    mOwned(true)
+    mLaunchContactsPickerButton(NULL)
 {
-    mLayoutHorizontal = new QGraphicsLinearLayout(Qt::Horizontal, this);
-
-    mLabel = new HbLabel(labelString);
-    if (mLabel) {
-        mLayoutHorizontal->addItem(mLabel);
-        mLabel->setPreferredWidth(LabelFieldWidth);
-        mLabel->setFontSpec(HbFontSpec(HbFontSpec::Secondary));
-        mLabel->setAlignment(Qt::AlignTop);
-    }
+    NM_FUNCTION;
+    
+    // Load the widgets from nmeditorview.docml. The names match to the definitions in that docml.
+    mWidget = qobject_cast<HbWidget *>
+        (mDocumentLoader.findWidget(mObjectPrefix + "Field"));
 
-    mRecipientsEditor = new NmRecipientLineEdit();
-    if (mRecipientsEditor) {
-    	mLayoutHorizontal->addItem(mRecipientsEditor);
-        mRecipientsEditor->setMaxRows(MaxRows);
-        mRecipientsEditor->setPreferredHeight(FieldHeight);
-        mRecipientsEditor->setMinimumHeight(FieldHeight);
-        mRecipientsEditor->setFontSpec(HbFontSpec(HbFontSpec::Secondary));
-    }
+    mLabel = qobject_cast<HbLabel *>
+        (mDocumentLoader.findWidget(mObjectPrefix + "Label"));
 
-    mLaunchContactsPickerButton = new HbPushButton();
-    if (mLaunchContactsPickerButton) {
-    	mLayoutHorizontal->addItem(mLaunchContactsPickerButton);
-    	mLayoutHorizontal->setAlignment(mLaunchContactsPickerButton, Qt::AlignTop);
-        mLaunchContactsPickerButton->setPreferredHeight(FieldHeight);
-        mLaunchContactsPickerButton->setPreferredWidth(ButtonWidth);
-        mLaunchContactsPickerButton->setMaximumHeight(FieldHeight);
+    mRecipientsEditor = qobject_cast<NmRecipientLineEdit *>
+        (mDocumentLoader.findWidget(mObjectPrefix + "Edit"));
+    mRecipientsEditor->setMaxRows(MaxRows);
 
-        mLaunchContactsPickerButton->setIcon(NmIcons::getIcon(NmIcons::NmIconContacts));
-    }
+    mLaunchContactsPickerButton = qobject_cast<HbPushButton *>
+        (mDocumentLoader.findWidget(mObjectPrefix + "Button"));
 
-    mLayoutHorizontal->setContentsMargins(0, 0, 0, 0);
-    // Set the spacing between the line edit  and the Add button to
-    mLayoutHorizontal->setItemSpacing(1, Un);
-    // Set the spacing between the label and the line edit to 0.0
-    mLayoutHorizontal->setItemSpacing(0, 0.0);
+    mLaunchContactsPickerButton->setIcon(NmIcons::getIcon(NmIcons::NmIconContacts));
 
     createConnections();
 }
 
+/*!
+   Creates connections for this class items
+*/
 void NmRecipientField::createConnections()
 {
+    NM_FUNCTION;
+    
     connect(mRecipientsEditor, SIGNAL(textChanged(const QString &)),
         this, SIGNAL(textChanged(const QString &)));
     connect(mRecipientsEditor, SIGNAL(cursorPositionChanged(int, int)),
@@ -120,21 +85,7 @@
 */
 NmRecipientField::~NmRecipientField()
 {
-    if (mOwned)
-    {
-        if (mLaunchContactsPickerButton) {
-            delete mLaunchContactsPickerButton;
-            mLaunchContactsPickerButton = 0;
-        }
-        if (mRecipientsEditor) {
-            delete mRecipientsEditor;
-            mRecipientsEditor = 0;
-        }
-        if (mLabel) {
-            delete mLabel;
-            mLabel = 0;
-        }
-    }
+    NM_FUNCTION;
 }
 
 /*!
@@ -142,7 +93,9 @@
 */
 qreal NmRecipientField::height()
 {
-    return mRecipientsEditor->geometry().height() + Margin;
+    NM_FUNCTION;
+    
+    return mWidget->geometry().height();
 }
 
 /*!
@@ -150,6 +103,8 @@
 */
 NmRecipientLineEdit *NmRecipientField::editor() const
 {
+    NM_FUNCTION;
+    
     return mRecipientsEditor;
 }
 
@@ -159,6 +114,8 @@
 */
 const QString NmRecipientField::text() const
 {
+    NM_FUNCTION;
+    
     return mRecipientsEditor->text();
 }
 
@@ -168,6 +125,8 @@
 */
 void NmRecipientField::setText(const QString &newText)
 {
+    NM_FUNCTION;
+    
     if (newText != mRecipientsEditor->text()) {
         mRecipientsEditor->setText(newText);
         emit textChanged(newText);
@@ -181,6 +140,8 @@
 */
 void NmRecipientField::launchContactsPicker()
 {
+    NM_FUNCTION;
+    
     XQApplicationManager mAppmgr;
     XQAiwRequest *launchContactsPickerRequest;
     
@@ -194,14 +155,20 @@
     }
     else {
         // Failed creating request 
-        NMLOG("XQApplicationManager: failed creating fecth contactspicker request.");
+        NM_ERROR(1,"XQApplicationManager: failed creating fecth contactspicker request");
 	    return;
     }
 
+    QVariantList args; 
+    args << "Non-filtered multi-fetch";
+    args << KCntActionAll; 
+    args << KCntFilterDisplayAll; 
+    launchContactsPickerRequest->setArguments(args); 
+    
     // Send request
     if (!launchContactsPickerRequest->send()) {
        //Failed sending request 
-       NMLOG("XQApplicationManager: failed sending request.");
+       NM_ERROR(1,"XQApplicationManager: failed sending request");
     }
         
     delete launchContactsPickerRequest;
--- a/emailuis/nmailui/src/nmsendserviceinterface.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmsendserviceinterface.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -38,6 +38,7 @@
       mAttachmentList(0),
       mEditorStartMode(NmUiEditorCreateNew)
     {
+        NM_FUNCTION;
     }
 
     /*!
@@ -45,6 +46,7 @@
     */
     inline ~NmStartParamDataHelper()
     {
+        NM_FUNCTION;
     }
 
     /*!
@@ -54,36 +56,24 @@
     */
     inline bool extractData(const QVariant &data)
     {
-        QVariant::Type dataType = data.type();
+        NM_FUNCTION;
+        
         bool success = false;
 
-        switch (dataType) {
-            case QVariant::String: {
-                // The given data contains a single attachment.
-                QString attachment = data.toString();
-                mAttachmentList = new QStringList(attachment);
-                success = true;
-                break;
-            }
-            case QVariant::StringList: {
-                // The given data contains a list of attachments.
-                QStringList attachmentList = data.toStringList();
-                mAttachmentList = new QStringList(attachmentList);
-                success = true;
-                break;
-            }
-            case QVariant::Map: {
-                // The given data may contain a mail subject and recipient lists.
-                QMap<QString, QVariant> map = data.toMap();
-                success = processMap(map);
-                break;
-            }
-            default: {
-                // Data type not supported!
-                NMLOG("NmStartParamDataHelper::extractData(): Data type not supported!");
-                break;
-            }
-        } // switch ()
+        if (data.canConvert(QVariant::Map)) {
+            // The given data may contain a mail subject and recipient lists.
+            QMap<QString, QVariant> map = data.toMap();
+            success = processMap(map);
+        }
+        else if (data.canConvert(QVariant::StringList)) {
+            QStringList attachmentList = data.toStringList();
+            mAttachmentList = new QStringList(attachmentList);
+            success = true;
+        }
+        else {
+            // Data type not supported!
+            NM_ERROR(1,"NmStartParamDataHelper::extractData(): data type not supported");
+        }
 
         // Determine the editor start mode.
         if (mToAddresses || mCcAddresses || mBccAddresses) {
@@ -102,6 +92,8 @@
     */
     inline void deleteData()
     {
+        NM_FUNCTION;
+        
         delete mSubject;
         mSubject = 0;
 
@@ -137,6 +129,8 @@
     */
     inline bool processMap(const QMap<QString, QVariant> &map)
     {
+        NM_FUNCTION;
+        
         QMap<QString, QVariant>::const_iterator i = map.constBegin();
         QString key;
         QVariant value;
@@ -186,7 +180,8 @@
     inline void addAddressesToList(const QVariant &addresses,
                                    QList<NmAddress*> **list)
     {
-
+        NM_FUNCTION;
+        
         if (!list) {
             // Invalid argument!
             return;
@@ -277,6 +272,8 @@
 */
 NmSendServiceInterface::~NmSendServiceInterface()
 {
+    NM_FUNCTION;
+    
     delete mStartParam;
     delete mSelectionDialog;
 }
@@ -289,7 +286,8 @@
 */
 void NmSendServiceInterface::selectionDialogClosed(NmId &mailboxId)
 {
-    NMLOG("NmSendServiceInterface::selectionDialogClosed");
+    NM_FUNCTION;
+    
     if (mailboxId.id()) { // mailbox selected
         launchEditorView(mailboxId);
     }
@@ -311,9 +309,13 @@
 */
 void NmSendServiceInterface::send(QVariant data)
 {
-    NMLOG("NmSendServiceInterface::send()");
-
+    NM_FUNCTION;
+    
 #ifndef NM_WINS_ENV
+    
+    // Make sure that qmail stays background if user presses back in editorview
+    mApplication->updateVisibilityState();
+    
     HbMainWindow *mainWindow = mApplication->mainWindow();
     mCurrentView = mainWindow->currentView();
 
@@ -331,35 +333,23 @@
     NmId mailboxId(0);
 
     mAsyncReqId = setCurrentRequestAsync();
-    
+
     if (!validData) {
         // Failed to extract the data!
-        NMLOG("NmSendServiceInterface::send(): Failed to process the given data!");
+        NM_ERROR(1,"NmSendServiceInterface::send(): failed to process the given data");
         cancelService();
     }
     else if (count == 0) {
-        // No mailboxes.
-        if (mainWindow) {
-            mainWindow->hide();
-        }
-
-        // Hide the app if it not embedded
-        if (!XQServiceUtil::isEmbedded()) {
-            XQServiceUtil::toBackground(true);
-        }
-
         HbDeviceMessageBox note(hbTrId("txt_mail_dialog_no_mailboxes_defined"),
                           HbMessageBox::MessageTypeInformation);
         note.setTimeout(HbMessageBox::NoTimeout);
-        note.exec();
-        if (mainWindow) {
-            mainWindow->show();
-        }
+        note.show();
         cancelService();
     }
     else { // count > 0
         // Make sure the NMail application is in the foreground.
         XQServiceUtil::toBackground(false);
+        mainWindow->show();
 
     	mStartParam = new NmUiStartParam(
         	NmUiViewMessageEditor,
@@ -401,26 +391,30 @@
     Called when mailbox id is know and editor can be opened
     \param mailboxId mailbox using in editor
  */
-void NmSendServiceInterface::launchEditorView(NmId mailboxId) 
+void NmSendServiceInterface::launchEditorView(NmId mailboxId)
 {
-    NMLOG(QString("NmSendServiceInterface::launchEditorView %1").arg(mailboxId.id()));
+    NM_FUNCTION;
+    NM_COMMENT(QString("NmSendServiceInterface::launchEditorView(): mailboxId=%1").arg(mailboxId.id()));
+    
     // Make the previous view visible again.
     if (mCurrentView) {
         mCurrentView->show();
-        mCurrentView = NULL;        
+        mCurrentView = NULL;
     }
-    
+
     if (mStartParam) {
         mStartParam->setMailboxId(mailboxId);
         mApplication->enterNmUiView(mStartParam);
         mStartParam = NULL; // ownership passed
     }
     completeRequest(mAsyncReqId, 1);
+    mAsyncReqId = 0;
 }
 
-void NmSendServiceInterface::cancelService() 
+void NmSendServiceInterface::cancelService()
 {
-    NMLOG("NmSendServiceInterface::cancelService");
+    NM_FUNCTION;
+    
     delete mStartParam;
     mStartParam = NULL;
 
@@ -430,6 +424,7 @@
     }
 
     completeRequest(mAsyncReqId, 0);
+    mAsyncReqId = 0;
 
     // If started as service, the application must be closed now.
     if (XQServiceUtil::isService()) {
--- a/emailuis/nmailui/src/nmuidocumentloader.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmuidocumentloader.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -22,6 +22,7 @@
 */
 NmUiDocumentLoader::NmUiDocumentLoader(const HbMainWindow *window) : HbDocumentLoader(window)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -29,6 +30,7 @@
 */
 NmUiDocumentLoader::~NmUiDocumentLoader()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -36,6 +38,8 @@
 */
 QObject *NmUiDocumentLoader::createObject(const QString& type, const QString &name)
 {
+    NM_FUNCTION;
+    
     QObject *res = NULL;
     if( type == NmMailViewerWK::staticMetaObject.className() ) {
         res = new NmMailViewerWK();
--- a/emailuis/nmailui/src/nmuieffects.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmuieffects.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -32,6 +32,7 @@
     mSendAnimationScreenShot(NULL),
     mDoSendAnimation(false)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -39,6 +40,8 @@
 */
 NmUiEffects::~NmUiEffects()
 {
+    NM_FUNCTION;
+    
     // Clean send animation if sendAnimationComplete slot is not called for some reason.
     // E.g. red key pressed.
     resetSendAnimation();
@@ -49,6 +52,8 @@
 */
 void NmUiEffects::prepareEffect(NmUiEffectType effect)
 {
+    NM_FUNCTION;
+    
     switch (effect) {
     case NmEditorSendMessageAnimation:
         // delete any existing stuff
@@ -65,6 +70,9 @@
         mSendAnimationScreenShot->hide();
         mSendAnimationScreenShot->setPos(0,0);
         mSendAnimationScreenShot->setZValue(0);
+
+        // Adds or moves the item and all its childen to this scene.
+        // This scene takes ownership of the item.
         mMainWindow.scene()->addItem(mSendAnimationScreenShot);
 
         // Set editor screen capture visible before old view is popped.
@@ -81,6 +89,8 @@
 */
 void NmUiEffects::startEffect(NmUiEffectType effect)
 {
+    NM_FUNCTION;
+    
     switch (effect) {
     case NmEditorSendMessageAnimation:
         // Send message animation for editor view.
@@ -99,6 +109,8 @@
  */
 QGraphicsPixmapItem *NmUiEffects::screenShot()
 {
+    NM_FUNCTION;
+    
     // Grab whole view into pixmap image (also chrome is included)
     QPixmap screenCapture = QPixmap::grabWindow(mMainWindow.internalWinId());
 
@@ -122,9 +134,16 @@
  */
 void NmUiEffects::resetSendAnimation()
 {
+    NM_FUNCTION;
+    
     if (mSendAnimationScreenShot) {
         // Clean send animation
         HbEffect::remove(mSendAnimationScreenShot, SendAnimation, "mail_send");
+        // Ownership of QGraphicsPixmapItem is tranferred to GraphicsScene when it has been added
+        // to it GraphicsScene.
+        // GraphicsPixmapItem needs to be removed from the GraphicsScene before deleting
+        // it to prevent double deletion.
+        mMainWindow.scene()->removeItem(mSendAnimationScreenShot);
         delete mSendAnimationScreenShot;
         mSendAnimationScreenShot = NULL;
         mDoSendAnimation = false;
@@ -136,6 +155,8 @@
 */
 void NmUiEffects::sendAnimationComplete(HbEffect::EffectStatus status)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(status);
     resetSendAnimation();
 }
--- a/emailuis/nmailui/src/nmuiextensionmanager.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmuiextensionmanager.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -17,7 +17,6 @@
 
 #include "nmuiheaders.h"
 
-const QString NmsPluginExtensionName = "nmsclientplugin.qtplugin"; 
 /*!
     \class NmUiExtensionManager
     \brief Handles ui extension plugins
@@ -31,8 +30,8 @@
 */
 QStringList NmUiExtensionManager::pluginFolders()
 {
-    NMLOG(QString("NmUiExtensionManager - HELPER FUNCTIONS - pluginFolders"));
-
+    NM_FUNCTION;
+    
     const QString NmSettingsPluginFolderPath("/resource/qt/plugins/nmail/uiext");
     QStringList pluginDirectories;
     QFileInfoList driveList = QDir::drives();
@@ -45,13 +44,14 @@
             pluginDirectories.append(pluginDirectory);
         }
     }
-
-    NMLOG(QString("NmUiExtensionManager - HELPER FUNCTIONS - pluginFolders - OK"));
+    
     return pluginDirectories;
 }
 
 NmUiExtensionManager::NmUiExtensionManager()
 {
+    NM_FUNCTION;
+    
     // load the protocol extension plugins
     loadExtensionPlugins();
 }
@@ -61,6 +61,8 @@
  */
 NmUiExtensionManager::~NmUiExtensionManager()
 {
+    NM_FUNCTION;
+    
     // delete plugins from array
     qDeleteAll(mExtensions.begin(), mExtensions.end());
     mExtensions.clear();
@@ -76,6 +78,8 @@
     const NmActionRequest &menuRequest,
     QList<NmAction*> &actionList)
 {
+    NM_FUNCTION;
+    
     for (int i = 0; i < mExtensions.count(); i++) {
     	NmUiExtensionInterface* interface = mExtensions[i];
         interface->getActions(menuRequest, actionList);
@@ -87,7 +91,7 @@
  */
 void NmUiExtensionManager::loadExtensionPlugins()
 {
-    NMLOG(QString("NmUiExtensionManager::loadExtensionPlugins -->"));
+    NM_FUNCTION;
     
     QStringList directories(pluginFolders());
     foreach (const QString &directoryPath, directories) {
@@ -95,7 +99,7 @@
         QFileInfoList fileList(directory.entryInfoList());
 
         foreach (const QFileInfo &fileInfo, fileList) {
-            NMLOG(QString("Plugin absolute FilePath : %1").arg(fileInfo.absoluteFilePath()));  
+            NM_COMMENT(QString("Plugin absolute FilePath : %1").arg(fileInfo.absoluteFilePath()));  
             QScopedPointer<QPluginLoader> loader(
                 new QPluginLoader(fileInfo.absoluteFilePath()));
             mPluginLoaders.append(loader.data());
@@ -105,17 +109,14 @@
     
     NmUiExtensionInterface *interface = NULL;    
     foreach (QPluginLoader *loader, mPluginLoaders) {      
-        NMLOG(QString("Plugin fileName() : %1").arg(loader->fileName()));
-        QString fileName = loader->fileName();
-        if (fileName.contains(NmsPluginExtensionName, Qt::CaseInsensitive) == false) {
-            QObject *pluginInstance = loader->instance();
-            interface = qobject_cast<NmUiExtensionInterface*>(pluginInstance);
-            if (interface) {
-                mExtensions.append(interface);
-            }
+        NM_COMMENT(QString("Plugin fileName() : %1").arg(loader->fileName()));
+        QString fileName = loader->fileName();        
+        QObject *pluginInstance = loader->instance();
+        interface = qobject_cast<NmUiExtensionInterface*>(pluginInstance);
+        if (interface) {
+            mExtensions.append(interface);
         }
-    }            
-    NMLOG(QString("<-- NmUiExtensionManager::loadExtensionPlugins"));
+    }
 }
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailui/src/nmuriserviceinterface.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,360 @@
+/*
+* Copyright (c) 2010 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: NMail Application Launcher interface used for interfacing between
+*              QT highway and other applications
+*
+*/
+
+//  INCLUDES
+#include <xqaiwdecl.h>
+#include "nmuiheaders.h"
+
+/*!
+    \class NmStartParamDataHelper
+    \brief A helper class for processing the data given to the actual service.
+*/
+class NmStartParamDataHelper
+{
+public:
+
+    /*!
+        Class constructor.
+    */
+    inline NmStartParamDataHelper()
+    : mSubject(0),
+      mToAddresses(0),
+      mCcAddresses(0),
+      mBccAddresses(0)
+    {
+        NM_FUNCTION;
+    }
+
+    /*!
+        Class destructor.
+    */
+    inline ~NmStartParamDataHelper()
+    {
+        NM_FUNCTION;
+    }
+
+    /*!
+        Extracts the data from the given QString into the class members.
+        \param data QString containing the data.
+        \return True if success, false otherwise.
+    */
+    inline bool extractData(const QString &data)
+    {
+        NM_FUNCTION;
+        
+        bool success = false;
+        
+        QUrl uri(data);
+        
+        if (uri.isValid()) {
+            
+            mSubject = new QString(uri.queryItemValue(emailSendSubjectKey));
+            QString to = uri.path();
+            QString cc = uri.queryItemValue(emailSendCcKey);
+            QString bcc = uri.queryItemValue(emailSendBccKey);
+            
+            addAddressesToList(to, &mToAddresses);
+            addAddressesToList(cc, &mCcAddresses);
+            addAddressesToList(bcc, &mBccAddresses);
+            
+            success = true;
+        }
+        
+        return success;
+    }
+
+    /*!
+        Appends the given addresses into the given list.
+        \param address The addresses to append.
+        \param list The list where the addresses are appended to.
+    */
+    inline void addAddressesToList(QString &addresses,
+                                   QList<NmAddress*> **list)
+    {
+        NM_FUNCTION;
+        
+        if (!addresses.isEmpty()) {
+
+            QList<NmAddress*> foundAddresses;
+                    
+            // Process multiple addresses.
+            if (addresses.contains(",")) {
+                QString str;               
+                while (addresses.contains(",")) {
+                    str = addresses.section(",", 0, 0); // Get the occurance.
+                    addresses.remove(0, (addresses.indexOf(",")+1)); // Remove the occurance.
+                    if (!str.isEmpty()) { // In case str would be empty on some error data. 
+                        NmAddress *address = new NmAddress(str);
+                        foundAddresses.append(address);    
+                    }
+                }
+            }
+            if (!addresses.isEmpty()) { // In case addresses would be empty on some error data. 
+                // Last one or single address.
+                NmAddress *address = new NmAddress(addresses);
+                foundAddresses.append(address);
+            }
+            // Append the found addresses into the given list.
+            *list = new QList<NmAddress*>();
+            (*list)->append(foundAddresses);
+        }
+    }
+        
+    /*!
+        Deletes the class members. Must be used if NmUiStartParam does not
+        take ownership of the members.
+    */
+    inline void deleteData()
+    {
+        NM_FUNCTION;
+        
+        delete mSubject;
+        mSubject = 0;
+
+        if (mToAddresses) {
+            qDeleteAll(*mToAddresses);
+            delete mToAddresses;
+            mToAddresses = 0;
+        }
+
+        if (mCcAddresses) {
+            qDeleteAll(*mCcAddresses);
+            delete mCcAddresses;
+            mCcAddresses = 0;
+        }
+
+        if (mBccAddresses) {
+            qDeleteAll(*mBccAddresses);
+            delete mBccAddresses;
+            mBccAddresses = 0;
+        }
+    }
+
+public: // Data
+
+    QString *mSubject; // Not owned.
+    QList<NmAddress*> *mToAddresses; // Not owned.
+    QList<NmAddress*> *mCcAddresses; // Not owned.
+    QList<NmAddress*> *mBccAddresses; // Not owned.
+};
+
+/*!
+    \class NmUriServiceInterface
+    \brief NMail application service interface which provides an email sending
+           interface for other application using the Qt Highway.
+*/
+
+/*!
+    Class constructor.
+*/
+NmUriServiceInterface::NmUriServiceInterface(QObject *parent,
+                                               NmUiEngine &uiEngine,
+                                               NmApplication *application)
+#ifndef NM_WINS_ENV
+    : XQServiceProvider(emailServiceName+"."+XQI_URI_VIEW, parent),
+#else
+    : QObject(parent),
+#endif
+      mApplication(application),
+      mUiEngine(uiEngine),
+      mAsyncReqId(0),
+      mStartParam(NULL),
+      mSelectionDialog(NULL),
+      mCurrentView(NULL)
+{
+#ifndef NM_WINS_ENV
+    publishAll();
+#endif
+}
+
+
+/*!
+    Class desctructor.
+*/
+NmUriServiceInterface::~NmUriServiceInterface()
+{
+    NM_FUNCTION;
+    
+    delete mStartParam;
+    delete mSelectionDialog;
+}
+
+
+/*!
+    Queries the user for a mailbox to use.
+    \param mailboxId Where the ID of the selected mailbox is set.
+    \return True if a mailbox was selected, false otherwise.
+*/
+void NmUriServiceInterface::selectionDialogClosed(NmId &mailboxId)
+{
+    NM_FUNCTION;
+    
+    if (mailboxId.id()) { // mailbox selected
+        launchEditorView(mailboxId);
+    }
+    else {
+        cancelService();
+    }
+}
+
+
+/*!
+    Used from external applications to handle mailto: uri's.
+
+    \param data <mailto:> uri
+*/
+bool NmUriServiceInterface::view(const QString& uri)
+{
+    NM_FUNCTION;
+    
+#ifndef NM_WINS_ENV
+    
+    // Make sure that nmail stays background if user presses back in editorview
+    mApplication->updateVisibilityState();
+    
+    HbMainWindow *mainWindow = mApplication->mainWindow();
+    mCurrentView = mainWindow->currentView();
+
+    // Hide the current view.
+    if (mCurrentView) {
+        mCurrentView->hide();
+    }
+    
+    // Check the given data.
+    NmStartParamDataHelper dataHelper;
+    bool validData = dataHelper.extractData(uri);
+     
+    NmMailboxListModel &mailboxListModel = mUiEngine.mailboxListModel();
+    const int count = mailboxListModel.rowCount();
+    NmId mailboxId(0);
+
+    mAsyncReqId = setCurrentRequestAsync();
+
+    if (!validData) {
+        // Failed to extract the data!
+        NM_ERROR(1,"NmUriServiceInterface::view(): failed to process the given data");
+        cancelService();
+    }
+    else if (count == 0) {
+        HbDeviceMessageBox note(hbTrId("txt_mail_dialog_no_mailboxes_defined"),
+                          HbMessageBox::MessageTypeInformation);
+        note.setTimeout(HbMessageBox::NoTimeout);
+        note.show();
+        cancelService();
+    }
+    else { // count > 0
+        // Make sure the NMail application is in the foreground.
+        XQServiceUtil::toBackground(false);
+        mainWindow->show();
+
+    	mStartParam = new NmUiStartParam(
+        	NmUiViewMessageEditor,
+	        0, // account id
+	        0, // folder id
+    	    0, // message id
+    	    NmUiEditorMailto, // editor start mode
+	        dataHelper.mToAddresses, // address list
+    	    0, // attachment list
+        	true, // start as service
+	        dataHelper.mSubject, // message subject
+	        dataHelper.mCcAddresses, // list containing cc recipient addresses
+    	    dataHelper.mBccAddresses // list containing bcc recipient addresses
+	    );
+
+        if (count == 1) {
+            // A single mailbox exists.
+            QModelIndex modelIndex = mailboxListModel.index(0, 0);
+            QVariant mailbox(mailboxListModel.data(modelIndex));
+            NmMailboxMetaData *mailboxMetaData = mailbox.value<NmMailboxMetaData*>();
+            mailboxId = mailboxMetaData->id();
+        	launchEditorView(mailboxId);
+        }
+        else { // count > 1
+            if (!mSelectionDialog) {
+                mSelectionDialog =
+                    new NmMailboxSelectionDialog(mUiEngine.mailboxListModel());
+            }
+            connect(mSelectionDialog,SIGNAL(selectionDialogClosed(NmId&)),
+                this,SLOT(selectionDialogClosed(NmId&)));
+            mSelectionDialog->open();
+
+            // launch the editor when the dialog is closed
+        }
+    }
+    
+    return true;
+}
+
+/*!
+    Called when mailbox id is known and editor can be opened
+    \param mailboxId mailbox using in editor
+ */
+void NmUriServiceInterface::launchEditorView(NmId mailboxId)
+{
+    NM_FUNCTION;
+    NM_COMMENT(QString("NmUriServiceInterface::launchEditorView(): mailboxId=%1").arg(mailboxId.id()));
+    
+    // Make the previous view visible again.
+    if (mCurrentView) {
+        mCurrentView->show();
+        mCurrentView = NULL;
+    }
+
+    if (mStartParam) {
+        mStartParam->setMailboxId(mailboxId);
+        mApplication->enterNmUiView(mStartParam);
+        mStartParam = NULL; // ownership passed
+    }
+    completeRequest(mAsyncReqId, 1);
+    mAsyncReqId = 0;
+}
+
+void NmUriServiceInterface::cancelService()
+{
+    NM_FUNCTION;
+    
+    delete mStartParam;
+    mStartParam = NULL;
+
+    // If the service was started as embedded, do not hide the app.
+    if (!XQServiceUtil::isEmbedded()) {
+        XQServiceUtil::toBackground(true);
+    }
+
+    completeRequest(mAsyncReqId, 0);
+    mAsyncReqId = 0;
+
+    // If started as service, the application must be closed now.
+    if (XQServiceUtil::isService()) {
+        connect(this, SIGNAL(returnValueDelivered()),
+            mApplication, SLOT(delayedExitApplication()));
+    }
+    else {
+        // Make the previous view visible again
+        if (mCurrentView) {
+            mCurrentView->show();
+            mCurrentView = NULL;
+        }
+    }
+}
+
+#endif /* NM_WINS_ENV */
+
+
+
+// End of file.
--- a/emailuis/nmailui/src/nmutilities.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmutilities.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -47,6 +47,8 @@
     QList<NmAddress> &recipients,
     NmAddressValidationType type )
 {
+    NM_FUNCTION;
+    
     // validate TO addresses
     QList<NmAddress> toRecipients = message.envelope().toRecipients();
     int recipientCount = toRecipients.count();
@@ -95,6 +97,8 @@
 */
 bool NmUtilities::isValidEmailAddress( const QString &emailAddress )
 {
+    NM_FUNCTION;
+    
     return EmailAddressPattern.exactMatch(emailAddress);
 }
 
@@ -103,6 +107,8 @@
 */
 QString NmUtilities::addressToDisplayName( const NmAddress &address )
 {
+    NM_FUNCTION;
+    
     QString emailAddress = address.address();
     QString displayName = address.displayName();
 
@@ -121,6 +127,8 @@
 */
 bool NmUtilities::parseEmailAddress( const QString &emailAddress, NmAddress &address )
 {
+    NM_FUNCTION;
+    
     bool foundAddress = false;
 
     QRegExp rx(EmailAddressPattern);
@@ -147,6 +155,8 @@
 */
 QString NmUtilities::cleanupDisplayName( const QString &displayName )
 {
+    NM_FUNCTION;
+    
     // find the first and last position that is NOT one of the characters below
     QRegExp rx("[^\\s\"<>]");
     int firstPos = std::max(rx.indexIn(displayName), 0);
@@ -165,6 +175,8 @@
 */
 int NmUtilities::openFile(QFile &file)
 {
+    NM_FUNCTION;
+    
     int ret(NmNotFoundError);
     XQApplicationManager aiwMgr;
     XQAiwRequest *request(NULL);
@@ -193,6 +205,8 @@
 */
 int NmUtilities::openFile(XQSharableFile &file)
 {
+    NM_FUNCTION;
+    
     int ret(NmNotFoundError);
     XQApplicationManager aiwMgr;
     XQAiwRequest *request(NULL);
@@ -220,6 +234,8 @@
  */
 QString NmUtilities::truncate( const QString &string, int length )
 {
+    NM_FUNCTION;
+    
     if (string.length() <= length) {
         return string;
     }
@@ -235,6 +251,8 @@
  */
 void NmUtilities::displayErrorNote(QString noteText)
 {
+    NM_FUNCTION;
+    
 	HbNotificationDialog *note = new HbNotificationDialog();
 	
 	note->setIcon(HbIcon(QLatin1String("note_warning")));
@@ -253,6 +271,8 @@
  */
 QString NmUtilities::attachmentSizeString(const int sizeInBytes)
 {
+    NM_FUNCTION;
+    
     qreal sizeMb = (qreal)sizeInBytes / (qreal)NmMegabyte;
     if (sizeMb < 0.1) {
         // 0.1 Mb is the minimum size shown for attachment
@@ -262,50 +282,20 @@
 }
 
 /*!
-    takes care of necessary error/information note displaying based on the given operation completion event
-    returns boolean whether settings should be opened or not
+    Displays a note with Yes/No buttons. Note has no timeout, i.e. it has to be dismissed manually.
+    Returns pointer to dialog so that caller can take ownership and handle deletion.
+    Parameter 'receiver' is the object and 'member' is the slot where user selection is passed. 
 */
-bool NmUtilities::displayOperationCompletionNote(const NmOperationCompletionEvent &event)
+HbMessageBox* NmUtilities::displayQuestionNote(
+    QString noteText, QObject* receiver, const char* member)
 {
-    bool openSettings(false);
-    // nothing to do in successfull or cancelled case
-    if(event.mCompletionCode != NmNoError && event.mCompletionCode != NmCancelError) {
-        if(event.mOperationType == Synch && event.mCompletionCode == NmAuthenticationError) {
-            openSettings = displayQuestionNote(hbTrId("txt_mail_dialog_address_or_password_incorrect"));
-        }
-        if(event.mOperationType == Synch && event.mCompletionCode == NmServerConnectionError) {
-            openSettings = displayQuestionNote(hbTrId("txt_mail_dialog_server_settings_incorrect"));
-        }
-        // following applies to all operation/event types
-        if(event.mCompletionCode == NmConnectionError) {
-            displayWarningNote(hbTrId("txt_mail_dialog_mail_connection_error"));
-        }
-    }
-    return openSettings;
-}
-
-/*!
-    displays a note with Yes/No buttons. Note has no timeout, i.e. it has to be dismissed manually
-    returns boolean whether primaryaction was taken (Left button ("Yes") pressed)
-*/
-bool NmUtilities::displayQuestionNote(QString noteText)
-{
-	HbMessageBox::warning(noteText);
-	return true;
-	/*
-	 * Commented out because of exec() deprecation. Will be fixed later...
-	 * 
-    bool ret(false);
+    NM_FUNCTION;
+    
     HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
     messageBox->setText(noteText);
-    messageBox->setTimeout(HbMessageBox::NoTimeout); // note has to be dismissed manually
-    HbAction *action = messageBox->exec();
-    if(action == messageBox->primaryAction()) {
-        ret=true; // primary/left button was pressed
-    }
-    delete messageBox;
-    return ret;
-    */
+    messageBox->setTimeout(HbMessageBox::NoTimeout); // Note has to be dismissed manually
+    messageBox->open(receiver, member);
+    return messageBox;
 }
 
 /*!
@@ -313,6 +303,8 @@
  */
 void NmUtilities::displayWarningNote(QString noteText)
 {
+    NM_FUNCTION;
+    
     HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeWarning);
     messageBox->setText(noteText);
     messageBox->setTimeout(NmShortInterval);
@@ -330,6 +322,8 @@
 */
 QString NmUtilities::createReplyHeader(const NmMessageEnvelope &env)
 {
+    NM_FUNCTION;
+    
     QString ret = "<html><body><br><br>";
     // Append "----- Original message ----" text
     ret+=hbTrId("txt_mail_editor_reply_original_msg");                  
--- a/emailuis/nmailui/src/nmviewerheader.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmviewerheader.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -38,6 +38,8 @@
     mRecipientsBox(NULL),
     mViewerView(NULL)
 {
+    NM_FUNCTION;
+    
     loadWidgets();
 }
 
@@ -46,6 +48,7 @@
 */
 NmViewerHeader::~NmViewerHeader()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -53,6 +56,8 @@
 */
 void NmViewerHeader::setView(NmViewerView* view)
 {
+    NM_FUNCTION;
+    
     mViewerView = view;
 }
 
@@ -61,6 +66,8 @@
 */
 void NmViewerHeader::loadWidgets()
 {
+    NM_FUNCTION;
+    
     // Scale header widget to screen width
     setSizePolicy(QSizePolicy::Minimum, QSizePolicy::MinimumExpanding); 
 
@@ -105,6 +112,8 @@
     const QStyleOptionGraphicsItem *option,
     QWidget *widget)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(option);
     Q_UNUSED(widget);
     if (painter) {
@@ -126,6 +135,8 @@
 */
 void NmViewerHeader::setMessage(NmMessage* message)
 {
+    NM_FUNCTION;
+    
     mMessage=message;
     setHeaderData();
 }
@@ -139,6 +150,8 @@
 */
 void NmViewerHeader::updateMessageData(NmMessage* message)
 {
+    NM_FUNCTION;
+    
     if (message){
         mMessage=message;
         // Set recipients to text edit field as html 
@@ -156,6 +169,8 @@
 */
 void NmViewerHeader::setHeaderData()
 {
+    NM_FUNCTION;
+    
     if (mMessage) {
         // Background is all white always, so force text color to black
         QColor textColor(Qt::black);
@@ -222,6 +237,8 @@
 */ 
 void NmViewerHeader::rescaleHeader(const QSizeF layoutReso)
 {  
+    NM_FUNCTION;
+    
     setMinimumWidth(layoutReso.width());
     setMaximumWidth(layoutReso.width());
 }
@@ -231,6 +248,8 @@
 */
 void NmViewerHeader::createExpandableHeader()
 {
+    NM_FUNCTION;
+    
     if (mHeaderBox) {        // Initialize recipient box
         if (!mRecipientsBox){
             mRecipientsBox = new HbTextEdit();
@@ -267,6 +286,8 @@
                                             const QList<NmAddress> &to,
                                             const QList<NmAddress> &cc)
 {
+    NM_FUNCTION;
+    
     QString result;
     result.append("<html><body link=\"blue\" topmargin=\"0\" leftmargin=\"0\" marginheight=\"0\"");
     result.append("marginwidth=\"0\" bgcolor=\"white\" text=\"black\">");    
@@ -332,6 +353,8 @@
 */
 QString NmViewerHeader::addressToDisplayInHtml(const NmAddress &addr)
 {
+    NM_FUNCTION;
+    
     QString dispName;
     if (addr.displayName().length()!=0){
         dispName.append(NmUtilities::cleanupDisplayName(addr.displayName()));
@@ -353,6 +376,8 @@
 */
 void NmViewerHeader::cursorPositionChanged(int oldPos, int newPos)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(oldPos);
     QString string = mRecipientsBox->anchorAt(newPos); 
     if (mViewerView&&string.contains("mailto:",Qt::CaseSensitive)){
--- a/emailuis/nmailui/src/nmviewerserviceinterface.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmviewerserviceinterface.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -51,6 +51,7 @@
 */
 NmViewerServiceInterface::~NmViewerServiceInterface()
 {
+    NM_FUNCTION;
 }
 
 
@@ -59,7 +60,8 @@
  */
 void NmViewerServiceInterface::viewMessage(QVariant mailboxId, QVariant folderId, QVariant messageId)
 {
-    NMLOG("NmViewerServiceInterface::viewMessage()");
+    NM_FUNCTION;
+
 #ifndef NM_WINS_ENV
     mAsyncReqId = setCurrentRequestAsync();
 
@@ -67,10 +69,15 @@
     NmId messageNmId(messageId.toULongLong());
     NmId folderNmId(folderId.toULongLong());
 
+	// Make sure the app stays background if user presses back in viewer view
+	bool visible = mApplication->updateVisibilityState();
+
     NmMessage *message = mUiEngine.message( mailboxNmId, folderNmId, messageNmId );
     if (message) {
         // bring application to foreground
         XQServiceUtil::toBackground(false);
+        HbMainWindow *mainWindow = mApplication->mainWindow();
+        mainWindow->show();
 
         // Launch the message list view.
         NmUiStartParam *startParam =
@@ -90,7 +97,7 @@
         // Message was not found
 
         // if started as embedded, do not hide the app
-		if (!XQServiceUtil::isEmbedded()) {
+		if (!XQServiceUtil::isEmbedded() && !visible) {
 			XQServiceUtil::toBackground(true);
 		}
 
--- a/emailuis/nmailui/src/nmviewerview.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmviewerview.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -47,7 +47,7 @@
     NmAttachmentManager &attaManager,
     bool toolbarEnabled,
     QGraphicsItem *parent)
-:NmBaseView(startParam, parent),
+:NmBaseView(startParam, application, parent),
 mApplication(application),
 mUiEngine(uiEngine),
 mMainWindow(mainWindow),
@@ -71,10 +71,10 @@
 mAttaIndexUnderFetch(NmNotFoundError),
 mAttaWidget(NULL),
 mViewReady(false),
-mWaitNoteCancelled(false),
-mOkAction(NULL),
-mCancelAction(NULL)
+mWaitNoteCancelled(false)
     {
+    NM_FUNCTION;
+    
     // Create documentloader
     mDocumentLoader = new NmUiDocumentLoader(mMainWindow);
     // Get screensize
@@ -95,6 +95,8 @@
 */
 NmViewerView::~NmViewerView()
 {
+    NM_FUNCTION;
+    
     delete mWebView;
     mWebView = NULL;
     delete mMessage;
@@ -107,10 +109,6 @@
     // remove view from osbserving atta manager events
     mAttaManager.clearObserver();
     mAttaManager.cancelFetch();
-    delete mOkAction;
-    mOkAction = NULL;
-    delete mCancelAction;
-    mCancelAction = NULL;
 }
 
 /*!
@@ -118,6 +116,8 @@
 */
 void NmViewerView::aboutToExitView()
 {
+    NM_FUNCTION;
+    
     // View is about to exit, for safety, stop 
     // loading of content before closing the view
     if (mWebView){
@@ -133,6 +133,8 @@
 */
 void NmViewerView::loadViewLayout()
 {
+    NM_FUNCTION;
+    
     // Use document loader to load the view
     bool ok = false;
     setObjectName(QString(NMUI_MESSAGE_VIEWER_VIEW));
@@ -140,10 +142,9 @@
     objectList.append(this);
     // Pass the view to documentloader. Document loader uses this view
     // when docml is parsed, instead of creating new view.
-    if (mDocumentLoader) {
-        mDocumentLoader->setObjectTree(objectList);
-        mWidgetList = mDocumentLoader->load(NMUI_MESSAGE_VIEWER_XML, &ok);
-    }
+    // documentloader is created in constructor
+    mDocumentLoader->setObjectTree(objectList);
+    mWidgetList = mDocumentLoader->load(NMUI_MESSAGE_VIEWER_XML, &ok);
     int widgetCount = mWidgetList.count();
     if (ok == true && widgetCount)
     {
@@ -167,16 +168,18 @@
             // Get scroll area contents and set layout margins
             mScrollAreaContents = qobject_cast<HbWidget *>(
                     mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_SCROLL_AREA_CONTENTS));
-            if (mScrollAreaContents->layout()){
-                mScrollAreaContents->layout()->setContentsMargins(0,0,0,0);
+            if (mScrollAreaContents) {
+                QGraphicsLayout *layout = mScrollAreaContents->layout();
+                if (layout){
+                    layout->setContentsMargins(0,0,0,0);
+                }
+                // Set white pixmap to backgrounditem 
+                QPixmap whitePixmap(10,10);
+                whitePixmap.fill(Qt::white);
+                QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(whitePixmap);
+                mScrollAreaContents->setBackgroundItem(pixmapItem);
             }
 
-            // Set white pixmap to backgrounditem 
-            QPixmap whitePixmap(10,10);
-            whitePixmap.fill(Qt::white);
-            QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(whitePixmap);
-            mScrollAreaContents->setBackgroundItem(pixmapItem);
-
             // Load headerwidget
             mHeaderWidget = qobject_cast<NmViewerHeader *>(
                     mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_HEADER));
@@ -193,21 +196,26 @@
             if (mWebView) {
                 mWebView->setParentView(this);
                 // Set auto load images and private browsing(no history) attributes
-                mWebView->settings()->setAttribute(QWebSettings::AutoLoadImages, true);
-                mWebView->settings()->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);                                
+                QWebSettings *settings = mWebView->settings();
+                if (settings) {
+                    settings->setAttribute(QWebSettings::AutoLoadImages, true);
+                    settings->setAttribute(QWebSettings::PrivateBrowsingEnabled, true);   
+                }                             
                 HbEditorInterface editorInterface(mWebView);
                 editorInterface.setInputConstraints(HbEditorConstraintIgnoreFocus);
                 mWebView->setAcceptedMouseButtons(Qt::NoButton);
-                if (mWebView->page()){
-                    mWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical,
-                                                                      Qt::ScrollBarAlwaysOff);
-                    mWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal,
-                                                                      Qt::ScrollBarAlwaysOff);
-                    connect(mWebView->page()->mainFrame(),
-                            SIGNAL(contentsSizeChanged(const QSize&)),
-                        this, SLOT(scaleWebViewWhenLoading(const QSize&)));
+                QWebPage *page = mWebView->page();
+                if (page) {
+                    QWebFrame *frame = page->mainFrame();
+                    if (frame) {
+                        frame->setScrollBarPolicy(Qt::Vertical,Qt::ScrollBarAlwaysOff);
+                        frame->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
+                        connect(mWebView->page()->mainFrame(),
+                                SIGNAL(contentsSizeChanged(const QSize&)),
+                            this, SLOT(scaleWebViewWhenLoading(const QSize&)));  
+                    }
                 }
-             }
+            }
         }
     }
 }
@@ -217,14 +225,15 @@
 */
 void NmViewerView::viewReady()
 {
+    NM_FUNCTION;
+    
     if (!mViewReady){
         // Set mailbox name to title
         setMailboxName();
         // Create toolbar if needed
         if (mToolbarEnabled) {
             createToolBar();
-        }
-        else {
+        } else {
             // Connect options menu about to show to create options menu function
             QObject::connect(menu(), SIGNAL(aboutToShow()),
                     this, SLOT(createOptionsMenu())); 
@@ -232,12 +241,11 @@
             NmAction *dummy = new NmAction(0);
             menu()->addAction(dummy);
         }
-        
-        
-        if (mHeaderWidget){
+                
+        if (mHeaderWidget) {
             QPointF contentWidgetPos = mScrollArea->pos();
             qreal headerHeight = mHeaderWidget->geometry().height();
-            if(mMainWindow->orientation()==Qt::Horizontal) {
+            if (mMainWindow->orientation() == Qt::Horizontal) {
                 const QPointF pointToWebView(contentWidgetPos.x(), headerHeight+NmHeaderMargin);
                 mScrollArea->scrollContentsTo(pointToWebView,0);
             }
@@ -246,7 +254,7 @@
         // Run fetchmessage in queue
         QMetaObject::invokeMethod(this, "fetchMessage", Qt::QueuedConnection);
         // Set view ready
-        mViewReady=true;
+        mViewReady = true;
     }
 }
 
@@ -255,18 +263,17 @@
 */
 void NmViewerView::loadMessage()
 {
+    NM_FUNCTION;
+    
     if (mMessage) {
         delete mMessage;
         mMessage = NULL;
     }
-    NmId mailboxId;
-    NmId folderId;
-    NmId msgId;
     // Read start params and message object
     if (mStartParam){
-        mailboxId = mStartParam->mailboxId();
-        folderId = mStartParam->folderId();
-        msgId = mStartParam->messageId();
+        NmId mailboxId = mStartParam->mailboxId();
+        NmId folderId = mStartParam->folderId();
+        NmId msgId = mStartParam->messageId();
         mMessage = mUiEngine.message(mailboxId, folderId, msgId);
     }
 }
@@ -277,7 +284,8 @@
 */
 void NmViewerView::fetchMessage()
 {
-#ifdef Q_OS_SYMBIAN
+    NM_FUNCTION;
+    
     if (mMessage) {
         NmId mailboxId = mStartParam->mailboxId();
         NmId folderId = mStartParam->folderId();
@@ -301,28 +309,13 @@
                         SIGNAL(operationCompleted(int)),
                         this,
                         SLOT(messageFetched(int)));
-
-                delete mWaitDialog;
-                mWaitDialog = NULL;
-                // Create new wait dialog and set it to me modal with dimmed background
-                mWaitDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
-                mWaitDialog->setModal(true);
-                mWaitDialog->setBackgroundFaded(true);
-                connect(mWaitDialog, SIGNAL(cancelled()), this, SLOT(waitNoteCancelled()));
-                mWaitDialog->setText(hbTrId("txt_mail_dialog_loading_mail_content"));
-                // Display wait dialog
-                mWaitDialog->show();
+                createAndShowWaitDialog();
             }
-        }
-        else {
+        } else {
             // message is fetched
             setMessageData();
         }
-
     }
-#else
-    setMessageData();
-#endif
 }
 
 /*!
@@ -330,22 +323,20 @@
  */
 void NmViewerView::messageFetched(int result)
 {
-    delete mWaitDialog;
-    mWaitDialog = NULL;
+    NM_FUNCTION;
+    
+    mWaitDialog->close();
 
     if (result == NmNoError && mMessageFetchingOperation) {
         if (mMessage) {
             delete mMessage;
             mMessage = NULL;
         }
-        NmId mailboxId;
-        NmId folderId;
-        NmId msgId;
         // Read start params and message object
         if (mStartParam) {
-            mailboxId = mStartParam->mailboxId();
-            folderId = mStartParam->folderId();
-            msgId = mStartParam->messageId();
+            NmId mailboxId = mStartParam->mailboxId();
+            NmId folderId = mStartParam->folderId();
+            NmId msgId = mStartParam->messageId();
             mMessage = mUiEngine.message(mailboxId, folderId, msgId);
         }
         setMessageData();
@@ -362,12 +353,14 @@
  */
 void NmViewerView::waitNoteCancelled()
 {
+    NM_FUNCTION;
+    
     if (!mWaitNoteCancelled) {
         if (mMessageFetchingOperation && mMessageFetchingOperation->isRunning()) { 
 	        mMessageFetchingOperation->cancelOperation();
         }
         mWaitNoteCancelled = true;
-        QMetaObject::invokeMethod(&mApplication, "popView", Qt::QueuedConnection);
+        QMetaObject::invokeMethod(&mApplication, "prepareForPopView", Qt::QueuedConnection);
     }
 }
 
@@ -377,6 +370,8 @@
 */
 void NmViewerView::setMessageData()
 {
+    NM_FUNCTION;
+    
     // Connect to observe orientation change events
     connect(mApplication.mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
                 this, SLOT(orientationChanged(Qt::Orientation)));
@@ -418,6 +413,8 @@
 */
 void NmViewerView::setAttachmentList()
 {
+    NM_FUNCTION;
+    
     // Load headerwidget
     mAttaWidget = qobject_cast<NmAttachmentListWidget *>(
             mDocumentLoader->findObject(NMUI_MESSAGE_VIEWER_ATTALIST));
@@ -471,11 +468,16 @@
 */
 void NmViewerView::openAttachment(int index)
 {
+    NM_FUNCTION;
+    
     NmId attaId = mAttaIdList.at(index);
     // reload message to get updates part sizes
     loadMessage();
     QList<NmMessagePart*> messageParts;
     mMessage->attachmentList(messageParts);
+    NmId mailboxId = mMessage->envelope().mailboxId();
+    NmId folderId = mMessage->envelope().folderId();
+    NmId messageId = mMessage->envelope().messageId();
     for (int i = 0; i < messageParts.count(); i++) {
         // message part found have to found
         // and its fetched size is smaller than size, then start part fetch
@@ -484,20 +486,14 @@
             // do not start if there's already ongoing fetch
             if (mAttaIndexUnderFetch == NmNotFoundError) {
                 mAttaIndexUnderFetch = index;
-                mAttaManager.fetchAttachment(
-                        mMessage->envelope().mailboxId(),
-                        mMessage->envelope().folderId(),
-                        mMessage->envelope().messageId(),
-                        attaId);
+                mAttaManager.fetchAttachment(mailboxId, folderId,
+                                             messageId, attaId);
             }
         }
         // attachment is fetched, open file
         else if (messageParts[i]->partId() == attaId) {
-            XQSharableFile file = mUiEngine.messagePartFile(
-                    mMessage->envelope().mailboxId(),
-                    mMessage->envelope().folderId(),
-                    mMessage->envelope().messageId(),
-                    attaId);
+            XQSharableFile file = mUiEngine.messagePartFile(mailboxId, folderId,
+                                                            messageId, attaId);
             NmUtilities::openFile(file);
             file.close();
         }
@@ -509,8 +505,13 @@
 */
 QString NmViewerView::formatMessage()
 {
+    NM_FUNCTION;
+    
     QString msg = "";
     // null pointer check for mMessage is done before calling this function
+    NmId mailboxId = mMessage->envelope().mailboxId();
+    NmId folderId = mMessage->envelope().folderId();
+    NmId messageId = mMessage->envelope().messageId();
     NmMessagePart *html = mMessage->htmlBodyPart();
     if (html) {
         QList<NmMessagePart*> parts;
@@ -519,26 +520,24 @@
             NmMessagePart *child = parts[i];
             // Browse through embedded image parts and add those
             // the web view.
-            quint32 fetchedSize = child->fetchedSize();
-            quint32 size = child->size();
-            if (fetchedSize >= size &&
-                    child->contentType().startsWith("image", Qt::CaseInsensitive)) {
+            bool isFetched = child->fetchedSize() >= child->size();
+            if (child->contentType().startsWith("image", Qt::CaseInsensitive)) {
                 QString contentId = child->contentId();
-                int ret = mUiEngine.contentToMessagePart(
-                        mMessage->envelope().mailboxId(),
-                        mMessage->envelope().folderId(),
-                        mMessage->envelope().messageId(),
-                        *child);
-                if (ret == NmNoError) {
-                  mWebView->addContent(contentId, QVariant::fromValue(child->binaryContent()));
+                if (isFetched) {
+                    int ret = mUiEngine.contentToMessagePart(
+                            mailboxId, folderId, messageId, *child);
+                    if (ret == NmNoError) {
+                      mWebView->addContent(contentId, QVariant::fromValue(child->binaryContent()), 
+                              child->partId(), isFetched);
+                    }
+                }
+                else {
+                    mWebView->addContent(contentId, QVariant::fromValue(QByteArray()), 
+                            child->partId(), isFetched);
                 }
             }
         }
-        int ret = mUiEngine.contentToMessagePart(
-                mMessage->envelope().mailboxId(),
-                mMessage->envelope().folderId(),
-                mMessage->envelope().messageId(),
-                *html);
+        int ret = mUiEngine.contentToMessagePart(mailboxId, folderId, messageId, *html);
         if (ret == NmNoError) {
             msg = html->textContent();
         }
@@ -546,15 +545,12 @@
     else {
         NmMessagePart *plain = mMessage->plainTextBodyPart();
         if (plain) {
-            int ret = mUiEngine.contentToMessagePart(
-                    mMessage->envelope().mailboxId(),
-                    mMessage->envelope().folderId(),
-                    mMessage->envelope().messageId(),
-                    *plain);
+            int ret = mUiEngine.contentToMessagePart(mailboxId, folderId,
+                                                     messageId, *plain);
             if (ret == NmNoError) {
-                QTextDocument doku;
+                QTextDocument document;
                 // set font
-                QFont currentFont = doku.defaultFont();
+                QFont currentFont = document.defaultFont();
                 currentFont.setWeight(QFont::Normal);
                 qreal secondarySize;
                 HbStyle myStyle;
@@ -564,10 +560,10 @@
                     fontSpec.setTextHeight(secondarySize);
                     currentFont.setPixelSize(fontSpec.font().pixelSize());
                 }
-                doku.setDefaultFont(currentFont);
+                document.setDefaultFont(currentFont);
                 // convert to html
-                doku.setPlainText(plain->textContent());
-                msg = doku.toHtml();
+                document.setPlainText(plain->textContent());
+                msg = document.toHtml();
 
                 if (qApp->layoutDirection()==Qt::RightToLeft){
                     // add right alignment to document css section
@@ -596,6 +592,8 @@
 */
 void NmViewerView::reloadViewContents(NmUiStartParam* startParam)
 {
+    NM_FUNCTION;
+    
     // Check start parameter validity, message view cannot
     // be updated if given parameter is zero.
     if (startParam && startParam->viewId() == NmUiViewMessageViewer &&
@@ -620,6 +618,8 @@
 */
 NmUiViewId NmViewerView::nmailViewId() const
 {
+    NM_FUNCTION;
+    
     return NmUiViewMessageViewer;
 }
 
@@ -628,6 +628,8 @@
 */
 void NmViewerView::webFrameLoaded(bool loaded)
 {
+    NM_FUNCTION;
+    
     if (loaded){
         webFrameloadingCompleted = true;
         // Scale web view after loading the
@@ -641,31 +643,29 @@
 */
 void NmViewerView::scaleWebViewWhenLoading(const QSize &size)
 {
+    NM_FUNCTION;
+    
     // Try to scale web view while mainframe is being loaded.
     // So that screen is scrollable even before images are fully loaded
     // First check that new size is different than previous, no need to react if
     // same size value is received more than once.
-    if (size!=mLatestLoadingSize){
-        if (!webFrameloadingCompleted&&mWebView&&mWebView->page()&&
-            (size.width()>mScreenSize.width()||size.height()>mScreenSize.height())) {
+    if (size != mLatestLoadingSize) {
+        if (!webFrameloadingCompleted && mWebView && mWebView->page() &&
+            (size.width() > mScreenSize.width() || size.height() > mScreenSize.height())) {
             int width = (int)size.width();
             int height = (int)size.height();
             // Set content (webview) width
             if (mDisplayingPlainText){
-                mWebView->setMaximumWidth(mScreenSize.width());
-                mWebView->setMinimumWidth(mScreenSize.width());
-                mWebView->setPreferredWidth(mScreenSize.width());
+                setWebViewWidth(mScreenSize.width());
             }
             else {
-                 mWebView->setMaximumWidth(width);
-                 mWebView->setMinimumWidth(width);
-                 mWebView->setPreferredWidth(width);
+                setWebViewWidth(width);
             }
             mWebView->setMinimumHeight(height);
             mWebView->setPreferredHeight(height);
         }
     }
-    mLatestLoadingSize=size;
+    mLatestLoadingSize = size;
 }
 
 /*!
@@ -673,21 +673,18 @@
 */
 void NmViewerView::scaleWebViewWhenLoaded()
 {
+    NM_FUNCTION;
+    
     if (mWebView&&mWebView->page()) {
         QSizeF contentSize = mWebView->page()->mainFrame()->contentsSize();
         int width = (int)contentSize.width();
         int height = (int)contentSize.height();
         // Set content (webview) width
-        if (mDisplayingPlainText){
+        if (mDisplayingPlainText) {
             mWebView->page()->setPreferredContentsSize(mScreenSize);
-            mWebView->setMinimumWidth(mScreenSize.width());
-            mWebView->setMaximumWidth(mScreenSize.width());
-            mWebView->setPreferredWidth(mScreenSize.width());
-        }
-        else {
-            mWebView->setMinimumWidth(width);
-            mWebView->setMaximumWidth(width);
-            mWebView->setPreferredWidth(width);
+            setWebViewWidth(mScreenSize.width());
+        } else {
+            setWebViewWidth(width);
         }
         // Set content (webview) height
         if (mScrollAreaContents){
@@ -696,14 +693,9 @@
                 contentRect.setHeight(geometry().height());
                 mViewerContent->setPreferredHeight(contentRect.height());
                 qreal webViewHeight = geometry().height()-mHeaderWidget->geometry().height();
-                mWebView->setMinimumHeight(webViewHeight);
-                mWebView->setMaximumHeight(webViewHeight);
-                mWebView->setPreferredHeight(webViewHeight);
-            }
-            else{
-                mWebView->setMinimumHeight(height);
-                mWebView->setMaximumHeight(height);
-                mWebView->setPreferredHeight(height);
+                setWebViewHeighth(webViewHeight);
+            } else {
+                setWebViewHeighth(height);
             }
         }
     }
@@ -715,6 +707,8 @@
 */
 void NmViewerView::adjustViewDimensions()
 {
+    NM_FUNCTION;
+    
     // Update current screensize
     mScreenSize = mApplication.screenSize();
     // Scale header to screen width
@@ -765,6 +759,8 @@
 */
 void NmViewerView::orientationChanged(Qt::Orientation orientation)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(orientation);
     QTimer::singleShot(NmOrientationTimer, this, SLOT(adjustViewDimensions()));
 }
@@ -774,7 +770,8 @@
 */
 void NmViewerView::linkClicked(const QUrl& link)
 {
-    NMLOG("link clicked");
+    NM_FUNCTION;
+    
       if (link.scheme() == "http" ||
           link.scheme() == "https" ) {
           QDesktopServices::openUrl(link);
@@ -801,19 +798,9 @@
 */
 void NmViewerView::handleMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
 {
-    NmMailViewerWK* view = webView();
-    if (event&& view && mHeaderWidget && mScrollAreaContents) {
-        QPointF lastReleasePoint = event->pos();
-        QPointF contentWidgetPos = mScrollAreaContents->pos();
-        qreal headerHeight = mHeaderWidget->geometry().height();
-        qreal y = lastReleasePoint.y()-headerHeight;
-        y -= contentWidgetPos.y();
-        qreal x = lastReleasePoint.x()-contentWidgetPos.x();
-        const QPointF pointToWebView(x, y);
-        event->setPos(pointToWebView);
-        event->setAccepted(true);
-        view->sendMouseReleaseEvent(event);
-    }
+    NM_FUNCTION;
+    handleMouseEvent(event, false);
+
 }
 
 /*!
@@ -821,19 +808,8 @@
 */
 void NmViewerView::handleMousePressEvent(QGraphicsSceneMouseEvent *event)
 {
-    NmMailViewerWK* view = webView();
-    if (event&& view && mHeaderWidget && mScrollAreaContents) {
-        QPointF lastPressPoint = event->pos();
-        QPointF contentWidgetPos = mScrollAreaContents->pos();
-        qreal headerHeight = mHeaderWidget->geometry().height();
-        qreal y = lastPressPoint.y()-headerHeight;
-        y -= contentWidgetPos.y();
-        qreal x = lastPressPoint.x()-contentWidgetPos.x();
-        const QPointF pointToWebView(x, y);
-        event->setPos(pointToWebView);
-        event->setAccepted(true);
-        view->sendMousePressEvent(event);
-    }
+    NM_FUNCTION;
+    handleMouseEvent(event, true);
 }
 
 /*!
@@ -842,12 +818,14 @@
 */
 bool NmViewerView::eventOnTopOfHeaderArea(QGraphicsSceneMouseEvent *event)
 {
+    NM_FUNCTION;
+    
     bool ret(false);
-    if (event && mHeaderWidget){
+    if (event && mHeaderWidget) {
         QPointF lastReleasePoint = event->lastPos();
         QPointF contentWidgetPos = mScrollAreaContents->pos();
         int headerHeight = (int)mHeaderWidget->geometry().height();
-        if (lastReleasePoint.y()<headerHeight+contentWidgetPos.y()){
+        if (lastReleasePoint.y()<headerHeight+contentWidgetPos.y()) {
             ret=true;
         }
     }
@@ -859,18 +837,30 @@
 */
 NmMailViewerWK* NmViewerView::webView()
 {
+    NM_FUNCTION;
+    
     return mWebView;
 }
 
 /*!
+
+*/
+NmMessage* NmViewerView::message()
+{
+    return mMessage;
+}
+
+/*!
    Function to set message read status
 */
 void NmViewerView::changeMessageReadStatus(bool read)
 {
+    NM_FUNCTION;
+    
     QList<const NmMessageEnvelope*> envelopeList;
     NmMessageEnvelope *envelope = &mMessage->envelope();
     QPointer<NmStoreEnvelopesOperation> op(NULL);
-    if (envelope){
+    if (envelope) {
         if ( read != envelope->isRead() ){
             if (read){
                 envelope->setRead(true);
@@ -899,9 +889,11 @@
 */
 void NmViewerView::setMailboxName()
 {
+    NM_FUNCTION;
+    
     if (mStartParam){
         NmMailboxMetaData *meta = mUiEngine.mailboxById(mStartParam->mailboxId());
-        if (meta){
+        if (meta) {
             setTitle(meta->name());
         }
     }
@@ -914,21 +906,23 @@
 */
 void NmViewerView::contentScrollPositionChanged(const QPointF &newPosition)
 {
+    NM_FUNCTION;
+    
     if (mWebView&&mHeaderWidget){
         QRectF webViewRect = mWebView->geometry();
         QTransform tr;
         qreal leftMovementThreshold(webViewRect.width()-mHeaderWidget->geometry().width());
-        if (newPosition.x()<0){
+        if (newPosition.x()<0) {
             tr.translate(webViewRect.topLeft().x() ,0);
         }
-        else if (newPosition.x()>=0 && newPosition.x()<leftMovementThreshold){
+        else if (newPosition.x()>=0 && newPosition.x()<leftMovementThreshold) {
             tr.translate(mHeaderStartScenePos.x()+newPosition.x() ,0);
         }
         else {
             tr.translate(webViewRect.topLeft().x()+leftMovementThreshold ,0);
         }
         mHeaderWidget->setTransform(tr);
-        if (mAttaWidget){
+        if (mAttaWidget) {
             mAttaWidget->setTransform(tr);
         }
     }
@@ -941,6 +935,8 @@
 */
 void NmViewerView::createToolBar()
 {
+    NM_FUNCTION;
+    
     HbToolBar *tb = toolBar();
     NmUiExtensionManager &extMngr = mApplication.extManager();
     if (tb && &extMngr && mStartParam) {
@@ -961,6 +957,8 @@
 */
 void NmViewerView::createOptionsMenu()
 {
+    NM_FUNCTION;
+    
 	HbMenu *optionsMenu = menu();
 	NmUiExtensionManager &extMngr = mApplication.extManager();
 	if (optionsMenu && &extMngr && mStartParam) {
@@ -982,6 +980,8 @@
 */
 void NmViewerView::handleActionCommand(NmActionResponse &actionResponse)
 {
+    NM_FUNCTION;
+    
     bool showSendInProgressNote = false;
 
     // Handle options menu or toolbar
@@ -1022,18 +1022,8 @@
             }
             break;
             case NmActionResponseCommandDeleteMail: {
-                HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
-                messageBox->setText(hbTrId("txt_mail_dialog_delete_mail"));
-                messageBox->setTimeout(HbMessageBox::NoTimeout);
-
-                mOkAction = new HbAction(tr("Ok"),messageBox);
-                mCancelAction = new HbAction(tr("Cancel"),messageBox);
-                messageBox->addAction(mOkAction);
-                messageBox->addAction(mCancelAction);
-                
-                // Read user selection
-                messageBox->open(this, SLOT(deleteButton(HbAction*)));
-              }
+                deleteMessage();
+                }
             break;
             default:
                 break;
@@ -1053,35 +1043,34 @@
 }
 
 /*!
-    Slot. Signaled when delete button is pressed
+    Deletes the currently open message
 */
-void NmViewerView::deleteButton(HbAction* result)
+void NmViewerView::deleteMessage()
 {
-     if (result == mOkAction ) {
-        QList<NmId> messageList;
-        messageList.append(mStartParam->messageId());
-
-        int err = mUiEngine.deleteMessages(mStartParam->mailboxId(),
-                                           mStartParam->folderId(),
-                                           messageList);
-
-        messageList.clear();
-        if (NmNoError != err) {
-            // Failed to delete the messages!
-            NMLOG(QString("NmViewerView::handleActionCommand(): failed err=%1").arg(err));
-        }
+    NM_FUNCTION;
+    
+    QList<NmId> messageList;
+    messageList.append(mStartParam->messageId());
+    
+    int err = mUiEngine.deleteMessages(mStartParam->mailboxId(),
+                                       mStartParam->folderId(),
+                                       messageList);
+    
+    messageList.clear();
+    if (NmNoError != err) {
+        // Failed to delete the messages!
+        NMLOG(QString("NmViewerView::handleActionCommand(): failed err=%1").arg(err));
     }
-
-    mCancelAction = NULL;
-    mOkAction = NULL;
 }
 
 
 /*!
-    Slot. Signaled when attachment fetch progress changes
+    This is called when attachment fetch progress changes
 */
 void NmViewerView::progressChanged(int value)
 {
+    NM_FUNCTION;
+    
     if (mAttaIndexUnderFetch != NmNotFoundError) {
         // emit signal
         if (mAttaWidget && mAttaWidget->progressValue(mAttaIndexUnderFetch) < value) {
@@ -1091,15 +1080,17 @@
 }
 
 /*!
-    Slot. Signaled when attachment fetch is completed
+    This is called when attachment fetch is completed
 */
 void NmViewerView::fetchCompleted(int result)
 {
+    NM_FUNCTION;
+    
     if (mAttaWidget && mAttaIndexUnderFetch != NmNotFoundError) {
         if (result == NmNoError) {
             progressValueChanged(mAttaIndexUnderFetch, 100);
-        }
-        else {
+            openAttachment(mAttaIndexUnderFetch);
+        } else {
             mAttaWidget->hideProgressBar(mAttaIndexUnderFetch);
         }
     }
@@ -1111,12 +1102,82 @@
 */
 void NmViewerView::messageDeleted(const NmId &mailboxId, const NmId &folderId, const NmId &messageId)
 {
-    NMLOG("NmViewerView::messageDeleted");
+    NM_FUNCTION;
+    
     if ((mStartParam->viewId() == NmUiViewMessageViewer)
         && (mStartParam->mailboxId()== mailboxId)
         && (mStartParam->folderId()== folderId)
-        && (mStartParam->messageId()== messageId)){
-        mApplication.popView();
+        && (mStartParam->messageId()== messageId)) {
+        mApplication.prepareForPopView();
     }
 }
 
+/*!
+    Helper function for wait dialog creation.
+*/
+void NmViewerView::createAndShowWaitDialog()
+{
+    NM_FUNCTION;
+    
+    delete mWaitDialog;
+    mWaitDialog = NULL;
+    // Create new wait dialog and set it to me modal with dimmed background
+    mWaitDialog = new HbProgressDialog(HbProgressDialog::WaitDialog);
+    mWaitDialog->setModal(true);
+    mWaitDialog->setBackgroundFaded(true);
+    connect(mWaitDialog, SIGNAL(cancelled()), this, SLOT(waitNoteCancelled()));
+    mWaitDialog->setText(hbTrId("txt_mail_dialog_loading_mail_content"));
+    // Display wait dialog
+    mWaitDialog->show(); 
+}
+
+/*!
+    Helper function for width.
+*/
+void NmViewerView::setWebViewWidth(int width)
+{
+    NM_FUNCTION;
+    
+    // null pointer check for mWebView in calling function
+    mWebView->setMinimumWidth(width);
+    mWebView->setMaximumWidth(width);
+    mWebView->setPreferredWidth(width);
+}
+
+/*!
+    Helper function for heigth.
+*/
+void NmViewerView::setWebViewHeighth(int height)
+{
+    NM_FUNCTION;
+    
+    // null pointer check for mWebView in calling function
+    mWebView->setMinimumHeight(height);
+    mWebView->setMaximumHeight(height);
+    mWebView->setPreferredHeight(height);
+}
+
+/*!
+    Helper function for mouse events.
+*/
+void NmViewerView::handleMouseEvent(QGraphicsSceneMouseEvent *event, bool pressed)
+{
+    NM_FUNCTION;
+    NmMailViewerWK* view = webView();
+    if (event && view && mHeaderWidget && mScrollAreaContents) {
+        QPointF lastReleasePoint = event->pos();
+        QPointF contentWidgetPos = mScrollAreaContents->pos();
+        qreal headerHeight = mHeaderWidget->geometry().height();
+        qreal y = lastReleasePoint.y()-headerHeight;
+        y -= contentWidgetPos.y();
+        qreal x = lastReleasePoint.x()-contentWidgetPos.x();
+        const QPointF pointToWebView(x, y);
+        event->setPos(pointToWebView);
+        event->setAccepted(true);
+        if (pressed) {
+            view->sendMousePressEvent(event);
+        } else {
+            view->sendMouseReleaseEvent(event);
+        }
+    }
+}
--- a/emailuis/nmailui/src/nmviewerviewnetmanager.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmviewerviewnetmanager.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -28,10 +28,12 @@
 /*!
     Constructor
 */
-NmViewerViewNetManager::NmViewerViewNetManager()
+NmViewerViewNetManager::NmViewerViewNetManager(NmUiEngine &uiEngine)
     : QNetworkAccessManager(),
+      mUiEngine(uiEngine),
       mMessageView(NULL)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -39,6 +41,7 @@
 */
 NmViewerViewNetManager::~NmViewerViewNetManager()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -46,6 +49,8 @@
 */
 void NmViewerViewNetManager::setView(NmViewerView *viewerView)
 {
+    NM_FUNCTION;
+    
     mMessageView=viewerView;
 }
 
@@ -55,6 +60,8 @@
 QNetworkReply *NmViewerViewNetManager::createRequest(
     Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
 {
+    NM_FUNCTION;
+    
     QNetworkRequest myRequest(request);
     // Set request attribute to prefer cachevar  
     const QVariant cacheControl((int)QNetworkRequest::PreferCache);
@@ -64,11 +71,26 @@
     // Check whether request is for embedded image
     if (mMessageView&&mMessageView->webView()&&op==QNetworkAccessManager::GetOperation
         && requestUrl.scheme()==NmViewerViewNetManagerScheme) {
-        NmViewerViewNetReply* reply = new NmViewerViewNetReply(
-            mMessageView->webView()->loadResource(QTextDocument::ImageResource, requestUrl));
-        reply->setOriginalRequest(myRequest);
-        return reply;
+        QString id = requestUrl.path();
+        NmId partId;
+        bool isFetched = false;
+        NmMessage *message = mMessageView->message();
+        if (message) {
+            QVariant data = mMessageView->webView()->loadResource(
+                    QTextDocument::ImageResource, requestUrl, partId, isFetched);
+            NmViewerViewNetReply* reply = NULL;
+            if (isFetched) {
+                reply = new NmViewerViewNetReply(data, mUiEngine);
+            }
+            else  {
+                reply = new NmViewerViewNetReply(data, mUiEngine,
+                        message->envelope().mailboxId(), message->envelope().folderId(),
+                        message->envelope().messageId(), partId);
+            }
+            reply->setOriginalRequest(myRequest);
+            return reply;
         }
+    }
     // If request is not for embedded image, forward to base class
     return QNetworkAccessManager::createRequest(op, myRequest, outgoingData);
 }
--- a/emailuis/nmailui/src/nmviewerviewnetreply.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmviewerviewnetreply.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -28,18 +28,52 @@
 /*!
     Constructor
 */
-NmViewerViewNetReply::NmViewerViewNetReply(QVariant data)
+NmViewerViewNetReply::NmViewerViewNetReply(QVariant data, NmUiEngine &uiEngine)
     : QNetworkReply(),
       mDataArray(data.toByteArray()),
+      mUiEngine(uiEngine),
+      mOperation(NULL),
       mReadIndex(0)
 {
+    NM_FUNCTION;
+    
     open(ReadWrite);
     setReadBufferSize(mDataArray.length());
     // QNetworkAccessManager starts listening the signals only
     // after the construction, so we cannot signal reply to be
     // ready instantly. We need to emit the signals after the
     // construction.
-    QTimer::singleShot(100, this, SLOT(signalReady()));
+    QMetaObject::invokeMethod(this, "signalReady", Qt::QueuedConnection);
+}
+
+/*!
+
+*/
+NmViewerViewNetReply::NmViewerViewNetReply(QVariant data, NmUiEngine &uiEngine, 
+        const NmId &mailboxId, const NmId &folderId, const NmId &messageId, 
+        const NmId &messagePartId)
+    : QNetworkReply(),
+      mDataArray(data.toByteArray()),
+      mUiEngine(uiEngine),
+      mMailboxId(mailboxId),
+      mFolderId(folderId),
+      mMessageId(messageId),
+      mMessagePartId(messagePartId),
+      mOperation(NULL),
+      mReadIndex(0)
+{
+    mOperation = uiEngine.fetchMessagePart(mMailboxId, mFolderId, mMessageId, mMessagePartId);
+    if (mOperation) {
+        connect(mOperation, SIGNAL(operationCompleted(int)),
+            this, SLOT(fetchCompleted(int)));
+        connect(mOperation, SIGNAL(operationCancelled()),
+            this, SLOT(fetchCancelled()));
+    }
+    else {
+        open(ReadWrite);
+        setReadBufferSize(mDataArray.length());
+        QMetaObject::invokeMethod(this, "signalReady", Qt::QueuedConnection);
+    }
 }
 
 /*!
@@ -47,6 +81,7 @@
 */
 NmViewerViewNetReply::~NmViewerViewNetReply()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -54,6 +89,8 @@
 */
 void NmViewerViewNetReply::signalReady()
 {
+    NM_FUNCTION;
+    
     // Insert embedded images into cache manually
     if(manager()) {
         if(manager()->cache() && request().url().scheme() == NMUI_NET_REPLY_CONTENT_ID) {
@@ -76,11 +113,60 @@
 }
 
 /*!
+    Slot. Called when fetch operation completes
+*/
+void NmViewerViewNetReply::fetchCompleted(int result)
+{
+    NM_FUNCTION;
+    
+    Q_UNUSED(result);
+    NmMessage *message = NULL;
+    message = mUiEngine.message(
+            mMailboxId,
+            mFolderId,
+            mMessageId);
+    if (message) {
+        QList<NmMessagePart*> partList;
+        message->attachmentList(partList);
+        NmMessagePart *part = NULL;
+        for (int i = 0; !part && i < partList.count(); i++) {
+            if (partList[i]->partId() == mMessagePartId) {
+                part = partList[i];
+            }
+        }
+        if (part) {
+            int error = mUiEngine.contentToMessagePart(mMailboxId, mFolderId, mMessageId, *part);
+            if (error == NmNoError) {
+                mDataArray = part->binaryContent();
+            }
+        }
+    }
+    delete message;
+    message = NULL;
+    open(ReadWrite);
+    setReadBufferSize(mDataArray.length());
+    QMetaObject::invokeMethod(this, "signalReady", Qt::QueuedConnection);
+}
+
+/*!
+    Slot. Called if fetch operation is cancelled
+*/
+void NmViewerViewNetReply::fetchCancelled()
+{
+    NM_FUNCTION;
+    
+    // just call fetch completed
+    fetchCompleted(NmCancelError);
+}
+
+/*!
     setOriginalRequest. This function is created to provide access to call
     base class' protected function setRequest
 */
 void NmViewerViewNetReply::setOriginalRequest(const QNetworkRequest &request)
 {
+    NM_FUNCTION;
+    
     setRequest(request);
 }
 
@@ -89,6 +175,8 @@
 */
 qint64 NmViewerViewNetReply::readData(char *data, qint64 maxlen)
 {
+    NM_FUNCTION;
+    
     qint64 i = 0;
     const qint64 dataLength(mDataArray.length());
 
@@ -107,6 +195,8 @@
 */
 qint64 NmViewerViewNetReply::readBufferSize() const
 {
+    NM_FUNCTION;
+    
     return mDataArray.length();
 }
 
@@ -118,6 +208,8 @@
 */
 qint64 NmViewerViewNetReply::bytesAvailable() const
 {
+    NM_FUNCTION;
+    
     return mDataArray.length() + QIODevice::bytesAvailable();
 }
 
@@ -126,6 +218,8 @@
 */
 bool NmViewerViewNetReply::isSequential () const
 {
+    NM_FUNCTION;
+    
     return false;
 }
 
@@ -135,5 +229,6 @@
 */
 void NmViewerViewNetReply::abort()
 {
+    NM_FUNCTION;
 }
 
--- a/emailuis/nmailui/src/nmviewerwebview.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/src/nmviewerwebview.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -23,6 +23,7 @@
 NmMailViewerWK::NmMailViewerWK()
 	:QGraphicsWebView()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -30,6 +31,8 @@
 */
 NmMailViewerWK::~NmMailViewerWK()
 {
+    NM_FUNCTION;
+    
     mContent.clear();
 }
 
@@ -38,28 +41,37 @@
 */
 void NmMailViewerWK::setParentView(NmViewerView *parentView)
 {
+    NM_FUNCTION;
+    
     mParentView = parentView;
 }
 
 /*!
     addContent. Function adds content into web view.
 */
-void NmMailViewerWK::addContent(QString key, QVariant val) {
-    mContent[key] = val;
+void NmMailViewerWK::addContent(QString key, QVariant val, NmId partId, bool isFetched) 
+{
+    NM_FUNCTION;
+    
+    mContent[key] = NmMailViewerWkContentItem(val, partId, isFetched);
 }
 
 /*!
     loadResource. Function returns resource from added content (added with addContent)
 */
-QVariant NmMailViewerWK::loadResource(int type, const QUrl &name)
+QVariant NmMailViewerWK::loadResource(int type, const QUrl &name, NmId &partId, bool &isFetched)
 {
+    NM_FUNCTION;
+    
     if (type == QTextDocument::ImageResource) {
         QString key = '<' + name.path() + '>';
         if (!mContent.contains(key)) {
             key = name.path();
         }
         if (mContent.contains(key)) {
-            return mContent[key];
+            partId = mContent[key].mPartId;
+            isFetched = mContent[key].mIsFetched;
+            return mContent[key].mData;
         }
         return 0;
     }
@@ -71,6 +83,8 @@
 */
 void NmMailViewerWK::sendMousePressEvent(QGraphicsSceneMouseEvent *event)
 {
+    NM_FUNCTION;
+    
     if (event){
         QGraphicsWebView::mousePressEvent(event);
     }
@@ -81,6 +95,8 @@
 */
 void NmMailViewerWK::sendMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
 {
+    NM_FUNCTION;
+    
     if (event) {
         QGraphicsWebView::mouseReleaseEvent(event);
     }
Binary file emailuis/nmailui/translations/mail.qm has changed
--- a/emailuis/nmailui/translations/mail.ts	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailui/translations/mail.ts	Wed Jun 23 17:00:39 2010 +0100
@@ -46,7 +46,7 @@
     <comment>Original message header data in the editor. Followed by the name/mail address of the recipient of the message.</comment>        
     <source>To:</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_editor_reply_sent</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_04_c</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
@@ -92,11 +92,21 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_dialog_no_mailboxes_defined">
+    <comment>When mail is selected and there are no mailboxes defined</comment>        
+    <source>No mailboxes defined</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_list_cc">
     <comment>Cc label in mail viewer</comment>        
     <source>Cc:</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_list_from</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_03</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
@@ -162,6 +172,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_shareui_send_as_mail">
+    <comment>text for share ui component. By selecting this the selected content will be sent as mail</comment>        
+    <source>Send as new mail</source>
+    <translation variants="yes" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_list_popup_pri_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>list</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_opt_add_priority_sub_high">
     <comment>Suboption for option &quot;Add priority&quot; to set mail as high priority.</comment>        
     <source>High</source>
@@ -183,10 +203,10 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mail_editor_reply_importance_high">
-    <comment>Custom layout ID parent. Original message header data in the editor. Level of importance for the message: High.</comment>        
+    <comment>Original message header data in the editor. Level of importance for the message: High.</comment>        
     <source>High</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_editor_reply_importance_high</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_04_c</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
@@ -222,6 +242,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_dialog_downloading_canceled">
+    <comment>A notification shown to a user when download cannot be completed because of there is not enough disk space.</comment>        
+    <source>Not enough memory - downloading canceled</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_dialog_1_deleted">
     <comment>Confirmation note shown after the mailbox is deleted succesfully. %[]1 is replaced with the name of the deleted mailbox.</comment>        
     <source>%[]1 deleted.</source>
@@ -276,27 +306,7 @@
     <comment>Original message header data in the editor. Followed by the subject of the message.</comment>        
     <source>Subject:</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_editor_reply_sent</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
-    <extra-loc-positionid>list</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_mail_menu_search_from_server">
-    <comment>Item specific command for searching number &amp;address from the service. IS THIS NEEDED?</comment>        
-    <source>search from server</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
-    <extra-loc-positionid>menu</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_mail_list_re">
-    <comment>Prefix in subject field in the editor. This indicates that the mail is replyed</comment>        
-    <source>Re:</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_list_fw</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_04_c</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
@@ -312,16 +322,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_menu_send_mail">
-    <comment>Item specific command for sending mail to a contact</comment>        
-    <source>send mail</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
-    <extra-loc-positionid>menu</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_shareui_sending_please_wait">
     <comment>Text for shared UI component wait note. Shown when the user has sent an email from shared UI.</comment>        
     <source>Sending, please wait</source>
@@ -332,16 +332,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_list_fw">
-    <comment>Custom layout ID parent. Prefix in subject field in the editor. This indicates that the mail is forwarded</comment>        
-    <source>Fw:</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_list_fw</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
-    <extra-loc-positionid>list</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_dialog_invalid_mail_address_send">
     <comment>Note in editor when the user has typed incorrect mail address (e.g. without @-character). %[]1 is replaced with the name of the invalid mail address. Pressing yes sends the mail anyway</comment>        
     <source>Invalid mail address: %[]1. Send anyway?</source>
@@ -352,13 +342,13 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_menu_open_contact_card">
-    <comment>Item specific command for opening contact card from mail viewer</comment>        
-    <source>open contact card</source>
+<message numerus="no" id="txt_mail_list_searching">
+    <comment>Text for indicating that the search is ongoing in mail list view. Component is simple label</comment>        
+    <source>Seaching</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
-    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-layout_id>txt_mail_subhead_inbox</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
@@ -373,20 +363,40 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mail_list_from">
-    <comment>Custom layout ID parent. From label in mail viewer </comment>        
+    <comment>From label in mail viewer </comment>        
     <source>From:</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_list_from</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_03</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_nmailui_forward_subject_prefix">
+    <comment>Text for subject field if the message is forwarded.</comment>        
+    <source>Fw:</source>
+    <translation variants="yes" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_3_val</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_mail_opt_folder_sub_deleted">
+    <comment>Submenu item for Options menus item Folder (txt_mail_opt_change_folder)</comment>        
+    <source>Deleted items</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_menu_sec_add</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_01_a</extra-loc-viewid>
+    <extra-loc-positionid>opt_2_sub</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_editor_reply_importance_low">
     <comment>Original message header data in the editor. Level of importance for the message: Low.</comment>        
     <source>Low</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_editor_reply_importance_high</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_04_c</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
@@ -396,7 +406,7 @@
     <comment>Original message header data in the editor. Followed by the name(s)/mail address(es) of the receipients to whom a copy of the message is sent.</comment>        
     <source>Cc:</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_editor_reply_sent</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_04_c</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
@@ -412,6 +422,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_status_menu_new_mail">
+    <comment>Secondary text for status menu item: indicates the there are new mail messages</comment>        
+    <source>New Mail</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id></extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>list</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_dialog_server_settings_incorrect">
     <comment>Notification shown when the connection fails (e.g. when syncing) due to server settings. </comment>        
     <source>Server settings are incorrect. Do you want to check the settings?</source>
@@ -462,16 +482,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dialog_delete_message">
-    <comment>This conifrmation is shown if the user presses &quot;Back&quot; in the editor. Selecting yes deletes the composed message. &quot;No&quot; returns to the editor.</comment>        
-    <source>Delete message?</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_dialog_invalid_mail_address">
     <comment>Note in editor when the user has typed incorrect mail address (e.g. without @-character). %[]1 is replaced with the name of the invalid mail address.</comment>        
     <source>Invalid mail address: %[]1</source>
@@ -512,13 +522,13 @@
     <extra-loc-feature>Mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dialog_deleting_mailbox">
-    <comment>Wait note for the case where the mailbox is beign deleted.</comment>        
-    <source>Deleting mailbox</source>
+<message numerus="no" id="txt_mail_dblist_no_messages_matched_your_search">
+    <comment>A text shown in mail list view, if there are no matches to a search.</comment>        
+    <source>No messages matched your search. Try another search term. </source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dialog_pri3</extra-loc-layout_id>    
+    <extra-loc-layout_id>qtl_view_empty_title_pri</extra-loc-layout_id>    
     <extra-loc-viewid>mail</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-positionid>dblist_4</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
@@ -532,11 +542,21 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_dialog_deleting_mailbox">
+    <comment>Wait note for the case where the mailbox is beign deleted.</comment>        
+    <source>Deleting mailbox</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri3</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>dialog</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_editor_reply_importance">
     <comment>Original message header data in the editor. The user can select the level of importance for the message (High txt_mail_editor_reply_importance_high or Low txt_mail_editor_reply_importance_low).</comment>        
     <source>Importance:</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_editor_reply_sent</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_04_c</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
@@ -546,52 +566,22 @@
     <comment>To label in mail viewer</comment>        
     <source>To:</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_list_from</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_03</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dialog_data_has_been_deleted_to_protect_a">
-    <comment></comment>        
-    <source>Data has been deleted to protect against theft or loss. Contact you system administrator</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id></extra-loc-layout_id>    
-    <extra-loc-viewid>mail</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_mail_dialog_cannot_open_the_attachment_deleted">
-    <comment></comment>        
-    <source>Cannot open the attachment deleted on the server</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id></extra-loc-layout_id>    
-    <extra-loc-viewid>mail</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_editor_reply_sent">
     <comment>Original message header data in the editor. Followed by the date when the message was sent.</comment>        
     <source>Sent:</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_editor_reply_sent</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_04_c</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dialog_account_disabled_due_to_security_i">
-    <comment></comment>        
-    <source>Account disabled due to security issues. Contact your system administrator.</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id></extra-loc-layout_id>    
-    <extra-loc-viewid>mail</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_dialog_unable_to_open_attachment_file_ty">
     <comment>Error note. If the user tries to open an attachment which cannot be viewed</comment>        
     <source>Unable to open. Attachment file type not supported</source>
@@ -612,6 +602,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_nmailui_reply_subject_prefix">
+    <comment>Text for subject field if the message is replyed.</comment>        
+    <source>Re:</source>
+    <translation variants="yes" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-positionid>dblist_3_val</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_opt_send_and_receive_now">
     <comment>Options menu item for synchronize mail folders with the mail server content (sending and receiving mail)</comment>        
     <source>Refresh</source>
@@ -646,7 +646,7 @@
     <comment>Original message header data in the editor. Separates the original mail message from the edit area of the new message the user is typing.</comment>        
     <source>---- Original message ----</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_editor_reply_sent</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_04_c</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
@@ -712,16 +712,6 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dialog_conversion_error_unable_to_show_t">
-    <comment></comment>        
-    <source>Conversion error. Unable to show the content properly</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id></extra-loc-layout_id>    
-    <extra-loc-viewid>mail</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mail_editor_bcc">
     <comment>Bcc: label in mail editor</comment>        
     <source>Bcc:</source>
@@ -732,6 +722,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_opt_folder_sub_drafts">
+    <comment>Submenu item for Options menus item Folder (txt_mail_opt_change_folder)</comment>        
+    <source>Drafts</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_menu_sec_add</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_01_a</extra-loc-viewid>
+    <extra-loc-positionid>opt_2_sub</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_editor_cc">
     <comment>Cc: label in mail editor</comment>        
     <source>Cc:</source>
@@ -752,6 +752,26 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_opt_folder_sub_inbox">
+    <comment>Submenu item for Options menus item Folder (txt_mail_opt_change_folder)</comment>        
+    <source>Inbox </source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_menu_sec_add</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_01_a</extra-loc-viewid>
+    <extra-loc-positionid>opt_2_sub</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
+<message numerus="no" id="txt_mail_opt_folder_sub_sent">
+    <comment>Submenu item for Options menus item Folder (txt_mail_opt_change_folder)</comment>        
+    <source>Sent</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_menu_sec_add</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_01_a</extra-loc-viewid>
+    <extra-loc-positionid>opt_2_sub</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_dialog_unable_to_add_attachment">
     <comment>Error note for the case where the selected file cannot be attached (it&apos;s deleted, moved etc. at the same time)</comment>        
     <source>Unable to add attachment </source>
@@ -772,11 +792,21 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_opt_folder_sub_outbox">
+    <comment>Submenu item for Options menus item Folder (txt_mail_opt_change_folder)</comment>        
+    <source>Outbox</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_menu_sec_add</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_01_a</extra-loc-viewid>
+    <extra-loc-positionid>opt_2_sub</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_editor_reply_from">
     <comment>Original message header data in the editor. Followed by the name/mail address of the sender of the message.</comment>        
     <source>From:</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_editor_reply_sent</extra-loc-layout_id>    
+    <extra-loc-layout_id>none</extra-loc-layout_id>    
     <extra-loc-viewid>mail_04_c</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
@@ -792,6 +822,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_status_menu_waiting_to_send">
+    <comment>Text for status menu item: indicates that there are unsent messages in outbox. %L1 is the number of unsent mails in that mailbox.</comment>        
+    <source>Waiting to send (%L1)</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id></extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid></extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_dialog_do_you_want_to_delete_mfe">
     <comment>Confirmation note for mailbox deleting. This will delete also contacts, calendar and tasks data, which has been synchronized via this account. This MfE protocol only</comment>        
     <source>Do you want to delete all mail, calendar, contacts and tasks data related to this account?</source>
@@ -832,13 +872,13 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_menu_search_from_service">
-    <comment>Item specific command for searching number &amp;address from the service</comment>        
-    <source>search from service</source>
+<message numerus="no" id="txt_mail_list_search_results">
+    <comment>Text for indicating the search results in mail list view. Component is simple label</comment>        
+    <source>%L1 results</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
-    <extra-loc-positionid>menu</extra-loc-positionid>
+    <extra-loc-layout_id>txt_mail_subhead_inbox</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
@@ -922,25 +962,5 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_dialog_1_is_disabled_enable">
-    <comment></comment>        
-    <source>%1 is disabled, enable?</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id></extra-loc-layout_id>    
-    <extra-loc-viewid>mail</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
-<message numerus="no" id="txt_mail_dialog_password_expired_new_security_cre">
-    <comment></comment>        
-    <source>Password expired. New security credentials must be created on your computer.</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id></extra-loc-layout_id>    
-    <extra-loc-viewid>mail</extra-loc-viewid>
-    <extra-loc-positionid>dialog</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 </context>
 </TS>
--- a/emailuis/nmailuiengine/bwins/nmailuiengineu.def	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/bwins/nmailuiengineu.def	Wed Jun 23 17:00:39 2010 +0100
@@ -4,12 +4,12 @@
 	?insertDividerIntoModel@NmMessageListModel@@AAEXPAVNmMessageEnvelope@@H@Z @ 3 NONAME ; void NmMessageListModel::insertDividerIntoModel(class NmMessageEnvelope *, int)
 	?goOnline@NmUiEngine@@QAEHABVNmId@@@Z @ 4 NONAME ; int NmUiEngine::goOnline(class NmId const &)
 	??0NmStoreEnvelopesOperation@@QAE@XZ @ 5 NONAME ; NmStoreEnvelopesOperation::NmStoreEnvelopesOperation(void)
-	?currentMailboxId@NmMessageListModel@@QAE?AVNmId@@XZ @ 6 NONAME ; class NmId NmMessageListModel::currentMailboxId(void)
-	?folderById@NmDataManager@@QAEPAVNmFolderMetaData@@ABVNmId@@0@Z @ 7 NONAME ; class NmFolderMetaData * NmDataManager::folderById(class NmId const &, class NmId const &)
-	?removeAttachment@NmBaseClientPlugin@@QAEXXZ @ 8 NONAME ; void NmBaseClientPlugin::removeAttachment(void)
-	?completeOperationPart@NmAddAttachmentsOperation@@QAEXABVQString@@ABVNmId@@H@Z @ 9 NONAME ; void NmAddAttachmentsOperation::completeOperationPart(class QString const &, class NmId const &, int)
-	?data@NmMessageSearchListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 10 NONAME ; class QVariant NmMessageSearchListModel::data(class QModelIndex const &, int) const
-	?qt_metacast@NmMessageSearchListModel@@UAEPAXPBD@Z @ 11 NONAME ; void * NmMessageSearchListModel::qt_metacast(char const *)
+	?applicationStateInterfaceInstance@NmDataPluginFactory@@QAEPAVNmApplicationStateInterface@@VNmId@@@Z @ 6 NONAME ; class NmApplicationStateInterface * NmDataPluginFactory::applicationStateInterfaceInstance(class NmId)
+	?currentMailboxId@NmMessageListModel@@QAE?AVNmId@@XZ @ 7 NONAME ; class NmId NmMessageListModel::currentMailboxId(void)
+	?folderById@NmDataManager@@QAEPAVNmFolderMetaData@@ABVNmId@@0@Z @ 8 NONAME ; class NmFolderMetaData * NmDataManager::folderById(class NmId const &, class NmId const &)
+	?removeAttachment@NmBaseClientPlugin@@QAEXXZ @ 9 NONAME ; void NmBaseClientPlugin::removeAttachment(void)
+	?handleCompletedSaveDraftOperation@NmUiEngine@@QAEXXZ @ 10 NONAME ; void NmUiEngine::handleCompletedSaveDraftOperation(void)
+	?completeOperationPart@NmAddAttachmentsOperation@@QAEXABVQString@@ABVNmId@@H@Z @ 11 NONAME ; void NmAddAttachmentsOperation::completeOperationPart(class QString const &, class NmId const &, int)
 	?releaseInstance@NmUiEngine@@SAXAAPAV1@@Z @ 12 NONAME ; void NmUiEngine::releaseInstance(class NmUiEngine * &)
 	?id@NmMailboxMetaData@@QBE?AVNmId@@XZ @ 13 NONAME ; class NmId NmMailboxMetaData::id(void) const
 	??1NmMessageCreationOperation@@MAE@XZ @ 14 NONAME ; NmMessageCreationOperation::~NmMessageCreationOperation(void)
@@ -17,15 +17,15 @@
 	?setName@NmMailboxMetaData@@QAEXABVQString@@@Z @ 16 NONAME ; void NmMailboxMetaData::setName(class QString const &)
 	?staticMetaObject@NmStoreEnvelopesOperation@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const NmStoreEnvelopesOperation::staticMetaObject
 	?handleMessageEvent@NmUiEngine@@AAEXW4NmMessageEvent@@ABVNmId@@ABV?$QList@VNmId@@@@1@Z @ 18 NONAME ; void NmUiEngine::handleMessageEvent(enum NmMessageEvent, class NmId const &, class QList<class NmId> const &, class NmId const &)
-	?tr@NmMessageSearchListModel@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString NmMessageSearchListModel::tr(char const *, char const *)
-	?isRunning@NmOperation@@QBE_NXZ @ 20 NONAME ; bool NmOperation::isRunning(void) const
-	?setPriorityLow@NmBaseClientPlugin@@QAEXXZ @ 21 NONAME ; void NmBaseClientPlugin::setPriorityLow(void)
-	?tr@NmMessageCreationOperation@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString NmMessageCreationOperation::tr(char const *, char const *, int)
-	?openMessage@NmBaseClientPlugin@@QAEXXZ @ 23 NONAME ; void NmBaseClientPlugin::openMessage(void)
-	?getStaticMetaObject@NmMailboxListModel@@SAABUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const & NmMailboxListModel::getStaticMetaObject(void)
-	?envelope@NmMessageListModelItem@@QBEABVNmMessageEnvelope@@XZ @ 25 NONAME ; class NmMessageEnvelope const & NmMessageListModelItem::envelope(void) const
-	?qt_metacall@NmMailboxListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 26 NONAME ; int NmMailboxListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?listMailboxIds@NmDataManager@@QAEXAAV?$QList@VNmId@@@@@Z @ 27 NONAME ; void NmDataManager::listMailboxIds(class QList<class NmId> &)
+	?isRunning@NmOperation@@QBE_NXZ @ 19 NONAME ; bool NmOperation::isRunning(void) const
+	?setPriorityLow@NmBaseClientPlugin@@QAEXXZ @ 20 NONAME ; void NmBaseClientPlugin::setPriorityLow(void)
+	?tr@NmMessageCreationOperation@@SA?AVQString@@PBD0H@Z @ 21 NONAME ; class QString NmMessageCreationOperation::tr(char const *, char const *, int)
+	?openMessage@NmBaseClientPlugin@@QAEXXZ @ 22 NONAME ; void NmBaseClientPlugin::openMessage(void)
+	?getStaticMetaObject@NmMailboxListModel@@SAABUQMetaObject@@XZ @ 23 NONAME ; struct QMetaObject const & NmMailboxListModel::getStaticMetaObject(void)
+	?envelope@NmMessageListModelItem@@QBEABVNmMessageEnvelope@@XZ @ 24 NONAME ; class NmMessageEnvelope const & NmMessageListModelItem::envelope(void) const
+	?qt_metacall@NmMailboxListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 25 NONAME ; int NmMailboxListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?listMailboxIds@NmDataManager@@QAEXAAV?$QList@VNmId@@@@@Z @ 26 NONAME ; void NmDataManager::listMailboxIds(class QList<class NmId> &)
+	?removeDraftMessage@NmUiEngine@@QAEXPAVNmMessage@@@Z @ 27 NONAME ; void NmUiEngine::removeDraftMessage(class NmMessage *)
 	??0NmDataManager@@QAE@XZ @ 28 NONAME ; NmDataManager::NmDataManager(void)
 	?trUtf8@NmAddAttachmentsOperation@@SA?AVQString@@PBD0H@Z @ 29 NONAME ; class QString NmAddAttachmentsOperation::trUtf8(char const *, char const *, int)
 	?refresh@NmMailboxListModel@@QAEXAAV?$QList@PAVNmMailbox@@@@@Z @ 30 NONAME ; void NmMailboxListModel::refresh(class QList<class NmMailbox *> &)
@@ -35,24 +35,24 @@
 	??_ENmFolderListModel@@UAE@I@Z @ 34 NONAME ; NmFolderListModel::~NmFolderListModel(unsigned int)
 	?contentToMessagePart@NmDataManager@@QAEHABVNmId@@00AAVNmMessagePart@@@Z @ 35 NONAME ; int NmDataManager::contentToMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmMessagePart &)
 	?setExpanded@NmMessageListModelItem@@QAEX_N@Z @ 36 NONAME ; void NmMessageListModelItem::setExpanded(bool)
-	?qt_metacall@NmMessageSearchListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 37 NONAME ; int NmMessageSearchListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?staticMetaObject@NmCheckOutboxOperation@@2UQMetaObject@@B @ 38 NONAME ; struct QMetaObject const NmCheckOutboxOperation::staticMetaObject
-	?getStaticMetaObject@NmStoreEnvelopesOperation@@SAABUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const & NmStoreEnvelopesOperation::getStaticMetaObject(void)
-	?setPriorityHigh@NmBaseClientPlugin@@QAEXXZ @ 40 NONAME ; void NmBaseClientPlugin::setPriorityHigh(void)
-	??0NmAddAttachmentsOperation@@QAE@XZ @ 41 NONAME ; NmAddAttachmentsOperation::NmAddAttachmentsOperation(void)
-	?deleteMessage@NmBaseClientPlugin@@QAEXXZ @ 42 NONAME ; void NmBaseClientPlugin::deleteMessage(void)
-	?getStaticMetaObject@NmAddAttachmentsOperation@@SAABUQMetaObject@@XZ @ 43 NONAME ; struct QMetaObject const & NmAddAttachmentsOperation::getStaticMetaObject(void)
-	?standardFolderId@NmUiEngine@@QAE?AVNmId@@ABV2@W4NmFolderType@@@Z @ 44 NONAME ; class NmId NmUiEngine::standardFolderId(class NmId const &, enum NmFolderType)
-	?settings@NmBaseClientPlugin@@QAEXXZ @ 45 NONAME ; void NmBaseClientPlugin::settings(void)
-	?staticMetaObject@NmUiEngine@@2UQMetaObject@@B @ 46 NONAME ; struct QMetaObject const NmUiEngine::staticMetaObject
-	?mailboxDeleted@NmUiEngine@@IAEXABVNmId@@@Z @ 47 NONAME ; void NmUiEngine::mailboxDeleted(class NmId const &)
-	?getIcon@NmIcons@@SAAAVHbIcon@@W4Icon@1@@Z @ 48 NONAME ; class HbIcon & NmIcons::getIcon(enum NmIcons::Icon)
-	?itemType@NmMessageListModelItem@@QBE?AW4NmMessageItemType@1@XZ @ 49 NONAME ; enum NmMessageListModelItem::NmMessageItemType NmMessageListModelItem::itemType(void) const
-	?mInstance@NmDataPluginFactory@@0PAV1@A @ 50 NONAME ; class NmDataPluginFactory * NmDataPluginFactory::mInstance
-	?data@NmFolderListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 51 NONAME ; class QVariant NmFolderListModel::data(class QModelIndex const &, int) const
-	?setName@NmFolderMetaData@@QAEXABVQString@@@Z @ 52 NONAME ; void NmFolderMetaData::setName(class QString const &)
-	?mReferenceCount@NmUiEngine@@0HA @ 53 NONAME ; int NmUiEngine::mReferenceCount
-	?listFolders@NmDataManager@@QAEXVNmId@@AAV?$QList@PAVNmFolder@@@@@Z @ 54 NONAME ; void NmDataManager::listFolders(class NmId, class QList<class NmFolder *> &)
+	?saveDraftMessage@NmUiEngine@@QAEXPAVNmMessage@@ABV?$QList@PAVNmOperation@@@@@Z @ 37 NONAME ; void NmUiEngine::saveDraftMessage(class NmMessage *, class QList<class NmOperation *> const &)
+	?getStaticMetaObject@NmStoreEnvelopesOperation@@SAABUQMetaObject@@XZ @ 38 NONAME ; struct QMetaObject const & NmStoreEnvelopesOperation::getStaticMetaObject(void)
+	?setPriorityHigh@NmBaseClientPlugin@@QAEXXZ @ 39 NONAME ; void NmBaseClientPlugin::setPriorityHigh(void)
+	??0NmAddAttachmentsOperation@@QAE@XZ @ 40 NONAME ; NmAddAttachmentsOperation::NmAddAttachmentsOperation(void)
+	?deleteMessage@NmBaseClientPlugin@@QAEXXZ @ 41 NONAME ; void NmBaseClientPlugin::deleteMessage(void)
+	?getStaticMetaObject@NmAddAttachmentsOperation@@SAABUQMetaObject@@XZ @ 42 NONAME ; struct QMetaObject const & NmAddAttachmentsOperation::getStaticMetaObject(void)
+	?standardFolderId@NmUiEngine@@QAE?AVNmId@@ABV2@W4NmFolderType@@@Z @ 43 NONAME ; class NmId NmUiEngine::standardFolderId(class NmId const &, enum NmFolderType)
+	?settings@NmBaseClientPlugin@@QAEXXZ @ 44 NONAME ; void NmBaseClientPlugin::settings(void)
+	?staticMetaObject@NmUiEngine@@2UQMetaObject@@B @ 45 NONAME ; struct QMetaObject const NmUiEngine::staticMetaObject
+	?mailboxDeleted@NmUiEngine@@IAEXABVNmId@@@Z @ 46 NONAME ; void NmUiEngine::mailboxDeleted(class NmId const &)
+	?getIcon@NmIcons@@SAAAVHbIcon@@W4Icon@1@@Z @ 47 NONAME ; class HbIcon & NmIcons::getIcon(enum NmIcons::Icon)
+	?itemType@NmMessageListModelItem@@QBE?AW4NmMessageItemType@1@XZ @ 48 NONAME ; enum NmMessageListModelItem::NmMessageItemType NmMessageListModelItem::itemType(void) const
+	?mInstance@NmDataPluginFactory@@0PAV1@A @ 49 NONAME ; class NmDataPluginFactory * NmDataPluginFactory::mInstance
+	?data@NmFolderListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 50 NONAME ; class QVariant NmFolderListModel::data(class QModelIndex const &, int) const
+	?setName@NmFolderMetaData@@QAEXABVQString@@@Z @ 51 NONAME ; void NmFolderMetaData::setName(class QString const &)
+	?mReferenceCount@NmUiEngine@@0HA @ 52 NONAME ; int NmUiEngine::mReferenceCount
+	?listFolders@NmDataManager@@QAEXVNmId@@AAV?$QList@PAVNmFolder@@@@@Z @ 53 NONAME ; void NmDataManager::listFolders(class NmId, class QList<class NmFolder *> &)
+	?fetchMessageParts@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmId@@00ABV?$QList@VNmId@@@@@Z @ 54 NONAME ; class QPointer<class NmOperation> NmUiEngine::fetchMessageParts(class NmId const &, class NmId const &, class NmId const &, class QList<class NmId> const &)
 	?cancelSearch@NmUiEngine@@QAEHABVNmId@@@Z @ 55 NONAME ; int NmUiEngine::cancelSearch(class NmId const &)
 	?data@NmMailboxListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 56 NONAME ; class QVariant NmMailboxListModel::data(class QModelIndex const &, int) const
 	?metaObject@NmMessageCreationOperation@@UBEPBUQMetaObject@@XZ @ 57 NONAME ; struct QMetaObject const * NmMessageCreationOperation::metaObject(void) const
@@ -64,53 +64,53 @@
 	?refresh@NmBaseClientPlugin@@QAEXXZ @ 63 NONAME ; void NmBaseClientPlugin::refresh(void)
 	??1NmFolderMetaData@@UAE@XZ @ 64 NONAME ; NmFolderMetaData::~NmFolderMetaData(void)
 	??1NmMessageSendingOperation@@MAE@XZ @ 65 NONAME ; NmMessageSendingOperation::~NmMessageSendingOperation(void)
-	?staticMetaObject@NmMessageSearchListModel@@2UQMetaObject@@B @ 66 NONAME ; struct QMetaObject const NmMessageSearchListModel::staticMetaObject
-	?name@NmFolderMetaData@@QBE?AVQString@@XZ @ 67 NONAME ; class QString NmFolderMetaData::name(void) const
-	??_ENmMessageCreationOperation@@UAE@I@Z @ 68 NONAME ; NmMessageCreationOperation::~NmMessageCreationOperation(unsigned int)
-	?sendMail@NmBaseClientPlugin@@QAEXXZ @ 69 NONAME ; void NmBaseClientPlugin::sendMail(void)
-	?insertNewMessageIntoModel@NmMessageListModel@@AAEXABVNmId@@00@Z @ 70 NONAME ; void NmMessageListModel::insertNewMessageIntoModel(class NmId const &, class NmId const &, class NmId const &)
-	?getStaticMetaObject@NmUiEngine@@SAABUQMetaObject@@XZ @ 71 NONAME ; struct QMetaObject const & NmUiEngine::getStaticMetaObject(void)
+	?name@NmFolderMetaData@@QBE?AVQString@@XZ @ 66 NONAME ; class QString NmFolderMetaData::name(void) const
+	??_ENmMessageCreationOperation@@UAE@I@Z @ 67 NONAME ; NmMessageCreationOperation::~NmMessageCreationOperation(unsigned int)
+	?sendMail@NmBaseClientPlugin@@QAEXXZ @ 68 NONAME ; void NmBaseClientPlugin::sendMail(void)
+	?insertNewMessageIntoModel@NmMessageListModel@@AAEXABVNmId@@00@Z @ 69 NONAME ; void NmMessageListModel::insertNewMessageIntoModel(class NmId const &, class NmId const &, class NmId const &)
+	?getStaticMetaObject@NmUiEngine@@SAABUQMetaObject@@XZ @ 70 NONAME ; struct QMetaObject const & NmUiEngine::getStaticMetaObject(void)
+	?applicationStateInterfaceInstance@NmDataPluginFactory@@AAEPAVNmApplicationStateInterface@@PAVQObject@@@Z @ 71 NONAME ; class NmApplicationStateInterface * NmDataPluginFactory::applicationStateInterfaceInstance(class QObject *)
 	?metaObject@NmMessageListModel@@UBEPBUQMetaObject@@XZ @ 72 NONAME ; struct QMetaObject const * NmMessageListModel::metaObject(void) const
 	?messageBeingSent@NmUiEngine@@QBEPBVNmMessage@@XZ @ 73 NONAME ; class NmMessage const * NmUiEngine::messageBeingSent(void) const
 	?handleMailboxEvent@NmUiEngine@@AAEXW4NmMailboxEvent@@ABV?$QList@VNmId@@@@@Z @ 74 NONAME ; void NmUiEngine::handleMailboxEvent(enum NmMailboxEvent, class QList<class NmId> const &)
 	?interfaceInstance@NmDataPluginFactory@@QAEPAVNmDataPluginInterface@@VNmId@@@Z @ 75 NONAME ; class NmDataPluginInterface * NmDataPluginFactory::interfaceInstance(class NmId)
-	?trUtf8@NmMessageSearchListModel@@SA?AVQString@@PBD0@Z @ 76 NONAME ; class QString NmMessageSearchListModel::trUtf8(char const *, char const *)
-	?goOffline@NmBaseClientPlugin@@AAEXABVNmId@@@Z @ 77 NONAME ; void NmBaseClientPlugin::goOffline(class NmId const &)
-	?sendMessage@NmUiEngine@@QAEXPAVNmMessage@@ABV?$QList@PAVNmOperation@@@@@Z @ 78 NONAME ; void NmUiEngine::sendMessage(class NmMessage *, class QList<class NmOperation *> const &)
-	?tr@NmDataManager@@SA?AVQString@@PBD0H@Z @ 79 NONAME ; class QString NmDataManager::tr(char const *, char const *, int)
-	??0NmMailboxListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 80 NONAME ; NmMailboxListModel::NmMailboxListModel(class NmDataManager &, class QObject *)
-	?trUtf8@NmCheckOutboxOperation@@SA?AVQString@@PBD0@Z @ 81 NONAME ; class QString NmCheckOutboxOperation::trUtf8(char const *, char const *)
-	?setPriorityNormal@NmBaseClientPlugin@@QAEXXZ @ 82 NONAME ; void NmBaseClientPlugin::setPriorityNormal(void)
-	??_ENmMessageSendingOperation@@UAE@I@Z @ 83 NONAME ; NmMessageSendingOperation::~NmMessageSendingOperation(unsigned int)
-	?changed@NmMessageListModel@@AAE_NABVNmMessageEnvelope@@0@Z @ 84 NONAME ; bool NmMessageListModel::changed(class NmMessageEnvelope const &, class NmMessageEnvelope const &)
-	?openAttachment@NmBaseClientPlugin@@QAEXXZ @ 85 NONAME ; void NmBaseClientPlugin::openAttachment(void)
-	?staticMetaObject@NmMessageCreationOperation@@2UQMetaObject@@B @ 86 NONAME ; struct QMetaObject const NmMessageCreationOperation::staticMetaObject
-	?handleMailboxEvent@NmMailboxListModel@@QAEXW4NmMailboxEvent@@ABV?$QList@VNmId@@@@@Z @ 87 NONAME ; void NmMailboxListModel::handleMailboxEvent(enum NmMailboxEvent, class QList<class NmId> const &)
-	?metaObject@NmStoreEnvelopesOperation@@UBEPBUQMetaObject@@XZ @ 88 NONAME ; struct QMetaObject const * NmStoreEnvelopesOperation::metaObject(void) const
-	?trUtf8@NmMailboxListModel@@SA?AVQString@@PBD0H@Z @ 89 NONAME ; class QString NmMailboxListModel::trUtf8(char const *, char const *, int)
-	?mPluginArray@NmDataPluginFactory@@0PAV?$QList@PAVQObject@@@@A @ 90 NONAME ; class QList<class QObject *> * NmDataPluginFactory::mPluginArray
-	?instance@NmDataPluginFactory@@SAPAV1@XZ @ 91 NONAME ; class NmDataPluginFactory * NmDataPluginFactory::instance(void)
-	?getStaticMetaObject@NmMessageListModel@@SAABUQMetaObject@@XZ @ 92 NONAME ; struct QMetaObject const & NmMessageListModel::getStaticMetaObject(void)
-	?deleteMessageFromViewerView@NmBaseClientPlugin@@QAEXXZ @ 93 NONAME ; void NmBaseClientPlugin::deleteMessageFromViewerView(void)
-	?tr@NmUiEngine@@SA?AVQString@@PBD0H@Z @ 94 NONAME ; class QString NmUiEngine::tr(char const *, char const *, int)
-	?refresh@NmMessageListModel@@QAEXVNmId@@0ABV?$QList@PAVNmMessageEnvelope@@@@@Z @ 95 NONAME ; void NmMessageListModel::refresh(class NmId, class NmId, class QList<class NmMessageEnvelope *> const &)
-	?mailboxById@NmUiEngine@@QAEPAVNmMailboxMetaData@@ABVNmId@@@Z @ 96 NONAME ; class NmMailboxMetaData * NmUiEngine::mailboxById(class NmId const &)
-	?createNewMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@@Z @ 97 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createNewMessage(class NmId const &)
-	?tr@NmCheckOutboxOperation@@SA?AVQString@@PBD0@Z @ 98 NONAME ; class QString NmCheckOutboxOperation::tr(char const *, char const *)
-	??_ENmMessageListModelItem@@UAE@I@Z @ 99 NONAME ; NmMessageListModelItem::~NmMessageListModelItem(unsigned int)
-	?replyAllMail@NmBaseClientPlugin@@QAEXXZ @ 100 NONAME ; void NmBaseClientPlugin::replyAllMail(void)
-	?syncStateEvent@NmUiEngine@@IAEXW4NmSyncState@@ABVNmId@@@Z @ 101 NONAME ; void NmUiEngine::syncStateEvent(enum NmSyncState, class NmId const &)
-	?trUtf8@NmDataManager@@SA?AVQString@@PBD0@Z @ 102 NONAME ; class QString NmDataManager::trUtf8(char const *, char const *)
-	?setEnvelopeProperties@NmMessageListModel@@QAEXW4NmEnvelopeProperties@@ABV?$QList@VNmId@@@@@Z @ 103 NONAME ; void NmMessageListModel::setEnvelopeProperties(enum NmEnvelopeProperties, class QList<class NmId> const &)
-	??1NmStoreEnvelopesOperation@@MAE@XZ @ 104 NONAME ; NmStoreEnvelopesOperation::~NmStoreEnvelopesOperation(void)
-	?tr@NmUiEngine@@SA?AVQString@@PBD0@Z @ 105 NONAME ; class QString NmUiEngine::tr(char const *, char const *)
-	?mPluginLoaderArray@NmDataPluginFactory@@0V?$QList@PAVQPluginLoader@@@@A @ 106 NONAME ; class QList<class QPluginLoader *> NmDataPluginFactory::mPluginLoaderArray
-	?trUtf8@NmBaseClientPlugin@@SA?AVQString@@PBD0@Z @ 107 NONAME ; class QString NmBaseClientPlugin::trUtf8(char const *, char const *)
-	?deleteOperation@NmOperation@@AAEXXZ @ 108 NONAME ; void NmOperation::deleteOperation(void)
-	?trUtf8@NmBaseClientPlugin@@SA?AVQString@@PBD0H@Z @ 109 NONAME ; class QString NmBaseClientPlugin::trUtf8(char const *, char const *, int)
-	?createViewerViewCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 110 NONAME ; void NmBaseClientPlugin::createViewerViewCommands(class NmActionRequest const &, class QList<class NmAction *> &)
-	?fetchMessagePart@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmId@@000@Z @ 111 NONAME ; class QPointer<class NmOperation> NmUiEngine::fetchMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmId const &)
-	?tr@NmMailboxListModel@@SA?AVQString@@PBD0H@Z @ 112 NONAME ; class QString NmMailboxListModel::tr(char const *, char const *, int)
+	?goOffline@NmBaseClientPlugin@@AAEXABVNmId@@@Z @ 76 NONAME ; void NmBaseClientPlugin::goOffline(class NmId const &)
+	?sendMessage@NmUiEngine@@QAEXPAVNmMessage@@ABV?$QList@PAVNmOperation@@@@@Z @ 77 NONAME ; void NmUiEngine::sendMessage(class NmMessage *, class QList<class NmOperation *> const &)
+	?tr@NmDataManager@@SA?AVQString@@PBD0H@Z @ 78 NONAME ; class QString NmDataManager::tr(char const *, char const *, int)
+	??0NmMailboxListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 79 NONAME ; NmMailboxListModel::NmMailboxListModel(class NmDataManager &, class QObject *)
+	?handleMessageEvent@NmMessageListModel@@QAEXW4NmMessageEvent@@ABVNmId@@ABV?$QList@VNmId@@@@1@Z @ 80 NONAME ; void NmMessageListModel::handleMessageEvent(enum NmMessageEvent, class NmId const &, class QList<class NmId> const &, class NmId const &)
+	?setPriorityNormal@NmBaseClientPlugin@@QAEXXZ @ 81 NONAME ; void NmBaseClientPlugin::setPriorityNormal(void)
+	??_ENmMessageSendingOperation@@UAE@I@Z @ 82 NONAME ; NmMessageSendingOperation::~NmMessageSendingOperation(unsigned int)
+	?changed@NmMessageListModel@@AAE_NABVNmMessageEnvelope@@0@Z @ 83 NONAME ; bool NmMessageListModel::changed(class NmMessageEnvelope const &, class NmMessageEnvelope const &)
+	?openAttachment@NmBaseClientPlugin@@QAEXXZ @ 84 NONAME ; void NmBaseClientPlugin::openAttachment(void)
+	?staticMetaObject@NmMessageCreationOperation@@2UQMetaObject@@B @ 85 NONAME ; struct QMetaObject const NmMessageCreationOperation::staticMetaObject
+	?handleMailboxEvent@NmMailboxListModel@@QAEXW4NmMailboxEvent@@ABV?$QList@VNmId@@@@@Z @ 86 NONAME ; void NmMailboxListModel::handleMailboxEvent(enum NmMailboxEvent, class QList<class NmId> const &)
+	?metaObject@NmStoreEnvelopesOperation@@UBEPBUQMetaObject@@XZ @ 87 NONAME ; struct QMetaObject const * NmStoreEnvelopesOperation::metaObject(void) const
+	?trUtf8@NmMailboxListModel@@SA?AVQString@@PBD0H@Z @ 88 NONAME ; class QString NmMailboxListModel::trUtf8(char const *, char const *, int)
+	?mPluginArray@NmDataPluginFactory@@0PAV?$QList@PAVQObject@@@@A @ 89 NONAME ; class QList<class QObject *> * NmDataPluginFactory::mPluginArray
+	?instance@NmDataPluginFactory@@SAPAV1@XZ @ 90 NONAME ; class NmDataPluginFactory * NmDataPluginFactory::instance(void)
+	?getStaticMetaObject@NmMessageListModel@@SAABUQMetaObject@@XZ @ 91 NONAME ; struct QMetaObject const & NmMessageListModel::getStaticMetaObject(void)
+	?deleteMessageFromViewerView@NmBaseClientPlugin@@QAEXXZ @ 92 NONAME ; void NmBaseClientPlugin::deleteMessageFromViewerView(void)
+	?tr@NmUiEngine@@SA?AVQString@@PBD0H@Z @ 93 NONAME ; class QString NmUiEngine::tr(char const *, char const *, int)
+	?refresh@NmMessageListModel@@QAEXVNmId@@0ABV?$QList@PAVNmMessageEnvelope@@@@@Z @ 94 NONAME ; void NmMessageListModel::refresh(class NmId, class NmId, class QList<class NmMessageEnvelope *> const &)
+	?mailboxById@NmUiEngine@@QAEPAVNmMailboxMetaData@@ABVNmId@@@Z @ 95 NONAME ; class NmMailboxMetaData * NmUiEngine::mailboxById(class NmId const &)
+	?createNewMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@@Z @ 96 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createNewMessage(class NmId const &)
+	??_ENmMessageListModelItem@@UAE@I@Z @ 97 NONAME ; NmMessageListModelItem::~NmMessageListModelItem(unsigned int)
+	?replyAllMail@NmBaseClientPlugin@@QAEXXZ @ 98 NONAME ; void NmBaseClientPlugin::replyAllMail(void)
+	?handleMatchFound@NmUiEngine@@AAEXABVNmId@@0@Z @ 99 NONAME ; void NmUiEngine::handleMatchFound(class NmId const &, class NmId const &)
+	?syncStateEvent@NmUiEngine@@IAEXW4NmSyncState@@ABVNmId@@@Z @ 100 NONAME ; void NmUiEngine::syncStateEvent(enum NmSyncState, class NmId const &)
+	?trUtf8@NmDataManager@@SA?AVQString@@PBD0@Z @ 101 NONAME ; class QString NmDataManager::trUtf8(char const *, char const *)
+	?setEnvelopeProperties@NmMessageListModel@@QAEXW4NmEnvelopeProperties@@ABV?$QList@VNmId@@@@@Z @ 102 NONAME ; void NmMessageListModel::setEnvelopeProperties(enum NmEnvelopeProperties, class QList<class NmId> const &)
+	??1NmStoreEnvelopesOperation@@MAE@XZ @ 103 NONAME ; NmStoreEnvelopesOperation::~NmStoreEnvelopesOperation(void)
+	?tr@NmUiEngine@@SA?AVQString@@PBD0@Z @ 104 NONAME ; class QString NmUiEngine::tr(char const *, char const *)
+	?mPluginLoaderArray@NmDataPluginFactory@@0V?$QList@PAVQPluginLoader@@@@A @ 105 NONAME ; class QList<class QPluginLoader *> NmDataPluginFactory::mPluginLoaderArray
+	?trUtf8@NmBaseClientPlugin@@SA?AVQString@@PBD0@Z @ 106 NONAME ; class QString NmBaseClientPlugin::trUtf8(char const *, char const *)
+	?deleteOperation@NmOperation@@AAEXXZ @ 107 NONAME ; void NmOperation::deleteOperation(void)
+	?trUtf8@NmBaseClientPlugin@@SA?AVQString@@PBD0H@Z @ 108 NONAME ; class QString NmBaseClientPlugin::trUtf8(char const *, char const *, int)
+	?createViewerViewCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 109 NONAME ; void NmBaseClientPlugin::createViewerViewCommands(class NmActionRequest const &, class QList<class NmAction *> &)
+	?fetchMessagePart@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmId@@000@Z @ 110 NONAME ; class QPointer<class NmOperation> NmUiEngine::fetchMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmId const &)
+	?tr@NmMailboxListModel@@SA?AVQString@@PBD0H@Z @ 111 NONAME ; class QString NmMailboxListModel::tr(char const *, char const *, int)
+	?handleConnectEvent@NmUiEngine@@QAEXW4NmConnectState@@ABVNmId@@H@Z @ 112 NONAME ; void NmUiEngine::handleConnectEvent(enum NmConnectState, class NmId const &, int)
 	?trUtf8@NmUiEngine@@SA?AVQString@@PBD0H@Z @ 113 NONAME ; class QString NmUiEngine::trUtf8(char const *, char const *, int)
 	?createMailboxItem@NmMailboxListModel@@AAEPAVNmMailboxListModelItem@@PBVNmMailbox@@@Z @ 114 NONAME ; class NmMailboxListModelItem * NmMailboxListModel::createMailboxItem(class NmMailbox const *)
 	?setTitleDivider@NmMessageListModelItem@@QAEXABVQString@@@Z @ 115 NONAME ; void NmMessageListModelItem::setTitleDivider(class QString const &)
@@ -121,211 +121,194 @@
 	?operationCompleted@NmUiEngine@@IAEXABVNmOperationCompletionEvent@@@Z @ 120 NONAME ; void NmUiEngine::operationCompleted(class NmOperationCompletionEvent const &)
 	??1NmDataManager@@UAE@XZ @ 121 NONAME ; NmDataManager::~NmDataManager(void)
 	?trUtf8@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0@Z @ 122 NONAME ; class QString NmStoreEnvelopesOperation::trUtf8(char const *, char const *)
-	?metaObject@NmMessageSearchListModel@@UBEPBUQMetaObject@@XZ @ 123 NONAME ; struct QMetaObject const * NmMessageSearchListModel::metaObject(void) const
-	??0NmMessageSearchListModel@@QAE@PAVQObject@@@Z @ 124 NONAME ; NmMessageSearchListModel::NmMessageSearchListModel(class QObject *)
-	?getStaticMetaObject@NmMessageCreationOperation@@SAABUQMetaObject@@XZ @ 125 NONAME ; struct QMetaObject const & NmMessageCreationOperation::getStaticMetaObject(void)
+	?setAddress@NmMailboxMetaData@@QAEXABVQString@@@Z @ 123 NONAME ; void NmMailboxMetaData::setAddress(class QString const &)
+	?getStaticMetaObject@NmMessageCreationOperation@@SAABUQMetaObject@@XZ @ 124 NONAME ; struct QMetaObject const & NmMessageCreationOperation::getStaticMetaObject(void)
+	?updateActiveFolder@NmUiEngine@@QAEXABVNmId@@0@Z @ 125 NONAME ; void NmUiEngine::updateActiveFolder(class NmId const &, class NmId const &)
 	?trUtf8@NmAddAttachmentsOperation@@SA?AVQString@@PBD0@Z @ 126 NONAME ; class QString NmAddAttachmentsOperation::trUtf8(char const *, char const *)
 	?name@NmMailboxMetaData@@QBE?AVQString@@XZ @ 127 NONAME ; class QString NmMailboxMetaData::name(void) const
 	?qt_metacall@NmDataManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 128 NONAME ; int NmDataManager::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??1NmMessageSearchListModel@@UAE@XZ @ 129 NONAME ; NmMessageSearchListModel::~NmMessageSearchListModel(void)
-	?runAsyncOperation@NmOperation@@MAEXXZ @ 130 NONAME ; void NmOperation::runAsyncOperation(void)
-	??0NmFolderListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 131 NONAME ; NmFolderListModel::NmFolderListModel(class NmDataManager &, class QObject *)
-	?getStaticMetaObject@NmCheckOutboxOperation@@SAABUQMetaObject@@XZ @ 132 NONAME ; struct QMetaObject const & NmCheckOutboxOperation::getStaticMetaObject(void)
-	?metaObject@NmCheckOutboxOperation@@UBEPBUQMetaObject@@XZ @ 133 NONAME ; struct QMetaObject const * NmCheckOutboxOperation::metaObject(void) const
-	?tr@NmBaseClientPlugin@@SA?AVQString@@PBD0H@Z @ 134 NONAME ; class QString NmBaseClientPlugin::tr(char const *, char const *, int)
-	??0NmMailboxMetaData@@QAE@XZ @ 135 NONAME ; NmMailboxMetaData::NmMailboxMetaData(void)
-	?setEnvelope@NmMessageListModelItem@@QAEXPAVNmMessageEnvelope@@@Z @ 136 NONAME ; void NmMessageListModelItem::setEnvelope(class NmMessageEnvelope *)
-	?saveMessage@NmUiEngine@@QAEHABVNmMessage@@@Z @ 137 NONAME ; int NmUiEngine::saveMessage(class NmMessage const &)
-	?setId@NmMailboxMetaData@@QAEXABVNmId@@@Z @ 138 NONAME ; void NmMailboxMetaData::setId(class NmId const &)
-	?mReferenceCount@NmDataPluginFactory@@0HA @ 139 NONAME ; int NmDataPluginFactory::mReferenceCount
-	?tr@NmOperation@@SA?AVQString@@PBD0@Z @ 140 NONAME ; class QString NmOperation::tr(char const *, char const *)
-	?qt_metacast@NmCheckOutboxOperation@@UAEPAXPBD@Z @ 141 NONAME ; void * NmCheckOutboxOperation::qt_metacast(char const *)
-	?clearSearchResults@NmMessageSearchListModel@@QAEXXZ @ 142 NONAME ; void NmMessageSearchListModel::clearSearchResults(void)
-	?updateMessageEnvelope@NmMessageListModel@@AAEXABVNmId@@00@Z @ 143 NONAME ; void NmMessageListModel::updateMessageEnvelope(class NmId const &, class NmId const &, class NmId const &)
-	?filterAcceptsRow@NmMessageSearchListModel@@MBE_NHABVQModelIndex@@@Z @ 144 NONAME ; bool NmMessageSearchListModel::filterAcceptsRow(int, class QModelIndex const &) const
-	?messageSearchListModel@NmUiEngine@@QAEAAVNmMessageSearchListModel@@PAVQAbstractItemModel@@@Z @ 145 NONAME ; class NmMessageSearchListModel & NmUiEngine::messageSearchListModel(class QAbstractItemModel *)
-	?tr@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0@Z @ 146 NONAME ; class QString NmStoreEnvelopesOperation::tr(char const *, char const *)
-	?messagesBelongUnderSameDivider@NmMessageListModel@@ABE_NPBVNmMessageEnvelope@@0@Z @ 147 NONAME ; bool NmMessageListModel::messagesBelongUnderSameDivider(class NmMessageEnvelope const *, class NmMessageEnvelope const *) const
-	?checkOutbox@NmUiEngine@@QAE?AV?$QPointer@VNmCheckOutboxOperation@@@@ABVNmId@@@Z @ 148 NONAME ; class QPointer<class NmCheckOutboxOperation> NmUiEngine::checkOutbox(class NmId const &)
-	?metaObject@NmDataManager@@UBEPBUQMetaObject@@XZ @ 149 NONAME ; struct QMetaObject const * NmDataManager::metaObject(void) const
-	?isSendingMessage@NmUiEngine@@QBE_NXZ @ 150 NONAME ; bool NmUiEngine::isSendingMessage(void) const
-	?freeIcons@NmIcons@@SAXXZ @ 151 NONAME ; void NmIcons::freeIcons(void)
-	?tr@NmAddAttachmentsOperation@@SA?AVQString@@PBD0@Z @ 152 NONAME ; class QString NmAddAttachmentsOperation::tr(char const *, char const *)
-	?itemFromModel@NmMessageListModel@@AAEPAVNmMessageListModelItem@@ABVNmId@@@Z @ 153 NONAME ; class NmMessageListModelItem * NmMessageListModel::itemFromModel(class NmId const &)
-	?instance@NmUiEngine@@SAPAV1@XZ @ 154 NONAME ; class NmUiEngine * NmUiEngine::instance(void)
-	?createMessageListCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 155 NONAME ; void NmBaseClientPlugin::createMessageListCommands(class NmActionRequest const &, class QList<class NmAction *> &)
-	?updateEnvelopeProperty@NmBaseClientPlugin@@AAEXW4NmEnvelopeProperties@@@Z @ 156 NONAME ; void NmBaseClientPlugin::updateEnvelopeProperty(enum NmEnvelopeProperties)
-	??1NmAddAttachmentsOperation@@MAE@XZ @ 157 NONAME ; NmAddAttachmentsOperation::~NmAddAttachmentsOperation(void)
-	?goOffline@NmUiEngine@@QAEHABVNmId@@@Z @ 158 NONAME ; int NmUiEngine::goOffline(class NmId const &)
-	?staticMetaObject@NmDataManager@@2UQMetaObject@@B @ 159 NONAME ; struct QMetaObject const NmDataManager::staticMetaObject
-	?mInstance@NmUiEngine@@0PAV1@A @ 160 NONAME ; class NmUiEngine * NmUiEngine::mInstance
-	?attach@NmBaseClientPlugin@@QAEXXZ @ 161 NONAME ; void NmBaseClientPlugin::attach(void)
-	?metaObject@NmAddAttachmentsOperation@@UBEPBUQMetaObject@@XZ @ 162 NONAME ; struct QMetaObject const * NmAddAttachmentsOperation::metaObject(void) const
-	?refresh@NmFolderListModel@@QAEXAAV?$QList@PAVNmFolder@@@@@Z @ 163 NONAME ; void NmFolderListModel::refresh(class QList<class NmFolder *> &)
-	?qt_metacall@NmCheckOutboxOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 164 NONAME ; int NmCheckOutboxOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?trUtf8@NmMailboxListModel@@SA?AVQString@@PBD0@Z @ 165 NONAME ; class QString NmMailboxListModel::trUtf8(char const *, char const *)
-	?envelopeById@NmDataManager@@QAEPAVNmMessageEnvelope@@ABVNmId@@00@Z @ 166 NONAME ; class NmMessageEnvelope * NmDataManager::envelopeById(class NmId const &, class NmId const &, class NmId const &)
-	?getStaticMetaObject@NmOperation@@SAABUQMetaObject@@XZ @ 167 NONAME ; struct QMetaObject const & NmOperation::getStaticMetaObject(void)
-	?trUtf8@NmOperation@@SA?AVQString@@PBD0@Z @ 168 NONAME ; class QString NmOperation::trUtf8(char const *, char const *)
-	?addAttachments@NmUiEngine@@QAE?AV?$QPointer@VNmAddAttachmentsOperation@@@@ABVNmMessage@@ABV?$QList@VQString@@@@@Z @ 169 NONAME ; class QPointer<class NmAddAttachmentsOperation> NmUiEngine::addAttachments(class NmMessage const &, class QList<class QString> const &)
-	?doCancelOperation@NmOperation@@MAEXXZ @ 170 NONAME ; void NmOperation::doCancelOperation(void)
-	?tr@NmOperation@@SA?AVQString@@PBD0H@Z @ 171 NONAME ; class QString NmOperation::tr(char const *, char const *, int)
-	??_ENmOperation@@UAE@I@Z @ 172 NONAME ; NmOperation::~NmOperation(unsigned int)
-	?tr@NmMessageCreationOperation@@SA?AVQString@@PBD0@Z @ 173 NONAME ; class QString NmMessageCreationOperation::tr(char const *, char const *)
-	?qt_metacall@NmMessageListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 174 NONAME ; int NmMessageListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?staticMetaObject@NmOperation@@2UQMetaObject@@B @ 175 NONAME ; struct QMetaObject const NmOperation::staticMetaObject
-	??1NmUiEngine@@EAE@XZ @ 176 NONAME ; NmUiEngine::~NmUiEngine(void)
-	?messagePartFile@NmUiEngine@@QAE?AVXQSharableFile@@ABVNmId@@000@Z @ 177 NONAME ; class XQSharableFile NmUiEngine::messagePartFile(class NmId const &, class NmId const &, class NmId const &, class NmId const &)
-	??_ENmMessageListModel@@UAE@I@Z @ 178 NONAME ; NmMessageListModel::~NmMessageListModel(unsigned int)
-	?addPreliminaryOperation@NmOperation@@QAEXPAV1@@Z @ 179 NONAME ; void NmOperation::addPreliminaryOperation(class NmOperation *)
-	?deleteMessages@NmUiEngine@@QAEHABVNmId@@0ABV?$QList@VNmId@@@@@Z @ 180 NONAME ; int NmUiEngine::deleteMessages(class NmId const &, class NmId const &, class QList<class NmId> const &)
-	??_ENmStoreEnvelopesOperation@@UAE@I@Z @ 181 NONAME ; NmStoreEnvelopesOperation::~NmStoreEnvelopesOperation(unsigned int)
-	?mailboxById@NmDataManager@@QAEPAVNmMailboxMetaData@@ABVNmId@@@Z @ 182 NONAME ; class NmMailboxMetaData * NmDataManager::mailboxById(class NmId const &)
-	?search@NmBaseClientPlugin@@QAEXXZ @ 183 NONAME ; void NmBaseClientPlugin::search(void)
-	?pluginInstances@NmDataPluginFactory@@QAEPAV?$QList@PAVQObject@@@@XZ @ 184 NONAME ; class QList<class QObject *> * NmDataPluginFactory::pluginInstances(void)
-	?tr@NmBaseClientPlugin@@SA?AVQString@@PBD0@Z @ 185 NONAME ; class QString NmBaseClientPlugin::tr(char const *, char const *)
-	?listMessages@NmDataManager@@QAEXABVNmId@@0AAV?$QList@PAVNmMessageEnvelope@@@@@Z @ 186 NONAME ; void NmDataManager::listMessages(class NmId const &, class NmId const &, class QList<class NmMessageEnvelope *> &)
-	?getStaticMetaObject@NmMessageSearchListModel@@SAABUQMetaObject@@XZ @ 187 NONAME ; struct QMetaObject const & NmMessageSearchListModel::getStaticMetaObject(void)
-	??1NmBaseClientPlugin@@UAE@XZ @ 188 NONAME ; NmBaseClientPlugin::~NmBaseClientPlugin(void)
-	?qt_metacast@NmDataManager@@UAEPAXPBD@Z @ 189 NONAME ; void * NmDataManager::qt_metacast(char const *)
-	??0NmMessageCreationOperation@@QAE@XZ @ 190 NONAME ; NmMessageCreationOperation::NmMessageCreationOperation(void)
-	?qt_metacall@NmBaseClientPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 191 NONAME ; int NmBaseClientPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?envelopePtr@NmMessageListModelItem@@QAEPAVNmMessageEnvelope@@XZ @ 192 NONAME ; class NmMessageEnvelope * NmMessageListModelItem::envelopePtr(void)
-	?messageListModel@NmUiEngine@@QAEAAVNmMessageListModel@@ABVNmId@@0@Z @ 193 NONAME ; class NmMessageListModel & NmUiEngine::messageListModel(class NmId const &, class NmId const &)
-	??1NmMailboxMetaData@@UAE@XZ @ 194 NONAME ; NmMailboxMetaData::~NmMailboxMetaData(void)
-	?trUtf8@NmCheckOutboxOperation@@SA?AVQString@@PBD0H@Z @ 195 NONAME ; class QString NmCheckOutboxOperation::trUtf8(char const *, char const *, int)
-	??0NmCheckOutboxOperation@@QAE@XZ @ 196 NONAME ; NmCheckOutboxOperation::NmCheckOutboxOperation(void)
-	?connectionEvent@NmUiEngine@@IAEXW4NmConnectState@@ABVNmId@@@Z @ 197 NONAME ; void NmUiEngine::connectionEvent(enum NmConnectState, class NmId const &)
-	?mailbox@NmDataManager@@QAEPAVNmMailbox@@ABVNmId@@@Z @ 198 NONAME ; class NmMailbox * NmDataManager::mailbox(class NmId const &)
-	?interfaceInstance@NmDataPluginFactory@@QAEPAVNmDataPluginInterface@@PAVQObject@@@Z @ 199 NONAME ; class NmDataPluginInterface * NmDataPluginFactory::interfaceInstance(class QObject *)
-	?refreshModelItem@NmMailboxListModel@@QAEXABVNmId@@_N@Z @ 200 NONAME ; void NmMailboxListModel::refreshModelItem(class NmId const &, bool)
-	?metaObject@NmMailboxListModel@@UBEPBUQMetaObject@@XZ @ 201 NONAME ; struct QMetaObject const * NmMailboxListModel::metaObject(void) const
-	?IconId@NmMailboxMetaData@@QBE?AVNmId@@XZ @ 202 NONAME ; class NmId NmMailboxMetaData::IconId(void) const
-	?sendOperationCompleted@NmUiEngine@@IAEXXZ @ 203 NONAME ; void NmUiEngine::sendOperationCompleted(void)
-	??0NmFolderMetaData@@QAE@XZ @ 204 NONAME ; NmFolderMetaData::NmFolderMetaData(void)
-	?staticMetaObject@NmAddAttachmentsOperation@@2UQMetaObject@@B @ 205 NONAME ; struct QMetaObject const NmAddAttachmentsOperation::staticMetaObject
-	?connectionState@NmUiEngine@@QAE?AW4NmConnectState@@ABVNmId@@@Z @ 206 NONAME ; enum NmConnectState NmUiEngine::connectionState(class NmId const &)
-	?createTitleDividerItem@NmMessageListModel@@AAEPAVNmMessageListModelItem@@PAVNmMessageEnvelope@@@Z @ 207 NONAME ; class NmMessageListModelItem * NmMessageListModel::createTitleDividerItem(class NmMessageEnvelope *)
-	?setId@NmFolderMetaData@@QAEXABVNmId@@@Z @ 208 NONAME ; void NmFolderMetaData::setId(class NmId const &)
-	??0NmOperation@@QAE@XZ @ 209 NONAME ; NmOperation::NmOperation(void)
-	?cancelOperation@NmOperation@@QAEXXZ @ 210 NONAME ; void NmOperation::cancelOperation(void)
-	??_ENmFolderMetaData@@UAE@I@Z @ 211 NONAME ; NmFolderMetaData::~NmFolderMetaData(unsigned int)
-	?qt_metacast@NmMessageListModel@@UAEPAXPBD@Z @ 212 NONAME ; void * NmMessageListModel::qt_metacast(char const *)
-	?operationProgressChanged@NmOperation@@IAEXH@Z @ 213 NONAME ; void NmOperation::operationProgressChanged(int)
-	?trUtf8@NmOperation@@SA?AVQString@@PBD0H@Z @ 214 NONAME ; class QString NmOperation::trUtf8(char const *, char const *, int)
-	??_ENmMailboxListModel@@UAE@I@Z @ 215 NONAME ; NmMailboxListModel::~NmMailboxListModel(unsigned int)
-	?messageDeleted@NmUiEngine@@IAEXABVNmId@@00@Z @ 216 NONAME ; void NmUiEngine::messageDeleted(class NmId const &, class NmId const &, class NmId const &)
-	?trUtf8@NmMessageCreationOperation@@SA?AVQString@@PBD0@Z @ 217 NONAME ; class QString NmMessageCreationOperation::trUtf8(char const *, char const *)
-	?metaObject@NmUiEngine@@UBEPBUQMetaObject@@XZ @ 218 NONAME ; struct QMetaObject const * NmUiEngine::metaObject(void) const
-	??_ENmBaseClientPlugin@@UAE@I@Z @ 219 NONAME ; NmBaseClientPlugin::~NmBaseClientPlugin(unsigned int)
-	?markAsUnread@NmBaseClientPlugin@@QAEXXZ @ 220 NONAME ; void NmBaseClientPlugin::markAsUnread(void)
-	?metaObject@NmBaseClientPlugin@@UBEPBUQMetaObject@@XZ @ 221 NONAME ; struct QMetaObject const * NmBaseClientPlugin::metaObject(void) const
-	?tr@NmDataManager@@SA?AVQString@@PBD0@Z @ 222 NONAME ; class QString NmDataManager::tr(char const *, char const *)
-	?mailboxListModel@NmUiEngine@@QAEAAVNmMailboxListModel@@XZ @ 223 NONAME ; class NmMailboxListModel & NmUiEngine::mailboxListModel(void)
-	?fetchMessage@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmId@@00@Z @ 224 NONAME ; class QPointer<class NmOperation> NmUiEngine::fetchMessage(class NmId const &, class NmId const &, class NmId const &)
-	?setIconId@NmMailboxMetaData@@QAEXABVNmId@@@Z @ 225 NONAME ; void NmMailboxMetaData::setIconId(class NmId const &)
-	??1NmDataPluginFactory@@EAE@XZ @ 226 NONAME ; NmDataPluginFactory::~NmDataPluginFactory(void)
-	?refreshMailboxListModel@NmUiEngine@@QAEXXZ @ 227 NONAME ; void NmUiEngine::refreshMailboxListModel(void)
-	?qt_metacall@NmStoreEnvelopesOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 228 NONAME ; int NmStoreEnvelopesOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?trUtf8@NmMessageListModel@@SA?AVQString@@PBD0@Z @ 229 NONAME ; class QString NmMessageListModel::trUtf8(char const *, char const *)
-	?rowCount@NmFolderListModel@@UBEHABVQModelIndex@@@Z @ 230 NONAME ; int NmFolderListModel::rowCount(class QModelIndex const &) const
-	?doUpdateOperationProgress@NmOperation@@MAEXXZ @ 231 NONAME ; void NmOperation::doUpdateOperationProgress(void)
-	?tr@NmMailboxListModel@@SA?AVQString@@PBD0@Z @ 232 NONAME ; class QString NmMailboxListModel::tr(char const *, char const *)
-	?removeMessage@NmUiEngine@@QAEHABVNmId@@00@Z @ 233 NONAME ; int NmUiEngine::removeMessage(class NmId const &, class NmId const &, class NmId const &)
-	??_ENmUiEngine@@UAE@I@Z @ 234 NONAME ; NmUiEngine::~NmUiEngine(unsigned int)
-	??_ENmMessageSearchListModel@@UAE@I@Z @ 235 NONAME ; NmMessageSearchListModel::~NmMessageSearchListModel(unsigned int)
-	?operationCompleted@NmOperation@@IAEXH@Z @ 236 NONAME ; void NmOperation::operationCompleted(int)
-	?callEmitDataChanged@NmMessageListModelItem@@QAEXXZ @ 237 NONAME ; void NmMessageListModelItem::callEmitDataChanged(void)
-	?matchFound@NmUiEngine@@IAEXABVNmId@@@Z @ 238 NONAME ; void NmUiEngine::matchFound(class NmId const &)
-	?tr@NmCheckOutboxOperation@@SA?AVQString@@PBD0H@Z @ 239 NONAME ; class QString NmCheckOutboxOperation::tr(char const *, char const *, int)
-	?addSearchResult@NmMessageSearchListModel@@QAE_NABVNmId@@@Z @ 240 NONAME ; bool NmMessageSearchListModel::addSearchResult(class NmId const &)
-	??0NmMessageListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 241 NONAME ; NmMessageListModel::NmMessageListModel(class NmDataManager &, class QObject *)
-	??_ENmAddAttachmentsOperation@@UAE@I@Z @ 242 NONAME ; NmAddAttachmentsOperation::~NmAddAttachmentsOperation(unsigned int)
-	?syncState@NmUiEngine@@QAE?AW4NmSyncState@@ABVNmId@@@Z @ 243 NONAME ; enum NmSyncState NmUiEngine::syncState(class NmId const &)
-	??1NmOperation@@MAE@XZ @ 244 NONAME ; NmOperation::~NmOperation(void)
-	?tr@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0H@Z @ 245 NONAME ; class QString NmStoreEnvelopesOperation::tr(char const *, char const *, int)
-	?listMailboxes@NmDataManager@@QAEXAAV?$QList@PAVNmMailbox@@@@@Z @ 246 NONAME ; void NmDataManager::listMailboxes(class QList<class NmMailbox *> &)
-	?message@NmUiEngine@@QAEPAVNmMessage@@ABVNmId@@00@Z @ 247 NONAME ; class NmMessage * NmUiEngine::message(class NmId const &, class NmId const &, class NmId const &)
-	?refreshMailbox@NmUiEngine@@QAEHABVNmId@@@Z @ 248 NONAME ; int NmUiEngine::refreshMailbox(class NmId const &)
-	?trUtf8@NmUiEngine@@SA?AVQString@@PBD0@Z @ 249 NONAME ; class QString NmUiEngine::trUtf8(char const *, char const *)
-	?contentToMessagePart@NmUiEngine@@QAEHABVNmId@@00AAVNmMessagePart@@@Z @ 250 NONAME ; int NmUiEngine::contentToMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmMessagePart &)
-	?removeItem@NmMessageListModel@@AAEXHAAVNmMessageListModelItem@@@Z @ 251 NONAME ; void NmMessageListModel::removeItem(int, class NmMessageListModelItem &)
-	??1NmMailboxListModel@@UAE@XZ @ 252 NONAME ; NmMailboxListModel::~NmMailboxListModel(void)
-	??0NmBaseClientPlugin@@QAE@XZ @ 253 NONAME ; NmBaseClientPlugin::NmBaseClientPlugin(void)
-	?forwardMail@NmBaseClientPlugin@@QAEXXZ @ 254 NONAME ; void NmBaseClientPlugin::forwardMail(void)
-	?setItemType@NmMessageListModelItem@@QAEXW4NmMessageItemType@1@@Z @ 255 NONAME ; void NmMessageListModelItem::setItemType(enum NmMessageListModelItem::NmMessageItemType)
-	??_ENmDataPluginFactory@@UAE@I@Z @ 256 NONAME ; NmDataPluginFactory::~NmDataPluginFactory(unsigned int)
-	?mailboxListChanged@NmBaseClientPlugin@@AAEXABVNmId@@W4MailboxEventType@NmSettings@@@Z @ 257 NONAME ; void NmBaseClientPlugin::mailboxListChanged(class NmId const &, enum NmSettings::MailboxEventType)
-	?expanded@NmMessageListModelItem@@QBE_NXZ @ 258 NONAME ; bool NmMessageListModelItem::expanded(void) const
-	?columnCount@NmFolderListModel@@UBEHABVQModelIndex@@@Z @ 259 NONAME ; int NmFolderListModel::columnCount(class QModelIndex const &) const
-	?pluginInstance@NmDataPluginFactory@@QAEPAVQObject@@VNmId@@@Z @ 260 NONAME ; class QObject * NmDataPluginFactory::pluginInstance(class NmId)
-	?setNewParam@NmMessageListModel@@IAEXPAVNmUiStartParam@@@Z @ 261 NONAME ; void NmMessageListModel::setNewParam(class NmUiStartParam *)
-	?data@NmMessageListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 262 NONAME ; class QVariant NmMessageListModel::data(class QModelIndex const &, int) const
-	?goOnline@NmBaseClientPlugin@@AAEXABVNmId@@@Z @ 263 NONAME ; void NmBaseClientPlugin::goOnline(class NmId const &)
-	?createNewMail@NmBaseClientPlugin@@QAEXXZ @ 264 NONAME ; void NmBaseClientPlugin::createNewMail(void)
-	??_ENmCheckOutboxOperation@@UAE@I@Z @ 265 NONAME ; NmCheckOutboxOperation::~NmCheckOutboxOperation(unsigned int)
-	?qt_metacast@NmBaseClientPlugin@@UAEPAXPBD@Z @ 266 NONAME ; void * NmBaseClientPlugin::qt_metacast(char const *)
-	?staticMetaObject@NmBaseClientPlugin@@2UQMetaObject@@B @ 267 NONAME ; struct QMetaObject const NmBaseClientPlugin::staticMetaObject
-	?searchComplete@NmUiEngine@@IAEXXZ @ 268 NONAME ; void NmUiEngine::searchComplete(void)
-	?setEnvelope@NmMessageListModelItem@@QAEXABVNmMessageEnvelope@@@Z @ 269 NONAME ; void NmMessageListModelItem::setEnvelope(class NmMessageEnvelope const &)
-	?qt_metacast@NmAddAttachmentsOperation@@UAEPAXPBD@Z @ 270 NONAME ; void * NmAddAttachmentsOperation::qt_metacast(char const *)
-	?createNewMailViewerToolBar@NmBaseClientPlugin@@QAEXXZ @ 271 NONAME ; void NmBaseClientPlugin::createNewMailViewerToolBar(void)
-	?staticMetaObject@NmMailboxListModel@@2UQMetaObject@@B @ 272 NONAME ; struct QMetaObject const NmMailboxListModel::staticMetaObject
-	?qt_metacall@NmMessageCreationOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 273 NONAME ; int NmMessageCreationOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?trUtf8@NmDataManager@@SA?AVQString@@PBD0H@Z @ 274 NONAME ; class QString NmDataManager::trUtf8(char const *, char const *, int)
-	?trUtf8@NmMessageCreationOperation@@SA?AVQString@@PBD0H@Z @ 275 NONAME ; class QString NmMessageCreationOperation::trUtf8(char const *, char const *, int)
-	?createForwardMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@0@Z @ 276 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createForwardMessage(class NmId const &, class NmId const &)
-	?handleSyncStateEvent@NmUiEngine@@QAEXW4NmSyncState@@ABVNmOperationCompletionEvent@@@Z @ 277 NONAME ; void NmUiEngine::handleSyncStateEvent(enum NmSyncState, class NmOperationCompletionEvent const &)
-	?completeOperation@NmOperation@@QAEXH@Z @ 278 NONAME ; void NmOperation::completeOperation(int)
-	?parent@NmFolderListModel@@UBE?AVQModelIndex@@ABV2@@Z @ 279 NONAME ; class QModelIndex NmFolderListModel::parent(class QModelIndex const &) const
-	?folder@NmDataManager@@QAEPAVNmFolder@@ABVNmId@@0@Z @ 280 NONAME ; class NmFolder * NmDataManager::folder(class NmId const &, class NmId const &)
-	??0NmMessageSendingOperation@@QAE@XZ @ 281 NONAME ; NmMessageSendingOperation::NmMessageSendingOperation(void)
-	?replyMail@NmBaseClientPlugin@@QAEXXZ @ 282 NONAME ; void NmBaseClientPlugin::replyMail(void)
-	??1NmMessageListModelItem@@UAE@XZ @ 283 NONAME ; NmMessageListModelItem::~NmMessageListModelItem(void)
-	?mailboxPropertyChanged@NmBaseClientPlugin@@AAEXABVNmId@@VQVariant@@1@Z @ 284 NONAME ; void NmBaseClientPlugin::mailboxPropertyChanged(class NmId const &, class QVariant, class QVariant)
-	?qt_metacall@NmOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 285 NONAME ; int NmOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?removeMessageFromModel@NmMessageListModel@@AAEXABVNmId@@@Z @ 286 NONAME ; void NmMessageListModel::removeMessageFromModel(class NmId const &)
-	?trUtf8@NmMessageListModel@@SA?AVQString@@PBD0H@Z @ 287 NONAME ; class QString NmMessageListModel::trUtf8(char const *, char const *, int)
-	?handleRequest@NmBaseClientPlugin@@AAEXW4NmActionResponseCommand@@ABVNmActionRequest@@@Z @ 288 NONAME ; void NmBaseClientPlugin::handleRequest(enum NmActionResponseCommand, class NmActionRequest const &)
-	?operationPartCompleted@NmAddAttachmentsOperation@@IAEXABVQString@@ABVNmId@@H@Z @ 289 NONAME ; void NmAddAttachmentsOperation::operationPartCompleted(class QString const &, class NmId const &, int)
-	?trUtf8@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0H@Z @ 290 NONAME ; class QString NmStoreEnvelopesOperation::trUtf8(char const *, char const *, int)
-	?tr@NmMessageListModel@@SA?AVQString@@PBD0@Z @ 291 NONAME ; class QString NmMessageListModel::tr(char const *, char const *)
-	?doCompleteOperation@NmOperation@@MAEXXZ @ 292 NONAME ; void NmOperation::doCompleteOperation(void)
-	?dividerInsertionIndex@NmMessageListModel@@AAEHH@Z @ 293 NONAME ; int NmMessageListModel::dividerInsertionIndex(int)
-	??1NmCheckOutboxOperation@@MAE@XZ @ 294 NONAME ; NmCheckOutboxOperation::~NmCheckOutboxOperation(void)
-	?createMessageItem@NmMessageListModel@@AAEPAVNmMessageListModelItem@@PAVNmMessageEnvelope@@@Z @ 295 NONAME ; class NmMessageListModelItem * NmMessageListModel::createMessageItem(class NmMessageEnvelope *)
-	?id@NmFolderMetaData@@QBE?AVNmId@@XZ @ 296 NONAME ; class NmId NmFolderMetaData::id(void) const
-	?createReplyMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@0_N@Z @ 297 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createReplyMessage(class NmId const &, class NmId const &, bool)
-	?getStandardFolderId@NmDataManager@@QAE?AVNmId@@ABV2@W4NmFolderType@@@Z @ 298 NONAME ; class NmId NmDataManager::getStandardFolderId(class NmId const &, enum NmFolderType)
-	?dividersActive@NmMessageListModel@@QAE_NXZ @ 299 NONAME ; bool NmMessageListModel::dividersActive(void)
-	?trUtf8@NmMessageSearchListModel@@SA?AVQString@@PBD0H@Z @ 300 NONAME ; class QString NmMessageSearchListModel::trUtf8(char const *, char const *, int)
-	?titleDivider@NmMessageListModelItem@@QBE?AVQString@@XZ @ 301 NONAME ; class QString NmMessageListModelItem::titleDivider(void) const
-	?getStaticMetaObject@NmBaseClientPlugin@@SAABUQMetaObject@@XZ @ 302 NONAME ; struct QMetaObject const & NmBaseClientPlugin::getStaticMetaObject(void)
-	?qt_metacast@NmMessageCreationOperation@@UAEPAXPBD@Z @ 303 NONAME ; void * NmMessageCreationOperation::qt_metacast(char const *)
-	?updateEnvelope@NmMessageListModel@@AAEXW4NmEnvelopeProperties@@ABVNmId@@@Z @ 304 NONAME ; void NmMessageListModel::updateEnvelope(enum NmEnvelopeProperties, class NmId const &)
-	??_ENmDataManager@@UAE@I@Z @ 305 NONAME ; NmDataManager::~NmDataManager(unsigned int)
-	?qt_metacast@NmMailboxListModel@@UAEPAXPBD@Z @ 306 NONAME ; void * NmMailboxListModel::qt_metacast(char const *)
-	?search@NmUiEngine@@QAEHABVNmId@@ABVQStringList@@@Z @ 307 NONAME ; int NmUiEngine::search(class NmId const &, class QStringList const &)
-	?setEnvelopes@NmUiEngine@@QAE?AV?$QPointer@VNmStoreEnvelopesOperation@@@@ABVNmId@@0W4NmEnvelopeProperties@@ABV?$QList@PB$$CBVNmMessageEnvelope@@@@@Z @ 308 NONAME ; class QPointer<class NmStoreEnvelopesOperation> NmUiEngine::setEnvelopes(class NmId const &, class NmId const &, enum NmEnvelopeProperties, class QList<class NmMessageEnvelope const *> const &)
-	?getActions@NmBaseClientPlugin@@UAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 309 NONAME ; void NmBaseClientPlugin::getActions(class NmActionRequest const &, class QList<class NmAction *> &)
-	?qt_metacast@NmStoreEnvelopesOperation@@UAEPAXPBD@Z @ 310 NONAME ; void * NmStoreEnvelopesOperation::qt_metacast(char const *)
-	?handleMessageEvent@NmMessageListModel@@QAEXW4NmMessageEvent@@ABVNmId@@ABV?$QList@VNmId@@@@@Z @ 311 NONAME ; void NmMessageListModel::handleMessageEvent(enum NmMessageEvent, class NmId const &, class QList<class NmId> const &)
-	??_ENmMailboxMetaData@@UAE@I@Z @ 312 NONAME ; NmMailboxMetaData::~NmMailboxMetaData(unsigned int)
-	??0NmMessageListModelItem@@QAE@XZ @ 313 NONAME ; NmMessageListModelItem::NmMessageListModelItem(void)
-	?tr@NmAddAttachmentsOperation@@SA?AVQString@@PBD0H@Z @ 314 NONAME ; class QString NmAddAttachmentsOperation::tr(char const *, char const *, int)
-	?setDividers@NmMessageListModel@@QAEX_N@Z @ 315 NONAME ; void NmMessageListModel::setDividers(bool)
-	?loadPlugin@NmDataPluginFactory@@QAEPAVQObject@@ABVQDir@@ABVQString@@@Z @ 316 NONAME ; class QObject * NmDataPluginFactory::loadPlugin(class QDir const &, class QString const &)
-	?qt_metacast@NmOperation@@UAEPAXPBD@Z @ 317 NONAME ; void * NmOperation::qt_metacast(char const *)
-	?tr@NmMessageListModel@@SA?AVQString@@PBD0H@Z @ 318 NONAME ; class QString NmMessageListModel::tr(char const *, char const *, int)
-	?removeAttachment@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmMessage@@ABVNmId@@@Z @ 319 NONAME ; class QPointer<class NmOperation> NmUiEngine::removeAttachment(class NmMessage const &, class NmId const &)
-	?staticMetaObject@NmMessageListModel@@2UQMetaObject@@B @ 320 NONAME ; struct QMetaObject const NmMessageListModel::staticMetaObject
-	?qt_metacall@NmAddAttachmentsOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 321 NONAME ; int NmAddAttachmentsOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?qt_metacall@NmUiEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 322 NONAME ; int NmUiEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?tr@NmMessageSearchListModel@@SA?AVQString@@PBD0H@Z @ 323 NONAME ; class QString NmMessageSearchListModel::tr(char const *, char const *, int)
-	?message@NmDataManager@@QAEPAVNmMessage@@ABVNmId@@00@Z @ 324 NONAME ; class NmMessage * NmDataManager::message(class NmId const &, class NmId const &, class NmId const &)
-	?metaObject@NmOperation@@UBEPBUQMetaObject@@XZ @ 325 NONAME ; struct QMetaObject const * NmOperation::metaObject(void) const
-	?folderTypeById@NmUiEngine@@QAE?AW4NmFolderType@@VNmId@@0@Z @ 326 NONAME ; enum NmFolderType NmUiEngine::folderTypeById(class NmId, class NmId)
-	?refreshContent@NmMessageSearchListModel@@QAEXXZ @ 327 NONAME ; void NmMessageSearchListModel::refreshContent(void)
-	?searchResultCount@NmMessageSearchListModel@@QBEHXZ @ 328 NONAME ; int NmMessageSearchListModel::searchResultCount(void) const
-	?handleConnectEvent@NmUiEngine@@QAEXW4NmConnectState@@ABVNmId@@H@Z @ 329 NONAME ; void NmUiEngine::handleConnectEvent(enum NmConnectState, class NmId const &, int)
+	?runAsyncOperation@NmOperation@@MAEXXZ @ 129 NONAME ; void NmOperation::runAsyncOperation(void)
+	??0NmFolderListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 130 NONAME ; NmFolderListModel::NmFolderListModel(class NmDataManager &, class QObject *)
+	?folderTypeById@NmDataManager@@QAE?AW4NmFolderType@@VNmId@@0@Z @ 131 NONAME ; enum NmFolderType NmDataManager::folderTypeById(class NmId, class NmId)
+	?tr@NmBaseClientPlugin@@SA?AVQString@@PBD0H@Z @ 132 NONAME ; class QString NmBaseClientPlugin::tr(char const *, char const *, int)
+	??0NmMailboxMetaData@@QAE@XZ @ 133 NONAME ; NmMailboxMetaData::NmMailboxMetaData(void)
+	?setEnvelope@NmMessageListModelItem@@QAEXPAVNmMessageEnvelope@@@Z @ 134 NONAME ; void NmMessageListModelItem::setEnvelope(class NmMessageEnvelope *)
+	?saveMessage@NmUiEngine@@QAEHABVNmMessage@@@Z @ 135 NONAME ; int NmUiEngine::saveMessage(class NmMessage const &)
+	?setId@NmMailboxMetaData@@QAEXABVNmId@@@Z @ 136 NONAME ; void NmMailboxMetaData::setId(class NmId const &)
+	?folderTypeById@NmUiEngine@@QAE?AW4NmFolderType@@VNmId@@0@Z @ 137 NONAME ; enum NmFolderType NmUiEngine::folderTypeById(class NmId, class NmId)
+	?mReferenceCount@NmDataPluginFactory@@0HA @ 138 NONAME ; int NmDataPluginFactory::mReferenceCount
+	?tr@NmOperation@@SA?AVQString@@PBD0@Z @ 139 NONAME ; class QString NmOperation::tr(char const *, char const *)
+	?updateMessageEnvelope@NmMessageListModel@@AAEXABVNmId@@00@Z @ 140 NONAME ; void NmMessageListModel::updateMessageEnvelope(class NmId const &, class NmId const &, class NmId const &)
+	?tr@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0@Z @ 141 NONAME ; class QString NmStoreEnvelopesOperation::tr(char const *, char const *)
+	?messagesBelongUnderSameDivider@NmMessageListModel@@ABE_NPBVNmMessageEnvelope@@0@Z @ 142 NONAME ; bool NmMessageListModel::messagesBelongUnderSameDivider(class NmMessageEnvelope const *, class NmMessageEnvelope const *) const
+	?matchFound@NmUiEngine@@IAEXABVNmId@@0@Z @ 143 NONAME ; void NmUiEngine::matchFound(class NmId const &, class NmId const &)
+	?metaObject@NmDataManager@@UBEPBUQMetaObject@@XZ @ 144 NONAME ; struct QMetaObject const * NmDataManager::metaObject(void) const
+	?isSendingMessage@NmUiEngine@@QBE_NXZ @ 145 NONAME ; bool NmUiEngine::isSendingMessage(void) const
+	?freeIcons@NmIcons@@SAXXZ @ 146 NONAME ; void NmIcons::freeIcons(void)
+	?tr@NmAddAttachmentsOperation@@SA?AVQString@@PBD0@Z @ 147 NONAME ; class QString NmAddAttachmentsOperation::tr(char const *, char const *)
+	?itemFromModel@NmMessageListModel@@AAEPAVNmMessageListModelItem@@ABVNmId@@@Z @ 148 NONAME ; class NmMessageListModelItem * NmMessageListModel::itemFromModel(class NmId const &)
+	?instance@NmUiEngine@@SAPAV1@XZ @ 149 NONAME ; class NmUiEngine * NmUiEngine::instance(void)
+	?createMessageListCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 150 NONAME ; void NmBaseClientPlugin::createMessageListCommands(class NmActionRequest const &, class QList<class NmAction *> &)
+	?updateEnvelopeProperty@NmBaseClientPlugin@@AAEXW4NmEnvelopeProperties@@@Z @ 151 NONAME ; void NmBaseClientPlugin::updateEnvelopeProperty(enum NmEnvelopeProperties)
+	??1NmAddAttachmentsOperation@@MAE@XZ @ 152 NONAME ; NmAddAttachmentsOperation::~NmAddAttachmentsOperation(void)
+	?goOffline@NmUiEngine@@QAEHABVNmId@@@Z @ 153 NONAME ; int NmUiEngine::goOffline(class NmId const &)
+	?staticMetaObject@NmDataManager@@2UQMetaObject@@B @ 154 NONAME ; struct QMetaObject const NmDataManager::staticMetaObject
+	?mInstance@NmUiEngine@@0PAV1@A @ 155 NONAME ; class NmUiEngine * NmUiEngine::mInstance
+	?attach@NmBaseClientPlugin@@QAEXXZ @ 156 NONAME ; void NmBaseClientPlugin::attach(void)
+	?setIgnoreFolderIds@NmMessageListModel@@QAEX_N@Z @ 157 NONAME ; void NmMessageListModel::setIgnoreFolderIds(bool)
+	?metaObject@NmAddAttachmentsOperation@@UBEPBUQMetaObject@@XZ @ 158 NONAME ; struct QMetaObject const * NmAddAttachmentsOperation::metaObject(void) const
+	?refresh@NmFolderListModel@@QAEXAAV?$QList@PAVNmFolder@@@@@Z @ 159 NONAME ; void NmFolderListModel::refresh(class QList<class NmFolder *> &)
+	?handleCompletedRemoveDraftOperation@NmUiEngine@@QAEXXZ @ 160 NONAME ; void NmUiEngine::handleCompletedRemoveDraftOperation(void)
+	?trUtf8@NmMailboxListModel@@SA?AVQString@@PBD0@Z @ 161 NONAME ; class QString NmMailboxListModel::trUtf8(char const *, char const *)
+	?envelopeById@NmDataManager@@QAEPAVNmMessageEnvelope@@ABVNmId@@00@Z @ 162 NONAME ; class NmMessageEnvelope * NmDataManager::envelopeById(class NmId const &, class NmId const &, class NmId const &)
+	?getStaticMetaObject@NmOperation@@SAABUQMetaObject@@XZ @ 163 NONAME ; struct QMetaObject const & NmOperation::getStaticMetaObject(void)
+	?trUtf8@NmOperation@@SA?AVQString@@PBD0@Z @ 164 NONAME ; class QString NmOperation::trUtf8(char const *, char const *)
+	?addAttachments@NmUiEngine@@QAE?AV?$QPointer@VNmAddAttachmentsOperation@@@@ABVNmMessage@@ABV?$QList@VQString@@@@@Z @ 165 NONAME ; class QPointer<class NmAddAttachmentsOperation> NmUiEngine::addAttachments(class NmMessage const &, class QList<class QString> const &)
+	?doCancelOperation@NmOperation@@MAEXXZ @ 166 NONAME ; void NmOperation::doCancelOperation(void)
+	?tr@NmOperation@@SA?AVQString@@PBD0H@Z @ 167 NONAME ; class QString NmOperation::tr(char const *, char const *, int)
+	??_ENmOperation@@UAE@I@Z @ 168 NONAME ; NmOperation::~NmOperation(unsigned int)
+	?tr@NmMessageCreationOperation@@SA?AVQString@@PBD0@Z @ 169 NONAME ; class QString NmMessageCreationOperation::tr(char const *, char const *)
+	?qt_metacall@NmMessageListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 170 NONAME ; int NmMessageListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?staticMetaObject@NmOperation@@2UQMetaObject@@B @ 171 NONAME ; struct QMetaObject const NmOperation::staticMetaObject
+	??1NmUiEngine@@EAE@XZ @ 172 NONAME ; NmUiEngine::~NmUiEngine(void)
+	?messagePartFile@NmUiEngine@@QAE?AVXQSharableFile@@ABVNmId@@000@Z @ 173 NONAME ; class XQSharableFile NmUiEngine::messagePartFile(class NmId const &, class NmId const &, class NmId const &, class NmId const &)
+	??_ENmMessageListModel@@UAE@I@Z @ 174 NONAME ; NmMessageListModel::~NmMessageListModel(unsigned int)
+	?addPreliminaryOperation@NmOperation@@QAEXPAV1@@Z @ 175 NONAME ; void NmOperation::addPreliminaryOperation(class NmOperation *)
+	?deleteMessages@NmUiEngine@@QAEHABVNmId@@0ABV?$QList@VNmId@@@@@Z @ 176 NONAME ; int NmUiEngine::deleteMessages(class NmId const &, class NmId const &, class QList<class NmId> const &)
+	??_ENmStoreEnvelopesOperation@@UAE@I@Z @ 177 NONAME ; NmStoreEnvelopesOperation::~NmStoreEnvelopesOperation(unsigned int)
+	?mailboxById@NmDataManager@@QAEPAVNmMailboxMetaData@@ABVNmId@@@Z @ 178 NONAME ; class NmMailboxMetaData * NmDataManager::mailboxById(class NmId const &)
+	?messageListModelForSearch@NmUiEngine@@QAEAAVNmMessageListModel@@ABVNmId@@@Z @ 179 NONAME ; class NmMessageListModel & NmUiEngine::messageListModelForSearch(class NmId const &)
+	?search@NmBaseClientPlugin@@QAEXXZ @ 180 NONAME ; void NmBaseClientPlugin::search(void)
+	?pluginInstances@NmDataPluginFactory@@QAEPAV?$QList@PAVQObject@@@@XZ @ 181 NONAME ; class QList<class QObject *> * NmDataPluginFactory::pluginInstances(void)
+	?tr@NmBaseClientPlugin@@SA?AVQString@@PBD0@Z @ 182 NONAME ; class QString NmBaseClientPlugin::tr(char const *, char const *)
+	?listMessages@NmDataManager@@QAEXABVNmId@@0AAV?$QList@PAVNmMessageEnvelope@@@@@Z @ 183 NONAME ; void NmDataManager::listMessages(class NmId const &, class NmId const &, class QList<class NmMessageEnvelope *> &)
+	??1NmBaseClientPlugin@@UAE@XZ @ 184 NONAME ; NmBaseClientPlugin::~NmBaseClientPlugin(void)
+	?qt_metacast@NmDataManager@@UAEPAXPBD@Z @ 185 NONAME ; void * NmDataManager::qt_metacast(char const *)
+	??0NmMessageCreationOperation@@QAE@XZ @ 186 NONAME ; NmMessageCreationOperation::NmMessageCreationOperation(void)
+	?qt_metacall@NmBaseClientPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 187 NONAME ; int NmBaseClientPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?envelopePtr@NmMessageListModelItem@@QAEPAVNmMessageEnvelope@@XZ @ 188 NONAME ; class NmMessageEnvelope * NmMessageListModelItem::envelopePtr(void)
+	?messageListModel@NmUiEngine@@QAEAAVNmMessageListModel@@ABVNmId@@0@Z @ 189 NONAME ; class NmMessageListModel & NmUiEngine::messageListModel(class NmId const &, class NmId const &)
+	??1NmMailboxMetaData@@UAE@XZ @ 190 NONAME ; NmMailboxMetaData::~NmMailboxMetaData(void)
+	?connectionEvent@NmUiEngine@@IAEXW4NmConnectState@@ABVNmId@@@Z @ 191 NONAME ; void NmUiEngine::connectionEvent(enum NmConnectState, class NmId const &)
+	?mailbox@NmDataManager@@QAEPAVNmMailbox@@ABVNmId@@@Z @ 192 NONAME ; class NmMailbox * NmDataManager::mailbox(class NmId const &)
+	?interfaceInstance@NmDataPluginFactory@@QAEPAVNmDataPluginInterface@@PAVQObject@@@Z @ 193 NONAME ; class NmDataPluginInterface * NmDataPluginFactory::interfaceInstance(class QObject *)
+	?refreshModelItem@NmMailboxListModel@@QAEXABVNmId@@@Z @ 194 NONAME ; void NmMailboxListModel::refreshModelItem(class NmId const &)
+	?metaObject@NmMailboxListModel@@UBEPBUQMetaObject@@XZ @ 195 NONAME ; struct QMetaObject const * NmMailboxListModel::metaObject(void) const
+	?IconId@NmMailboxMetaData@@QBE?AVNmId@@XZ @ 196 NONAME ; class NmId NmMailboxMetaData::IconId(void) const
+	?sendOperationCompleted@NmUiEngine@@IAEXXZ @ 197 NONAME ; void NmUiEngine::sendOperationCompleted(void)
+	??0NmFolderMetaData@@QAE@XZ @ 198 NONAME ; NmFolderMetaData::NmFolderMetaData(void)
+	?staticMetaObject@NmAddAttachmentsOperation@@2UQMetaObject@@B @ 199 NONAME ; struct QMetaObject const NmAddAttachmentsOperation::staticMetaObject
+	?connectionState@NmUiEngine@@QAE?AW4NmConnectState@@ABVNmId@@@Z @ 200 NONAME ; enum NmConnectState NmUiEngine::connectionState(class NmId const &)
+	?createTitleDividerItem@NmMessageListModel@@AAEPAVNmMessageListModelItem@@PAVNmMessageEnvelope@@@Z @ 201 NONAME ; class NmMessageListModelItem * NmMessageListModel::createTitleDividerItem(class NmMessageEnvelope *)
+	?setId@NmFolderMetaData@@QAEXABVNmId@@@Z @ 202 NONAME ; void NmFolderMetaData::setId(class NmId const &)
+	??0NmOperation@@QAE@XZ @ 203 NONAME ; NmOperation::NmOperation(void)
+	?cancelOperation@NmOperation@@QAEXXZ @ 204 NONAME ; void NmOperation::cancelOperation(void)
+	??_ENmFolderMetaData@@UAE@I@Z @ 205 NONAME ; NmFolderMetaData::~NmFolderMetaData(unsigned int)
+	?qt_metacast@NmMessageListModel@@UAEPAXPBD@Z @ 206 NONAME ; void * NmMessageListModel::qt_metacast(char const *)
+	?operationProgressChanged@NmOperation@@IAEXH@Z @ 207 NONAME ; void NmOperation::operationProgressChanged(int)
+	?trUtf8@NmOperation@@SA?AVQString@@PBD0H@Z @ 208 NONAME ; class QString NmOperation::trUtf8(char const *, char const *, int)
+	??_ENmMailboxListModel@@UAE@I@Z @ 209 NONAME ; NmMailboxListModel::~NmMailboxListModel(unsigned int)
+	?messageDeleted@NmUiEngine@@IAEXABVNmId@@00@Z @ 210 NONAME ; void NmUiEngine::messageDeleted(class NmId const &, class NmId const &, class NmId const &)
+	?trUtf8@NmMessageCreationOperation@@SA?AVQString@@PBD0@Z @ 211 NONAME ; class QString NmMessageCreationOperation::trUtf8(char const *, char const *)
+	?metaObject@NmUiEngine@@UBEPBUQMetaObject@@XZ @ 212 NONAME ; struct QMetaObject const * NmUiEngine::metaObject(void) const
+	??_ENmBaseClientPlugin@@UAE@I@Z @ 213 NONAME ; NmBaseClientPlugin::~NmBaseClientPlugin(unsigned int)
+	?markAsUnread@NmBaseClientPlugin@@QAEXXZ @ 214 NONAME ; void NmBaseClientPlugin::markAsUnread(void)
+	?metaObject@NmBaseClientPlugin@@UBEPBUQMetaObject@@XZ @ 215 NONAME ; struct QMetaObject const * NmBaseClientPlugin::metaObject(void) const
+	?tr@NmDataManager@@SA?AVQString@@PBD0@Z @ 216 NONAME ; class QString NmDataManager::tr(char const *, char const *)
+	?mailboxListModel@NmUiEngine@@QAEAAVNmMailboxListModel@@XZ @ 217 NONAME ; class NmMailboxListModel & NmUiEngine::mailboxListModel(void)
+	?fetchMessage@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmId@@00@Z @ 218 NONAME ; class QPointer<class NmOperation> NmUiEngine::fetchMessage(class NmId const &, class NmId const &, class NmId const &)
+	?setIconId@NmMailboxMetaData@@QAEXABVNmId@@@Z @ 219 NONAME ; void NmMailboxMetaData::setIconId(class NmId const &)
+	??1NmDataPluginFactory@@EAE@XZ @ 220 NONAME ; NmDataPluginFactory::~NmDataPluginFactory(void)
+	?refreshMailboxListModel@NmUiEngine@@QAEXXZ @ 221 NONAME ; void NmUiEngine::refreshMailboxListModel(void)
+	?qt_metacall@NmStoreEnvelopesOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 222 NONAME ; int NmStoreEnvelopesOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@NmMessageListModel@@SA?AVQString@@PBD0@Z @ 223 NONAME ; class QString NmMessageListModel::trUtf8(char const *, char const *)
+	?rowCount@NmFolderListModel@@UBEHABVQModelIndex@@@Z @ 224 NONAME ; int NmFolderListModel::rowCount(class QModelIndex const &) const
+	?doUpdateOperationProgress@NmOperation@@MAEXXZ @ 225 NONAME ; void NmOperation::doUpdateOperationProgress(void)
+	?tr@NmMailboxListModel@@SA?AVQString@@PBD0@Z @ 226 NONAME ; class QString NmMailboxListModel::tr(char const *, char const *)
+	?removeMessage@NmUiEngine@@QAEHABVNmId@@00@Z @ 227 NONAME ; int NmUiEngine::removeMessage(class NmId const &, class NmId const &, class NmId const &)
+	??_ENmUiEngine@@UAE@I@Z @ 228 NONAME ; NmUiEngine::~NmUiEngine(unsigned int)
+	?operationCompleted@NmOperation@@IAEXH@Z @ 229 NONAME ; void NmOperation::operationCompleted(int)
+	?callEmitDataChanged@NmMessageListModelItem@@QAEXXZ @ 230 NONAME ; void NmMessageListModelItem::callEmitDataChanged(void)
+	?handleRequest@NmBaseClientPlugin@@IAEXW4NmActionResponseCommand@@ABVNmActionRequest@@@Z @ 231 NONAME ; void NmBaseClientPlugin::handleRequest(enum NmActionResponseCommand, class NmActionRequest const &)
+	??0NmMessageListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 232 NONAME ; NmMessageListModel::NmMessageListModel(class NmDataManager &, class QObject *)
+	??_ENmAddAttachmentsOperation@@UAE@I@Z @ 233 NONAME ; NmAddAttachmentsOperation::~NmAddAttachmentsOperation(unsigned int)
+	?syncState@NmUiEngine@@QAE?AW4NmSyncState@@ABVNmId@@@Z @ 234 NONAME ; enum NmSyncState NmUiEngine::syncState(class NmId const &)
+	??1NmOperation@@MAE@XZ @ 235 NONAME ; NmOperation::~NmOperation(void)
+	?tr@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0H@Z @ 236 NONAME ; class QString NmStoreEnvelopesOperation::tr(char const *, char const *, int)
+	?listMailboxes@NmDataManager@@QAEXAAV?$QList@PAVNmMailbox@@@@@Z @ 237 NONAME ; void NmDataManager::listMailboxes(class QList<class NmMailbox *> &)
+	?message@NmUiEngine@@QAEPAVNmMessage@@ABVNmId@@00@Z @ 238 NONAME ; class NmMessage * NmUiEngine::message(class NmId const &, class NmId const &, class NmId const &)
+	?refreshMailbox@NmUiEngine@@QAEHABVNmId@@@Z @ 239 NONAME ; int NmUiEngine::refreshMailbox(class NmId const &)
+	?trUtf8@NmUiEngine@@SA?AVQString@@PBD0@Z @ 240 NONAME ; class QString NmUiEngine::trUtf8(char const *, char const *)
+	?contentToMessagePart@NmUiEngine@@QAEHABVNmId@@00AAVNmMessagePart@@@Z @ 241 NONAME ; int NmUiEngine::contentToMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmMessagePart &)
+	?removeItem@NmMessageListModel@@AAEXHAAVNmMessageListModelItem@@@Z @ 242 NONAME ; void NmMessageListModel::removeItem(int, class NmMessageListModelItem &)
+	??1NmMailboxListModel@@UAE@XZ @ 243 NONAME ; NmMailboxListModel::~NmMailboxListModel(void)
+	??0NmBaseClientPlugin@@QAE@XZ @ 244 NONAME ; NmBaseClientPlugin::NmBaseClientPlugin(void)
+	?forwardMail@NmBaseClientPlugin@@QAEXXZ @ 245 NONAME ; void NmBaseClientPlugin::forwardMail(void)
+	?setItemType@NmMessageListModelItem@@QAEXW4NmMessageItemType@1@@Z @ 246 NONAME ; void NmMessageListModelItem::setItemType(enum NmMessageListModelItem::NmMessageItemType)
+	??_ENmDataPluginFactory@@UAE@I@Z @ 247 NONAME ; NmDataPluginFactory::~NmDataPluginFactory(unsigned int)
+	?mailboxListChanged@NmBaseClientPlugin@@AAEXABVNmId@@W4MailboxEventType@NmSettings@@@Z @ 248 NONAME ; void NmBaseClientPlugin::mailboxListChanged(class NmId const &, enum NmSettings::MailboxEventType)
+	?expanded@NmMessageListModelItem@@QBE_NXZ @ 249 NONAME ; bool NmMessageListModelItem::expanded(void) const
+	?columnCount@NmFolderListModel@@UBEHABVQModelIndex@@@Z @ 250 NONAME ; int NmFolderListModel::columnCount(class QModelIndex const &) const
+	?pluginInstance@NmDataPluginFactory@@QAEPAVQObject@@VNmId@@@Z @ 251 NONAME ; class QObject * NmDataPluginFactory::pluginInstance(class NmId)
+	?setNewParam@NmMessageListModel@@IAEXPAVNmUiStartParam@@@Z @ 252 NONAME ; void NmMessageListModel::setNewParam(class NmUiStartParam *)
+	?data@NmMessageListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 253 NONAME ; class QVariant NmMessageListModel::data(class QModelIndex const &, int) const
+	?goOnline@NmBaseClientPlugin@@AAEXABVNmId@@@Z @ 254 NONAME ; void NmBaseClientPlugin::goOnline(class NmId const &)
+	?createNewMail@NmBaseClientPlugin@@QAEXXZ @ 255 NONAME ; void NmBaseClientPlugin::createNewMail(void)
+	?qt_metacast@NmBaseClientPlugin@@UAEPAXPBD@Z @ 256 NONAME ; void * NmBaseClientPlugin::qt_metacast(char const *)
+	?staticMetaObject@NmBaseClientPlugin@@2UQMetaObject@@B @ 257 NONAME ; struct QMetaObject const NmBaseClientPlugin::staticMetaObject
+	?searchComplete@NmUiEngine@@IAEXXZ @ 258 NONAME ; void NmUiEngine::searchComplete(void)
+	?setEnvelope@NmMessageListModelItem@@QAEXABVNmMessageEnvelope@@@Z @ 259 NONAME ; void NmMessageListModelItem::setEnvelope(class NmMessageEnvelope const &)
+	?qt_metacast@NmAddAttachmentsOperation@@UAEPAXPBD@Z @ 260 NONAME ; void * NmAddAttachmentsOperation::qt_metacast(char const *)
+	?createNewMailViewerToolBar@NmBaseClientPlugin@@QAEXXZ @ 261 NONAME ; void NmBaseClientPlugin::createNewMailViewerToolBar(void)
+	?staticMetaObject@NmMailboxListModel@@2UQMetaObject@@B @ 262 NONAME ; struct QMetaObject const NmMailboxListModel::staticMetaObject
+	?qt_metacall@NmMessageCreationOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 263 NONAME ; int NmMessageCreationOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@NmDataManager@@SA?AVQString@@PBD0H@Z @ 264 NONAME ; class QString NmDataManager::trUtf8(char const *, char const *, int)
+	?trUtf8@NmMessageCreationOperation@@SA?AVQString@@PBD0H@Z @ 265 NONAME ; class QString NmMessageCreationOperation::trUtf8(char const *, char const *, int)
+	?createForwardMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@0@Z @ 266 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createForwardMessage(class NmId const &, class NmId const &)
+	?handleSyncStateEvent@NmUiEngine@@QAEXW4NmSyncState@@ABVNmOperationCompletionEvent@@@Z @ 267 NONAME ; void NmUiEngine::handleSyncStateEvent(enum NmSyncState, class NmOperationCompletionEvent const &)
+	?completeOperation@NmOperation@@QAEXH@Z @ 268 NONAME ; void NmOperation::completeOperation(int)
+	?parent@NmFolderListModel@@UBE?AVQModelIndex@@ABV2@@Z @ 269 NONAME ; class QModelIndex NmFolderListModel::parent(class QModelIndex const &) const
+	?folder@NmDataManager@@QAEPAVNmFolder@@ABVNmId@@0@Z @ 270 NONAME ; class NmFolder * NmDataManager::folder(class NmId const &, class NmId const &)
+	??0NmMessageSendingOperation@@QAE@XZ @ 271 NONAME ; NmMessageSendingOperation::NmMessageSendingOperation(void)
+	?replyMail@NmBaseClientPlugin@@QAEXXZ @ 272 NONAME ; void NmBaseClientPlugin::replyMail(void)
+	??1NmMessageListModelItem@@UAE@XZ @ 273 NONAME ; NmMessageListModelItem::~NmMessageListModelItem(void)
+	?mailboxPropertyChanged@NmBaseClientPlugin@@AAEXABVNmId@@VQVariant@@1@Z @ 274 NONAME ; void NmBaseClientPlugin::mailboxPropertyChanged(class NmId const &, class QVariant, class QVariant)
+	?qt_metacall@NmOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 275 NONAME ; int NmOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?removeMessageFromModel@NmMessageListModel@@AAEXABVNmId@@@Z @ 276 NONAME ; void NmMessageListModel::removeMessageFromModel(class NmId const &)
+	?trUtf8@NmMessageListModel@@SA?AVQString@@PBD0H@Z @ 277 NONAME ; class QString NmMessageListModel::trUtf8(char const *, char const *, int)
+	?operationPartCompleted@NmAddAttachmentsOperation@@IAEXABVQString@@ABVNmId@@H@Z @ 278 NONAME ; void NmAddAttachmentsOperation::operationPartCompleted(class QString const &, class NmId const &, int)
+	?trUtf8@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0H@Z @ 279 NONAME ; class QString NmStoreEnvelopesOperation::trUtf8(char const *, char const *, int)
+	?tr@NmMessageListModel@@SA?AVQString@@PBD0@Z @ 280 NONAME ; class QString NmMessageListModel::tr(char const *, char const *)
+	?doCompleteOperation@NmOperation@@MAEXXZ @ 281 NONAME ; void NmOperation::doCompleteOperation(void)
+	?dividerInsertionIndex@NmMessageListModel@@AAEHH@Z @ 282 NONAME ; int NmMessageListModel::dividerInsertionIndex(int)
+	?createMessageItem@NmMessageListModel@@AAEPAVNmMessageListModelItem@@PAVNmMessageEnvelope@@@Z @ 283 NONAME ; class NmMessageListModelItem * NmMessageListModel::createMessageItem(class NmMessageEnvelope *)
+	?id@NmFolderMetaData@@QBE?AVNmId@@XZ @ 284 NONAME ; class NmId NmFolderMetaData::id(void) const
+	?createReplyMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@0_N@Z @ 285 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createReplyMessage(class NmId const &, class NmId const &, bool)
+	?getStandardFolderId@NmDataManager@@QAE?AVNmId@@ABV2@W4NmFolderType@@@Z @ 286 NONAME ; class NmId NmDataManager::getStandardFolderId(class NmId const &, enum NmFolderType)
+	?address@NmMailboxMetaData@@QBE?AVQString@@XZ @ 287 NONAME ; class QString NmMailboxMetaData::address(void) const
+	?dividersActive@NmMessageListModel@@QAE_NXZ @ 288 NONAME ; bool NmMessageListModel::dividersActive(void)
+	?titleDivider@NmMessageListModelItem@@QBE?AVQString@@XZ @ 289 NONAME ; class QString NmMessageListModelItem::titleDivider(void) const
+	?getStaticMetaObject@NmBaseClientPlugin@@SAABUQMetaObject@@XZ @ 290 NONAME ; struct QMetaObject const & NmBaseClientPlugin::getStaticMetaObject(void)
+	?qt_metacast@NmMessageCreationOperation@@UAEPAXPBD@Z @ 291 NONAME ; void * NmMessageCreationOperation::qt_metacast(char const *)
+	?updateEnvelope@NmMessageListModel@@AAEXW4NmEnvelopeProperties@@ABVNmId@@@Z @ 292 NONAME ; void NmMessageListModel::updateEnvelope(enum NmEnvelopeProperties, class NmId const &)
+	??_ENmDataManager@@UAE@I@Z @ 293 NONAME ; NmDataManager::~NmDataManager(unsigned int)
+	?qt_metacast@NmMailboxListModel@@UAEPAXPBD@Z @ 294 NONAME ; void * NmMailboxListModel::qt_metacast(char const *)
+	?search@NmUiEngine@@QAEHABVNmId@@ABVQStringList@@@Z @ 295 NONAME ; int NmUiEngine::search(class NmId const &, class QStringList const &)
+	?setEnvelopes@NmUiEngine@@QAE?AV?$QPointer@VNmStoreEnvelopesOperation@@@@ABVNmId@@0W4NmEnvelopeProperties@@ABV?$QList@PB$$CBVNmMessageEnvelope@@@@@Z @ 296 NONAME ; class QPointer<class NmStoreEnvelopesOperation> NmUiEngine::setEnvelopes(class NmId const &, class NmId const &, enum NmEnvelopeProperties, class QList<class NmMessageEnvelope const *> const &)
+	?getActions@NmBaseClientPlugin@@UAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 297 NONAME ; void NmBaseClientPlugin::getActions(class NmActionRequest const &, class QList<class NmAction *> &)
+	?qt_metacast@NmStoreEnvelopesOperation@@UAEPAXPBD@Z @ 298 NONAME ; void * NmStoreEnvelopesOperation::qt_metacast(char const *)
+	??_ENmMailboxMetaData@@UAE@I@Z @ 299 NONAME ; NmMailboxMetaData::~NmMailboxMetaData(unsigned int)
+	??0NmMessageListModelItem@@QAE@XZ @ 300 NONAME ; NmMessageListModelItem::NmMessageListModelItem(void)
+	?tr@NmAddAttachmentsOperation@@SA?AVQString@@PBD0H@Z @ 301 NONAME ; class QString NmAddAttachmentsOperation::tr(char const *, char const *, int)
+	?setDividers@NmMessageListModel@@QAEX_N@Z @ 302 NONAME ; void NmMessageListModel::setDividers(bool)
+	?loadPlugin@NmDataPluginFactory@@QAEPAVQObject@@ABVQDir@@ABVQString@@@Z @ 303 NONAME ; class QObject * NmDataPluginFactory::loadPlugin(class QDir const &, class QString const &)
+	?qt_metacast@NmOperation@@UAEPAXPBD@Z @ 304 NONAME ; void * NmOperation::qt_metacast(char const *)
+	?tr@NmMessageListModel@@SA?AVQString@@PBD0H@Z @ 305 NONAME ; class QString NmMessageListModel::tr(char const *, char const *, int)
+	?removeAttachment@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmMessage@@ABVNmId@@@Z @ 306 NONAME ; class QPointer<class NmOperation> NmUiEngine::removeAttachment(class NmMessage const &, class NmId const &)
+	?staticMetaObject@NmMessageListModel@@2UQMetaObject@@B @ 307 NONAME ; struct QMetaObject const NmMessageListModel::staticMetaObject
+	?qt_metacall@NmAddAttachmentsOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 308 NONAME ; int NmAddAttachmentsOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@NmUiEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 309 NONAME ; int NmUiEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?message@NmDataManager@@QAEPAVNmMessage@@ABVNmId@@00@Z @ 310 NONAME ; class NmMessage * NmDataManager::message(class NmId const &, class NmId const &, class NmId const &)
+	?metaObject@NmOperation@@UBEPBUQMetaObject@@XZ @ 311 NONAME ; struct QMetaObject const * NmOperation::metaObject(void) const
+	?messageEventForListModel@NmUiEngine@@AAEXW4NmMessageEvent@@ABVNmId@@ABV?$QList@VNmId@@@@1@Z @ 312 NONAME ; void NmUiEngine::messageEventForListModel(enum NmMessageEvent, class NmId const &, class QList<class NmId> const &, class NmId const &)
 
--- a/emailuis/nmailuiengine/eabi/nmailuiengineu.def	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/eabi/nmailuiengineu.def	Wed Jun 23 17:00:39 2010 +0100
@@ -1,17 +1,17 @@
 EXPORTS
-	_ZN10NmUiEngine10matchFoundERK4NmId @ 1 NONAME
-	_ZN10NmUiEngine11checkOutboxERK4NmId @ 2 NONAME
-	_ZN10NmUiEngine11mailboxByIdERK4NmId @ 3 NONAME
-	_ZN10NmUiEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 4 NONAME
-	_ZN10NmUiEngine11qt_metacastEPKc @ 5 NONAME
-	_ZN10NmUiEngine11saveMessageERK9NmMessage @ 6 NONAME
-	_ZN10NmUiEngine11sendMessageEP9NmMessageRK5QListIP11NmOperationE @ 7 NONAME
-	_ZN10NmUiEngine12cancelSearchERK4NmId @ 8 NONAME
-	_ZN10NmUiEngine12fetchMessageERK4NmIdS2_S2_ @ 9 NONAME
-	_ZN10NmUiEngine12setEnvelopesERK4NmIdS2_20NmEnvelopePropertiesRK5QListIPK17NmMessageEnvelopeE @ 10 NONAME
-	_ZN10NmUiEngine13removeMessageERK4NmIdS2_S2_ @ 11 NONAME
-	_ZN10NmUiEngine14addAttachmentsERK9NmMessageRK5QListI7QStringE @ 12 NONAME
-	_ZN10NmUiEngine14deleteMessagesERK4NmIdS2_RK5QListIS0_E @ 13 NONAME
+	_ZN10NmUiEngine10matchFoundERK4NmIdS2_ @ 1 NONAME
+	_ZN10NmUiEngine11mailboxByIdERK4NmId @ 2 NONAME
+	_ZN10NmUiEngine11qt_metacallEN11QMetaObject4CallEiPPv @ 3 NONAME
+	_ZN10NmUiEngine11qt_metacastEPKc @ 4 NONAME
+	_ZN10NmUiEngine11saveMessageERK9NmMessage @ 5 NONAME
+	_ZN10NmUiEngine11sendMessageEP9NmMessageRK5QListIP11NmOperationE @ 6 NONAME
+	_ZN10NmUiEngine12cancelSearchERK4NmId @ 7 NONAME
+	_ZN10NmUiEngine12fetchMessageERK4NmIdS2_S2_ @ 8 NONAME
+	_ZN10NmUiEngine12setEnvelopesERK4NmIdS2_20NmEnvelopePropertiesRK5QListIPK17NmMessageEnvelopeE @ 9 NONAME
+	_ZN10NmUiEngine13removeMessageERK4NmIdS2_S2_ @ 10 NONAME
+	_ZN10NmUiEngine14addAttachmentsERK9NmMessageRK5QListI7QStringE @ 11 NONAME
+	_ZN10NmUiEngine14deleteMessagesERK4NmIdS2_RK5QListIS0_E @ 12 NONAME
+	_ZN10NmUiEngine14folderTypeByIdE4NmIdS0_ @ 13 NONAME
 	_ZN10NmUiEngine14mailboxDeletedERK4NmId @ 14 NONAME
 	_ZN10NmUiEngine14messageDeletedERK4NmIdS2_S2_ @ 15 NONAME
 	_ZN10NmUiEngine14refreshMailboxERK4NmId @ 16 NONAME
@@ -24,310 +24,298 @@
 	_ZN10NmUiEngine15releaseInstanceERPS_ @ 23 NONAME
 	_ZN10NmUiEngine16createNewMessageERK4NmId @ 24 NONAME
 	_ZN10NmUiEngine16fetchMessagePartERK4NmIdS2_S2_S2_ @ 25 NONAME
-	_ZN10NmUiEngine16mailboxListModelEv @ 26 NONAME
-	_ZN10NmUiEngine16messageListModelERK4NmIdS2_ @ 27 NONAME
-	_ZN10NmUiEngine16removeAttachmentERK9NmMessageRK4NmId @ 28 NONAME
-	_ZN10NmUiEngine16standardFolderIdERK4NmId12NmFolderType @ 29 NONAME
-	_ZN10NmUiEngine16staticMetaObjectE @ 30 NONAME DATA 16
-	_ZN10NmUiEngine18createReplyMessageERK4NmIdS2_b @ 31 NONAME
-	_ZN10NmUiEngine18handleMailboxEventE14NmMailboxEventRK5QListI4NmIdE @ 32 NONAME
-	_ZN10NmUiEngine18handleMessageEventE14NmMessageEventRK4NmIdRK5QListIS1_ES3_ @ 33 NONAME
-	_ZN10NmUiEngine18operationCompletedERK26NmOperationCompletionEvent @ 34 NONAME
-	_ZN10NmUiEngine19getStaticMetaObjectEv @ 35 NONAME
-	_ZN10NmUiEngine20contentToMessagePartERK4NmIdS2_S2_R13NmMessagePart @ 36 NONAME
-	_ZN10NmUiEngine20createForwardMessageERK4NmIdS2_ @ 37 NONAME
-	_ZN10NmUiEngine20handleSyncStateEventE11NmSyncStateRK26NmOperationCompletionEvent @ 38 NONAME
-	_ZN10NmUiEngine22messageSearchListModelEP18QAbstractItemModel @ 39 NONAME
-	_ZN10NmUiEngine22sendOperationCompletedEv @ 40 NONAME
-	_ZN10NmUiEngine23refreshMailboxListModelEv @ 41 NONAME
-	_ZN10NmUiEngine28handleCompletedSendOperationEv @ 42 NONAME
-	_ZN10NmUiEngine6searchERK4NmIdRK11QStringList @ 43 NONAME
-	_ZN10NmUiEngine7messageERK4NmIdS2_S2_ @ 44 NONAME
-	_ZN10NmUiEngine8goOnlineERK4NmId @ 45 NONAME
-	_ZN10NmUiEngine8instanceEv @ 46 NONAME
-	_ZN10NmUiEngine9goOfflineERK4NmId @ 47 NONAME
-	_ZN10NmUiEngine9mInstanceE @ 48 NONAME DATA 4
-	_ZN10NmUiEngine9syncStateERK4NmId @ 49 NONAME
-	_ZN10NmUiEngineC1Ev @ 50 NONAME
-	_ZN10NmUiEngineC2Ev @ 51 NONAME
-	_ZN10NmUiEngineD0Ev @ 52 NONAME
-	_ZN10NmUiEngineD1Ev @ 53 NONAME
-	_ZN10NmUiEngineD2Ev @ 54 NONAME
-	_ZN11NmOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 55 NONAME
-	_ZN11NmOperation11qt_metacastEPKc @ 56 NONAME
-	_ZN11NmOperation15cancelOperationEv @ 57 NONAME
-	_ZN11NmOperation15deleteOperationEv @ 58 NONAME
-	_ZN11NmOperation16staticMetaObjectE @ 59 NONAME DATA 16
-	_ZN11NmOperation17completeOperationEi @ 60 NONAME
-	_ZN11NmOperation17doCancelOperationEv @ 61 NONAME
-	_ZN11NmOperation17runAsyncOperationEv @ 62 NONAME
-	_ZN11NmOperation18operationCancelledEv @ 63 NONAME
-	_ZN11NmOperation18operationCompletedEi @ 64 NONAME
-	_ZN11NmOperation19doCompleteOperationEv @ 65 NONAME
-	_ZN11NmOperation19getStaticMetaObjectEv @ 66 NONAME
-	_ZN11NmOperation23addPreliminaryOperationEPS_ @ 67 NONAME
-	_ZN11NmOperation23updateOperationProgressEi @ 68 NONAME
-	_ZN11NmOperation24operationProgressChangedEi @ 69 NONAME
-	_ZN11NmOperation25doUpdateOperationProgressEv @ 70 NONAME
-	_ZN11NmOperation34handlePreliminaryOperationFinishedEv @ 71 NONAME
-	_ZN11NmOperationC2Ev @ 72 NONAME
-	_ZN11NmOperationD0Ev @ 73 NONAME
-	_ZN11NmOperationD1Ev @ 74 NONAME
-	_ZN11NmOperationD2Ev @ 75 NONAME
-	_ZN13NmDataManager10folderByIdERK4NmIdS2_ @ 76 NONAME
-	_ZN13NmDataManager11listFoldersE4NmIdR5QListIP8NmFolderE @ 77 NONAME
-	_ZN13NmDataManager11mailboxByIdERK4NmId @ 78 NONAME
-	_ZN13NmDataManager11qt_metacallEN11QMetaObject4CallEiPPv @ 79 NONAME
-	_ZN13NmDataManager11qt_metacastEPKc @ 80 NONAME
-	_ZN13NmDataManager12envelopeByIdERK4NmIdS2_S2_ @ 81 NONAME
-	_ZN13NmDataManager12listMessagesERK4NmIdS2_R5QListIP17NmMessageEnvelopeE @ 82 NONAME
-	_ZN13NmDataManager13listMailboxesER5QListIP9NmMailboxE @ 83 NONAME
-	_ZN13NmDataManager14listMailboxIdsER5QListI4NmIdE @ 84 NONAME
-	_ZN13NmDataManager16staticMetaObjectE @ 85 NONAME DATA 16
-	_ZN13NmDataManager19getStandardFolderIdERK4NmId12NmFolderType @ 86 NONAME
-	_ZN13NmDataManager19getStaticMetaObjectEv @ 87 NONAME
-	_ZN13NmDataManager20contentToMessagePartERK4NmIdS2_S2_R13NmMessagePart @ 88 NONAME
-	_ZN13NmDataManager6folderERK4NmIdS2_ @ 89 NONAME
-	_ZN13NmDataManager7mailboxERK4NmId @ 90 NONAME
-	_ZN13NmDataManager7messageERK4NmIdS2_S2_ @ 91 NONAME
-	_ZN13NmDataManagerC1Ev @ 92 NONAME
-	_ZN13NmDataManagerC2Ev @ 93 NONAME
-	_ZN13NmDataManagerD0Ev @ 94 NONAME
-	_ZN13NmDataManagerD1Ev @ 95 NONAME
-	_ZN13NmDataManagerD2Ev @ 96 NONAME
-	_ZN16NmFolderMetaData5setIdERK4NmId @ 97 NONAME
-	_ZN16NmFolderMetaData7setNameERK7QString @ 98 NONAME
-	_ZN16NmFolderMetaDataC1Ev @ 99 NONAME
-	_ZN16NmFolderMetaDataC2Ev @ 100 NONAME
-	_ZN16NmFolderMetaDataD0Ev @ 101 NONAME
-	_ZN16NmFolderMetaDataD1Ev @ 102 NONAME
-	_ZN16NmFolderMetaDataD2Ev @ 103 NONAME
-	_ZN17NmFolderListModel7refreshER5QListIP8NmFolderE @ 104 NONAME
-	_ZN17NmFolderListModelC1ER13NmDataManagerP7QObject @ 105 NONAME
-	_ZN17NmFolderListModelC2ER13NmDataManagerP7QObject @ 106 NONAME
-	_ZN17NmFolderListModelD0Ev @ 107 NONAME
-	_ZN17NmFolderListModelD1Ev @ 108 NONAME
-	_ZN17NmFolderListModelD2Ev @ 109 NONAME
-	_ZN17NmMailboxMetaData5setIdERK4NmId @ 110 NONAME
-	_ZN17NmMailboxMetaData7setNameERK7QString @ 111 NONAME
-	_ZN17NmMailboxMetaData9setIconIdERK4NmId @ 112 NONAME
-	_ZN17NmMailboxMetaDataC1Ev @ 113 NONAME
-	_ZN17NmMailboxMetaDataC2Ev @ 114 NONAME
-	_ZN17NmMailboxMetaDataD0Ev @ 115 NONAME
-	_ZN17NmMailboxMetaDataD1Ev @ 116 NONAME
-	_ZN17NmMailboxMetaDataD2Ev @ 117 NONAME
-	_ZN18NmBaseClientPlugin10getActionsERK15NmActionRequestR5QListIP8NmActionE @ 118 NONAME
-	_ZN18NmBaseClientPlugin10markAsReadEv @ 119 NONAME
-	_ZN18NmBaseClientPlugin11forwardMailEv @ 120 NONAME
-	_ZN18NmBaseClientPlugin11openMessageEv @ 121 NONAME
-	_ZN18NmBaseClientPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 122 NONAME
-	_ZN18NmBaseClientPlugin11qt_metacastEPKc @ 123 NONAME
-	_ZN18NmBaseClientPlugin12markAsUnreadEv @ 124 NONAME
-	_ZN18NmBaseClientPlugin12replyAllMailEv @ 125 NONAME
-	_ZN18NmBaseClientPlugin13createNewMailEv @ 126 NONAME
-	_ZN18NmBaseClientPlugin13deleteMessageEv @ 127 NONAME
-	_ZN18NmBaseClientPlugin13handleRequestE23NmActionResponseCommandRK15NmActionRequest @ 128 NONAME
-	_ZN18NmBaseClientPlugin14openAttachmentEv @ 129 NONAME
-	_ZN18NmBaseClientPlugin14setPriorityLowEv @ 130 NONAME
-	_ZN18NmBaseClientPlugin15setPriorityHighEv @ 131 NONAME
-	_ZN18NmBaseClientPlugin16removeAttachmentEv @ 132 NONAME
-	_ZN18NmBaseClientPlugin16staticMetaObjectE @ 133 NONAME DATA 16
-	_ZN18NmBaseClientPlugin17setPriorityNormalEv @ 134 NONAME
-	_ZN18NmBaseClientPlugin18mailboxListChangedERK4NmIdN10NmSettings16MailboxEventTypeE @ 135 NONAME
-	_ZN18NmBaseClientPlugin19getStaticMetaObjectEv @ 136 NONAME
-	_ZN18NmBaseClientPlugin22mailboxPropertyChangedERK4NmId8QVariantS3_ @ 137 NONAME
-	_ZN18NmBaseClientPlugin22updateEnvelopePropertyE20NmEnvelopeProperties @ 138 NONAME
-	_ZN18NmBaseClientPlugin24createEditorViewCommandsERK15NmActionRequestR5QListIP8NmActionE @ 139 NONAME
-	_ZN18NmBaseClientPlugin24createViewerViewCommandsERK15NmActionRequestR5QListIP8NmActionE @ 140 NONAME
-	_ZN18NmBaseClientPlugin25createMessageListCommandsERK15NmActionRequestR5QListIP8NmActionE @ 141 NONAME
-	_ZN18NmBaseClientPlugin26createNewMailViewerToolBarEv @ 142 NONAME
-	_ZN18NmBaseClientPlugin27deleteMessageFromViewerViewEv @ 143 NONAME
-	_ZN18NmBaseClientPlugin6attachEv @ 144 NONAME
-	_ZN18NmBaseClientPlugin6searchEv @ 145 NONAME
-	_ZN18NmBaseClientPlugin7refreshEv @ 146 NONAME
-	_ZN18NmBaseClientPlugin8goOnlineERK4NmId @ 147 NONAME
-	_ZN18NmBaseClientPlugin8sendMailEv @ 148 NONAME
-	_ZN18NmBaseClientPlugin8settingsEv @ 149 NONAME
-	_ZN18NmBaseClientPlugin9goOfflineERK4NmId @ 150 NONAME
-	_ZN18NmBaseClientPlugin9replyMailEv @ 151 NONAME
-	_ZN18NmBaseClientPluginC2Ev @ 152 NONAME
-	_ZN18NmBaseClientPluginD0Ev @ 153 NONAME
-	_ZN18NmBaseClientPluginD1Ev @ 154 NONAME
-	_ZN18NmBaseClientPluginD2Ev @ 155 NONAME
-	_ZN18NmMailboxListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 156 NONAME
-	_ZN18NmMailboxListModel11qt_metacastEPKc @ 157 NONAME
-	_ZN18NmMailboxListModel16refreshModelItemERK4NmIdb @ 158 NONAME
-	_ZN18NmMailboxListModel16staticMetaObjectE @ 159 NONAME DATA 16
-	_ZN18NmMailboxListModel17createMailboxItemEPK9NmMailbox @ 160 NONAME
-	_ZN18NmMailboxListModel18handleMailboxEventE14NmMailboxEventRK5QListI4NmIdE @ 161 NONAME
-	_ZN18NmMailboxListModel19getStaticMetaObjectEv @ 162 NONAME
-	_ZN18NmMailboxListModel7refreshER5QListIP9NmMailboxE @ 163 NONAME
-	_ZN18NmMailboxListModelC1ER13NmDataManagerP7QObject @ 164 NONAME
-	_ZN18NmMailboxListModelC2ER13NmDataManagerP7QObject @ 165 NONAME
-	_ZN18NmMailboxListModelD0Ev @ 166 NONAME
-	_ZN18NmMailboxListModelD1Ev @ 167 NONAME
-	_ZN18NmMailboxListModelD2Ev @ 168 NONAME
-	_ZN18NmMessageListModel10removeItemEiR22NmMessageListModelItem @ 169 NONAME
-	_ZN18NmMessageListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 170 NONAME
-	_ZN18NmMessageListModel11qt_metacastEPKc @ 171 NONAME
-	_ZN18NmMessageListModel11setDividersEb @ 172 NONAME
-	_ZN18NmMessageListModel11setNewParamEP14NmUiStartParam @ 173 NONAME
-	_ZN18NmMessageListModel13itemFromModelERK4NmId @ 174 NONAME
-	_ZN18NmMessageListModel14dividersActiveEv @ 175 NONAME
-	_ZN18NmMessageListModel14updateEnvelopeE20NmEnvelopePropertiesRK4NmId @ 176 NONAME
-	_ZN18NmMessageListModel16currentMailboxIdEv @ 177 NONAME
-	_ZN18NmMessageListModel16staticMetaObjectE @ 178 NONAME DATA 16
-	_ZN18NmMessageListModel17createMessageItemEP17NmMessageEnvelope @ 179 NONAME
-	_ZN18NmMessageListModel18handleMessageEventE14NmMessageEventRK4NmIdRK5QListIS1_E @ 180 NONAME
-	_ZN18NmMessageListModel19getStaticMetaObjectEv @ 181 NONAME
-	_ZN18NmMessageListModel21dividerInsertionIndexEi @ 182 NONAME
-	_ZN18NmMessageListModel21setEnvelopePropertiesE20NmEnvelopePropertiesRK5QListI4NmIdE @ 183 NONAME
-	_ZN18NmMessageListModel21updateMessageEnvelopeERK4NmIdS2_S2_ @ 184 NONAME
-	_ZN18NmMessageListModel22createTitleDividerItemEP17NmMessageEnvelope @ 185 NONAME
-	_ZN18NmMessageListModel22insertDividerIntoModelEP17NmMessageEnvelopei @ 186 NONAME
-	_ZN18NmMessageListModel22insertMessageIntoModelEP17NmMessageEnvelopeib @ 187 NONAME
-	_ZN18NmMessageListModel22removeMessageFromModelERK4NmId @ 188 NONAME
-	_ZN18NmMessageListModel25insertNewMessageIntoModelERK4NmIdS2_S2_ @ 189 NONAME
-	_ZN18NmMessageListModel7changedERK17NmMessageEnvelopeS2_ @ 190 NONAME
-	_ZN18NmMessageListModel7refreshE4NmIdS0_RK5QListIP17NmMessageEnvelopeE @ 191 NONAME
-	_ZN18NmMessageListModelC1ER13NmDataManagerP7QObject @ 192 NONAME
-	_ZN18NmMessageListModelC2ER13NmDataManagerP7QObject @ 193 NONAME
-	_ZN18NmMessageListModelD0Ev @ 194 NONAME
-	_ZN18NmMessageListModelD1Ev @ 195 NONAME
-	_ZN18NmMessageListModelD2Ev @ 196 NONAME
-	_ZN19NmDataPluginFactory10loadPluginERK4QDirRK7QString @ 197 NONAME
-	_ZN19NmDataPluginFactory12mPluginArrayE @ 198 NONAME DATA 4
-	_ZN19NmDataPluginFactory14pluginInstanceE4NmId @ 199 NONAME
-	_ZN19NmDataPluginFactory15mReferenceCountE @ 200 NONAME DATA 4
-	_ZN19NmDataPluginFactory15pluginInstancesEv @ 201 NONAME
-	_ZN19NmDataPluginFactory15releaseInstanceERPS_ @ 202 NONAME
-	_ZN19NmDataPluginFactory17interfaceInstanceE4NmId @ 203 NONAME
-	_ZN19NmDataPluginFactory17interfaceInstanceEP7QObject @ 204 NONAME
-	_ZN19NmDataPluginFactory18mPluginLoaderArrayE @ 205 NONAME DATA 4
-	_ZN19NmDataPluginFactory8instanceEv @ 206 NONAME
-	_ZN19NmDataPluginFactory9mInstanceE @ 207 NONAME DATA 4
-	_ZN19NmDataPluginFactoryC1Ev @ 208 NONAME
-	_ZN19NmDataPluginFactoryC2Ev @ 209 NONAME
-	_ZN19NmDataPluginFactoryD0Ev @ 210 NONAME
-	_ZN19NmDataPluginFactoryD1Ev @ 211 NONAME
-	_ZN19NmDataPluginFactoryD2Ev @ 212 NONAME
-	_ZN22NmCheckOutboxOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 213 NONAME
-	_ZN22NmCheckOutboxOperation11qt_metacastEPKc @ 214 NONAME
-	_ZN22NmCheckOutboxOperation16staticMetaObjectE @ 215 NONAME DATA 16
-	_ZN22NmCheckOutboxOperation19getStaticMetaObjectEv @ 216 NONAME
-	_ZN22NmMessageListModelItem11envelopePtrEv @ 217 NONAME
-	_ZN22NmMessageListModelItem11setEnvelopeEP17NmMessageEnvelope @ 218 NONAME
-	_ZN22NmMessageListModelItem11setEnvelopeERK17NmMessageEnvelope @ 219 NONAME
-	_ZN22NmMessageListModelItem11setExpandedEb @ 220 NONAME
-	_ZN22NmMessageListModelItem11setItemTypeENS_17NmMessageItemTypeE @ 221 NONAME
-	_ZN22NmMessageListModelItem15setTitleDividerERK7QString @ 222 NONAME
-	_ZN22NmMessageListModelItem19callEmitDataChangedEv @ 223 NONAME
-	_ZN22NmMessageListModelItemC1Ev @ 224 NONAME
-	_ZN22NmMessageListModelItemC2Ev @ 225 NONAME
-	_ZN22NmMessageListModelItemD0Ev @ 226 NONAME
-	_ZN22NmMessageListModelItemD1Ev @ 227 NONAME
-	_ZN22NmMessageListModelItemD2Ev @ 228 NONAME
-	_ZN24NmMessageSearchListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 229 NONAME
-	_ZN24NmMessageSearchListModel11qt_metacastEPKc @ 230 NONAME
-	_ZN24NmMessageSearchListModel15addSearchResultERK4NmId @ 231 NONAME
-	_ZN24NmMessageSearchListModel16staticMetaObjectE @ 232 NONAME DATA 16
-	_ZN24NmMessageSearchListModel18clearSearchResultsEv @ 233 NONAME
-	_ZN24NmMessageSearchListModel19getStaticMetaObjectEv @ 234 NONAME
-	_ZN24NmMessageSearchListModelC1EP7QObject @ 235 NONAME
-	_ZN24NmMessageSearchListModelC2EP7QObject @ 236 NONAME
-	_ZN24NmMessageSearchListModelD0Ev @ 237 NONAME
-	_ZN24NmMessageSearchListModelD1Ev @ 238 NONAME
-	_ZN24NmMessageSearchListModelD2Ev @ 239 NONAME
-	_ZN25NmAddAttachmentsOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 240 NONAME
-	_ZN25NmAddAttachmentsOperation11qt_metacastEPKc @ 241 NONAME
-	_ZN25NmAddAttachmentsOperation16staticMetaObjectE @ 242 NONAME DATA 16
-	_ZN25NmAddAttachmentsOperation19getStaticMetaObjectEv @ 243 NONAME
-	_ZN25NmAddAttachmentsOperation21completeOperationPartERK7QStringRK4NmIdi @ 244 NONAME
-	_ZN25NmAddAttachmentsOperation22operationPartCompletedERK7QStringRK4NmIdi @ 245 NONAME
-	_ZN25NmAddAttachmentsOperationC2Ev @ 246 NONAME
-	_ZN25NmAddAttachmentsOperationD0Ev @ 247 NONAME
-	_ZN25NmAddAttachmentsOperationD1Ev @ 248 NONAME
-	_ZN25NmAddAttachmentsOperationD2Ev @ 249 NONAME
-	_ZN25NmStoreEnvelopesOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 250 NONAME
-	_ZN25NmStoreEnvelopesOperation11qt_metacastEPKc @ 251 NONAME
-	_ZN25NmStoreEnvelopesOperation16staticMetaObjectE @ 252 NONAME DATA 16
-	_ZN25NmStoreEnvelopesOperation19getStaticMetaObjectEv @ 253 NONAME
-	_ZN26NmMessageCreationOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 254 NONAME
-	_ZN26NmMessageCreationOperation11qt_metacastEPKc @ 255 NONAME
-	_ZN26NmMessageCreationOperation16staticMetaObjectE @ 256 NONAME DATA 16
-	_ZN26NmMessageCreationOperation19getStaticMetaObjectEv @ 257 NONAME
-	_ZN7NmIcons7getIconENS_4IconE @ 258 NONAME
-	_ZN7NmIcons9freeIconsEv @ 259 NONAME
-	_ZNK10NmUiEngine10metaObjectEv @ 260 NONAME
-	_ZNK10NmUiEngine16isSendingMessageEv @ 261 NONAME
-	_ZNK10NmUiEngine16messageBeingSentEv @ 262 NONAME
-	_ZNK11NmOperation10metaObjectEv @ 263 NONAME
-	_ZNK11NmOperation9isRunningEv @ 264 NONAME
-	_ZNK13NmDataManager10metaObjectEv @ 265 NONAME
-	_ZNK16NmFolderMetaData2idEv @ 266 NONAME
-	_ZNK16NmFolderMetaData4nameEv @ 267 NONAME
-	_ZNK17NmFolderListModel11columnCountERK11QModelIndex @ 268 NONAME
-	_ZNK17NmFolderListModel4dataERK11QModelIndexi @ 269 NONAME
-	_ZNK17NmFolderListModel6parentERK11QModelIndex @ 270 NONAME
-	_ZNK17NmFolderListModel8rowCountERK11QModelIndex @ 271 NONAME
-	_ZNK17NmMailboxMetaData2idEv @ 272 NONAME
-	_ZNK17NmMailboxMetaData4nameEv @ 273 NONAME
-	_ZNK17NmMailboxMetaData6IconIdEv @ 274 NONAME
-	_ZNK18NmBaseClientPlugin10metaObjectEv @ 275 NONAME
-	_ZNK18NmMailboxListModel10metaObjectEv @ 276 NONAME
-	_ZNK18NmMailboxListModel4dataERK11QModelIndexi @ 277 NONAME
-	_ZNK18NmMessageListModel10metaObjectEv @ 278 NONAME
-	_ZNK18NmMessageListModel17getInsertionIndexERK17NmMessageEnvelope @ 279 NONAME
-	_ZNK18NmMessageListModel30messagesBelongUnderSameDividerEPK17NmMessageEnvelopeS2_ @ 280 NONAME
-	_ZNK18NmMessageListModel4dataERK11QModelIndexi @ 281 NONAME
-	_ZNK22NmCheckOutboxOperation10metaObjectEv @ 282 NONAME
-	_ZNK22NmMessageListModelItem12titleDividerEv @ 283 NONAME
-	_ZNK22NmMessageListModelItem8envelopeEv @ 284 NONAME
-	_ZNK22NmMessageListModelItem8expandedEv @ 285 NONAME
-	_ZNK22NmMessageListModelItem8itemTypeEv @ 286 NONAME
-	_ZNK24NmMessageSearchListModel10metaObjectEv @ 287 NONAME
-	_ZNK24NmMessageSearchListModel16filterAcceptsRowEiRK11QModelIndex @ 288 NONAME
-	_ZNK24NmMessageSearchListModel4dataERK11QModelIndexi @ 289 NONAME
-	_ZNK25NmAddAttachmentsOperation10metaObjectEv @ 290 NONAME
-	_ZNK25NmStoreEnvelopesOperation10metaObjectEv @ 291 NONAME
-	_ZNK26NmMessageCreationOperation10metaObjectEv @ 292 NONAME
-	_ZTI10NmUiEngine @ 293 NONAME
-	_ZTI11NmOperation @ 294 NONAME
-	_ZTI13NmDataManager @ 295 NONAME
-	_ZTI16NmFolderMetaData @ 296 NONAME
-	_ZTI17NmFolderListModel @ 297 NONAME
-	_ZTI17NmMailboxMetaData @ 298 NONAME
-	_ZTI18NmBaseClientPlugin @ 299 NONAME
-	_ZTI18NmMailboxListModel @ 300 NONAME
-	_ZTI18NmMessageListModel @ 301 NONAME
-	_ZTI19NmDataPluginFactory @ 302 NONAME
-	_ZTI22NmCheckOutboxOperation @ 303 NONAME
-	_ZTI22NmMessageListModelItem @ 304 NONAME
-	_ZTI24NmMessageSearchListModel @ 305 NONAME
-	_ZTI25NmAddAttachmentsOperation @ 306 NONAME
-	_ZTI25NmStoreEnvelopesOperation @ 307 NONAME
-	_ZTI26NmMessageCreationOperation @ 308 NONAME
-	_ZTV10NmUiEngine @ 309 NONAME
-	_ZTV11NmOperation @ 310 NONAME
-	_ZTV13NmDataManager @ 311 NONAME
-	_ZTV16NmFolderMetaData @ 312 NONAME
-	_ZTV17NmFolderListModel @ 313 NONAME
-	_ZTV17NmMailboxMetaData @ 314 NONAME
-	_ZTV18NmBaseClientPlugin @ 315 NONAME
-	_ZTV18NmMailboxListModel @ 316 NONAME
-	_ZTV18NmMessageListModel @ 317 NONAME
-	_ZTV19NmDataPluginFactory @ 318 NONAME
-	_ZTV22NmCheckOutboxOperation @ 319 NONAME
-	_ZTV22NmMessageListModelItem @ 320 NONAME
-	_ZTV24NmMessageSearchListModel @ 321 NONAME
-	_ZTV25NmAddAttachmentsOperation @ 322 NONAME
-	_ZTV25NmStoreEnvelopesOperation @ 323 NONAME
-	_ZTV26NmMessageCreationOperation @ 324 NONAME
-	_ZThn8_N18NmBaseClientPlugin10getActionsERK15NmActionRequestR5QListIP8NmActionE @ 325 NONAME
-	_ZThn8_N18NmBaseClientPluginD0Ev @ 326 NONAME
-	_ZThn8_N18NmBaseClientPluginD1Ev @ 327 NONAME
-	_ZN10NmUiEngine14folderTypeByIdE4NmIdS0_ @ 328 NONAME
-	_ZN24NmMessageSearchListModel14refreshContentEv @ 329 NONAME
-	_ZNK24NmMessageSearchListModel17searchResultCountEv @ 330 NONAME
-	_ZN10NmUiEngine18handleConnectEventE14NmConnectStateRK4NmIdi @ 331 NONAME
+	_ZN10NmUiEngine16handleMatchFoundERK4NmIdS2_ @ 26 NONAME
+	_ZN10NmUiEngine16mailboxListModelEv @ 27 NONAME
+	_ZN10NmUiEngine16messageListModelERK4NmIdS2_ @ 28 NONAME
+	_ZN10NmUiEngine16removeAttachmentERK9NmMessageRK4NmId @ 29 NONAME
+	_ZN10NmUiEngine16saveDraftMessageEP9NmMessageRK5QListIP11NmOperationE @ 30 NONAME
+	_ZN10NmUiEngine16standardFolderIdERK4NmId12NmFolderType @ 31 NONAME
+	_ZN10NmUiEngine16staticMetaObjectE @ 32 NONAME DATA 16
+	_ZN10NmUiEngine17fetchMessagePartsERK4NmIdS2_S2_RK5QListIS0_E @ 33 NONAME
+	_ZN10NmUiEngine18createReplyMessageERK4NmIdS2_b @ 34 NONAME
+	_ZN10NmUiEngine18handleConnectEventE14NmConnectStateRK4NmIdi @ 35 NONAME
+	_ZN10NmUiEngine18handleMailboxEventE14NmMailboxEventRK5QListI4NmIdE @ 36 NONAME
+	_ZN10NmUiEngine18handleMessageEventE14NmMessageEventRK4NmIdRK5QListIS1_ES3_ @ 37 NONAME
+	_ZN10NmUiEngine18operationCompletedERK26NmOperationCompletionEvent @ 38 NONAME
+	_ZN10NmUiEngine18removeDraftMessageEP9NmMessage @ 39 NONAME
+	_ZN10NmUiEngine18updateActiveFolderERK4NmIdS2_ @ 40 NONAME
+	_ZN10NmUiEngine19getStaticMetaObjectEv @ 41 NONAME
+	_ZN10NmUiEngine20contentToMessagePartERK4NmIdS2_S2_R13NmMessagePart @ 42 NONAME
+	_ZN10NmUiEngine20createForwardMessageERK4NmIdS2_ @ 43 NONAME
+	_ZN10NmUiEngine20handleSyncStateEventE11NmSyncStateRK26NmOperationCompletionEvent @ 44 NONAME
+	_ZN10NmUiEngine22sendOperationCompletedEv @ 45 NONAME
+	_ZN10NmUiEngine23refreshMailboxListModelEv @ 46 NONAME
+	_ZN10NmUiEngine25messageListModelForSearchERK4NmId @ 47 NONAME
+	_ZN10NmUiEngine28handleCompletedSendOperationEv @ 48 NONAME
+	_ZN10NmUiEngine33handleCompletedSaveDraftOperationEv @ 49 NONAME
+	_ZN10NmUiEngine35handleCompletedRemoveDraftOperationEv @ 50 NONAME
+	_ZN10NmUiEngine6searchERK4NmIdRK11QStringList @ 51 NONAME
+	_ZN10NmUiEngine7messageERK4NmIdS2_S2_ @ 52 NONAME
+	_ZN10NmUiEngine8goOnlineERK4NmId @ 53 NONAME
+	_ZN10NmUiEngine8instanceEv @ 54 NONAME
+	_ZN10NmUiEngine9goOfflineERK4NmId @ 55 NONAME
+	_ZN10NmUiEngine9mInstanceE @ 56 NONAME DATA 4
+	_ZN10NmUiEngine9syncStateERK4NmId @ 57 NONAME
+	_ZN10NmUiEngineC1Ev @ 58 NONAME
+	_ZN10NmUiEngineC2Ev @ 59 NONAME
+	_ZN10NmUiEngineD0Ev @ 60 NONAME
+	_ZN10NmUiEngineD1Ev @ 61 NONAME
+	_ZN10NmUiEngineD2Ev @ 62 NONAME
+	_ZN11NmOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 63 NONAME
+	_ZN11NmOperation11qt_metacastEPKc @ 64 NONAME
+	_ZN11NmOperation15cancelOperationEv @ 65 NONAME
+	_ZN11NmOperation15deleteOperationEv @ 66 NONAME
+	_ZN11NmOperation16staticMetaObjectE @ 67 NONAME DATA 16
+	_ZN11NmOperation17completeOperationEi @ 68 NONAME
+	_ZN11NmOperation17doCancelOperationEv @ 69 NONAME
+	_ZN11NmOperation17runAsyncOperationEv @ 70 NONAME
+	_ZN11NmOperation18operationCancelledEv @ 71 NONAME
+	_ZN11NmOperation18operationCompletedEi @ 72 NONAME
+	_ZN11NmOperation19doCompleteOperationEv @ 73 NONAME
+	_ZN11NmOperation19getStaticMetaObjectEv @ 74 NONAME
+	_ZN11NmOperation23addPreliminaryOperationEPS_ @ 75 NONAME
+	_ZN11NmOperation23updateOperationProgressEi @ 76 NONAME
+	_ZN11NmOperation24operationProgressChangedEi @ 77 NONAME
+	_ZN11NmOperation25doUpdateOperationProgressEv @ 78 NONAME
+	_ZN11NmOperation34handlePreliminaryOperationFinishedEv @ 79 NONAME
+	_ZN11NmOperationC2Ev @ 80 NONAME
+	_ZN11NmOperationD0Ev @ 81 NONAME
+	_ZN11NmOperationD1Ev @ 82 NONAME
+	_ZN11NmOperationD2Ev @ 83 NONAME
+	_ZN13NmDataManager10folderByIdERK4NmIdS2_ @ 84 NONAME
+	_ZN13NmDataManager11listFoldersE4NmIdR5QListIP8NmFolderE @ 85 NONAME
+	_ZN13NmDataManager11mailboxByIdERK4NmId @ 86 NONAME
+	_ZN13NmDataManager11qt_metacallEN11QMetaObject4CallEiPPv @ 87 NONAME
+	_ZN13NmDataManager11qt_metacastEPKc @ 88 NONAME
+	_ZN13NmDataManager12envelopeByIdERK4NmIdS2_S2_ @ 89 NONAME
+	_ZN13NmDataManager12listMessagesERK4NmIdS2_R5QListIP17NmMessageEnvelopeE @ 90 NONAME
+	_ZN13NmDataManager13listMailboxesER5QListIP9NmMailboxE @ 91 NONAME
+	_ZN13NmDataManager14folderTypeByIdE4NmIdS0_ @ 92 NONAME
+	_ZN13NmDataManager14listMailboxIdsER5QListI4NmIdE @ 93 NONAME
+	_ZN13NmDataManager16staticMetaObjectE @ 94 NONAME DATA 16
+	_ZN13NmDataManager19getStandardFolderIdERK4NmId12NmFolderType @ 95 NONAME
+	_ZN13NmDataManager19getStaticMetaObjectEv @ 96 NONAME
+	_ZN13NmDataManager20contentToMessagePartERK4NmIdS2_S2_R13NmMessagePart @ 97 NONAME
+	_ZN13NmDataManager6folderERK4NmIdS2_ @ 98 NONAME
+	_ZN13NmDataManager7mailboxERK4NmId @ 99 NONAME
+	_ZN13NmDataManager7messageERK4NmIdS2_S2_ @ 100 NONAME
+	_ZN13NmDataManagerC1Ev @ 101 NONAME
+	_ZN13NmDataManagerC2Ev @ 102 NONAME
+	_ZN13NmDataManagerD0Ev @ 103 NONAME
+	_ZN13NmDataManagerD1Ev @ 104 NONAME
+	_ZN13NmDataManagerD2Ev @ 105 NONAME
+	_ZN16NmFolderMetaData5setIdERK4NmId @ 106 NONAME
+	_ZN16NmFolderMetaData7setNameERK7QString @ 107 NONAME
+	_ZN16NmFolderMetaDataC1Ev @ 108 NONAME
+	_ZN16NmFolderMetaDataC2Ev @ 109 NONAME
+	_ZN16NmFolderMetaDataD0Ev @ 110 NONAME
+	_ZN16NmFolderMetaDataD1Ev @ 111 NONAME
+	_ZN16NmFolderMetaDataD2Ev @ 112 NONAME
+	_ZN17NmFolderListModel7refreshER5QListIP8NmFolderE @ 113 NONAME
+	_ZN17NmFolderListModelC1ER13NmDataManagerP7QObject @ 114 NONAME
+	_ZN17NmFolderListModelC2ER13NmDataManagerP7QObject @ 115 NONAME
+	_ZN17NmFolderListModelD0Ev @ 116 NONAME
+	_ZN17NmFolderListModelD1Ev @ 117 NONAME
+	_ZN17NmFolderListModelD2Ev @ 118 NONAME
+	_ZN17NmMailboxMetaData10setAddressERK7QString @ 119 NONAME
+	_ZN17NmMailboxMetaData5setIdERK4NmId @ 120 NONAME
+	_ZN17NmMailboxMetaData7setNameERK7QString @ 121 NONAME
+	_ZN17NmMailboxMetaData9setIconIdERK4NmId @ 122 NONAME
+	_ZN17NmMailboxMetaDataC1Ev @ 123 NONAME
+	_ZN17NmMailboxMetaDataC2Ev @ 124 NONAME
+	_ZN17NmMailboxMetaDataD0Ev @ 125 NONAME
+	_ZN17NmMailboxMetaDataD1Ev @ 126 NONAME
+	_ZN17NmMailboxMetaDataD2Ev @ 127 NONAME
+	_ZN18NmBaseClientPlugin10getActionsERK15NmActionRequestR5QListIP8NmActionE @ 128 NONAME
+	_ZN18NmBaseClientPlugin10markAsReadEv @ 129 NONAME
+	_ZN18NmBaseClientPlugin11forwardMailEv @ 130 NONAME
+	_ZN18NmBaseClientPlugin11openMessageEv @ 131 NONAME
+	_ZN18NmBaseClientPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 132 NONAME
+	_ZN18NmBaseClientPlugin11qt_metacastEPKc @ 133 NONAME
+	_ZN18NmBaseClientPlugin12markAsUnreadEv @ 134 NONAME
+	_ZN18NmBaseClientPlugin12replyAllMailEv @ 135 NONAME
+	_ZN18NmBaseClientPlugin13createNewMailEv @ 136 NONAME
+	_ZN18NmBaseClientPlugin13deleteMessageEv @ 137 NONAME
+	_ZN18NmBaseClientPlugin13handleRequestE23NmActionResponseCommandRK15NmActionRequest @ 138 NONAME
+	_ZN18NmBaseClientPlugin14openAttachmentEv @ 139 NONAME
+	_ZN18NmBaseClientPlugin14setPriorityLowEv @ 140 NONAME
+	_ZN18NmBaseClientPlugin15setPriorityHighEv @ 141 NONAME
+	_ZN18NmBaseClientPlugin16removeAttachmentEv @ 142 NONAME
+	_ZN18NmBaseClientPlugin16staticMetaObjectE @ 143 NONAME DATA 16
+	_ZN18NmBaseClientPlugin17setPriorityNormalEv @ 144 NONAME
+	_ZN18NmBaseClientPlugin18mailboxListChangedERK4NmIdN10NmSettings16MailboxEventTypeE @ 145 NONAME
+	_ZN18NmBaseClientPlugin19getStaticMetaObjectEv @ 146 NONAME
+	_ZN18NmBaseClientPlugin22mailboxPropertyChangedERK4NmId8QVariantS3_ @ 147 NONAME
+	_ZN18NmBaseClientPlugin22updateEnvelopePropertyE20NmEnvelopeProperties @ 148 NONAME
+	_ZN18NmBaseClientPlugin24createEditorViewCommandsERK15NmActionRequestR5QListIP8NmActionE @ 149 NONAME
+	_ZN18NmBaseClientPlugin24createViewerViewCommandsERK15NmActionRequestR5QListIP8NmActionE @ 150 NONAME
+	_ZN18NmBaseClientPlugin25createMessageListCommandsERK15NmActionRequestR5QListIP8NmActionE @ 151 NONAME
+	_ZN18NmBaseClientPlugin26createNewMailViewerToolBarEv @ 152 NONAME
+	_ZN18NmBaseClientPlugin27deleteMessageFromViewerViewEv @ 153 NONAME
+	_ZN18NmBaseClientPlugin6attachEv @ 154 NONAME
+	_ZN18NmBaseClientPlugin6searchEv @ 155 NONAME
+	_ZN18NmBaseClientPlugin7refreshEv @ 156 NONAME
+	_ZN18NmBaseClientPlugin8goOnlineERK4NmId @ 157 NONAME
+	_ZN18NmBaseClientPlugin8sendMailEv @ 158 NONAME
+	_ZN18NmBaseClientPlugin8settingsEv @ 159 NONAME
+	_ZN18NmBaseClientPlugin9goOfflineERK4NmId @ 160 NONAME
+	_ZN18NmBaseClientPlugin9replyMailEv @ 161 NONAME
+	_ZN18NmBaseClientPluginC2Ev @ 162 NONAME
+	_ZN18NmBaseClientPluginD0Ev @ 163 NONAME
+	_ZN18NmBaseClientPluginD1Ev @ 164 NONAME
+	_ZN18NmBaseClientPluginD2Ev @ 165 NONAME
+	_ZN18NmMailboxListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 166 NONAME
+	_ZN18NmMailboxListModel11qt_metacastEPKc @ 167 NONAME
+	_ZN18NmMailboxListModel16refreshModelItemERK4NmId @ 168 NONAME
+	_ZN18NmMailboxListModel16staticMetaObjectE @ 169 NONAME DATA 16
+	_ZN18NmMailboxListModel17createMailboxItemEPK9NmMailbox @ 170 NONAME
+	_ZN18NmMailboxListModel18handleMailboxEventE14NmMailboxEventRK5QListI4NmIdE @ 171 NONAME
+	_ZN18NmMailboxListModel19getStaticMetaObjectEv @ 172 NONAME
+	_ZN18NmMailboxListModel7refreshER5QListIP9NmMailboxE @ 173 NONAME
+	_ZN18NmMailboxListModelC1ER13NmDataManagerP7QObject @ 174 NONAME
+	_ZN18NmMailboxListModelC2ER13NmDataManagerP7QObject @ 175 NONAME
+	_ZN18NmMailboxListModelD0Ev @ 176 NONAME
+	_ZN18NmMailboxListModelD1Ev @ 177 NONAME
+	_ZN18NmMailboxListModelD2Ev @ 178 NONAME
+	_ZN18NmMessageListModel10removeItemEiR22NmMessageListModelItem @ 179 NONAME
+	_ZN18NmMessageListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 180 NONAME
+	_ZN18NmMessageListModel11qt_metacastEPKc @ 181 NONAME
+	_ZN18NmMessageListModel11setDividersEb @ 182 NONAME
+	_ZN18NmMessageListModel11setNewParamEP14NmUiStartParam @ 183 NONAME
+	_ZN18NmMessageListModel13itemFromModelERK4NmId @ 184 NONAME
+	_ZN18NmMessageListModel14dividersActiveEv @ 185 NONAME
+	_ZN18NmMessageListModel14updateEnvelopeE20NmEnvelopePropertiesRK4NmId @ 186 NONAME
+	_ZN18NmMessageListModel16currentMailboxIdEv @ 187 NONAME
+	_ZN18NmMessageListModel16staticMetaObjectE @ 188 NONAME DATA 16
+	_ZN18NmMessageListModel17createMessageItemEP17NmMessageEnvelope @ 189 NONAME
+	_ZN18NmMessageListModel18handleMessageEventE14NmMessageEventRK4NmIdRK5QListIS1_ES3_ @ 190 NONAME
+	_ZN18NmMessageListModel18setIgnoreFolderIdsEb @ 191 NONAME
+	_ZN18NmMessageListModel19getStaticMetaObjectEv @ 192 NONAME
+	_ZN18NmMessageListModel21dividerInsertionIndexEi @ 193 NONAME
+	_ZN18NmMessageListModel21setEnvelopePropertiesE20NmEnvelopePropertiesRK5QListI4NmIdE @ 194 NONAME
+	_ZN18NmMessageListModel21updateMessageEnvelopeERK4NmIdS2_S2_ @ 195 NONAME
+	_ZN18NmMessageListModel22createTitleDividerItemEP17NmMessageEnvelope @ 196 NONAME
+	_ZN18NmMessageListModel22insertDividerIntoModelEP17NmMessageEnvelopei @ 197 NONAME
+	_ZN18NmMessageListModel22insertMessageIntoModelEP17NmMessageEnvelopeib @ 198 NONAME
+	_ZN18NmMessageListModel22removeMessageFromModelERK4NmId @ 199 NONAME
+	_ZN18NmMessageListModel25insertNewMessageIntoModelERK4NmIdS2_S2_ @ 200 NONAME
+	_ZN18NmMessageListModel7changedERK17NmMessageEnvelopeS2_ @ 201 NONAME
+	_ZN18NmMessageListModel7refreshE4NmIdS0_RK5QListIP17NmMessageEnvelopeE @ 202 NONAME
+	_ZN18NmMessageListModelC1ER13NmDataManagerP7QObject @ 203 NONAME
+	_ZN18NmMessageListModelC2ER13NmDataManagerP7QObject @ 204 NONAME
+	_ZN18NmMessageListModelD0Ev @ 205 NONAME
+	_ZN18NmMessageListModelD1Ev @ 206 NONAME
+	_ZN18NmMessageListModelD2Ev @ 207 NONAME
+	_ZN19NmDataPluginFactory10loadPluginERK4QDirRK7QString @ 208 NONAME
+	_ZN19NmDataPluginFactory12mPluginArrayE @ 209 NONAME DATA 4
+	_ZN19NmDataPluginFactory14pluginInstanceE4NmId @ 210 NONAME
+	_ZN19NmDataPluginFactory15mReferenceCountE @ 211 NONAME DATA 4
+	_ZN19NmDataPluginFactory15pluginInstancesEv @ 212 NONAME
+	_ZN19NmDataPluginFactory15releaseInstanceERPS_ @ 213 NONAME
+	_ZN19NmDataPluginFactory17interfaceInstanceE4NmId @ 214 NONAME
+	_ZN19NmDataPluginFactory17interfaceInstanceEP7QObject @ 215 NONAME
+	_ZN19NmDataPluginFactory18mPluginLoaderArrayE @ 216 NONAME DATA 4
+	_ZN19NmDataPluginFactory33applicationStateInterfaceInstanceE4NmId @ 217 NONAME
+	_ZN19NmDataPluginFactory33applicationStateInterfaceInstanceEP7QObject @ 218 NONAME
+	_ZN19NmDataPluginFactory8instanceEv @ 219 NONAME
+	_ZN19NmDataPluginFactory9mInstanceE @ 220 NONAME DATA 4
+	_ZN19NmDataPluginFactoryC1Ev @ 221 NONAME
+	_ZN19NmDataPluginFactoryC2Ev @ 222 NONAME
+	_ZN19NmDataPluginFactoryD0Ev @ 223 NONAME
+	_ZN19NmDataPluginFactoryD1Ev @ 224 NONAME
+	_ZN19NmDataPluginFactoryD2Ev @ 225 NONAME
+	_ZN22NmMessageListModelItem11envelopePtrEv @ 226 NONAME
+	_ZN22NmMessageListModelItem11setEnvelopeEP17NmMessageEnvelope @ 227 NONAME
+	_ZN22NmMessageListModelItem11setEnvelopeERK17NmMessageEnvelope @ 228 NONAME
+	_ZN22NmMessageListModelItem11setExpandedEb @ 229 NONAME
+	_ZN22NmMessageListModelItem11setItemTypeENS_17NmMessageItemTypeE @ 230 NONAME
+	_ZN22NmMessageListModelItem15setTitleDividerERK7QString @ 231 NONAME
+	_ZN22NmMessageListModelItem19callEmitDataChangedEv @ 232 NONAME
+	_ZN22NmMessageListModelItemC1Ev @ 233 NONAME
+	_ZN22NmMessageListModelItemC2Ev @ 234 NONAME
+	_ZN22NmMessageListModelItemD0Ev @ 235 NONAME
+	_ZN22NmMessageListModelItemD1Ev @ 236 NONAME
+	_ZN22NmMessageListModelItemD2Ev @ 237 NONAME
+	_ZN25NmAddAttachmentsOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 238 NONAME
+	_ZN25NmAddAttachmentsOperation11qt_metacastEPKc @ 239 NONAME
+	_ZN25NmAddAttachmentsOperation16staticMetaObjectE @ 240 NONAME DATA 16
+	_ZN25NmAddAttachmentsOperation19getStaticMetaObjectEv @ 241 NONAME
+	_ZN25NmAddAttachmentsOperation21completeOperationPartERK7QStringRK4NmIdi @ 242 NONAME
+	_ZN25NmAddAttachmentsOperation22operationPartCompletedERK7QStringRK4NmIdi @ 243 NONAME
+	_ZN25NmAddAttachmentsOperationC2Ev @ 244 NONAME
+	_ZN25NmAddAttachmentsOperationD0Ev @ 245 NONAME
+	_ZN25NmAddAttachmentsOperationD1Ev @ 246 NONAME
+	_ZN25NmAddAttachmentsOperationD2Ev @ 247 NONAME
+	_ZN25NmStoreEnvelopesOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 248 NONAME
+	_ZN25NmStoreEnvelopesOperation11qt_metacastEPKc @ 249 NONAME
+	_ZN25NmStoreEnvelopesOperation16staticMetaObjectE @ 250 NONAME DATA 16
+	_ZN25NmStoreEnvelopesOperation19getStaticMetaObjectEv @ 251 NONAME
+	_ZN26NmMessageCreationOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 252 NONAME
+	_ZN26NmMessageCreationOperation11qt_metacastEPKc @ 253 NONAME
+	_ZN26NmMessageCreationOperation16staticMetaObjectE @ 254 NONAME DATA 16
+	_ZN26NmMessageCreationOperation19getStaticMetaObjectEv @ 255 NONAME
+	_ZN7NmIcons7getIconENS_4IconE @ 256 NONAME
+	_ZN7NmIcons9freeIconsEv @ 257 NONAME
+	_ZNK10NmUiEngine10metaObjectEv @ 258 NONAME
+	_ZNK10NmUiEngine16isSendingMessageEv @ 259 NONAME
+	_ZNK10NmUiEngine16messageBeingSentEv @ 260 NONAME
+	_ZNK11NmOperation10metaObjectEv @ 261 NONAME
+	_ZNK11NmOperation9isRunningEv @ 262 NONAME
+	_ZNK13NmDataManager10metaObjectEv @ 263 NONAME
+	_ZNK16NmFolderMetaData2idEv @ 264 NONAME
+	_ZNK16NmFolderMetaData4nameEv @ 265 NONAME
+	_ZNK17NmFolderListModel11columnCountERK11QModelIndex @ 266 NONAME
+	_ZNK17NmFolderListModel4dataERK11QModelIndexi @ 267 NONAME
+	_ZNK17NmFolderListModel6parentERK11QModelIndex @ 268 NONAME
+	_ZNK17NmFolderListModel8rowCountERK11QModelIndex @ 269 NONAME
+	_ZNK17NmMailboxMetaData2idEv @ 270 NONAME
+	_ZNK17NmMailboxMetaData4nameEv @ 271 NONAME
+	_ZNK17NmMailboxMetaData6IconIdEv @ 272 NONAME
+	_ZNK17NmMailboxMetaData7addressEv @ 273 NONAME
+	_ZNK18NmBaseClientPlugin10metaObjectEv @ 274 NONAME
+	_ZNK18NmMailboxListModel10metaObjectEv @ 275 NONAME
+	_ZNK18NmMailboxListModel4dataERK11QModelIndexi @ 276 NONAME
+	_ZNK18NmMessageListModel10metaObjectEv @ 277 NONAME
+	_ZNK18NmMessageListModel17getInsertionIndexERK17NmMessageEnvelope @ 278 NONAME
+	_ZNK18NmMessageListModel30messagesBelongUnderSameDividerEPK17NmMessageEnvelopeS2_ @ 279 NONAME
+	_ZNK18NmMessageListModel4dataERK11QModelIndexi @ 280 NONAME
+	_ZNK22NmMessageListModelItem12titleDividerEv @ 281 NONAME
+	_ZNK22NmMessageListModelItem8envelopeEv @ 282 NONAME
+	_ZNK22NmMessageListModelItem8expandedEv @ 283 NONAME
+	_ZNK22NmMessageListModelItem8itemTypeEv @ 284 NONAME
+	_ZNK25NmAddAttachmentsOperation10metaObjectEv @ 285 NONAME
+	_ZNK25NmStoreEnvelopesOperation10metaObjectEv @ 286 NONAME
+	_ZNK26NmMessageCreationOperation10metaObjectEv @ 287 NONAME
+	_ZTI10NmUiEngine @ 288 NONAME
+	_ZTI11NmOperation @ 289 NONAME
+	_ZTI13NmDataManager @ 290 NONAME
+	_ZTI16NmFolderMetaData @ 291 NONAME
+	_ZTI17NmFolderListModel @ 292 NONAME
+	_ZTI17NmMailboxMetaData @ 293 NONAME
+	_ZTI18NmBaseClientPlugin @ 294 NONAME
+	_ZTI18NmMailboxListModel @ 295 NONAME
+	_ZTI18NmMessageListModel @ 296 NONAME
+	_ZTI19NmDataPluginFactory @ 297 NONAME
+	_ZTI22NmMessageListModelItem @ 298 NONAME
+	_ZTI25NmAddAttachmentsOperation @ 299 NONAME
+	_ZTI25NmStoreEnvelopesOperation @ 300 NONAME
+	_ZTI26NmMessageCreationOperation @ 301 NONAME
+	_ZTV10NmUiEngine @ 302 NONAME
+	_ZTV11NmOperation @ 303 NONAME
+	_ZTV13NmDataManager @ 304 NONAME
+	_ZTV16NmFolderMetaData @ 305 NONAME
+	_ZTV17NmFolderListModel @ 306 NONAME
+	_ZTV17NmMailboxMetaData @ 307 NONAME
+	_ZTV18NmBaseClientPlugin @ 308 NONAME
+	_ZTV18NmMailboxListModel @ 309 NONAME
+	_ZTV18NmMessageListModel @ 310 NONAME
+	_ZTV19NmDataPluginFactory @ 311 NONAME
+	_ZTV22NmMessageListModelItem @ 312 NONAME
+	_ZTV25NmAddAttachmentsOperation @ 313 NONAME
+	_ZTV25NmStoreEnvelopesOperation @ 314 NONAME
+	_ZTV26NmMessageCreationOperation @ 315 NONAME
+	_ZThn8_N18NmBaseClientPlugin10getActionsERK15NmActionRequestR5QListIP8NmActionE @ 316 NONAME
+	_ZThn8_N18NmBaseClientPluginD0Ev @ 317 NONAME
+	_ZThn8_N18NmBaseClientPluginD1Ev @ 318 NONAME
+	_ZN10NmUiEngine24messageEventForListModelE14NmMessageEventRK4NmIdRK5QListIS1_ES3_ @ 319 NONAME
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiengine/inc/nmapplicationstateinterface.h	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2010 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:
+*
+*/
+
+#ifndef NMAPPLICATIONSTATEINTERFACE_H_
+#define NMAPPLICATIONSTATEINTERFACE_H_
+
+
+/*!
+    \class NmApplicationStateInterface
+    \brief provides an interface to indicate application state information to protocol plugins    
+*/
+class NmApplicationStateInterface
+{
+public:
+    virtual void updateActiveFolder(const NmId &mailboxId, const NmId &folderId) = 0;
+};
+
+Q_DECLARE_INTERFACE(NmApplicationStateInterface, "sf.app.commonmail.emailuis.nmailuiengine.NmApplicationStateInterface/1.0")
+
+
+#endif /* NMAPPLICATIONSTATEINTERFACE_H_ */
+
+
--- a/emailuis/nmailuiengine/inc/nmbaseclientplugin.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/inc/nmbaseclientplugin.h	Wed Jun 23 17:00:39 2010 +0100
@@ -72,12 +72,12 @@
 
 protected:
     virtual quint32 pluginId() = 0;
+    void handleRequest(NmActionResponseCommand command, const NmActionRequest &request);
 
 private:
     void createMessageListCommands(const NmActionRequest &request, QList<NmAction*> &actionList);
     void createEditorViewCommands(const NmActionRequest &request, QList<NmAction*> &actionList);
     void createViewerViewCommands(const NmActionRequest &request, QList<NmAction*> &actionList);
-    void handleRequest(NmActionResponseCommand command, const NmActionRequest &request);
     void updateEnvelopeProperty(NmEnvelopeProperties property);
 
 protected:
--- a/emailuis/nmailuiengine/inc/nmdatamanager.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/inc/nmdatamanager.h	Wed Jun 23 17:00:39 2010 +0100
@@ -64,6 +64,8 @@
                              NmMessagePart &messagePart);
     NmId getStandardFolderId(const NmId &mailboxId,
                              NmFolderType folderType);
+    
+    NmFolderType folderTypeById(NmId mailboxId, NmId folderId);
 
 private:
     NmDataPluginFactory   *mFactory;
--- a/emailuis/nmailuiengine/inc/nmdatapluginfactory.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/inc/nmdatapluginfactory.h	Wed Jun 23 17:00:39 2010 +0100
@@ -22,6 +22,7 @@
 #include "nmuienginedef.h"
 
 class NmDataPluginInterface;
+class NmApplicationStateInterface;
 class QDir;
 class QPluginLoader;
 
@@ -37,12 +38,14 @@
     static void releaseInstance(NmDataPluginFactory *&instance);
     NmDataPluginInterface *interfaceInstance(QObject *plugin);
     NmDataPluginInterface *interfaceInstance(NmId mailboxId);
+    NmApplicationStateInterface *applicationStateInterfaceInstance(NmId mailboxId);
     QObject *pluginInstance(NmId mailboxId);
     QList<QObject*> *pluginInstances();
     QObject *loadPlugin(
         const QDir &pluginDir,
         const QString& pluginName);
 private:
+    NmApplicationStateInterface *applicationStateInterfaceInstance(QObject *plugin);
     NmDataPluginFactory();
     virtual ~NmDataPluginFactory();
     static NmDataPluginFactory   *mInstance;         // owned
--- a/emailuis/nmailuiengine/inc/nmdataplugininterface.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/inc/nmdataplugininterface.h	Wed Jun 23 17:00:39 2010 +0100
@@ -33,7 +33,6 @@
 class NmMessageCreationOperation;
 class NmStoreEnvelopesOperation;
 class NmAddAttachmentsOperation;
-class NmCheckOutboxOperation;
 class NmMessageSendingOperation;
 
 /*!
@@ -104,6 +103,12 @@
         const NmId &folderId,
         const NmId &messageId,
         const NmId &messagePartId) = 0;
+ 
+     virtual  QPointer<NmOperation> fetchMessageParts( 
+        const NmId &mailboxId,
+        const NmId &folderId,
+        const NmId &messageId,
+        const QList<NmId> &messagePartIds) = 0;
     
     virtual XQSharableFile messagePartFile(
         const NmId &mailboxId,
@@ -171,8 +176,6 @@
         const NmMessage &message,
         const NmId &attachmentPartId) = 0;
 
-    virtual QPointer<NmCheckOutboxOperation> checkOutbox(const NmId &mailboxId) = 0;
-    
     virtual NmSyncState syncState(const NmId& mailboxId) const = 0;
     
     virtual NmConnectState connectionState(const NmId& mailboxId) const = 0;
@@ -181,6 +184,8 @@
         const QStringList &searchStrings) = 0;
 
     virtual int cancelSearch(const NmId &mailboxId) = 0;
+
+    virtual QPointer<NmOperation> removeDraftMessage(NmMessage *message) = 0;
 };
 
 Q_DECLARE_INTERFACE(NmDataPluginInterface, "sf.app.commonmail.emailuis.nmailuiengine.NmDataPluginInterface/1.0")
--- a/emailuis/nmailuiengine/inc/nmmailboxlistmodel.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/inc/nmmailboxlistmodel.h	Wed Jun 23 17:00:39 2010 +0100
@@ -37,7 +37,7 @@
     virtual ~NmMailboxListModel();
     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
     void refresh(QList<NmMailbox*> &mailboxList);
-    void refreshModelItem(const NmId &mailboxId, bool allowEmitDataChanged = true);
+    void refreshModelItem(const NmId &mailboxId);
 
 public slots:
     void handleMailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds);
--- a/emailuis/nmailuiengine/inc/nmmailboxmetadata.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/inc/nmmailboxmetadata.h	Wed Jun 23 17:00:39 2010 +0100
@@ -36,6 +36,8 @@
     void setId(const NmId &id);
     NmId IconId() const;
     void setIconId(const NmId &id);
+    QString address() const;
+    void setAddress(const QString &address);
 
 private:
 
--- a/emailuis/nmailuiengine/inc/nmmessagelistmodel.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/inc/nmmessagelistmodel.h	Wed Jun 23 17:00:39 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 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"
@@ -20,10 +20,9 @@
 
 #include <QStandardItemModel>
 
+#include "nmcommon.h"
+#include "nmmessagelistmodelitem.h"
 #include "nmuienginedef.h"
-#include "nmcommon.h"
-
-#include "nmmessagelistmodelitem.h"
 #include "nmuiviewids.h"
 
 class NmMessage;
@@ -31,73 +30,105 @@
 class QModelIndex;
 class NmMessageEnvelope;
 
+
 class NMUIENGINE_EXPORT NmMessageListModel : public QStandardItemModel
 {
     Q_OBJECT
+
 public:
-    NmMessageListModel(
-      NmDataManager &dataManager,
-      QObject *parent = 0);
+
+    NmMessageListModel(NmDataManager &dataManager,
+                       QObject *parent = 0);
+
     virtual ~NmMessageListModel();
+
     QVariant data(const QModelIndex &index,
                   int role = Qt::DisplayRole) const;
-    void refresh(
-        const NmId mailboxId,
-        const NmId folderId,
-        const QList<NmMessageEnvelope*> &messageEnvelopeList);
+
+    void refresh(const NmId mailboxId,
+                 const NmId folderId,
+                 const QList<NmMessageEnvelope*> &messageEnvelopeList);
+
     bool dividersActive();
-    // This function is temporary, to be removed when
-    // divider state can be modified with settings
+
+    // This function is temporary, to be removed when divider state can be
+    // modified with settings.
     void setDividers(bool active);
-    void setEnvelopeProperties(
-        NmEnvelopeProperties property,
-        const QList<NmId> &messageIds);
+
+    void setEnvelopeProperties(NmEnvelopeProperties property,
+                               const QList<NmId> &messageIds);
+
     NmId currentMailboxId();
+
+    void setIgnoreFolderIds(bool ignore);
+
+
 public slots:
-    void handleMessageEvent(
-        NmMessageEvent event,
-        const NmId &folderId,
-        const QList<NmId> &messageIds);
+
+    void handleMessageEvent(NmMessageEvent event,
+                            const NmId &folderId,
+                            const QList<NmId> &messageIds,
+                            const NmId &mailboxId);
+
 
 private:
+
     bool messagesBelongUnderSameDivider(
         const NmMessageEnvelope *message1,
         const NmMessageEnvelope *message2) const;
+
     void insertDividerIntoModel(
         NmMessageEnvelope *messageForDivider,
         int parentRow);
+
     void insertMessageIntoModel(
         NmMessageEnvelope *messageEnvelope,
         int childRow,
         bool emitSignal);
+
     void insertNewMessageIntoModel(
         const NmId &mailboxId,
         const NmId &folderId,
         const NmId &msgId);
-    int getInsertionIndex(
-        const NmMessageEnvelope &envelope) const;
+
+    int getInsertionIndex(const NmMessageEnvelope &envelope) const;
+
     int dividerInsertionIndex(int messageIndex);
+
     NmMessageListModelItem *createTitleDividerItem(NmMessageEnvelope *messageForDivider);
+
     NmMessageListModelItem *createMessageItem(NmMessageEnvelope *message);
+
     void removeMessageFromModel(const NmId &msgId);
+
     void removeItem(int row, NmMessageListModelItem &item);
+
     NmMessageListModelItem *itemFromModel(const NmId &messageId);
-    bool changed(const NmMessageEnvelope &first, const NmMessageEnvelope &second);
+
+    bool changed(const NmMessageEnvelope &first,
+                 const NmMessageEnvelope &second);
+
     void updateMessageEnvelope(const NmId &mailboxId,
-            const NmId &folderId,
-            const NmId &msgId);
+                               const NmId &folderId,
+                               const NmId &msgId);
+
     void updateEnvelope(NmEnvelopeProperties property, const NmId &msgId);
 
+
 signals:
+
     void setNewParam(NmUiStartParam *startParam);
-    
-private:
-    NmDataManager &mDataManager;         // not owned
+
+
+private: // Data
+
+    NmDataManager &mDataManager;
     bool mDividersActive;
-    NmMessageListModelItem *mParentPtr;  // not owned
+    NmMessageListModelItem *mParentPtr; // Not owned
     NmId mCurrentMailboxId;
     NmId mCurrentFolderId;
-
+    NmFolderType mCurrentFolderType;
+    bool mIgnoreFolderIds;
 };
 
 #endif /* NMMESSAGELISTMODEL_H_*/
--- a/emailuis/nmailuiengine/inc/nmmessagesearchlistmodel.h	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-/*
-* Copyright (c) 2010 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:
-*
-*/
-
-#ifndef NMMESSAGESEARCHLISTMODEL_H_
-#define NMMESSAGESEARCHLISTMODEL_H_
-
-#include <QSortFilterProxyModel>
-#include <QVector>
-
-#include "nmuienginedef.h" // For NMUIENGINE_EXPORT
-#include "nmcommon.h"
-
-
-class NMUIENGINE_EXPORT NmMessageSearchListModel : public QSortFilterProxyModel
-{
-    Q_OBJECT
-
-public: // Construction and destruction
-
-    NmMessageSearchListModel(QObject *parent = 0);
-
-    ~NmMessageSearchListModel();
-
-
-public:
-
-    void clearSearchResults();
-
-    int searchResultCount() const;
-
-
-public: // From QSortFilterProxyModel
-
-    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-
-
-protected: // From QSortFilterProxyModel
-
-    bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
-
-
-public slots:
-
-    bool addSearchResult(const NmId &messageId);
-
-    void refreshContent();
-
-
-private: // Data
-
-    QVector<NmId> mSearchResults;
-};
-
-#endif /* NMMESSAGESEARCHLISTMODEL_H_ */
-
-// End of file.
--- a/emailuis/nmailuiengine/inc/nmuiengine.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/inc/nmuiengine.h	Wed Jun 23 17:00:39 2010 +0100
@@ -28,7 +28,6 @@
 class QAbstractItemModel;
 class NmMailboxListModel;
 class NmMessageListModel;
-class NmMessageSearchListModel;
 class NmDataManager;
 class NmDataPluginFactory;
 class NmMailboxMetaData;
@@ -39,7 +38,6 @@
 class NmMessageCreationOperation;
 class NmStoreEnvelopesOperation;
 class NmAddAttachmentsOperation;
-class NmCheckOutboxOperation;
 class NmMessageSendingOperation;
 
 
@@ -50,12 +48,17 @@
 public:
 
     static NmUiEngine *instance();
+
     static void releaseInstance(NmUiEngine *&instance);
 
     NmMailboxListModel &mailboxListModel();
+
     void refreshMailboxListModel();
-    NmMessageListModel &messageListModel(const NmId &mailboxId, const NmId &folderId);
-    NmMessageSearchListModel &messageSearchListModel(QAbstractItemModel *sourceModel);
+
+    NmMessageListModel &messageListModel(const NmId &mailboxId,
+                                         const NmId &folderId);
+
+    NmMessageListModel &messageListModelForSearch(const NmId &mailboxId);
 
     NmId standardFolderId(const NmId &mailboxId, NmFolderType folderType);
 
@@ -75,6 +78,12 @@
         const NmId &messageId,
         const NmId &messagePartId);
     
+    QPointer<NmOperation> fetchMessageParts( 
+        const NmId &mailboxId,
+        const NmId &folderId,
+        const NmId &messageId,
+        const QList<NmId> &messagePartIds);
+    
     XQSharableFile messagePartFile(
        const NmId &mailboxId,
        const NmId &folderId,
@@ -123,12 +132,17 @@
     
     int goOffline(const NmId &mailboxId);
     
-    int removeMessage(
-                const NmId &mailboxId,
-                const NmId &folderId,
-                const NmId &messageId);
+    int removeMessage(const NmId &mailboxId,
+                      const NmId &folderId,
+                      const NmId &messageId);
+    
+    void removeDraftMessage(NmMessage *message);
     
-    void sendMessage(NmMessage *message, const QList<NmOperation*> &preliminaryOperations);
+    void saveDraftMessage(NmMessage *message,
+                          const QList<NmOperation*> &preliminaryOperations);
+    
+    void sendMessage(NmMessage *message,
+                     const QList<NmOperation*> &preliminaryOperations);
 
     bool isSendingMessage() const;
 
@@ -142,9 +156,8 @@
         const NmMessage &message, 
         const NmId &attachmentPartId);
 
-    QPointer<NmCheckOutboxOperation> checkOutbox(const NmId &mailboxId);
-    
     NmSyncState syncState(const NmId& mailboxId);
+
     NmConnectState connectionState(const NmId& mailboxId);
 
     int search(const NmId &mailboxId,
@@ -154,46 +167,73 @@
     
     NmFolderType folderTypeById(NmId mailboxId, NmId folderId);
 
+    void updateActiveFolder(const NmId &mailboxId, const NmId &folderId);
+    
 public slots:
+
     void handleCompletedSendOperation();
-    void handleSyncStateEvent(NmSyncState syncState, const NmOperationCompletionEvent &event);
-    void handleConnectEvent(NmConnectState connectState, const NmId &mailboxId, const int errorCode);
+    void handleCompletedRemoveDraftOperation();
+    void handleCompletedSaveDraftOperation();
+
+    void handleSyncStateEvent(NmSyncState syncState,
+                              const NmOperationCompletionEvent &event);
+
+    void handleConnectEvent(NmConnectState connectState,
+                            const NmId &mailboxId,
+                            const int errorCode);
+
 
 private slots:
-    void handleMessageEvent(
-            NmMessageEvent event,
-            const NmId &folderId,
-            const QList<NmId> &messageIds, 
-            const NmId& mailboxId);
+
+    void handleMessageEvent(NmMessageEvent event,
+                            const NmId &folderId,
+                            const QList<NmId> &messageIds, 
+                            const NmId& mailboxId);
     
     void handleMailboxEvent(NmMailboxEvent event,
                             const QList<NmId> &mailboxIds);
 
+    void handleMatchFound(const NmId &messageId, const NmId &folderId);
+    
+    void messageEventForListModel(NmMessageEvent event,
+                            const NmId &folderId,
+                            const QList<NmId> &messageIds, 
+                            const NmId& mailboxId);
+
 
 signals:
+
     void syncStateEvent(NmSyncState, const NmId &);
     void connectionEvent(NmConnectState, const NmId &);
     void operationCompleted(const NmOperationCompletionEvent &event);
     void sendOperationCompleted();
     void messageDeleted(const NmId &mailboxId, const NmId &folderId, const NmId &messageId);
     void mailboxDeleted(const NmId &mailboxId);
-    void matchFound(const NmId &);
+    void matchFound(const NmId &, const NmId &);
     void searchComplete();
-    
+
+
 private:
+
     NmUiEngine();
+
     virtual ~NmUiEngine();
 
-private:
+
+private: // Data
+
     static NmUiEngine *mInstance;
     static int	mReferenceCount;
 
     NmDataPluginFactory *mPluginFactory;
     NmDataManager *mDataManager;                // Owned
     NmMailboxListModel *mMailboxListModel;      // Owned
+    NmMessageListModel *mInboxListModel;      // Owned
     NmMessageListModel *mMessageListModel;      // Owned
-    NmMessageSearchListModel *mMessageSearchListModel; // Owned
+    NmMessageListModel *mMessageSearchListModel; // Owned
     QPointer<NmMessageSendingOperation> mSendOperation;  // Not owned
+    QPointer<NmOperation> mRemoveDraftOperation; // not owned
+    QPointer<NmOperation> mSaveDraftOperation;   // not owned
 };
 
 
--- a/emailuis/nmailuiengine/inc/nmuiengineheaders.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/inc/nmuiengineheaders.h	Wed Jun 23 17:00:39 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 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"
@@ -39,6 +39,7 @@
 #include <hbicon.h>
 #include <hbiconanimationmanager.h>
 #include <hbmenu.h>
+#include <hbindicator.h>
 
 // nmailuiengine
 #include "nmuienginedef.h"
@@ -47,7 +48,6 @@
 #include "nmmailboxlistmodel.h"
 #include "nmfolderlistmodel.h"
 #include "nmmessagelistmodel.h"
-#include "nmmessagesearchlistmodel.h"
 #include "nmdatapluginfactory.h"
 #include "nmdataplugininterface.h"
 #include "nmmailboxlistmodelitem.h"
@@ -61,8 +61,8 @@
 #include "nmmessagesendingoperation.h"
 #include "nmaddattachmentsoperation.h"
 #include "nmmessagecreationoperation.h"
-#include "nmcheckoutboxoperation.h"
 #include "nmmessagecreationoperation.h"
+#include "nmapplicationstateinterface.h"
 
 // nmailui
 #include "nmactionrequest.h"
--- a/emailuis/nmailuiengine/nmailuiengine.pro	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/nmailuiengine.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -1,4 +1,4 @@
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+# Copyright (c) 2009 - 2010 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"
@@ -36,7 +36,6 @@
            inc/nmfoldermetadata.h \
            inc/nmmessagelistmodelitem.h \
            inc/nmmessagelistmodel.h \
-           inc/nmmessagesearchlistmodel.h \
            inc/nmuienginedef.h \
            inc/nmdataplugininterface.h \
            inc/nmicons.h \
@@ -44,8 +43,8 @@
            inc/nmoperation.h \
            inc/nmaddattachmentsoperation.h \
            inc/nmmessagesendingoperation.h \
-           inc/nmcheckoutboxoperation.h \
-           inc/nmstoreenvelopesoperation.h
+           inc/nmstoreenvelopesoperation.h \
+           inc/nmapplicationstateinterface.h 
 
 SOURCES += src/nmuiengine.cpp \
            src/nmdatamanager.cpp \
@@ -56,7 +55,6 @@
            src/nmfoldermetadata.cpp \
            src/nmmessagelistmodelitem.cpp \
            src/nmmessagelistmodel.cpp \
-           src/nmmessagesearchlistmodel.cpp \
            src/nmdatapluginfactory.cpp \
            src/nmicons.cpp \
            src/nmbaseclientplugin.cpp \
--- a/emailuis/nmailuiengine/src/nmaddattachmentoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmaddattachmentoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -22,6 +22,7 @@
   */
 NmAddAttachmentsOperation::NmAddAttachmentsOperation()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -29,6 +30,7 @@
  */
 NmAddAttachmentsOperation::~NmAddAttachmentsOperation()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -39,6 +41,8 @@
  */
 void NmAddAttachmentsOperation::completeOperationPart(const QString &fileName, const NmId &msgPartId, int result)
 {
+    NM_FUNCTION;
+    
     emit operationPartCompleted(fileName, msgPartId, result);
 }
 
--- a/emailuis/nmailuiengine/src/nmbaseclientplugin.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmbaseclientplugin.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -104,9 +104,9 @@
 mViewerToolBarRequest(NULL),
 mViewerViewRequest(NULL)
 {
-    NMLOG("NmBaseClientPlugin::NmBaseClientPlugin()-->");
+    NM_FUNCTION;
+    
     mUiEngine = NmUiEngine::instance();
-    NMLOG("<--NmBaseClientPlugin::NmBaseClientPlugin()");
 }
 
 /*!
@@ -114,27 +114,29 @@
 */
 NmBaseClientPlugin::~NmBaseClientPlugin()
 {
-    NMLOG("NmBaseClientPlugin::~NmBaseClientPlugin()-->");
+    NM_FUNCTION;
+    
     NmUiEngine::releaseInstance(mUiEngine);
     mUiEngine = NULL;
-    NMLOG("<--NmBaseClientPlugin::~NmBaseClientPlugin()");
 }
 
+
 /*!
-    Provides list of supported NmActions.
+    Provides a list of supported NmActions.
     Implementation of NmUiExtensionInterface.
+
     Parameter \a request controls list of request services.
     Parameter \a actionList is updated by supported NmActions.
 */
-void NmBaseClientPlugin::getActions(
-      const NmActionRequest &request,
-      QList<NmAction *> &actionList)
+void NmBaseClientPlugin::getActions(const NmActionRequest &request,
+                                    QList<NmAction *> &actionList)
 {
-    NMLOG("NmBaseClientPlugin::getActions()-->");
-
+    NM_FUNCTION;
+    
     if (request.observer()) {
         switch (request.contextView()) {
             case NmActionContextViewMessageList:
+            case NmActionContextViewMessageSearchList:
             {
                 createMessageListCommands(request, actionList);
                 break;
@@ -151,30 +153,28 @@
             }
             default:
             {
-                NMLOG(QString("NmBaseClientPlugin::getActions(): Unknown contextView()=%1").arg(request.contextView()));
+                NM_COMMENT(QString("NmBaseClientPlugin::getActions(): unknown contextView()=%1").arg(request.contextView()));
                 break;
             }
         }
     }
-    NMLOG("<--NmBaseClientPlugin::getActions()");
 }
 
+
 /*!
     Public slot connected to options menu refresh NmAction.
     Refreshes mailbox using the NmUiEngine instance.
 */
 void NmBaseClientPlugin::refresh()
 {
-    NMLOG("NmBaseClientPlugin::refresh()-->");
-
+    NM_FUNCTION;
+    
     int err = mUiEngine->refreshMailbox(mMenuRequest.mailboxId());
 
     if (NmNoError != err) {
         // Failed to refresh the mailbox!
-        NMLOG(QString("NmBaseClientPlugin::refresh(): failed err=%1").arg(err));
+        NM_ERROR(1,QString("NmBaseClientPlugin::refresh(): failed err=%1").arg(err));
     }
-
-    NMLOG("<--NmBaseClientPlugin::refresh()");
 }
 
 /*!
@@ -183,6 +183,8 @@
 */
 void NmBaseClientPlugin::openMessage()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandOpen, mMenuRequest);
 }
 
@@ -191,8 +193,8 @@
 */
 void NmBaseClientPlugin::deleteMessage()
 {
-    NMLOG("NmBaseClientPlugin::deleteMessage()-->");
-
+    NM_FUNCTION;
+    
     QList<NmId> messageList;
     messageList.append(mMenuRequest.messageId());
 
@@ -201,10 +203,9 @@
                                         messageList);
     if (NmNoError != err) {
         // Failed to delete the messages!
-        NMLOG(QString("NmBaseClientPlugin::deleteMessage(): failed err=%1").arg(err));
+        NM_ERROR(1,QString("NmBaseClientPlugin::deleteMessage(): failed err=%1").arg(err));
     }
     messageList.clear();
-    NMLOG("<--NmBaseClientPlugin::deleteMessage()");
 }
 
 /*!
@@ -213,6 +214,8 @@
 */
 void NmBaseClientPlugin::deleteMessageFromViewerView()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandDeleteMail, mViewerViewRequest);
 }
 
@@ -222,6 +225,8 @@
 */
 void NmBaseClientPlugin::createNewMailViewerToolBar()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandNewMail, mViewerToolBarRequest);
 }
 
@@ -231,6 +236,8 @@
 */
 void NmBaseClientPlugin::createNewMail()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandNewMail, mMenuRequest);
 }
 
@@ -240,6 +247,9 @@
 */
 void NmBaseClientPlugin::settings()
 {
+    NM_FUNCTION;
+    
+    handleRequest(NmActionResponseCommandSettings, mMenuRequest);
 }
 
 /*!
@@ -248,6 +258,8 @@
 */
 void NmBaseClientPlugin::sendMail()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandSendMail, mEditorToolBarRequest);
 }
 
@@ -258,6 +270,8 @@
 
 void NmBaseClientPlugin::replyMail()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandReply, mViewerViewRequest);
 }
 
@@ -268,6 +282,8 @@
 
 void NmBaseClientPlugin::replyAllMail()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandReplyAll, mViewerViewRequest);
 }
 
@@ -277,6 +293,8 @@
 */
 void NmBaseClientPlugin::forwardMail()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandForward, mViewerViewRequest);
 }
 
@@ -285,6 +303,8 @@
 */
 void NmBaseClientPlugin::setPriorityHigh()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandPriorityHigh, mMenuRequest);
 }
 
@@ -293,6 +313,8 @@
 */
 void NmBaseClientPlugin::setPriorityNormal()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandNone, mMenuRequest);
 }
 
@@ -301,6 +323,8 @@
 */
 void NmBaseClientPlugin::setPriorityLow()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandPriorityLow, mMenuRequest);
 }
 
@@ -309,6 +333,8 @@
 */
 void NmBaseClientPlugin::attach()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandAttach, mEditorToolBarRequest);
 }
 
@@ -317,6 +343,8 @@
 */
 void NmBaseClientPlugin::removeAttachment()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandRemoveAttachment, mMenuRequest);
 }
 
@@ -325,6 +353,8 @@
 */
 void NmBaseClientPlugin::openAttachment()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandOpenAttachment, mMenuRequest);
 }
 
@@ -334,6 +364,8 @@
 */
 void NmBaseClientPlugin::search()
 {
+    NM_FUNCTION;
+    
     handleRequest(NmActionResponseCommandSearch, mViewerToolBarRequest);
 }
 
@@ -346,6 +378,8 @@
 void NmBaseClientPlugin::mailboxListChanged(const NmId &mailboxId,
     NmSettings::MailboxEventType type)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(mailboxId)
     Q_UNUSED(type)
     handleRequest(NmActionResponseCommandMailboxDeleted, mMenuRequest);
@@ -361,15 +395,15 @@
 void NmBaseClientPlugin::mailboxPropertyChanged(const NmId &mailboxId, QVariant property,
     QVariant value)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(property)
     Q_UNUSED(value)
 
     NmActionObserver *observer = mMenuRequest.observer();
     if (observer) {
         // Force model item to be updated, because framework adapter sends it too slowly.
-        // Data changed signal is not emitted by this change, it is send when ever famework adapter
-        // calls data model's handleMailboxEvent method.
-        mUiEngine->mailboxListModel().refreshModelItem(mailboxId, false);
+        mUiEngine->mailboxListModel().refreshModelItem(mailboxId);
 
         // Notify view of changes.
         NmActionResponse response(NmActionResponseCommandUpdateMailboxName, mMenuRequest);
@@ -383,6 +417,8 @@
 */
 void NmBaseClientPlugin::goOnline(const NmId &mailboxId)
 {
+    NM_FUNCTION;
+    
 		(void) mUiEngine->refreshMailbox(mailboxId);
 }
 /*!
@@ -391,6 +427,8 @@
 */
 void NmBaseClientPlugin::goOffline(const NmId &mailboxId)
 {
+    NM_FUNCTION;
+    
         mUiEngine->goOffline(mailboxId);
 }
 
@@ -404,8 +442,8 @@
     const NmActionRequest &request,
     QList<NmAction *> &actionList)
 {
-    NMLOG("NmBaseClientPlugin::createMessageListCommands()-->");
-
+    NM_FUNCTION;
+    
     switch (request.menuType()) {
         case NmActionOptionsMenu:
         {
@@ -477,7 +515,7 @@
                         request.requestData().value<NmMessageEnvelope*>();    
                     if (envelope){
                         if (envelope->isRead()){
-                            NMLOG("nmailui: envelope is read");
+                            NM_COMMENT("nmailui: envelope is read");
                             NmAction* unreadAction = new NmAction(0);
                             unreadAction->setObjectName("baseclientplugin_unreadaction");
                             unreadAction->setText(hbTrId("txt_mail_menu_mark_as_unread"));
@@ -490,7 +528,7 @@
                             actionList.append(unreadAction);
                         }
                         else {
-                            NMLOG("nmailui: envelope is unread");
+                            NM_COMMENT("nmailui: envelope is unread");
                             NmAction* readAction = new NmAction(0);
                             readAction->setObjectName("baseclientplugin_readaction");
                             readAction->setText(hbTrId("txt_mail_menu_mark_as_read"));
@@ -509,11 +547,10 @@
         }
         default:
         {
-            NMLOG(QString("NmBaseClientPlugin::createMessageListCommands(): Unknown menuType()=%1").arg(request.menuType()));
+            NM_COMMENT(QString("NmBaseClientPlugin::createMessageListCommands(): unknown menuType()=%1").arg(request.menuType()));
             break;
         }
     }
-    NMLOG("<--NmBaseClientPlugin::createMessageListCommands()");
 }
 
 /*!
@@ -526,8 +563,8 @@
     const NmActionRequest &request,
     QList<NmAction *> &actionList)
 {
-    NMLOG("NmBaseClientPlugin::createViewerViewCommands()-->");
-
+    NM_FUNCTION;
+    
     switch (request.menuType()) {
     	case NmActionOptionsMenu:
 		{
@@ -620,7 +657,7 @@
         }
         default:
         {
-            NMLOG(QString("NmBaseClientPlugin::createViewerViewCommands(): Unknown menuType()=%1").arg(request.menuType()));
+            NM_COMMENT(QString("NmBaseClientPlugin::createViewerViewCommands(): unknown menuType()=%1").arg(request.menuType()));
             break;
         }
     }
@@ -637,8 +674,8 @@
     const NmActionRequest &request,
     QList<NmAction *> &actionList)
 {
-    NMLOG("NmBaseClientPlugin::createEditorViewCommands()-->");
-
+    NM_FUNCTION;
+    
     switch (request.menuType()) {
         case NmActionToolbar:
         {
@@ -722,12 +759,10 @@
         }
         default:
         {
-            NMLOG(QString("NmBaseClientPlugin::createEditorViewCommands(): Unknown menuType()=%1").arg(request.menuType()));
+            NM_COMMENT(QString("NmBaseClientPlugin::createEditorViewCommands(): unknown menuType()=%1").arg(request.menuType()));
             break;
         }
     }
-
-    NMLOG("<--NmBaseClientPlugin::createEditorViewCommands()");
 }
 
 /*!
@@ -735,9 +770,9 @@
 */
 void NmBaseClientPlugin::markAsRead()
 {
-    NMLOG("NmBaseClientPlugin::markAsRead()-->");
+    NM_FUNCTION;
+    
     updateEnvelopeProperty(MarkAsRead);
-    NMLOG("<--NmBaseClientPlugin::markAsRead()");
 }
 
 /*!
@@ -745,9 +780,9 @@
 */
 void NmBaseClientPlugin::markAsUnread()
 {
-    NMLOG("NmBaseClientPlugin::markAsUnread()-->");
+    NM_FUNCTION;
+    
     updateEnvelopeProperty(MarkAsUnread);
-    NMLOG("<--NmBaseClientPlugin::markAsUnread()");
 }
 
 /*!
@@ -755,6 +790,8 @@
 */
 void NmBaseClientPlugin::handleRequest(NmActionResponseCommand command, const NmActionRequest &request)
 {
+    NM_FUNCTION;
+    
     NmActionObserver *observer = request.observer();
     if (observer) {
         NmActionResponse response(command, request);
@@ -766,8 +803,8 @@
 */
 void NmBaseClientPlugin::updateEnvelopeProperty(NmEnvelopeProperties property)
 {
-    NMLOG("NmBaseClientPlugin::updateEnvelopeProperty()-->");
-
+    NM_FUNCTION;
+    
     QList<const NmMessageEnvelope*> envelopeList;
     NmMessageEnvelope *envelope =
             mMenuRequest.requestData().value<NmMessageEnvelope*>();
@@ -782,5 +819,4 @@
                                         envelopeList);
     }
     envelopeList.clear();
-    NMLOG("<--NmBaseClientPlugin::updateEnvelopeProperty()");
 }
--- a/emailuis/nmailuiengine/src/nmdatamanager.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmdatamanager.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -31,6 +31,8 @@
 NmDataManager::NmDataManager() 
 :mFactory(NULL)
 {
+    NM_FUNCTION;
+    
     mFactory = NmDataPluginFactory::instance();
 }
 
@@ -39,6 +41,8 @@
 */
 NmDataManager::~NmDataManager()
 {
+    NM_FUNCTION;
+    
     NmDataPluginFactory::releaseInstance(mFactory);
 }
 
@@ -47,6 +51,8 @@
 */
 void NmDataManager::listMailboxIds(QList<NmId> &mailboxIdList)
 {
+    NM_FUNCTION;
+    
     int count(mFactory->pluginInstances()->count());
     for (int i(0); i < count; i++) {
         NmDataPluginInterface *instance =
@@ -63,6 +69,8 @@
 */
 void NmDataManager::listMailboxes(QList<NmMailbox*> &mailboxList)
 {
+    NM_FUNCTION;
+    
     int count = mFactory->pluginInstances()->count();
     for (int i(0); i < count; i++) {
         NmDataPluginInterface *instance =
@@ -80,6 +88,8 @@
 */
 void NmDataManager::listFolders(const NmId mailboxId, QList<NmFolder*> &folderList)
 {
+    NM_FUNCTION;
+    
     NmDataPluginInterface *instance = mFactory->interfaceInstance(mailboxId);
     if (instance) {
         instance->listFolders(mailboxId, folderList);
@@ -96,6 +106,8 @@
         const NmId &folderId,
         QList<NmMessageEnvelope*> &messageEnvelopeList)
 {
+    NM_FUNCTION;
+    
     NmDataPluginInterface *instance = mFactory->interfaceInstance(folderId);
     if (instance) {
         instance->listMessages(mailboxId, folderId, messageEnvelopeList);
@@ -111,7 +123,8 @@
     const NmId &mailboxId,
     const NmId &folderId)
 {
-    NMLOG("nmuiengine: getFolderById");
+    NM_FUNCTION;
+    
     NmFolderMetaData *folderMetaData(NULL);
     QList<NmFolder*> folderList;
     listFolders(mailboxId, folderList);
@@ -135,7 +148,8 @@
 */
 NmMailboxMetaData *NmDataManager::mailboxById(const NmId &mailboxId)
 {
-    NMLOG("nmuiengine: getMailboxById");
+    NM_FUNCTION;
+    
     NmMailboxMetaData *mailboxMetaData(NULL);
     NmMailbox* mbox = mailbox(mailboxId);
 
@@ -161,8 +175,8 @@
     const NmId &folderId,
     const NmId &messageId)
 {
-    NMLOG("nmuiengine: getMessageById");
-
+    NM_FUNCTION;
+    
     NmMessageEnvelope *msgEnvelope(NULL);
     NmMessage* msg = message(mailboxId, folderId, messageId);
 
@@ -180,6 +194,8 @@
 */
 NmMailbox *NmDataManager::mailbox(const NmId &mailboxId)
 {
+    NM_FUNCTION;
+    
     NmMailbox *newMailboxObject(NULL);
     NmDataPluginInterface *instance = mFactory->interfaceInstance(mailboxId);
     int retVal(NmNotFoundError);
@@ -204,6 +220,8 @@
     const NmId &mailboxId,
     const NmId &folderId)
 {
+    NM_FUNCTION;
+    
     NmFolder* newFolderObject(NULL);
     QList<NmFolder*> folderList;
     listFolders(mailboxId, folderList);
@@ -227,6 +245,8 @@
     const NmId &folderId,
     const NmId &messageId)
 {
+    NM_FUNCTION;
+    
     NmMessage *newMessageObject(NULL);
     NmDataPluginInterface *instance = mFactory->interfaceInstance(mailboxId);
 
@@ -254,6 +274,8 @@
     const NmId &messageId,
     NmMessagePart &messagePart)
 {
+    NM_FUNCTION;
+    
     int retVal(NmNotFoundError);
     NmDataPluginInterface *instance = mFactory->interfaceInstance(mailboxId);
     if (instance) {
@@ -270,6 +292,8 @@
         const NmId &mailboxId,
         NmFolderType folderType )
 {
+    NM_FUNCTION;
+    
     NmId folderId;
     NmDataPluginInterface *instance = mFactory->interfaceInstance(mailboxId);
     if (instance) {
@@ -280,4 +304,34 @@
 }
 
 
+/*!
+    Returns folder type by id
 
+    \param mailboxId The ID of the mailbox containing the folder
+
+    \param folderId The ID of the folder 
+
+    \return Folder type
+*/
+NmFolderType NmDataManager::folderTypeById(NmId mailboxId, NmId folderId)
+{
+    NM_FUNCTION;
+    
+    NmFolderType folderType(NmFolderOther);
+    if (getStandardFolderId(mailboxId,NmFolderInbox)==folderId){
+        folderType=NmFolderInbox;
+    }
+    else if (getStandardFolderId(mailboxId,NmFolderOutbox)==folderId){
+        folderType=NmFolderOutbox; 
+    }
+    else if (getStandardFolderId(mailboxId,NmFolderDrafts)==folderId){
+        folderType=NmFolderDrafts;
+    }
+    else if (getStandardFolderId(mailboxId,NmFolderSent)==folderId){
+        folderType=NmFolderSent; 
+    }    
+    else if (getStandardFolderId(mailboxId,NmFolderDeleted)==folderId){
+        folderType=NmFolderDeleted;  
+    }    
+    return folderType;
+}
--- a/emailuis/nmailuiengine/src/nmdatapluginfactory.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmdatapluginfactory.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -38,7 +38,7 @@
  */
 NmDataPluginFactory::NmDataPluginFactory()
 {
-
+    NM_FUNCTION;
 }
 
 /*!
@@ -46,6 +46,8 @@
  */
 NmDataPluginFactory::~NmDataPluginFactory()
 {
+    NM_FUNCTION;
+    
     if (mPluginArray) {
         qDeleteAll(mPluginArray->begin(), mPluginArray->end());
         mPluginArray->clear();
@@ -62,6 +64,8 @@
  */
 NmDataPluginFactory *NmDataPluginFactory::instance()
 {
+    NM_FUNCTION;
+    
     if (!mInstance) {
         mInstance = new NmDataPluginFactory();
     }
@@ -74,6 +78,8 @@
  */
 void NmDataPluginFactory::releaseInstance(NmDataPluginFactory *&instance)
     {
+    NM_FUNCTION;
+    
     //can't have passed out instances if we don't have any
     if (mInstance) {
         if (instance == mInstance) {
@@ -92,6 +98,8 @@
  */
 NmDataPluginInterface *NmDataPluginFactory::interfaceInstance(QObject *plugin)
 {
+    NM_FUNCTION;
+    
     NmDataPluginInterface *pluginInterface = NULL;
     if (plugin) {
         pluginInterface= qobject_cast<NmDataPluginInterface*>(plugin);
@@ -104,14 +112,42 @@
  */
 NmDataPluginInterface *NmDataPluginFactory::interfaceInstance(NmId mailboxId)
 {
+    NM_FUNCTION;
+    
     return interfaceInstance(pluginInstance(mailboxId));
 }
 
 /*!
 
  */
+NmApplicationStateInterface *NmDataPluginFactory::applicationStateInterfaceInstance(QObject *plugin)
+{
+    NM_FUNCTION;
+    
+    NmApplicationStateInterface *pluginInterface = NULL;
+    if (plugin) {
+        pluginInterface= qobject_cast<NmApplicationStateInterface*>(plugin);
+        }
+    return pluginInterface;
+}
+
+/*!
+
+ */
+NmApplicationStateInterface *NmDataPluginFactory::applicationStateInterfaceInstance(NmId mailboxId)
+{
+    NM_FUNCTION;
+    
+    return applicationStateInterfaceInstance(pluginInstance(mailboxId));
+}
+
+/*!
+
+ */
 QObject *NmDataPluginFactory::pluginInstance(NmId mailboxId)
 {
+    NM_FUNCTION;
+    
     QObject *value(NULL);
 
     quint64 tmp = mailboxId.id();
@@ -138,6 +174,8 @@
  */
 QList<QObject*> *NmDataPluginFactory::pluginInstances()
 {
+    NM_FUNCTION;
+    
     //if plugins have not been already created, do it now.
     if (!mPluginArray) {
         mPluginArray = new QList<QObject*>();
@@ -174,6 +212,8 @@
     const QDir &pluginDir,
     const QString &pluginName )
 {
+    NM_FUNCTION;
+    
     /*!
         This creates plugin entity.
      */
--- a/emailuis/nmailuiengine/src/nmfolderlistmodel.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmfolderlistmodel.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -37,10 +37,13 @@
 
 NmFolderListModelPrivate::NmFolderListModelPrivate()
 {
+    NM_FUNCTION;
 }
 
 NmFolderListModelPrivate::~NmFolderListModelPrivate()
 {
+    NM_FUNCTION;
+    
     while (!mMetaDataList.isEmpty()) {
         delete mMetaDataList.takeLast();
     }
@@ -53,6 +56,8 @@
 :QAbstractListModel(parent),
 mDataManager(dataManager)
 {
+    NM_FUNCTION;
+    
     d = new NmFolderListModelPrivate;
 }
 
@@ -61,6 +66,8 @@
  */
 NmFolderListModel::~NmFolderListModel()
 {
+    NM_FUNCTION;
+    
     delete d;
 }
 
@@ -69,6 +76,8 @@
  */
 QModelIndex NmFolderListModel::parent(const QModelIndex &child) const
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(child);
     return QModelIndex();
 }
@@ -78,6 +87,8 @@
  */
 int NmFolderListModel::rowCount(const QModelIndex &parent) const
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(parent);
     return d->mMetaDataList.size();
 }
@@ -87,6 +98,8 @@
  */
 int NmFolderListModel::columnCount(const QModelIndex &parent) const
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(parent);
 	return 1;
 }
@@ -97,6 +110,8 @@
  */
 QVariant NmFolderListModel::data(const QModelIndex &index, int role) const
 {
+    NM_FUNCTION;
+    
     if (!index.isValid())
         return QVariant();
 
@@ -120,7 +135,8 @@
 void NmFolderListModel::refresh(
         QList<NmFolder*>& folderList)
 {
-    NMLOG("nmuiengine: folder list model refresh");
+    NM_FUNCTION;
+    
     while (!d->mMetaDataList.isEmpty()) {
         delete d->mMetaDataList.takeLast();
     }
--- a/emailuis/nmailuiengine/src/nmfoldermetadata.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmfoldermetadata.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -42,6 +42,8 @@
 */
 NmFolderMetaData::NmFolderMetaData()
 {
+    NM_FUNCTION;
+    
     d = new NmFolderMetaDataPrivate;
 }
 
@@ -51,6 +53,8 @@
 */
 NmFolderMetaData::~NmFolderMetaData()
 {
+    NM_FUNCTION;
+    
     delete d;
 }
 
@@ -59,6 +63,8 @@
 */
 QString NmFolderMetaData::name() const
 {
+    NM_FUNCTION;
+    
     return d->mName;
 }
 
@@ -67,6 +73,8 @@
 */
 void NmFolderMetaData::setName(const QString &name)
 {
+    NM_FUNCTION;
+    
     d->mName = name;
 }
 
@@ -75,6 +83,8 @@
 */
 NmId NmFolderMetaData::id() const
 {
+    NM_FUNCTION;
+    
     return d->mId;
 }
 
@@ -83,6 +93,8 @@
 */
 void NmFolderMetaData::setId(const NmId &id)
 {
+    NM_FUNCTION;
+    
     d->mId = id;
 }
 
--- a/emailuis/nmailuiengine/src/nmicons.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmicons.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -66,6 +66,8 @@
 */
 HbIcon &NmIcons::getIcon(NmIcons::Icon icon)
 {
+    NM_FUNCTION;
+    
     if (!icons[icon]) {
         for (int i(0); icon_res[i].id != NmIcons::NmLastItem; i++) {
             if (icon_res[i].id == icon) {
@@ -81,7 +83,7 @@
         }
     }
     if (!icons[icon]) {
-        NMLOG(QString("nmailuiengine: Cannot open icon file: ###").arg(__FILE__));
+        NM_ERROR(1,QString("nmailuiengine: cannot open icon file: %1").arg(__FILE__));
     }
     return *icons[icon];
 }
@@ -91,7 +93,8 @@
 */
 void NmIcons::freeIcons()
 {
-    NMLOG("nmailuiengine: Enter freeIcons");
+    NM_FUNCTION;
+    
     for (int i(0); icon_res[i].id != NmIcons::NmLastItem; i++) {
         if (icons[i]) {
             delete icons[i];
--- a/emailuis/nmailuiengine/src/nmmailboxlistmodel.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmmailboxlistmodel.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -30,10 +30,11 @@
 /*!
     Constructor
  */
-NmMailboxListModel::NmMailboxListModel(NmDataManager &dataManager, QObject *parent) 
+NmMailboxListModel::NmMailboxListModel(NmDataManager &dataManager, QObject *parent)
 :QStandardItemModel(parent),
 mDataManager(dataManager)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -41,6 +42,8 @@
  */
 NmMailboxListModel::~NmMailboxListModel()
 {
+    NM_FUNCTION;
+    
     clear();
 }
 
@@ -50,6 +53,8 @@
  */
 QVariant NmMailboxListModel::data(const QModelIndex &index, int role) const
 {
+    NM_FUNCTION;
+    
     QVariant qVariant;
     if (index.isValid() && Qt::DisplayRole == role) {
         NmMailboxListModelItem *item = static_cast<NmMailboxListModelItem*>(itemFromIndex(index));
@@ -65,7 +70,8 @@
 void NmMailboxListModel::refresh(
         QList<NmMailbox*> &mailboxList)
 {
-    NMLOG("nmuiengine: mailbox list model refresh");
+    NM_FUNCTION;
+    
     clear();
     for (int i(0); i < mailboxList.count(); i++) {
         NmMailbox *mailbox = mailboxList[i];
@@ -79,13 +85,11 @@
 /*!
     Updates specific model item.
     \param mailboxId Mailbox id.
-    \param allowEmitDataChanged If <code>true</code> data changed signal
-           is emitted \sa QStandardItem, otherwise signal is not send.
  */
-void NmMailboxListModel::refreshModelItem(const NmId &mailboxId, bool allowEmitDataChanged)
+void NmMailboxListModel::refreshModelItem(const NmId &mailboxId)
 {
-    NMLOG("NmMailboxListModel::refreshModelItem");
-
+    NM_FUNCTION;
+    
     // Get correct mailbox data.
     NmMailbox* mailbox = mDataManager.mailbox(mailboxId);
     NmMailboxListModelItem *entryItem(NULL);
@@ -102,21 +106,13 @@
 
     // Update entry item's data.
     if (mailbox && entryItem) {
-        if (allowEmitDataChanged) {
-            // Changes data and emits datachanged.
-            NmMailboxMetaData *metaData = new NmMailboxMetaData;
-            metaData->setId(mailbox->id());
-            metaData->setName(mailbox->name());
-            entryItem->setItemMetaData(metaData);
-        } else {
-            // Only changes meta data information (mailbox name).
-            // No need for updating mailbox id.
-            // Do not call emitDataChanged, because it seems that if
-            // emitDataChanged is called twice, it leads to KERN-EXEC 3 Panic.
-            entryItem->itemMetaData()->setName(mailbox->name());
-       }
+        // Changes data and emits datachanged.
+        NmMailboxMetaData *metaData = new NmMailboxMetaData;
+        metaData->setId(mailbox->id());
+        metaData->setName(mailbox->name());
+        metaData->setAddress(mailbox->address().address());
+        entryItem->setItemMetaData(metaData);
     }
-    NMLOG("NmMailboxListModel::refreshModelItem - OK");
 }
 
 /*!
@@ -124,7 +120,8 @@
  */
 void NmMailboxListModel::handleMailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds)
 {
-    NMLOG("NmMailboxListModel::handleMailboxEvent");
+    NM_FUNCTION;
+    
     for (int a(0); a < mailboxIds.count(); a++) {
         NmId mailboxId = mailboxIds[a];
         switch (event) {
@@ -174,9 +171,12 @@
  */
 NmMailboxListModelItem *NmMailboxListModel::createMailboxItem(const NmMailbox *mailbox)
 {
+    NM_FUNCTION;
+    
     NmMailboxMetaData *newMeta = new NmMailboxMetaData();
     newMeta->setId(mailbox->id());
     newMeta->setName(mailbox->name());
+    newMeta->setAddress(mailbox->address().address());
 
     NmMailboxListModelItem *item = new NmMailboxListModelItem();
     item->setItemMetaData(newMeta);
--- a/emailuis/nmailuiengine/src/nmmailboxlistmodelitem.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmmailboxlistmodelitem.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -30,6 +30,7 @@
 :QStandardItem(),
 mMailbox(NULL)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -37,6 +38,8 @@
  */
 NmMailboxListModelItem::~NmMailboxListModelItem()
 {
+    NM_FUNCTION;
+    
     delete mMailbox;
 }
 
@@ -45,6 +48,8 @@
  */
 void NmMailboxListModelItem::setItemMetaData(NmMailboxMetaData *mailbox)
 {
+    NM_FUNCTION;
+    
     if (mMailbox) {
         delete mMailbox;
     }
@@ -57,6 +62,8 @@
  */
 NmMailboxMetaData *NmMailboxListModelItem::itemMetaData()
 {
+    NM_FUNCTION;
+    
     return mMailbox;
 }
 
@@ -65,6 +72,8 @@
  */
 void NmMailboxListModelItem::callEmitDataChanged()
 {
+    NM_FUNCTION;
+    
     emitDataChanged();
 }
 
--- a/emailuis/nmailuiengine/src/nmmailboxmetadata.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmmailboxmetadata.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -34,6 +34,7 @@
     QString mName;
     NmId mId;
     NmId mIconId;
+    QString mAddress;
 };
 
 
@@ -42,6 +43,8 @@
 */
 NmMailboxMetaData::NmMailboxMetaData()
 {
+    NM_FUNCTION;
+    
     d = new NmMailboxMetaDataPrivate;
 }
 
@@ -51,6 +54,8 @@
 */
 NmMailboxMetaData::~NmMailboxMetaData()
 {
+    NM_FUNCTION;
+    
     delete d;
 }
 
@@ -59,6 +64,8 @@
 */
 QString NmMailboxMetaData::name() const
 {
+    NM_FUNCTION;
+    
     return d->mName;
 }
 
@@ -67,6 +74,8 @@
 */
 void NmMailboxMetaData::setName(const QString &name)
 {
+    NM_FUNCTION;
+    
     d->mName = name;
 }
 
@@ -75,6 +84,8 @@
 */
 NmId NmMailboxMetaData::id() const
 {
+    NM_FUNCTION;
+    
     return d->mId;
 }
 
@@ -83,6 +94,8 @@
 */
 void NmMailboxMetaData::setId(const NmId& id)
 {
+    NM_FUNCTION;
+    
     d->mId = id;
 }
 
@@ -91,6 +104,8 @@
 */
 NmId NmMailboxMetaData::IconId() const
 {
+    NM_FUNCTION;
+    
     return d->mIconId;
 }
 
@@ -99,10 +114,27 @@
 */
 void NmMailboxMetaData::setIconId(const NmId &id)
 {
+    NM_FUNCTION;
+    
     d->mIconId = id;
 }
 
-
+/*!
+    Get mailbox address
+*/
+QString NmMailboxMetaData::address() const
+{
+    NM_FUNCTION;
+    
+    return d->mAddress;
+}
 
-
-
+/*!
+    Set Mailbox address as \a address
+*/
+void NmMailboxMetaData::setAddress(const QString &address)
+{
+    NM_FUNCTION;
+    
+    d->mAddress = address;
+}
--- a/emailuis/nmailuiengine/src/nmmessagelistmodel.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmmessagelistmodel.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009 - 2010 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"
@@ -17,6 +17,7 @@
 
 #include "nmuiengineheaders.h"
 
+static const int NmFolderTypeRole = Qt::UserRole+1; 
 
 /*!
     \class NmMessageListModel
@@ -29,81 +30,127 @@
 */
 
 /*!
-	Constructor
- */
-NmMessageListModel::NmMessageListModel(NmDataManager &dataManager, QObject *parent)
-:QStandardItemModel(parent),
-mDataManager(dataManager),
-mDividersActive(false),
-mParentPtr(NULL)
+	Class constructor.
+*/
+NmMessageListModel::NmMessageListModel(NmDataManager &dataManager,
+                                       QObject *parent /* = 0 */)
+: QStandardItemModel(parent),
+  mDataManager(dataManager),
+  mDividersActive(false),
+  mParentPtr(NULL),
+  mCurrentFolderType(NmFolderInbox),
+  mIgnoreFolderIds(false)
 {
+    NM_FUNCTION;
+    
     // Check for setting whether dividers are active
     // mDividersActive = ...
     // update also the test cases
 }
 
+
 /*!
-	Destructor
- */
+	Class destructor.
+*/
 NmMessageListModel::~NmMessageListModel()
 {
+    NM_FUNCTION;
+    
     clear();
 }
 
+
 /*!
     Returns data specified by \a index. Only Qt::DisplayRole is supported in \a role.
     The refresh method must have been called before this method can return any real data.
- */
-
+*/
 QVariant NmMessageListModel::data(const QModelIndex &index, int role) const
 {
+    NM_FUNCTION;
+    
     QVariant qVariant;
-    if (index.isValid() && Qt::DisplayRole == role) {
-    	NmMessageListModelItem *item = static_cast<NmMessageListModelItem*>(itemFromIndex(index));
-        qVariant = QVariant::fromValue(item);
+
+    if (index.isValid()){
+        if (role == Qt::DisplayRole) {
+            NmMessageListModelItem *item =
+                static_cast<NmMessageListModelItem*>(itemFromIndex(index));
+            qVariant = QVariant::fromValue(item);
+        }
+        else if (role == NmFolderTypeRole) {
+            qVariant = QVariant(mCurrentFolderType);
+        }    
     }
+
     return qVariant;
 }
 
+
 /*!
     This refreshes the data of the model.
- */
+
+    \param mailboxId The ID of the mailbox.
+    \param folderId The ID of the folder.
+    \param messageEnvelopeList A list containing the message meta data.
+*/
 void NmMessageListModel::refresh(
-                    const NmId mailboxId, 
-                    const NmId folderId,
-                    const QList<NmMessageEnvelope*> &messageEnvelopeList)
+        const NmId mailboxId, 
+        const NmId folderId,
+        const QList<NmMessageEnvelope*> &messageEnvelopeList)
 {
-    // Store current mailbox and folder id
+    NM_FUNCTION;
+
+    // Store the current mailbox and folder IDs.
     mCurrentMailboxId = mailboxId;
     mCurrentFolderId = folderId;
-    // clear the model
+
+    // Store the type of the currently displayed folder.
+    mCurrentFolderType = mDataManager.folderTypeById(mailboxId, folderId);
+
+    // Clear the model.
     clear();
-    // Add items
+
+    // Add the items from the given list.
     NmMessageEnvelope* insertedMessage(NULL);
     int parentCount(0);
     int childCount(0);
+
     for (int i(0); i < messageEnvelopeList.count(); i++) {
-        NmMessageEnvelope* nextMessage = messageEnvelopeList[i];
-        if (mDividersActive && !messagesBelongUnderSameDivider(
-        		insertedMessage, nextMessage)) {
-            insertDividerIntoModel(nextMessage, parentCount);
-            parentCount++;
-            childCount = 0;
+        NmMessageEnvelope *nextMessage = messageEnvelopeList[i];
+        // imap and pop is using common sent, outbox or draft folder
+        // for all mailboxes, here we want to filter out messages that
+        // are not under this mailbox
+        bool insert(true);
+        if (nextMessage 
+            && (NmFolderSent == mCurrentFolderType
+             || NmFolderOutbox == mCurrentFolderType
+             || NmFolderDrafts == mCurrentFolderType)) {
+            insert = (mCurrentMailboxId == nextMessage->mailboxId());  
         }
-        insertMessageIntoModel(nextMessage, childCount, false);
-        insertedMessage = nextMessage;
-        childCount++;
+        if (insert) {
+            if (mDividersActive &&
+                !messagesBelongUnderSameDivider(insertedMessage, nextMessage)) {
+                insertDividerIntoModel(nextMessage, parentCount);
+                parentCount++;
+                childCount = 0;
+            }
+    
+            insertMessageIntoModel(nextMessage, childCount, false);
+            insertedMessage = nextMessage;
+            childCount++;
+        }
     }
-    //NMLOG(QString("nmailuiengine: model row count = %1").arg(rowCount()));
 }
 
+
 /*!
     insertDividerIntoModel. Function inserts divider into model.
- */
+*/
 void NmMessageListModel::insertDividerIntoModel(
     NmMessageEnvelope *messageForDivider,
     int parentRow)
 {
+    NM_FUNCTION;
+    
     mParentPtr = createTitleDividerItem(messageForDivider);
     insertRow(parentRow,mParentPtr);
     mParentPtr->callEmitDataChanged();
@@ -112,10 +159,12 @@
 /*!
     Function inserts message into model. Message can be inserted
     either to root or to parent. If parent is zero, item is added into root.
- */
+*/
 void NmMessageListModel::insertMessageIntoModel(
 		NmMessageEnvelope *messageEnvelope, int childRow, bool emitSignal)
 {
+    NM_FUNCTION;
+    
     NmMessageListModelItem *mailItem = createMessageItem(messageEnvelope);
     if (mParentPtr) {
         // Add under parent divider
@@ -133,11 +182,13 @@
 /*!
     Function checks whether the messages can be drawn under same title divider
     Check is done depending of the current sorting criteria
- */
+*/
 bool NmMessageListModel::messagesBelongUnderSameDivider(
     const NmMessageEnvelope *message1,
     const NmMessageEnvelope *message2) const
 {
+    NM_FUNCTION;
+    
     bool retVal(false);
     // First check pointer validity
     if (message1 && message2) {
@@ -154,59 +205,84 @@
 
 
 /*!
-    Function handles message events
- */
-void NmMessageListModel::handleMessageEvent(
-    NmMessageEvent event,
-    const NmId &folderId,
-    const QList<NmId> &messageIds)
+    Handles the message events.
+
+    \param event The type of the message event.
+    \param folderId The folder containing the message.
+    \param messageIds A list of message IDs related to the event.
+*/
+void NmMessageListModel::handleMessageEvent(NmMessageEvent event,
+                                            const NmId &folderId,
+                                            const QList<NmId> &messageIds,
+                                            const NmId &mailboxId)
 {
-    NmId mailboxId = mCurrentMailboxId;
+    NM_FUNCTION;
+    const int idCount = messageIds.count();
 
-    if (folderId == 0) {
-        // const cast is used here because also the input parameter has to be changed
-        const_cast<NmId&>(folderId) = mDataManager.getStandardFolderId(mailboxId, NmFolderInbox);
-        NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageList, mailboxId, folderId);
-        emit setNewParam(startParam);
+    // Folder ID does not concern us if this model instance is used for e.g.
+    // searching messages.
+    if (!mIgnoreFolderIds) {
+        if (folderId == 0) {
+            // Const cast is used here because also the input parameter has to
+            // be changed.
+            const_cast<NmId&>(folderId) =
+                mDataManager.getStandardFolderId(mailboxId, NmFolderInbox);
+            NmUiStartParam *startParam =
+                new NmUiStartParam(NmUiViewMessageList, mailboxId, folderId);
+            emit setNewParam(startParam);
+        }
+
+        if (mCurrentFolderId == 0) {
+            // Folder ID was not known at time when the mailbox opened and we
+            // know that because of events the subscription is valid only for
+            // the current mailbox.
+            mCurrentFolderId = folderId; 
+        }
+        // MailboxId checking here is done because we want to filter out messages
+        // that belongs to other mailboxes in case of imap/pop sent, outbox or draft folder
+        if (mCurrentFolderId != folderId || mCurrentMailboxId != mailboxId) {
+            // The event does not concern the folder currently being displayed.
+            // Thus, ignore it.
+            return;
+        }
     }
-    if (mCurrentFolderId == 0) {
-        // Folder id was not known at time mailbox opened
-        // and we know subscription is valid only for current 
-        // mailbox, because of events.
-        mCurrentFolderId = folderId; 
-    }
-    // Handle events if they concern currently displayed folder
-    if (mCurrentFolderId == folderId) {
-        NMLOG(QString("nmailuiengine: handleMessageEvent"));
-        if (NmMessageChanged == event) {
-            for (int a(0); a < messageIds.count(); a++) {
-                updateMessageEnvelope(mailboxId, folderId,messageIds[a]);
+
+    // Go through the given message IDs and do the appropriate operations
+    // according to the type of the event.
+    for (int i(0); i < idCount; ++i) {
+        switch (event) {
+            case NmMessageChanged: {
+                updateMessageEnvelope(mailboxId, folderId, messageIds[i]);
+                break;
             }
-        }
-        else if (NmMessageCreated == event) {
-            for (int a(0); a < messageIds.count(); a++) {
-                if(!itemFromModel(messageIds[a])) {
-                    insertNewMessageIntoModel(mailboxId, folderId, messageIds[a]);
+            case NmMessageCreated:
+            case NmMessageFound: {
+                if (!itemFromModel(messageIds[i])) {
+                    insertNewMessageIntoModel(mailboxId, folderId, messageIds[i]);
                 }
+
+                break;
             }
-        } else {
-            for (int a(0); a < messageIds.count(); a++) {
-                removeMessageFromModel(messageIds[a]);
+            case NmMessageDeleted: {
+                removeMessageFromModel(messageIds[i]);
+                break;
             }
         }
     }
 }
 
+
 /*!
     Function inserts new message into correct position to model.
     A new title divider is created if it is needed.
- */
+*/
 void NmMessageListModel::insertNewMessageIntoModel(
     const NmId &mailboxId,
     const NmId &folderId,
     const NmId &msgId)
 {
-    NMLOG(QString("NmMessageListModel::insertNewMessageIntoModel"));
+    NM_FUNCTION;
+    
     // envelope ownership is here
     NmMessageEnvelope *newMsgEnve = mDataManager.envelopeById(mailboxId, folderId, msgId);
     if (newMsgEnve) {
@@ -266,11 +342,12 @@
 /*!
     Function check model index in which the new message should be inserted
     with the currently active sort mode.
- */
+*/
 int NmMessageListModel::getInsertionIndex(
     const NmMessageEnvelope &envelope) const
 {
-    // NMLOG(QString("nmailuiengine: getInsertionIndex"));
+    NM_FUNCTION;
+    
     int ret(NmNotFoundError);
     
     // Date+descending sort mode based comparison.
@@ -300,9 +377,11 @@
 /*!
     Function finds preceding title divider index and sets the
     mParentPtr variable.
- */
+*/
 int NmMessageListModel::dividerInsertionIndex(int messageIndex)
 {
+    NM_FUNCTION;
+    
     bool found(false);
     int ret(NmNoError);
     QModelIndex index;
@@ -322,10 +401,12 @@
 
 /*!
     Create title divider item
- */
+*/
 NmMessageListModelItem *NmMessageListModel::createTitleDividerItem(
 		NmMessageEnvelope *messageForDivider)
 {
+    NM_FUNCTION;
+    
     NmMessageListModelItem *item = new NmMessageListModelItem();
     item->setItemType(NmMessageListModelItem::NmMessageItemTitleDivider);
 
@@ -351,11 +432,12 @@
 
 /*!
     Create message item
- */
+*/
 NmMessageListModelItem *NmMessageListModel::createMessageItem(
 		NmMessageEnvelope *envelope)
 {
-
+    NM_FUNCTION;
+    
     NmMessageListModelItem *mailItem = new NmMessageListModelItem();
     mailItem->setEnvelope(*envelope);
     mailItem->setItemType(NmMessageListModelItem::NmMessageItemMessage);
@@ -365,45 +447,72 @@
 
 /*!
     Returns divider state
- */
+*/
 bool NmMessageListModel::dividersActive()
 {
+    NM_FUNCTION;
+    
     return mDividersActive;
 }
 
 /*!
     Set divider state
- */
+*/
 void NmMessageListModel::setDividers(bool active)
 {
+    NM_FUNCTION;
+    
     mDividersActive = active;
 }
 
 /*!
    Change item property if differs
- */
+*/
 void NmMessageListModel::setEnvelopeProperties(
     NmEnvelopeProperties property,
     const QList<NmId> &messageIds)
 {
+    NM_FUNCTION;
+    
     for (int i(0); i < messageIds.count(); i++) {
         updateEnvelope(property, messageIds[i]);
     }
 }
 
+
 /*!
-   Returns the id of the current mailbox
- */
+    Returns the ID of the current mailbox.
+*/
 NmId NmMessageListModel::currentMailboxId()
 {
+    NM_FUNCTION;
+    
     return mCurrentMailboxId;
 }
 
+
+/*!
+    Sets whether the model should ignore the folder IDs or not. The folder IDs
+    should be ignored e.g. when the model is used for searching messages
+    (i.e. used by the search view).
+
+    \param ignore If true, will ignore the folder IDs.
+*/
+void NmMessageListModel::setIgnoreFolderIds(bool ignore)
+{
+    NM_FUNCTION;
+    
+    mIgnoreFolderIds = ignore;
+}
+
+
 /*!
    Remove message from model if message exists in model
- */
+*/
 void NmMessageListModel::removeMessageFromModel(const NmId &msgId)
 {
+    NM_FUNCTION;
+    
     QList<QStandardItem*> items = findItems("*", Qt::MatchWildcard | Qt::MatchRecursive);
     int count(items.count());
     bool found(false);
@@ -453,18 +562,22 @@
 
 /*!
    Helper function to remove row
- */
+*/
 void NmMessageListModel::removeItem(int row, NmMessageListModelItem &item)
 {
+    NM_FUNCTION;
+    
     QStandardItem *parent = item.parent();
     removeRow(row, indexFromItem(parent));
 }
 
 /*!
    Search item from model
- */
+*/
 NmMessageListModelItem *NmMessageListModel::itemFromModel(const NmId &messageId)
 {
+    NM_FUNCTION;
+    
     QList<QStandardItem*> items = findItems("*", Qt::MatchWildcard | Qt::MatchRecursive);
     int count(items.count());
     bool found(false);
@@ -485,19 +598,23 @@
 
 /*!
    Helper function for envelope comparison
- */
+*/
 bool NmMessageListModel::changed(const NmMessageEnvelope &first, const NmMessageEnvelope &second)
 {
+    NM_FUNCTION;
+    
     return first != second;
 }
 
 /*!
    Updates envelope if something is changed
- */
+*/
 void NmMessageListModel::updateMessageEnvelope(const NmId &mailboxId,
         const NmId &folderId,
         const NmId &msgId)
 {
+    NM_FUNCTION;
+    
     NmMessageListModelItem *item = itemFromModel(msgId);
     // envelope ownership is here
     NmMessageEnvelope *newEnvelope = mDataManager.envelopeById(mailboxId, folderId, msgId);
@@ -514,9 +631,11 @@
 
 /*!
    Update envelope property
- */
+*/
 void NmMessageListModel::updateEnvelope(NmEnvelopeProperties property, const NmId &msgId)
 {
+    NM_FUNCTION;
+    
     NmMessageListModelItem *item = itemFromModel(msgId);
     if (item) {
         bool changed(false);
--- a/emailuis/nmailuiengine/src/nmmessagelistmodelitem.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmmessagelistmodelitem.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -51,6 +51,8 @@
 */
 NmMessageListModelItem::NmMessageListModelItem()
 {
+    NM_FUNCTION;
+    
     d = new NmMessageListModelItemPrivate();
 }
 
@@ -60,6 +62,8 @@
 */
 NmMessageListModelItem::~NmMessageListModelItem()
 {
+    NM_FUNCTION;
+    
     delete d;
 }
 
@@ -68,6 +72,8 @@
 */
 void NmMessageListModelItem::setEnvelope(const NmMessageEnvelope &envelope)
 {
+    NM_FUNCTION;
+    
     delete d->mEnvelope;
     d->mEnvelope = new NmMessageEnvelope(envelope);
 	emitDataChanged();
@@ -78,6 +84,8 @@
 */
 void NmMessageListModelItem::setEnvelope(NmMessageEnvelope *envelope)
 {
+    NM_FUNCTION;
+    
     if (envelope) {
         delete d->mEnvelope;
         d->mEnvelope = envelope;
@@ -90,6 +98,8 @@
 */
 const NmMessageEnvelope &NmMessageListModelItem::envelope() const
 {
+    NM_FUNCTION;
+    
     if (!d->mEnvelope) {
         d->mEnvelope = new NmMessageEnvelope();
     }
@@ -102,6 +112,8 @@
 */
 NmMessageEnvelope *NmMessageListModelItem::envelopePtr()
 {
+    NM_FUNCTION;
+    
     if (!d->mEnvelope) {
         d->mEnvelope = new NmMessageEnvelope();
     }
@@ -113,6 +125,8 @@
 */
 NmMessageListModelItem::NmMessageItemType NmMessageListModelItem::itemType() const
 {
+    NM_FUNCTION;
+    
     return d->mType;
 }
 
@@ -121,6 +135,8 @@
 */
 void NmMessageListModelItem::setItemType(NmMessageListModelItem::NmMessageItemType type)
 {
+    NM_FUNCTION;
+    
     d->mType = type;
 }
 
@@ -129,6 +145,8 @@
 */
 QString NmMessageListModelItem::titleDivider() const
 {
+    NM_FUNCTION;
+    
     return d->mDivider;
 }
 
@@ -137,6 +155,8 @@
 */
 void NmMessageListModelItem::setTitleDivider(const QString &divider)
 {
+    NM_FUNCTION;
+    
     d->mDivider = divider;
 }
 
@@ -145,6 +165,8 @@
 */
 bool NmMessageListModelItem::expanded() const
 {
+    NM_FUNCTION;
+    
     return d->mExpanded;
 }
 
@@ -153,6 +175,8 @@
 */
 void NmMessageListModelItem::setExpanded(bool expanded)
 {
+    NM_FUNCTION;
+    
     d->mExpanded = expanded;
 }
 
@@ -161,5 +185,7 @@
  */
 void NmMessageListModelItem::callEmitDataChanged()
 {
+    NM_FUNCTION;
+    
     emitDataChanged();
 }
--- a/emailuis/nmailuiengine/src/nmmessagesearchlistmodel.cpp	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,173 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#include "nmuiengineheaders.h"
-
-/*!
-    \class NmMessageSearchListModel
-    \brief A proxy model used to filter out messages from the message list model
-           that are not amongst the search results.
-*/
-
-/*!
-    Class constructor.
-*/
-NmMessageSearchListModel::NmMessageSearchListModel(QObject *parent)
-: QSortFilterProxyModel(parent)
-{
-    // No implementation required.
-}
-
-
-/*!
-    Class destructor.
-*/
-NmMessageSearchListModel::~NmMessageSearchListModel()
-{
-    clearSearchResults();
-}
-
-
-/*!
-    Clears search results and removes the accepted source model items from this
-    proxy model.
-*/
-void NmMessageSearchListModel::clearSearchResults()
-{
-    mSearchResults.clear();
-    invalidateFilter();
-}
-
-
-/*!
-    Returns the number of search results i.e. IDs in the container.
-
-    \return The number of search results.
-*/
-int NmMessageSearchListModel::searchResultCount() const
-{
-    return mSearchResults.count();
-}
-
-
-/*!
-    From QSortFilterProxyModel.
-    Returns the data from the source model according to the given proxy index.
-
-    \param index The index of this proxy model.
-    \param role The item role.
-
-    \return The item data wrapped in a QVariant.
-*/
-QVariant NmMessageSearchListModel::data(const QModelIndex &index,
-                                        int role /* = Qt::DisplayRole */) const
-{
-    QVariant retVal;
-    QAbstractItemModel *model = sourceModel();
-
-    if (model) {
-        // Return the data from the source model by mapping the given index
-        // in respect to the source model.
-        QModelIndex sourceIndex = mapToSource(index);
-        retVal = model->data(sourceIndex, role);
-    }
-    else {
-        // Since no source model set, use the base class method implementation.
-        retVal = QSortFilterProxyModel::data(index, role);
-    }
-
-    return retVal;
-}
-
-
-/*!
-    From QSortFilterProxyModel.
-    Filters the items of the source model depending on the current search results.
-
-    \param source_row A source model row index.
-    \param source_parent The parent model index of the row.
-
-    \return True if the row should be accepted to the search list model, false
-            otherwise.
-*/
-bool NmMessageSearchListModel::filterAcceptsRow(int source_row,
-                                                const QModelIndex &source_parent) const
-{
-    bool accept(false);
-
-    // Get the source model.
-    NmMessageListModel *model = qobject_cast<NmMessageListModel*>(sourceModel());
-
-    if (model) {
-        // Extract the model item corresponding the given row and index.
-        QModelIndex listIndex = model->index(source_row, 0, source_parent);
-        QVariant qVariant = model->data(listIndex);
-        NmMessageListModelItem *item = qVariant.value<NmMessageListModelItem*>();
-
-        if (item) {
-            // Get the message ID from the item and compare it to the current
-            // search results.
-            const NmId itemId = item->envelope().messageId();
-
-            if (mSearchResults.contains(itemId)) {
-                // The message ID matches the search result => do accept the row.
-                accept = true;
-            }
-        }
-    }
-
-    return accept;
-}
-
-
-/*!
-    Adds the given message ID to the search results.
-
-    \param messageId The ID to add.
-
-    \return True if the given ID was added, false otherwise.
-*/
-bool NmMessageSearchListModel::addSearchResult(const NmId &messageId)
-{
-    bool resultAdded(false);
-
-    // Make sure not to add the same ID twice.
-    if (!mSearchResults.contains(messageId)) {
-        // Add the given ID to the results.
-        mSearchResults.append(messageId);
-        resultAdded = true;
-
-        // Invalidate the filter in order to update the model. This forces
-        // filterAcceptsRow() to be ran again for each row in the source model.
-        invalidateFilter();
-    }
-
-    return resultAdded;
-}
-
-
-/*!
-    Refreshes the content by forcing the model to re-process the source model
-    items using the current filter (search results).
-*/
-void NmMessageSearchListModel::refreshContent()
-{
-    invalidateFilter();
-}
-
-
-// End of file.
--- a/emailuis/nmailuiengine/src/nmoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -25,6 +25,8 @@
 : mProgress(0),
   mIsRunning(true)
 {
+    NM_FUNCTION;
+    
     QMetaObject::invokeMethod(this, "runAsyncOperation", Qt::QueuedConnection);
 }
 
@@ -33,6 +35,8 @@
  */
 NmOperation::~NmOperation()
 {
+    NM_FUNCTION;
+    
     while (!mPreliminaryOperations.isEmpty()) {
         QPointer<NmOperation> operation = mPreliminaryOperations.takeLast();
         if (operation && operation->isRunning()) {
@@ -46,6 +50,8 @@
  */
 bool NmOperation::isRunning() const
 {
+    NM_FUNCTION;
+    
     return mIsRunning;
 }
 
@@ -54,13 +60,19 @@
  */
 void NmOperation::addPreliminaryOperation(NmOperation *operation)
 {
-    connect(operation, SIGNAL(operationCompleted()), this,
-        SLOT(handlePreliminaryOperationFinished()));
-
-    connect(operation, SIGNAL(operationCancelled()), this,
-        SLOT(handlePreliminaryOperationFinished()));
-
-    mPreliminaryOperations.append(operation);
+    NM_FUNCTION;
+    
+    // if the preliminary operation is already completed
+    // the input parameter can be null
+    if (operation && operation->isRunning()) {
+        connect(operation, SIGNAL(operationCompleted()), this,
+            SLOT(handlePreliminaryOperationFinished()));
+    
+        connect(operation, SIGNAL(operationCancelled()), this,
+            SLOT(handlePreliminaryOperationFinished()));
+    
+        mPreliminaryOperations.append(operation);
+    }
 }
 
 /*!
@@ -71,6 +83,8 @@
  */
 void NmOperation::completeOperation(int result)
 {
+    NM_FUNCTION;
+    
     mIsRunning = false;
     // Operation is completed, emit the signal
     doCompleteOperation();
@@ -85,6 +99,8 @@
  */
 void NmOperation::cancelOperation()
 {
+    NM_FUNCTION;
+    
     mIsRunning = false;
     // Operation is canceled, emit the signal
     this->doCancelOperation();
@@ -98,6 +114,8 @@
  */
 void NmOperation::updateOperationProgress(int progress)
 {
+    NM_FUNCTION;
+    
     mProgress = progress;
     this->doUpdateOperationProgress();
     emit this->operationProgressChanged(mProgress);
@@ -111,6 +129,8 @@
  */
 void NmOperation::runAsyncOperation()
 {
+    NM_FUNCTION;
+    
     int count = mPreliminaryOperations.count();
     int ready = 0;
     // go through preliminary operations
@@ -133,6 +153,8 @@
  */
 void NmOperation::handlePreliminaryOperationFinished()
 {
+    NM_FUNCTION;
+    
     QMetaObject::invokeMethod(this, "runAsyncOperation", Qt::QueuedConnection);
 }
 
@@ -144,7 +166,7 @@
  */ 
 void NmOperation::doCompleteOperation()
 {
-    
+    NM_FUNCTION;
 }
 
 /*!
@@ -155,6 +177,7 @@
  */
 void NmOperation::doCancelOperation()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -165,6 +188,7 @@
  */
 void NmOperation::doUpdateOperationProgress()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -174,6 +198,8 @@
  */
 void NmOperation::deleteOperation()
 {
+    NM_FUNCTION;
+    
     this->deleteLater();   
 }
 
--- a/emailuis/nmailuiengine/src/nmuiengine.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiengine/src/nmuiengine.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -27,15 +27,22 @@
 NmUiEngine *NmUiEngine::mInstance;
 int NmUiEngine::mReferenceCount;
 
+const QString syncIndicatorName = "com.nokia.hb.nmsyncindicator/1.0";
+
 /*!
     Constructor
 */
 NmUiEngine::NmUiEngine() 
 : mMailboxListModel(NULL),
+  mInboxListModel(NULL),
   mMessageListModel(NULL),
   mMessageSearchListModel(NULL),
-  mSendOperation(NULL)
+  mSendOperation(NULL),
+  mRemoveDraftOperation(NULL),
+  mSaveDraftOperation(NULL)
 {
+    NM_FUNCTION;
+    
     mPluginFactory = NmDataPluginFactory::instance();
     mDataManager = new NmDataManager();
     // Connect to the plugins to receive change notifications
@@ -78,11 +85,16 @@
 */
 NmUiEngine::~NmUiEngine()
 {
+    NM_FUNCTION;
+    
     if (mMessageSearchListModel) {
         delete mMessageSearchListModel;
         mMessageSearchListModel = NULL;
     }
-
+    if (mInboxListModel) {
+        delete mInboxListModel;
+        mInboxListModel = NULL;
+    }  
     if (mMessageListModel) {
         delete mMessageListModel;
         mMessageListModel = NULL;
@@ -107,6 +119,12 @@
     if (mSendOperation && mSendOperation->isRunning()) {
         mSendOperation->cancelOperation();
     }
+    if(mRemoveDraftOperation && mRemoveDraftOperation->isRunning()) {
+        mRemoveDraftOperation->cancelOperation();        
+    }
+    if(mSaveDraftOperation && mSaveDraftOperation->isRunning()) {
+        mSaveDraftOperation->cancelOperation();
+    }
 }
 
 /*!
@@ -114,6 +132,8 @@
 */
 NmUiEngine *NmUiEngine::instance()
 {
+    NM_FUNCTION;
+    
     if (!mInstance) {
     	mInstance = new NmUiEngine();
     }
@@ -126,6 +146,8 @@
 */
 void NmUiEngine::releaseInstance(NmUiEngine *&instance)
 {
+    NM_FUNCTION;
+    
     //can't have passed out instances if we don't have any
     if (mInstance) {
         if(instance == mInstance) {
@@ -145,6 +167,8 @@
 */
 NmMailboxListModel &NmUiEngine::mailboxListModel()
 {
+    NM_FUNCTION;
+    
     if (!mMailboxListModel) {
         refreshMailboxListModel(); // creates the model too
     }
@@ -158,6 +182,8 @@
 */
 void NmUiEngine::refreshMailboxListModel()
 {
+    NM_FUNCTION;
+    
     if (!mMailboxListModel) {
         mMailboxListModel = new NmMailboxListModel(*mDataManager);
         
@@ -182,59 +208,129 @@
     }
 }
 
+
 /*!
-    Returns a message list model for a folder identified by \a mailboxId and \a folderId.
-    The model is updated dynamically. The ownership of the model object is not moved to the caller.
+    Returns a message list model for a folder identified by \a mailboxId and 
+    \a folderId. The model is updated dynamically. The ownership of the model
+    object is not moved to the caller.
 */
-NmMessageListModel &NmUiEngine::messageListModel(const NmId &mailboxId, const NmId &folderId)
+NmMessageListModel &NmUiEngine::messageListModel(const NmId &mailboxId,
+                                                 const NmId &folderId)
 {
-    if (!mMessageListModel){
-        mMessageListModel = new NmMessageListModel(*mDataManager);
+    NM_FUNCTION;
+
+    QObject *plugin = mPluginFactory->pluginInstance(mailboxId);
+    bool isInbox(false);
+    if (standardFolderId(mailboxId,NmFolderInbox)==folderId){
+        isInbox=true;
     }
-    else{
-        mMessageListModel->clear();
+    if (plugin) { 
+        // Connect plugin message events to handler slot messageEventForListModel
+        QObject::connect(plugin, SIGNAL(messageEvent(NmMessageEvent, const NmId &, 
+                                const QList<NmId> &, const NmId&)),
+                                this, SLOT(messageEventForListModel(NmMessageEvent, 
+                                const NmId &, const QList<NmId> &, const NmId&)), Qt::UniqueConnection );
+        // Create inbox list model only once when entering to inbox for the first time
+        // or re-create inbox list model when mailbox has changed    
+        if ((!mInboxListModel&&isInbox)||
+            (mInboxListModel&&isInbox&&mailboxId!=mInboxListModel->currentMailboxId())){
+            // Delete previous model and set to NULL. Deleting model will also
+            // delete all items in model. 
+            if (mInboxListModel){
+                delete mInboxListModel;
+                mInboxListModel=NULL;
+            }
+            // Create new inbox model 
+            mInboxListModel = new NmMessageListModel(*mDataManager);
+            // Initial fill up of inbox list model, otherwise updated in the background
+            QList<NmMessageEnvelope*> messageEnvelopeList;
+            mDataManager->listMessages(mailboxId, folderId, messageEnvelopeList);
+            mInboxListModel->refresh(mailboxId, folderId, messageEnvelopeList);
+
+            while (!messageEnvelopeList.isEmpty()) {
+                delete messageEnvelopeList.takeFirst();
+            }
+        }
+        // Selected folder is not inbox folder for the mailbox
+        else if (!isInbox){
+            // Recreate model for other folders when needed, previous model
+            // items are deleted from the memory with the old model
+            if (mMessageListModel){
+                delete mMessageListModel;
+                mMessageListModel=NULL;
+            }
+            mMessageListModel = new NmMessageListModel(*mDataManager);
+    
+            // Fill up other model 
+            QList<NmMessageEnvelope*> messageEnvelopeList;
+            mDataManager->listMessages(mailboxId, folderId, messageEnvelopeList);
+            mMessageListModel->refresh(mailboxId, folderId, messageEnvelopeList);
+
+            while (!messageEnvelopeList.isEmpty()) {
+                delete messageEnvelopeList.takeFirst(); 
+            }             
+        }    
     }
-    QObject *plugin =
-        mPluginFactory->pluginInstance(mailboxId);
-    if (plugin) {
-        QObject::connect(plugin,
-            SIGNAL(messageEvent(NmMessageEvent, const NmId &, const QList<NmId> &, const NmId&)),
-        mMessageListModel,
-            SLOT(handleMessageEvent(NmMessageEvent, const NmId &, const QList<NmId> &)),
-            Qt::UniqueConnection );
-
+     
+    // Connect sync state changed
+    if (plugin){
         QObject::connect(
             plugin, SIGNAL(syncStateEvent(NmSyncState, const NmOperationCompletionEvent &)),
             this, SLOT(handleSyncStateEvent(NmSyncState, const NmOperationCompletionEvent &)),
-            Qt::UniqueConnection);        
-        // no need for mailbox event subscription here, already done in constructor
+            Qt::UniqueConnection);
     }
-    QList<NmMessageEnvelope*> messageEnvelopeList;
-    mDataManager->listMessages(mailboxId, folderId, messageEnvelopeList);
-    mMessageListModel->refresh(mailboxId, folderId, messageEnvelopeList);
-    while (!messageEnvelopeList.isEmpty()) {
-        delete messageEnvelopeList.takeFirst();
+    NmMessageListModel* ret(NULL);
+    if (isInbox){
+        ret = mInboxListModel;    
+        // Inbox list model is queried, other model is not
+        // needed anymore and memory should be freeded
+        if (mMessageListModel){
+            delete mMessageListModel;
+            mMessageListModel=NULL;
+        }
     }
-    return *mMessageListModel;
+    else {
+        ret = mMessageListModel;    
+    }
+    return *ret;
 }
 
 
 /*!
-    Returns a reference of the message search list model. If the model does not
-    exist yet, one is constructed.
+    Returns a message list model used in the search view.
 
-    \param sourceModel The source model for the search list model.
+    \param mailboxId The ID of the mailbox to search messages from.
 
-    \return The message search list model.
+    \return A message list model.
 */
-NmMessageSearchListModel &NmUiEngine::messageSearchListModel(
-    QAbstractItemModel *sourceModel)
+NmMessageListModel &NmUiEngine::messageListModelForSearch(const NmId &mailboxId)
 {
+    NM_FUNCTION;
+    
+    Q_UNUSED(mailboxId);
+
     if (!mMessageSearchListModel) {
-        mMessageSearchListModel = new NmMessageSearchListModel();
+        mMessageSearchListModel = new NmMessageListModel(*mDataManager);
+        mMessageSearchListModel->setIgnoreFolderIds(true);
+    }
+    else {
+        mMessageSearchListModel->clear();
     }
 
-    mMessageSearchListModel->setSourceModel(sourceModel);
+    QObject *plugin = mPluginFactory->pluginInstance(mailboxId);
+
+    if (plugin) {
+        QObject::connect(plugin,
+            SIGNAL(messageEvent(NmMessageEvent, const NmId &, const QList<NmId> &, const NmId &)),
+            mMessageSearchListModel,
+            SLOT(handleMessageEvent(NmMessageEvent, const NmId &, const QList<NmId> &, const NmId &)),
+            Qt::UniqueConnection);
+    }
+
+    // Refresh to set the mailbox ID.
+    QList<NmMessageEnvelope*> messageEnvelopeList;
+    mMessageSearchListModel->refresh(mailboxId, 0, messageEnvelopeList);
+
     return *mMessageSearchListModel;
 }
 
@@ -247,6 +343,8 @@
     const NmId &mailboxId,
     NmFolderType folderType)
 {
+    NM_FUNCTION;
+    
     NmId value;
     if (folderType != NmFolderOther) {
         NmDataPluginInterface *plugin =
@@ -267,6 +365,8 @@
                       const NmId &folderId,
                       const NmId &messageId)
 {
+    NM_FUNCTION;
+    
     NmMessage *message = mDataManager->message(mailboxId, folderId, messageId);
     return message;
 }
@@ -278,7 +378,8 @@
     const NmId &folderId,
     const NmId &messageId )
 {
-    NMLOG("NmUiEngine::fetchMessage() <---");
+    NM_FUNCTION;
+    
     QPointer<NmOperation> value(NULL);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
@@ -297,7 +398,8 @@
     const NmId &messageId,
     const NmId &messagePartId)
 {
-    NMLOG("NmUiEngine::fetchMessagePart() <---");
+    NM_FUNCTION;
+    
     QPointer<NmOperation> value(NULL);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
@@ -310,12 +412,34 @@
 /*!
 
 */
+QPointer<NmOperation> NmUiEngine::fetchMessageParts(
+    const NmId &mailboxId,
+    const NmId &folderId,
+    const NmId &messageId,
+    const QList<NmId> &messagePartIds)
+{
+    NM_FUNCTION;
+    
+    QPointer<NmOperation> value(NULL);
+    NmDataPluginInterface *plugin =
+        mPluginFactory->interfaceInstance(mailboxId);
+    if (plugin) {
+        value = plugin->fetchMessageParts(mailboxId, folderId, messageId, messagePartIds);
+    }
+    return value;
+}
+
+/*!
+
+*/
 XQSharableFile NmUiEngine::messagePartFile(
         const NmId &mailboxId,
         const NmId &folderId,
         const NmId &messageId,
         const NmId &messagePartId)
 {
+    NM_FUNCTION;
+    
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
     if (plugin) {
@@ -335,33 +459,70 @@
     const NmId &messageId,
     NmMessagePart &messagePart)
 {
+    NM_FUNCTION;
+    
     return mDataManager->contentToMessagePart(mailboxId, folderId, messageId, messagePart);
 }
 
+
 /*!
-    Deletes messages from model and routes call to plugin
+    Deletes messages from the model and forwards the call to plugin.
+
+    \param mailboxId The ID of the mailbox which contains the deleted message(s).
+    \param folderId The ID of the folder which contains the deleted message(s).
+    \param messageIdList A list containing the IDs of the message to be deleted.
+
+    \return A possible error code (returned by the plugin).
 */
-int NmUiEngine::deleteMessages(
-	const NmId &mailboxId,
-	const NmId &folderId,
-	const QList<NmId> &messageIdList)
+int NmUiEngine::deleteMessages(const NmId &mailboxId,
+                               const NmId &folderId,
+                               const QList<NmId> &messageIdList)
 {
+    NM_FUNCTION;
+    
     int result(NmNotFoundError);
-	if (mMessageListModel) {
-	    mMessageListModel->handleMessageEvent(NmMessageDeleted, folderId, messageIdList);
+    
+    bool isInbox(false);
+    if (standardFolderId(mailboxId,NmFolderInbox)==folderId){
+        isInbox=true;
+    } 
+    if (isInbox&&mInboxListModel){
+        mInboxListModel->handleMessageEvent(NmMessageDeleted, folderId,
+                                               messageIdList, mailboxId);   
+    }   
+    else if (mMessageListModel) {
+	    mMessageListModel->handleMessageEvent(NmMessageDeleted, folderId,
+                                              messageIdList, mailboxId);
 	}
+
+	// If the search list model exists and contains message, remove the
+	// message from it too.
+	if (mMessageSearchListModel && mMessageSearchListModel->rowCount()) {
+        mMessageSearchListModel->handleMessageEvent(NmMessageDeleted, folderId,
+                                                    messageIdList, mailboxId);
+	}
+
     NmDataPluginInterface *plugin =
-            mPluginFactory->interfaceInstance(mailboxId);
+        mPluginFactory->interfaceInstance(mailboxId);
+
     if (plugin) {
-          result = plugin->deleteMessages(
-	            mailboxId, folderId, messageIdList);
+          result = plugin->deleteMessages(mailboxId, folderId, messageIdList);
     }
+
 	return result;
 }
 
+
 /*!
-    Sets envelope property given in argument.
-    Operation is automatically deleted after completion or cancelling.
+    Sets the envelope property for the given envelopes.
+    The operation is automatically deleted after the completion or cancelling.
+
+    \param mailboxId The ID of the mailbox containing the envelope(s).
+    \param folderId The ID of the folder containing the envelope(s).
+    \param property The property to set.
+    \param envelopeList The list containing the envelopes.
+
+    \return The constructed operation.
 */
 QPointer<NmStoreEnvelopesOperation> NmUiEngine::setEnvelopes(
         const NmId &mailboxId,
@@ -369,26 +530,42 @@
         NmEnvelopeProperties property,
         const QList<const NmMessageEnvelope*> &envelopeList)
 {
-    NMLOG("NmUiEngine::setEnvelopes() <---");
+    NM_FUNCTION;
+    
     QPointer<NmStoreEnvelopesOperation> operation(NULL);
-    if (mMessageListModel && envelopeList.count()) {
+    NmMessageListModel *theMessageListModel = mMessageListModel;
+
+    if (!theMessageListModel) {
+        theMessageListModel = &messageListModel(mailboxId, folderId);
+    }
+
+    if (theMessageListModel && envelopeList.count()) {
         QList<NmId> messageIdList;
         
         for (int i(0); i < envelopeList.count(); i++){
             messageIdList.append(envelopeList[i]->messageId());
         }
-        mMessageListModel->setEnvelopeProperties(
-                           property, messageIdList);
-        // Store new envelopes to plugin
+
+        theMessageListModel->setEnvelopeProperties(property, messageIdList);
+
+        if (mMessageSearchListModel && mMessageSearchListModel->rowCount()) {
+            // Update the envelopes in the search list model as well.
+            mMessageSearchListModel->setEnvelopeProperties(property,
+                                                           messageIdList);
+        }
+
+        // Store the new envelopes to plugin.
         NmDataPluginInterface *plugin =
             mPluginFactory->interfaceInstance(mailboxId);
+
         if (plugin) {
-            operation = plugin->storeEnvelopes(
-                    mailboxId, folderId, envelopeList);
+            operation =
+                plugin->storeEnvelopes(mailboxId, folderId, envelopeList);
         }
+
         messageIdList.clear();
-    }  
-    NMLOG("NmUiEngine::setEnvelopes() --->");
+    }
+
     return operation;
 }
 
@@ -422,7 +599,8 @@
 */
 QPointer<NmMessageCreationOperation> NmUiEngine::createNewMessage(const NmId &mailboxId)
 {
-    NMLOG("NmUiEngine::createNewMessage() <---");
+    NM_FUNCTION;
+    
     QPointer<NmMessageCreationOperation> value(NULL);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
@@ -440,7 +618,8 @@
         const NmId &mailboxId,
         const NmId &originalMessageId)
 {
-    NMLOG("NmUiEngine::createForwardMessage() <---");
+    NM_FUNCTION;
+    
     QPointer<NmMessageCreationOperation> value(NULL);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
@@ -459,7 +638,8 @@
         const NmId &originalMessageId,
         bool replyAll)
 {
-    NMLOG("NmUiEngine::createReplyMessage() <---");
+    NM_FUNCTION;
+    
     QPointer<NmMessageCreationOperation> value(NULL);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
@@ -474,6 +654,8 @@
 */
 int NmUiEngine::saveMessage(const NmMessage &message)
 {
+    NM_FUNCTION;
+    
     const NmId &mailboxId = message.envelope().mailboxId();
     int ret(NmNotFoundError);
     NmDataPluginInterface *plugin =
@@ -489,11 +671,17 @@
 */
 int NmUiEngine::refreshMailbox(const NmId &mailboxId )
 {
+    NM_FUNCTION;
+    
     int ret(NmNotFoundError);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
     if (plugin) {
         ret = plugin->refreshMailbox(mailboxId);
+        if (NmNoError == ret) {
+            HbIndicator indicator;
+            indicator.activate(syncIndicatorName, QVariant());
+        }
     }
     return ret;
 }
@@ -503,6 +691,8 @@
 */
 int NmUiEngine::goOnline(const NmId &mailboxId )
 {
+    NM_FUNCTION;
+    
     int ret(NmNotFoundError);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
@@ -517,6 +707,8 @@
 */
 int NmUiEngine::goOffline(const NmId &mailboxId )
 {
+    NM_FUNCTION;
+    
     int ret(NmNotFoundError);
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(mailboxId);
@@ -535,6 +727,8 @@
     const NmId &folderId,
     const NmId &messageId)
 {
+    NM_FUNCTION;
+    
     int result(NmNotFoundError);
     NmDataPluginInterface *plugin =
             mPluginFactory->interfaceInstance(mailboxId);
@@ -546,10 +740,83 @@
 
 
 /*!
+  Handles draft message deletion after editor has closed, takes ownership of message. 
+ */
+void NmUiEngine::removeDraftMessage(NmMessage *message)
+{
+    NM_FUNCTION;
+
+    if (message) {
+        NmDataPluginInterface *plugin =
+            mPluginFactory->interfaceInstance(message->envelope().mailboxId());
+        
+        if (plugin) {
+            // to be on the safer side:
+            // we shouldn't even be here if mRemoveDraftOperation != NULL
+            if (mRemoveDraftOperation && mRemoveDraftOperation->isRunning()) {
+                mRemoveDraftOperation->cancelOperation();
+            }
+            // ownership of message changes
+            mRemoveDraftOperation = plugin->removeDraftMessage(message);
+            
+            if (mRemoveDraftOperation) {
+                connect(mRemoveDraftOperation, 
+                        SIGNAL(operationCompleted(int)), 
+                        this, 
+                        SLOT(handleCompletedRemoveDraftOperation()));
+            }
+        }
+    }    
+}
+
+/*!
+    Handles draft message saving after editor has closed, takes ownership of message.
+ */
+void NmUiEngine::saveDraftMessage(NmMessage *message,
+                                  const QList<NmOperation*> &preliminaryOperations)
+{
+    NM_FUNCTION;
+    
+    if (message) {
+        NmDataPluginInterface *plugin =
+            mPluginFactory->interfaceInstance(message->envelope().mailboxId());
+        
+        if (plugin) {
+            // to be on the safer side:
+            // we shouldn't even be here if mSaveDraftOperation != NULL
+            if (mSaveDraftOperation && mSaveDraftOperation->isRunning()) {
+                mSaveDraftOperation->cancelOperation();
+            }
+            // ownership of message changes
+            mSaveDraftOperation = plugin->saveMessageWithSubparts(*message);
+            // don't put this to mOperations as we need to handle this
+            // operation separately
+            if (mSaveDraftOperation) {
+                for (int i(0); i < preliminaryOperations.count(); i++ ) {
+                    QPointer<NmOperation> op = preliminaryOperations[i];
+                    mSaveDraftOperation->addPreliminaryOperation(op);
+                }
+                
+                connect(mSaveDraftOperation, 
+                        SIGNAL(operationCompleted(int)), 
+                        this, 
+                        SLOT(handleCompletedSaveDraftOperation()));
+                
+                // message object is not needed any more, so delete it
+                delete message;
+                message = NULL;
+            }
+        }
+    }
+}
+
+/*!
     Sends the given message.
  */
 void NmUiEngine::sendMessage(NmMessage *message, const QList<NmOperation *> &preliminaryOperations)
 {
+    NM_FUNCTION;
+    
     //First trigger message storing
     if (message) {
         NmDataPluginInterface *plugin =
@@ -585,6 +852,8 @@
  */
 bool NmUiEngine::isSendingMessage() const
 {
+    NM_FUNCTION;
+    
     int ret(false);
     if (mSendOperation && mSendOperation->isRunning()) {
         ret = true;
@@ -597,6 +866,8 @@
  */
 const NmMessage *NmUiEngine::messageBeingSent() const
 {
+    NM_FUNCTION;
+    
     const NmMessage *message = NULL;
     
     if (mSendOperation != NULL) {
@@ -614,7 +885,8 @@
     const NmMessage &message,
     const QList<QString> &fileList)
 {
-    NMLOG("NmUiEngine::addAttachments() <---");
+    NM_FUNCTION;
+    
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(message.envelope().mailboxId());
     
@@ -633,7 +905,8 @@
     const NmMessage &message,
     const NmId &attachmentPartId)
 {
-    NMLOG("NmUiEngine::removeAttachments() <---");
+    NM_FUNCTION;
+    
     NmDataPluginInterface *plugin =
         mPluginFactory->interfaceInstance(message.envelope().mailboxId());
     
@@ -645,26 +918,12 @@
 }
 
 /*!
-    Operation is automatically deleted after completion or cancelling.
- */
-QPointer<NmCheckOutboxOperation> NmUiEngine::checkOutbox(const NmId &mailboxId)
-{
-    NMLOG("NmUiEngine::checkOutbox() <---");
-    NmDataPluginInterface *plugin =
-        mPluginFactory->interfaceInstance(mailboxId);
-
-    QPointer<NmCheckOutboxOperation> ret(NULL); 
-    if (plugin) {
-        ret = plugin->checkOutbox(mailboxId);
-    }  
-    return ret;
-}
-
-/*!
     Returns the current sync state of the mailbox
  */
 NmSyncState NmUiEngine::syncState(const NmId& mailboxId)
 {
+    NM_FUNCTION;
+    
     NmDataPluginInterface *plugin =
                 mPluginFactory->interfaceInstance(mailboxId);
     if (plugin) {
@@ -680,6 +939,8 @@
  */
 NmConnectState NmUiEngine::connectionState(const NmId& mailboxId)
 {
+    NM_FUNCTION;
+    
     NmDataPluginInterface *plugin =
                 mPluginFactory->interfaceInstance(mailboxId);
     if (plugin) {
@@ -702,18 +963,24 @@
 int NmUiEngine::search(const NmId &mailboxId,
                        const QStringList &searchStrings)
 {
+    NM_FUNCTION;
+    
     // Get the plugin instance.
     QObject *pluginInstance = mPluginFactory->pluginInstance(mailboxId);
 
     if (pluginInstance) {
         // Make sure the required signals are connected.
-        connect(pluginInstance, SIGNAL(matchFound(const NmId &)),
-                this, SIGNAL(matchFound(const NmId &)), Qt::UniqueConnection);    
-        connect(pluginInstance, SIGNAL(matchFound(const NmId &)),
-                mMessageSearchListModel, SLOT(addSearchResult(const NmId &)),
+        connect(pluginInstance, SIGNAL(matchFound(const NmId &, const NmId &)),
+                this, SIGNAL(matchFound(const NmId &, const NmId &)),
+                Qt::UniqueConnection);
+
+        connect(pluginInstance, SIGNAL(matchFound(const NmId &, const NmId &)),
+                this, SLOT(handleMatchFound(const NmId &, const NmId &)),
+                Qt::UniqueConnection); 
+
+        connect(pluginInstance, SIGNAL(searchComplete()),
+                this, SIGNAL(searchComplete()),
                 Qt::UniqueConnection);    
-        connect(pluginInstance, SIGNAL(searchComplete()),
-                this, SIGNAL(searchComplete()), Qt::UniqueConnection);    
     }
 
     int retVal(NmNoError);
@@ -740,6 +1007,8 @@
 */
 int NmUiEngine::cancelSearch(const NmId &mailboxId)
 {
+    NM_FUNCTION;
+    
     int retVal(NmNoError);
 
     // Get the plugin interface.
@@ -754,53 +1023,77 @@
 }
 
 /*!
-    Cancels the search operation if one is ongoing.
-
-    \param mailboxId The ID of the mailbox containing the folder
-
-    \param folderId The ID of the folder 
-
     \return Folder type
 */
 NmFolderType NmUiEngine::folderTypeById(NmId mailboxId, NmId folderId)
 {
-    NmFolderType folderType(NmFolderOther);
-    if (standardFolderId(mailboxId,NmFolderInbox)==folderId){
-        folderType=NmFolderInbox;
-    }
-    else if (standardFolderId(mailboxId,NmFolderOutbox)==folderId){
-        folderType=NmFolderOutbox; 
+    NM_FUNCTION;
+    
+    NmFolderType ret(NmFolderInbox);
+    if (mDataManager){
+        ret = mDataManager->folderTypeById(mailboxId,folderId);    
     }
-    else if (standardFolderId(mailboxId,NmFolderDrafts)==folderId){
-        folderType=NmFolderDrafts;
+    return ret;
+}
+
+/*!
+    Indicates application state information to protocol plugin
+    \param mailboxId Id of active mailbox, 0 if application is closed.
+    \param folderId Id of active folder, 0 if application is closed.
+*/
+void NmUiEngine::updateActiveFolder(const NmId &mailboxId, const NmId &folderId)
+{
+    NM_FUNCTION;
+    
+    NmApplicationStateInterface *interface = 
+        mPluginFactory->applicationStateInterfaceInstance(mailboxId);
+    if (interface) {
+        interface->updateActiveFolder(mailboxId, folderId);
     }
-    else if (standardFolderId(mailboxId,NmFolderSent)==folderId){
-        folderType=NmFolderSent; 
-    }    
-    else if (standardFolderId(mailboxId,NmFolderDeleted)==folderId){
-        folderType=NmFolderDeleted;  
-    }    
-    return folderType;
 }
+
 /*!
     Handle completed send operation.
 */
 void NmUiEngine::handleCompletedSendOperation()
 {
-    NMLOG("NmUiEngine::handleCompletedSendOperation()");
+    NM_FUNCTION;
+    
     emit sendOperationCompleted();
 }
 
 /*!
+    Handle completed remove draft operation.
+*/
+void NmUiEngine::handleCompletedRemoveDraftOperation()
+{
+    NM_FUNCTION;
+    
+    // draft message deletion observing not yet implemented...
+}
+
+/*!
+    Handle completed save draft operation.
+*/
+void NmUiEngine::handleCompletedSaveDraftOperation()
+{
+    NM_FUNCTION;
+    
+    // draft message saving observing not yet implemented...
+}
+
+/*!
     Handles synch operation related events
  */
 void NmUiEngine::handleSyncStateEvent(NmSyncState syncState, const NmOperationCompletionEvent &event)
 {
-    NMLOG("NmUiEngine::handleSyncStateEvent()");
-
+    NM_FUNCTION;
+    
     if ( syncState == SyncComplete ) {
         // signal for reporting about (sync) operation completion status
         emit operationCompleted(event);
+        HbIndicator indicator;
+        indicator.deactivate(syncIndicatorName, QVariant());
     }
 
     // signal for handling sync state icons
@@ -816,6 +1109,8 @@
                                     const QList<NmId> &messageIds, 
                                     const NmId& mailboxId)
 {
+    NM_FUNCTION;
+    
     switch (event) {
         case NmMessageDeleted:
         {
@@ -836,6 +1131,8 @@
 void NmUiEngine::handleMailboxEvent(NmMailboxEvent event,
                                     const QList<NmId> &mailboxIds)
 {
+    NM_FUNCTION;
+    
     switch (event) {
         case NmMailboxDeleted:
         {
@@ -849,11 +1146,68 @@
     }
 }
 
+
+/*!
+    Adds the found message into the search model.
+
+    \param messageId The ID of the found message.
+    \param folderId The ID of the folder where the message is located.
+*/
+void NmUiEngine::handleMatchFound(const NmId &messageId, const NmId &folderId)
+{
+    NM_FUNCTION;
+    
+    if (!mMessageSearchListModel) {
+        // No search list model!
+        return;
+    }
+
+    // Resolve the folder type.
+    NmId mailboxId = mMessageSearchListModel->currentMailboxId();
+    NmFolderType folderType = folderTypeById(mailboxId, folderId);
+
+    // Do not display matches from outbox or draft folders.
+    if (folderType != NmFolderOutbox && folderType != NmFolderDrafts) {
+        // Add the found message into the search model.
+        QList<NmId> messageIdList;
+        messageIdList.append(messageId);
+
+        mMessageSearchListModel->handleMessageEvent(NmMessageFound, folderId,
+                                                    messageIdList, mailboxId);
+    }
+}
+
+/*!
+    Function sens events from plugin to both models. Inbox model for
+    active mailbox is always alove whereas mMessageListModel can represent
+    other folder in the device (sent, outbox, drafts, etc.)
+*/
+void NmUiEngine::messageEventForListModel(NmMessageEvent event,
+                        const NmId &folderId,
+                        const QList<NmId> &messageIds, 
+                        const NmId& mailboxId)
+{
+    NM_FUNCTION;
+    
+    // Forward event to both list models. Models will take care of checking
+    // whether event really belongs to current mailbox & folder
+    if (mInboxListModel){
+        mInboxListModel->handleMessageEvent(event, folderId,
+                                            messageIds, mailboxId);   
+    }
+    if (mMessageListModel){
+        mMessageListModel->handleMessageEvent(event, folderId,
+                                              messageIds, mailboxId);    
+    }  
+}
+
 /*!
     receives events when going online, and offline.
 */
 void NmUiEngine::handleConnectEvent(NmConnectState connectState, const NmId &mailboxId, const int errorCode)
 {
+    NM_FUNCTION;
+    
     // signal for connection state icon handling
     emit connectionEvent(connectState, mailboxId);
 
--- a/emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def	Wed Jun 23 17:00:39 2010 +0100
@@ -1,146 +1,140 @@
 EXPORTS
 	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *, int)
-	?screenSize@NmAttachmentListItem@@AAE?AVQSize@@W4Orientation@Qt@@@Z @ 2 NONAME ; class QSize NmAttachmentListItem::screenSize(enum Qt::Orientation)
-	?itemActivated@NmAttachmentListWidget@@IAEXH@Z @ 3 NONAME ; void NmAttachmentListWidget::itemActivated(int)
-	?textCursor@NmHtmlLineEdit@@QBE?AVQTextCursor@@XZ @ 4 NONAME ; class QTextCursor NmHtmlLineEdit::textCursor(void) const
-	?keyPressEvent@NmRecipientLineEdit@@MAEXPAVQKeyEvent@@@Z @ 5 NONAME ; void NmRecipientLineEdit::keyPressEvent(class QKeyEvent *)
-	?sendMouseReleaseEvent@NmEditorTextEdit@@QAEXPAVQGraphicsSceneMouseEvent@@@Z @ 6 NONAME ; void NmEditorTextEdit::sendMouseReleaseEvent(class QGraphicsSceneMouseEvent *)
-	?paint@NmAttachmentListWidget@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 7 NONAME ; void NmAttachmentListWidget::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *)
-	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 8 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *, int)
-	?toHtml@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 9 NONAME ; class QString NmHtmlLineEdit::toHtml(void) const
-	?resetFileNameLength@NmAttachmentListItem@@QAEXW4Orientation@Qt@@@Z @ 10 NONAME ; void NmAttachmentListItem::resetFileNameLength(enum Qt::Orientation)
-	?metaObject@NmBaseViewScrollArea@@UBEPBUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const * NmBaseViewScrollArea::metaObject(void) const
-	?init@NmEditorTextEdit@@QAEXPAVNmBaseViewScrollArea@@@Z @ 12 NONAME ; void NmEditorTextEdit::init(class NmBaseViewScrollArea *)
-	?emailAddressList@NmRecipientLineEdit@@QAE?AV?$QList@VNmAddress@@@@XZ @ 13 NONAME ; class QList<class NmAddress> NmRecipientLineEdit::emailAddressList(void)
-	?getStaticMetaObject@NmAttachmentListItem@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & NmAttachmentListItem::getStaticMetaObject(void)
-	?getStaticMetaObject@NmBaseViewScrollArea@@SAABUQMetaObject@@XZ @ 15 NONAME ; struct QMetaObject const & NmBaseViewScrollArea::getStaticMetaObject(void)
-	?getStaticMetaObject@NmAttachmentListWidget@@SAABUQMetaObject@@XZ @ 16 NONAME ; struct QMetaObject const & NmAttachmentListWidget::getStaticMetaObject(void)
-	??_ENmAttachmentListItem@@UAE@I@Z @ 17 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(unsigned int)
-	?sendMouseMoveEvent@NmEditorTextEdit@@QAEXPAVQGraphicsSceneMouseEvent@@@Z @ 18 NONAME ; void NmEditorTextEdit::sendMouseMoveEvent(class QGraphicsSceneMouseEvent *)
-	?updateEditorHeight@NmEditorTextEdit@@QAEXXZ @ 19 NONAME ; void NmEditorTextEdit::updateEditorHeight(void)
-	?qt_metacast@NmHtmlLineEdit@@UAEPAXPBD@Z @ 20 NONAME ; void * NmHtmlLineEdit::qt_metacast(char const *)
-	?metaObject@NmEditorTextEdit@@UBEPBUQMetaObject@@XZ @ 21 NONAME ; struct QMetaObject const * NmEditorTextEdit::metaObject(void) const
-	?setFileNameText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 22 NONAME ; void NmAttachmentListItem::setFileNameText(class QString const &)
-	?qt_metacast@NmBaseViewScrollArea@@UAEPAXPBD@Z @ 23 NONAME ; void * NmBaseViewScrollArea::qt_metacast(char const *)
-	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *, int)
-	?qt_metacall@NmAttachmentListWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 25 NONAME ; int NmAttachmentListWidget::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 26 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *, int)
-	?qt_metacall@NmRecipientLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 27 NONAME ; int NmRecipientLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??0NmAttachmentListItem@@QAE@PAVQGraphicsItem@@@Z @ 28 NONAME ; NmAttachmentListItem::NmAttachmentListItem(class QGraphicsItem *)
-	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 29 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *, int)
-	??1NmHtmlLineEdit@@UAE@XZ @ 30 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(void)
-	?setProgressBarValue@NmAttachmentListItem@@QAEXH@Z @ 31 NONAME ; void NmAttachmentListItem::setProgressBarValue(int)
-	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *)
-	??0NmRecipientLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 33 NONAME ; NmRecipientLineEdit::NmRecipientLineEdit(class QGraphicsItem *)
-	?setAttachmentSize@NmAttachmentListWidget@@QAEXHABVQString@@@Z @ 34 NONAME ; void NmAttachmentListWidget::setAttachmentSize(int, class QString const &)
-	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 35 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *, int)
-	?setPlainText@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 36 NONAME ; void NmHtmlLineEdit::setPlainText(class QString const &)
-	?longPressGesture@NmBaseViewScrollArea@@MAEXABVQPointF@@@Z @ 37 NONAME ; void NmBaseViewScrollArea::longPressGesture(class QPointF const &)
-	?updateCustomTextColor@NmEditorTextEdit@@QAEXXZ @ 38 NONAME ; void NmEditorTextEdit::updateCustomTextColor(void)
-	?orientationChanged@NmAttachmentListWidget@@AAEXW4Orientation@Qt@@@Z @ 39 NONAME ; void NmAttachmentListWidget::orientationChanged(enum Qt::Orientation)
-	?insertSelectedContacts@NmRecipientLineEdit@@QAEXABVQVariant@@@Z @ 40 NONAME ; void NmRecipientLineEdit::insertSelectedContacts(class QVariant const &)
-	?qt_metacast@NmAttachmentListWidget@@UAEPAXPBD@Z @ 41 NONAME ; void * NmAttachmentListWidget::qt_metacast(char const *)
-	?getStaticMetaObject@NmHtmlLineEdit@@SAABUQMetaObject@@XZ @ 42 NONAME ; struct QMetaObject const & NmHtmlLineEdit::getStaticMetaObject(void)
-	?qt_metacall@NmEditorTextEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 43 NONAME ; int NmEditorTextEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??1NmAttachmentListWidget@@UAE@XZ @ 44 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(void)
-	??_ENmRecipientLineEdit@@UAE@I@Z @ 45 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(unsigned int)
-	?qt_metacast@NmRecipientLineEdit@@UAEPAXPBD@Z @ 46 NONAME ; void * NmRecipientLineEdit::qt_metacast(char const *)
-	?setCustomTextColor@NmEditorTextEdit@@QAEXABU?$QPair@_NVQColor@@@@@Z @ 47 NONAME ; void NmEditorTextEdit::setCustomTextColor(struct QPair<bool, class QColor> const &)
-	?setDocument@NmHtmlLineEdit@@QAEXPAVQTextDocument@@@Z @ 48 NONAME ; void NmHtmlLineEdit::setDocument(class QTextDocument *)
-	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 49 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *)
-	??0NmBaseViewScrollArea@@QAE@PAVQGraphicsItem@@@Z @ 50 NONAME ; NmBaseViewScrollArea::NmBaseViewScrollArea(class QGraphicsItem *)
-	?longPressed@NmAttachmentListWidget@@IAEXHVQPointF@@@Z @ 51 NONAME ; void NmAttachmentListWidget::longPressed(int, class QPointF)
-	?staticMetaObject@NmEditorTextEdit@@2UQMetaObject@@B @ 52 NONAME ; struct QMetaObject const NmEditorTextEdit::staticMetaObject
-	??0NmEditorTextEdit@@QAE@PAVQGraphicsItem@@@Z @ 53 NONAME ; NmEditorTextEdit::NmEditorTextEdit(class QGraphicsItem *)
-	??_ENmEditorTextEdit@@UAE@I@Z @ 54 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(unsigned int)
-	?sendLongPressEvent@NmEditorTextEdit@@QAEXABVQPointF@@@Z @ 55 NONAME ; void NmEditorTextEdit::sendLongPressEvent(class QPointF const &)
-	?hideProgressBar@NmAttachmentListItem@@QAEXXZ @ 56 NONAME ; void NmAttachmentListItem::hideProgressBar(void)
-	?qt_metacast@NmAttachmentListItem@@UAEPAXPBD@Z @ 57 NONAME ; void * NmAttachmentListItem::qt_metacast(char const *)
-	?handleMouseReleaseEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 58 NONAME ; void NmBaseViewScrollArea::handleMouseReleaseEvent(class QGraphicsSceneMouseEvent *)
-	?removeProgressBar@NmAttachmentListItem@@AAEXXZ @ 59 NONAME ; void NmAttachmentListItem::removeProgressBar(void)
-	??1NmBaseViewScrollArea@@UAE@XZ @ 60 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(void)
-	?sendMousePressEvent@NmEditorTextEdit@@QAEXPAVQGraphicsSceneMouseEvent@@@Z @ 61 NONAME ; void NmEditorTextEdit::sendMousePressEvent(class QGraphicsSceneMouseEvent *)
-	??_ENmHtmlLineEdit@@UAE@I@Z @ 62 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(unsigned int)
-	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 63 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *, int)
-	?handleMousePressEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 64 NONAME ; void NmBaseViewScrollArea::handleMousePressEvent(class QGraphicsSceneMouseEvent *)
-	?insertItemToLayout@NmAttachmentListWidget@@AAEXPAVNmAttachmentListItem@@@Z @ 65 NONAME ; void NmAttachmentListWidget::insertItemToLayout(class NmAttachmentListItem *)
-	?metaObject@NmHtmlLineEdit@@UBEPBUQMetaObject@@XZ @ 66 NONAME ; struct QMetaObject const * NmHtmlLineEdit::metaObject(void) const
-	?editorContentHeightChanged@NmEditorTextEdit@@IAEXXZ @ 67 NONAME ; void NmEditorTextEdit::editorContentHeightChanged(void)
-	?setTextColor@NmAttachmentListItem@@QAEXVQColor@@@Z @ 68 NONAME ; void NmAttachmentListItem::setTextColor(class QColor)
-	??1NmAttachmentListItem@@UAE@XZ @ 69 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(void)
-	?count@NmAttachmentListWidget@@QBEHXZ @ 70 NONAME ; int NmAttachmentListWidget::count(void) const
-	?handleTextChanged@NmRecipientLineEdit@@AAEXABVQString@@@Z @ 71 NONAME ; void NmRecipientLineEdit::handleTextChanged(class QString const &)
-	?longPressedActivated@NmAttachmentListItem@@AAEXXZ @ 72 NONAME ; void NmAttachmentListItem::longPressedActivated(void)
-	?handleLongPressGesture@NmBaseViewScrollArea@@IAEXABVQPointF@@@Z @ 73 NONAME ; void NmBaseViewScrollArea::handleLongPressGesture(class QPointF const &)
-	?updateScrollPosition@NmEditorTextEdit@@QAEXABVQPointF@@@Z @ 74 NONAME ; void NmEditorTextEdit::updateScrollPosition(class QPointF const &)
-	?contentHeight@NmEditorTextEdit@@QBEMXZ @ 75 NONAME ; float NmEditorTextEdit::contentHeight(void) const
-	?qt_metacast@NmEditorTextEdit@@UAEPAXPBD@Z @ 76 NONAME ; void * NmEditorTextEdit::qt_metacast(char const *)
-	?mouseMoveEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 77 NONAME ; void NmBaseViewScrollArea::mouseMoveEvent(class QGraphicsSceneMouseEvent *)
-	?qt_metacall@NmAttachmentListItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 78 NONAME ; int NmAttachmentListItem::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?handleLongPressed@NmAttachmentListWidget@@AAEXVQPointF@@@Z @ 79 NONAME ; void NmAttachmentListWidget::handleLongPressed(class QPointF)
-	?staticMetaObject@NmBaseViewScrollArea@@2UQMetaObject@@B @ 80 NONAME ; struct QMetaObject const NmBaseViewScrollArea::staticMetaObject
-	?setHeaderHeight@NmEditorTextEdit@@QAEXH@Z @ 81 NONAME ; void NmEditorTextEdit::setHeaderHeight(int)
-	?init@NmAttachmentListWidget@@AAEXXZ @ 82 NONAME ; void NmAttachmentListWidget::init(void)
-	?rearrangeLayout@NmAttachmentListWidget@@AAEXXZ @ 83 NONAME ; void NmAttachmentListWidget::rearrangeLayout(void)
-	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 84 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *)
-	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 85 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *)
-	?metaObject@NmRecipientLineEdit@@UBEPBUQMetaObject@@XZ @ 86 NONAME ; struct QMetaObject const * NmRecipientLineEdit::metaObject(void) const
-	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 87 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *)
-	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 88 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *)
-	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 89 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *)
-	?setFileSizeText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 90 NONAME ; void NmAttachmentListItem::setFileSizeText(class QString const &)
-	?customTextColor@NmEditorTextEdit@@QBE?AU?$QPair@_NVQColor@@@@XZ @ 91 NONAME ; struct QPair<bool, class QColor> NmEditorTextEdit::customTextColor(void) const
-	?staticMetaObject@NmHtmlLineEdit@@2UQMetaObject@@B @ 92 NONAME ; struct QMetaObject const NmHtmlLineEdit::staticMetaObject
-	?inputMethodEvent@NmRecipientLineEdit@@MAEXPAVQInputMethodEvent@@@Z @ 93 NONAME ; void NmRecipientLineEdit::inputMethodEvent(class QInputMethodEvent *)
-	?mouseReleaseEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 94 NONAME ; void NmBaseViewScrollArea::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
-	?constructUi@NmAttachmentListWidget@@AAEXXZ @ 95 NONAME ; void NmAttachmentListWidget::constructUi(void)
-	?toPlainText@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 96 NONAME ; class QString NmHtmlLineEdit::toPlainText(void) const
-	?getStaticMetaObject@NmEditorTextEdit@@SAABUQMetaObject@@XZ @ 97 NONAME ; struct QMetaObject const & NmEditorTextEdit::getStaticMetaObject(void)
-	?setScrollPosition@NmEditorTextEdit@@QAEXHH@Z @ 98 NONAME ; void NmEditorTextEdit::setScrollPosition(int, int)
-	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 99 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *)
-	?staticMetaObject@NmAttachmentListItem@@2UQMetaObject@@B @ 100 NONAME ; struct QMetaObject const NmAttachmentListItem::staticMetaObject
-	??_ENmBaseViewScrollArea@@UAE@I@Z @ 101 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(unsigned int)
-	?itemLongPressed@NmAttachmentListItem@@IAEXVQPointF@@@Z @ 102 NONAME ; void NmAttachmentListItem::itemLongPressed(class QPointF)
-	?progressBarValue@NmAttachmentListItem@@QBEHXZ @ 103 NONAME ; int NmAttachmentListItem::progressBarValue(void) const
-	?setCustomTextColor@NmEditorTextEdit@@QAEX_NABVQColor@@@Z @ 104 NONAME ; void NmEditorTextEdit::setCustomTextColor(bool, class QColor const &)
-	??0NmHtmlLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 105 NONAME ; NmHtmlLineEdit::NmHtmlLineEdit(class QGraphicsItem *)
-	?init@NmAttachmentListItem@@AAEXXZ @ 106 NONAME ; void NmAttachmentListItem::init(void)
-	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 107 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *)
-	??1NmEditorTextEdit@@UAE@XZ @ 108 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(void)
-	?generateEmailAddressList@NmRecipientLineEdit@@AAEXXZ @ 109 NONAME ; void NmRecipientLineEdit::generateEmailAddressList(void)
-	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 110 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *)
-	?mousePressEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 111 NONAME ; void NmBaseViewScrollArea::mousePressEvent(class QGraphicsSceneMouseEvent *)
-	?handleItemActivated@NmAttachmentListWidget@@AAEXXZ @ 112 NONAME ; void NmAttachmentListWidget::handleItemActivated(void)
-	?metaObject@NmAttachmentListWidget@@UBEPBUQMetaObject@@XZ @ 113 NONAME ; struct QMetaObject const * NmAttachmentListWidget::metaObject(void) const
-	?constructUi@NmAttachmentListItem@@AAEXXZ @ 114 NONAME ; void NmAttachmentListItem::constructUi(void)
-	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 115 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *, int)
-	?setHtml@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 116 NONAME ; void NmHtmlLineEdit::setHtml(class QString const &)
-	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 117 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *, int)
-	?itemActivated@NmAttachmentListItem@@IAEXXZ @ 118 NONAME ; void NmAttachmentListItem::itemActivated(void)
-	?mouseReleaseEvent@NmAttachmentListItem@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 119 NONAME ; void NmAttachmentListItem::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
-	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 120 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *)
-	?getStaticMetaObject@NmRecipientLineEdit@@SAABUQMetaObject@@XZ @ 121 NONAME ; struct QMetaObject const & NmRecipientLineEdit::getStaticMetaObject(void)
-	?findItem@NmAttachmentListWidget@@AAEHPBVQObject@@@Z @ 122 NONAME ; int NmAttachmentListWidget::findItem(class QObject const *)
-	??1NmRecipientLineEdit@@UAE@XZ @ 123 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(void)
-	?removeAttachment@NmAttachmentListWidget@@QAEXH@Z @ 124 NONAME ; void NmAttachmentListWidget::removeAttachment(int)
-	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 125 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *, int)
-	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 126 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *, int)
-	?progressValue@NmAttachmentListWidget@@QBEHH@Z @ 127 NONAME ; int NmAttachmentListWidget::progressValue(int) const
-	?staticMetaObject@NmAttachmentListWidget@@2UQMetaObject@@B @ 128 NONAME ; struct QMetaObject const NmAttachmentListWidget::staticMetaObject
-	??_ENmAttachmentListWidget@@UAE@I@Z @ 129 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(unsigned int)
-	?setTextColor@NmAttachmentListWidget@@QAEXVQColor@@@Z @ 130 NONAME ; void NmAttachmentListWidget::setTextColor(class QColor)
-	?setTextCursor@NmHtmlLineEdit@@QAEXABVQTextCursor@@@Z @ 131 NONAME ; void NmHtmlLineEdit::setTextCursor(class QTextCursor const &)
-	?handleMouseMoveEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 132 NONAME ; void NmBaseViewScrollArea::handleMouseMoveEvent(class QGraphicsSceneMouseEvent *)
-	?staticMetaObject@NmRecipientLineEdit@@2UQMetaObject@@B @ 133 NONAME ; struct QMetaObject const NmRecipientLineEdit::staticMetaObject
-	?setProgressBarValue@NmAttachmentListWidget@@QAEXHH@Z @ 134 NONAME ; void NmAttachmentListWidget::setProgressBarValue(int, int)
-	?metaObject@NmAttachmentListItem@@UBEPBUQMetaObject@@XZ @ 135 NONAME ; struct QMetaObject const * NmAttachmentListItem::metaObject(void) const
-	?insertAttachment@NmAttachmentListWidget@@QAEXHABVQString@@0@Z @ 136 NONAME ; void NmAttachmentListWidget::insertAttachment(int, class QString const &, class QString const &)
-	?hideProgressBar@NmAttachmentListWidget@@QAEXH@Z @ 137 NONAME ; void NmAttachmentListWidget::hideProgressBar(int)
-	??0NmAttachmentListWidget@@QAE@PAVQGraphicsItem@@@Z @ 138 NONAME ; NmAttachmentListWidget::NmAttachmentListWidget(class QGraphicsItem *)
-	?mousePressEvent@NmAttachmentListItem@@MAEXPAVQGraphicsSceneMouseEvent@@@Z @ 139 NONAME ; void NmAttachmentListItem::mousePressEvent(class QGraphicsSceneMouseEvent *)
-	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 140 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *, int)
-	?document@NmHtmlLineEdit@@QBEPAVQTextDocument@@XZ @ 141 NONAME ; class QTextDocument * NmHtmlLineEdit::document(void) const
-	?qt_metacall@NmBaseViewScrollArea@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 142 NONAME ; int NmBaseViewScrollArea::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?qt_metacall@NmHtmlLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 143 NONAME ; int NmHtmlLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 144 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *)
+	?handleLongPressGesture@NmBaseViewScrollArea@@IAEXABVQPointF@@@Z @ 2 NONAME ; void NmBaseViewScrollArea::handleLongPressGesture(class QPointF const &)
+	?updateScrollPosition@NmEditorTextEdit@@QAEXABVQPointF@@@Z @ 3 NONAME ; void NmEditorTextEdit::updateScrollPosition(class QPointF const &)
+	?screenSize@NmAttachmentListItem@@AAE?AVQSize@@W4Orientation@Qt@@@Z @ 4 NONAME ; class QSize NmAttachmentListItem::screenSize(enum Qt::Orientation)
+	?qt_metacast@NmEditorTextEdit@@UAEPAXPBD@Z @ 5 NONAME ; void * NmEditorTextEdit::qt_metacast(char const *)
+	?itemActivated@NmAttachmentListWidget@@IAEXH@Z @ 6 NONAME ; void NmAttachmentListWidget::itemActivated(int)
+	?contentHeight@NmEditorTextEdit@@QBEMXZ @ 7 NONAME ; float NmEditorTextEdit::contentHeight(void) const
+	?mouseMoveEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 8 NONAME ; void NmBaseViewScrollArea::mouseMoveEvent(class QGraphicsSceneMouseEvent *)
+	?textCursor@NmHtmlLineEdit@@QBE?AVQTextCursor@@XZ @ 9 NONAME ; class QTextCursor NmHtmlLineEdit::textCursor(void) const
+	?qt_metacall@NmAttachmentListItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 10 NONAME ; int NmAttachmentListItem::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?keyPressEvent@NmRecipientLineEdit@@MAEXPAVQKeyEvent@@@Z @ 11 NONAME ; void NmRecipientLineEdit::keyPressEvent(class QKeyEvent *)
+	?handleLongPressed@NmAttachmentListWidget@@AAEXVQPointF@@@Z @ 12 NONAME ; void NmAttachmentListWidget::handleLongPressed(class QPointF)
+	?staticMetaObject@NmBaseViewScrollArea@@2UQMetaObject@@B @ 13 NONAME ; struct QMetaObject const NmBaseViewScrollArea::staticMetaObject
+	?setHeaderHeight@NmEditorTextEdit@@QAEXH@Z @ 14 NONAME ; void NmEditorTextEdit::setHeaderHeight(int)
+	?paint@NmAttachmentListWidget@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 15 NONAME ; void NmAttachmentListWidget::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *)
+	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 16 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *, int)
+	?init@NmAttachmentListWidget@@AAEXXZ @ 17 NONAME ; void NmAttachmentListWidget::init(void)
+	?rearrangeLayout@NmAttachmentListWidget@@AAEXXZ @ 18 NONAME ; void NmAttachmentListWidget::rearrangeLayout(void)
+	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *)
+	?toHtml@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 20 NONAME ; class QString NmHtmlLineEdit::toHtml(void) const
+	?resetFileNameLength@NmAttachmentListItem@@QAEXW4Orientation@Qt@@@Z @ 21 NONAME ; void NmAttachmentListItem::resetFileNameLength(enum Qt::Orientation)
+	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 22 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *)
+	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 23 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *)
+	?metaObject@NmRecipientLineEdit@@UBEPBUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const * NmRecipientLineEdit::metaObject(void) const
+	?metaObject@NmBaseViewScrollArea@@UBEPBUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const * NmBaseViewScrollArea::metaObject(void) const
+	?init@NmEditorTextEdit@@QAEXPAVNmBaseViewScrollArea@@@Z @ 26 NONAME ; void NmEditorTextEdit::init(class NmBaseViewScrollArea *)
+	?emailAddressList@NmRecipientLineEdit@@QAE?AV?$QList@VNmAddress@@@@XZ @ 27 NONAME ; class QList<class NmAddress> NmRecipientLineEdit::emailAddressList(void)
+	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 28 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *)
+	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 29 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *)
+	?getStaticMetaObject@NmAttachmentListItem@@SAABUQMetaObject@@XZ @ 30 NONAME ; struct QMetaObject const & NmAttachmentListItem::getStaticMetaObject(void)
+	?getStaticMetaObject@NmBaseViewScrollArea@@SAABUQMetaObject@@XZ @ 31 NONAME ; struct QMetaObject const & NmBaseViewScrollArea::getStaticMetaObject(void)
+	?getStaticMetaObject@NmAttachmentListWidget@@SAABUQMetaObject@@XZ @ 32 NONAME ; struct QMetaObject const & NmAttachmentListWidget::getStaticMetaObject(void)
+	??_ENmAttachmentListItem@@UAE@I@Z @ 33 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(unsigned int)
+	?updateEditorHeight@NmEditorTextEdit@@QAEXXZ @ 34 NONAME ; void NmEditorTextEdit::updateEditorHeight(void)
+	?setFileSizeText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 35 NONAME ; void NmAttachmentListItem::setFileSizeText(class QString const &)
+	?qt_metacast@NmHtmlLineEdit@@UAEPAXPBD@Z @ 36 NONAME ; void * NmHtmlLineEdit::qt_metacast(char const *)
+	?metaObject@NmEditorTextEdit@@UBEPBUQMetaObject@@XZ @ 37 NONAME ; struct QMetaObject const * NmEditorTextEdit::metaObject(void) const
+	?staticMetaObject@NmHtmlLineEdit@@2UQMetaObject@@B @ 38 NONAME ; struct QMetaObject const NmHtmlLineEdit::staticMetaObject
+	?setFileNameText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 39 NONAME ; void NmAttachmentListItem::setFileNameText(class QString const &)
+	?customTextColor@NmEditorTextEdit@@QBE?AU?$QPair@_NVQColor@@@@XZ @ 40 NONAME ; struct QPair<bool, class QColor> NmEditorTextEdit::customTextColor(void) const
+	?qt_metacast@NmBaseViewScrollArea@@UAEPAXPBD@Z @ 41 NONAME ; void * NmBaseViewScrollArea::qt_metacast(char const *)
+	?inputMethodEvent@NmRecipientLineEdit@@MAEXPAVQInputMethodEvent@@@Z @ 42 NONAME ; void NmRecipientLineEdit::inputMethodEvent(class QInputMethodEvent *)
+	?mouseReleaseEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 43 NONAME ; void NmBaseViewScrollArea::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 44 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *, int)
+	?qt_metacall@NmAttachmentListWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 45 NONAME ; int NmAttachmentListWidget::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 46 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *, int)
+	?constructUi@NmAttachmentListWidget@@AAEXXZ @ 47 NONAME ; void NmAttachmentListWidget::constructUi(void)
+	?qt_metacall@NmRecipientLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 48 NONAME ; int NmRecipientLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??0NmAttachmentListItem@@QAE@PAVQGraphicsItem@@@Z @ 49 NONAME ; NmAttachmentListItem::NmAttachmentListItem(class QGraphicsItem *)
+	?toPlainText@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 50 NONAME ; class QString NmHtmlLineEdit::toPlainText(void) const
+	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 51 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *, int)
+	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 52 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *)
+	?setScrollPosition@NmEditorTextEdit@@QAEXHH@Z @ 53 NONAME ; void NmEditorTextEdit::setScrollPosition(int, int)
+	?getStaticMetaObject@NmEditorTextEdit@@SAABUQMetaObject@@XZ @ 54 NONAME ; struct QMetaObject const & NmEditorTextEdit::getStaticMetaObject(void)
+	?staticMetaObject@NmAttachmentListItem@@2UQMetaObject@@B @ 55 NONAME ; struct QMetaObject const NmAttachmentListItem::staticMetaObject
+	??1NmHtmlLineEdit@@UAE@XZ @ 56 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(void)
+	?setProgressBarValue@NmAttachmentListItem@@QAEXH@Z @ 57 NONAME ; void NmAttachmentListItem::setProgressBarValue(int)
+	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 58 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *)
+	??_ENmBaseViewScrollArea@@UAE@I@Z @ 59 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(unsigned int)
+	?progressBarValue@NmAttachmentListItem@@QBEHXZ @ 60 NONAME ; int NmAttachmentListItem::progressBarValue(void) const
+	?itemLongPressed@NmAttachmentListItem@@IAEXVQPointF@@@Z @ 61 NONAME ; void NmAttachmentListItem::itemLongPressed(class QPointF)
+	?gestureEvent@NmAttachmentListItem@@MAEXPAVQGestureEvent@@@Z @ 62 NONAME ; void NmAttachmentListItem::gestureEvent(class QGestureEvent *)
+	?setCustomTextColor@NmEditorTextEdit@@QAEX_NABVQColor@@@Z @ 63 NONAME ; void NmEditorTextEdit::setCustomTextColor(bool, class QColor const &)
+	?init@NmAttachmentListItem@@AAEXXZ @ 64 NONAME ; void NmAttachmentListItem::init(void)
+	??0NmRecipientLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 65 NONAME ; NmRecipientLineEdit::NmRecipientLineEdit(class QGraphicsItem *)
+	??0NmHtmlLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 66 NONAME ; NmHtmlLineEdit::NmHtmlLineEdit(class QGraphicsItem *)
+	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 67 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *)
+	?setAttachmentSize@NmAttachmentListWidget@@QAEXHABVQString@@@Z @ 68 NONAME ; void NmAttachmentListWidget::setAttachmentSize(int, class QString const &)
+	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 69 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *, int)
+	?setPlainText@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 70 NONAME ; void NmHtmlLineEdit::setPlainText(class QString const &)
+	?longPressGesture@NmBaseViewScrollArea@@MAEXABVQPointF@@@Z @ 71 NONAME ; void NmBaseViewScrollArea::longPressGesture(class QPointF const &)
+	?updateCustomTextColor@NmEditorTextEdit@@QAEXXZ @ 72 NONAME ; void NmEditorTextEdit::updateCustomTextColor(void)
+	?orientationChanged@NmAttachmentListWidget@@AAEXW4Orientation@Qt@@@Z @ 73 NONAME ; void NmAttachmentListWidget::orientationChanged(enum Qt::Orientation)
+	?insertSelectedContacts@NmRecipientLineEdit@@QAEXABVQVariant@@@Z @ 74 NONAME ; void NmRecipientLineEdit::insertSelectedContacts(class QVariant const &)
+	?qt_metacast@NmAttachmentListWidget@@UAEPAXPBD@Z @ 75 NONAME ; void * NmAttachmentListWidget::qt_metacast(char const *)
+	?getStaticMetaObject@NmHtmlLineEdit@@SAABUQMetaObject@@XZ @ 76 NONAME ; struct QMetaObject const & NmHtmlLineEdit::getStaticMetaObject(void)
+	?qt_metacall@NmEditorTextEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 77 NONAME ; int NmEditorTextEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??1NmEditorTextEdit@@UAE@XZ @ 78 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(void)
+	?generateEmailAddressList@NmRecipientLineEdit@@AAEXXZ @ 79 NONAME ; void NmRecipientLineEdit::generateEmailAddressList(void)
+	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 80 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *)
+	??1NmAttachmentListWidget@@UAE@XZ @ 81 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(void)
+	??_ENmRecipientLineEdit@@UAE@I@Z @ 82 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(unsigned int)
+	?mousePressEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 83 NONAME ; void NmBaseViewScrollArea::mousePressEvent(class QGraphicsSceneMouseEvent *)
+	?qt_metacast@NmRecipientLineEdit@@UAEPAXPBD@Z @ 84 NONAME ; void * NmRecipientLineEdit::qt_metacast(char const *)
+	?setCustomTextColor@NmEditorTextEdit@@QAEXABU?$QPair@_NVQColor@@@@@Z @ 85 NONAME ; void NmEditorTextEdit::setCustomTextColor(struct QPair<bool, class QColor> const &)
+	?setDocument@NmHtmlLineEdit@@QAEXPAVQTextDocument@@@Z @ 86 NONAME ; void NmHtmlLineEdit::setDocument(class QTextDocument *)
+	?handleItemActivated@NmAttachmentListWidget@@AAEXXZ @ 87 NONAME ; void NmAttachmentListWidget::handleItemActivated(void)
+	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 88 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *)
+	??0NmBaseViewScrollArea@@QAE@PAVQGraphicsItem@@@Z @ 89 NONAME ; NmBaseViewScrollArea::NmBaseViewScrollArea(class QGraphicsItem *)
+	?metaObject@NmAttachmentListWidget@@UBEPBUQMetaObject@@XZ @ 90 NONAME ; struct QMetaObject const * NmAttachmentListWidget::metaObject(void) const
+	?constructUi@NmAttachmentListItem@@AAEXXZ @ 91 NONAME ; void NmAttachmentListItem::constructUi(void)
+	?longPressed@NmAttachmentListWidget@@IAEXHVQPointF@@@Z @ 92 NONAME ; void NmAttachmentListWidget::longPressed(int, class QPointF)
+	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 93 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *, int)
+	?staticMetaObject@NmEditorTextEdit@@2UQMetaObject@@B @ 94 NONAME ; struct QMetaObject const NmEditorTextEdit::staticMetaObject
+	??0NmEditorTextEdit@@QAE@PAVQGraphicsItem@@@Z @ 95 NONAME ; NmEditorTextEdit::NmEditorTextEdit(class QGraphicsItem *)
+	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 96 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *, int)
+	?setHtml@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 97 NONAME ; void NmHtmlLineEdit::setHtml(class QString const &)
+	??_ENmEditorTextEdit@@UAE@I@Z @ 98 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(unsigned int)
+	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 99 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *)
+	?itemActivated@NmAttachmentListItem@@IAEXXZ @ 100 NONAME ; void NmAttachmentListItem::itemActivated(void)
+	?hideProgressBar@NmAttachmentListItem@@QAEXXZ @ 101 NONAME ; void NmAttachmentListItem::hideProgressBar(void)
+	?qt_metacast@NmAttachmentListItem@@UAEPAXPBD@Z @ 102 NONAME ; void * NmAttachmentListItem::qt_metacast(char const *)
+	?getStaticMetaObject@NmRecipientLineEdit@@SAABUQMetaObject@@XZ @ 103 NONAME ; struct QMetaObject const & NmRecipientLineEdit::getStaticMetaObject(void)
+	?findItem@NmAttachmentListWidget@@AAEHPBVQObject@@@Z @ 104 NONAME ; int NmAttachmentListWidget::findItem(class QObject const *)
+	?removeAttachment@NmAttachmentListWidget@@QAEXH@Z @ 105 NONAME ; void NmAttachmentListWidget::removeAttachment(int)
+	??1NmRecipientLineEdit@@UAE@XZ @ 106 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(void)
+	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 107 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *, int)
+	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 108 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *, int)
+	?progressValue@NmAttachmentListWidget@@QBEHH@Z @ 109 NONAME ; int NmAttachmentListWidget::progressValue(int) const
+	?staticMetaObject@NmAttachmentListWidget@@2UQMetaObject@@B @ 110 NONAME ; struct QMetaObject const NmAttachmentListWidget::staticMetaObject
+	??_ENmAttachmentListWidget@@UAE@I@Z @ 111 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(unsigned int)
+	?setTextCursor@NmHtmlLineEdit@@QAEXABVQTextCursor@@@Z @ 112 NONAME ; void NmHtmlLineEdit::setTextCursor(class QTextCursor const &)
+	?setTextColor@NmAttachmentListWidget@@QAEXVQColor@@@Z @ 113 NONAME ; void NmAttachmentListWidget::setTextColor(class QColor)
+	?handleMouseMoveEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 114 NONAME ; void NmBaseViewScrollArea::handleMouseMoveEvent(class QGraphicsSceneMouseEvent *)
+	?staticMetaObject@NmRecipientLineEdit@@2UQMetaObject@@B @ 115 NONAME ; struct QMetaObject const NmRecipientLineEdit::staticMetaObject
+	?setProgressBarValue@NmAttachmentListWidget@@QAEXHH@Z @ 116 NONAME ; void NmAttachmentListWidget::setProgressBarValue(int, int)
+	?handleMouseReleaseEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 117 NONAME ; void NmBaseViewScrollArea::handleMouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	?insertAttachment@NmAttachmentListWidget@@QAEXHABVQString@@0@Z @ 118 NONAME ; void NmAttachmentListWidget::insertAttachment(int, class QString const &, class QString const &)
+	?metaObject@NmAttachmentListItem@@UBEPBUQMetaObject@@XZ @ 119 NONAME ; struct QMetaObject const * NmAttachmentListItem::metaObject(void) const
+	?removeProgressBar@NmAttachmentListItem@@AAEXXZ @ 120 NONAME ; void NmAttachmentListItem::removeProgressBar(void)
+	??1NmBaseViewScrollArea@@UAE@XZ @ 121 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(void)
+	?hideProgressBar@NmAttachmentListWidget@@QAEXH@Z @ 122 NONAME ; void NmAttachmentListWidget::hideProgressBar(int)
+	??0NmAttachmentListWidget@@QAE@PAVQGraphicsItem@@@Z @ 123 NONAME ; NmAttachmentListWidget::NmAttachmentListWidget(class QGraphicsItem *)
+	??_ENmHtmlLineEdit@@UAE@I@Z @ 124 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(unsigned int)
+	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 125 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *, int)
+	?handleMousePressEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 126 NONAME ; void NmBaseViewScrollArea::handleMousePressEvent(class QGraphicsSceneMouseEvent *)
+	?insertItemToLayout@NmAttachmentListWidget@@AAEXPAVNmAttachmentListItem@@@Z @ 127 NONAME ; void NmAttachmentListWidget::insertItemToLayout(class NmAttachmentListItem *)
+	?metaObject@NmHtmlLineEdit@@UBEPBUQMetaObject@@XZ @ 128 NONAME ; struct QMetaObject const * NmHtmlLineEdit::metaObject(void) const
+	?editorContentHeightChanged@NmEditorTextEdit@@IAEXXZ @ 129 NONAME ; void NmEditorTextEdit::editorContentHeightChanged(void)
+	?setTextColor@NmAttachmentListItem@@QAEXVQColor@@@Z @ 130 NONAME ; void NmAttachmentListItem::setTextColor(class QColor)
+	??1NmAttachmentListItem@@UAE@XZ @ 131 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(void)
+	?count@NmAttachmentListWidget@@QBEHXZ @ 132 NONAME ; int NmAttachmentListWidget::count(void) const
+	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 133 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *, int)
+	?handleTextChanged@NmRecipientLineEdit@@AAEXABVQString@@@Z @ 134 NONAME ; void NmRecipientLineEdit::handleTextChanged(class QString const &)
+	?document@NmHtmlLineEdit@@QBEPAVQTextDocument@@XZ @ 135 NONAME ; class QTextDocument * NmHtmlLineEdit::document(void) const
+	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 136 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *)
+	?qt_metacall@NmHtmlLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 137 NONAME ; int NmHtmlLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@NmBaseViewScrollArea@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 138 NONAME ; int NmBaseViewScrollArea::qt_metacall(enum QMetaObject::Call, int, void * *)
 
--- a/emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def	Wed Jun 23 17:00:39 2010 +0100
@@ -17,162 +17,154 @@
 	_ZN16NmEditorTextEdit15setHeaderHeightEi @ 16 NONAME
 	_ZN16NmEditorTextEdit16staticMetaObjectE @ 17 NONAME DATA 16
 	_ZN16NmEditorTextEdit17setScrollPositionEii @ 18 NONAME
-	_ZN16NmEditorTextEdit18sendLongPressEventERK7QPointF @ 19 NONAME
-	_ZN16NmEditorTextEdit18sendMouseMoveEventEP24QGraphicsSceneMouseEvent @ 20 NONAME
-	_ZN16NmEditorTextEdit18setCustomTextColorERK5QPairIb6QColorE @ 21 NONAME
-	_ZN16NmEditorTextEdit18setCustomTextColorEbRK6QColor @ 22 NONAME
-	_ZN16NmEditorTextEdit18updateEditorHeightEv @ 23 NONAME
-	_ZN16NmEditorTextEdit19getStaticMetaObjectEv @ 24 NONAME
-	_ZN16NmEditorTextEdit19sendMousePressEventEP24QGraphicsSceneMouseEvent @ 25 NONAME
-	_ZN16NmEditorTextEdit20updateScrollPositionERK7QPointF @ 26 NONAME
-	_ZN16NmEditorTextEdit21sendMouseReleaseEventEP24QGraphicsSceneMouseEvent @ 27 NONAME
-	_ZN16NmEditorTextEdit21updateCustomTextColorEv @ 28 NONAME
-	_ZN16NmEditorTextEdit26editorContentHeightChangedEv @ 29 NONAME
-	_ZN16NmEditorTextEdit4initEP20NmBaseViewScrollArea @ 30 NONAME
-	_ZN16NmEditorTextEditC1EP13QGraphicsItem @ 31 NONAME
-	_ZN16NmEditorTextEditC2EP13QGraphicsItem @ 32 NONAME
-	_ZN16NmEditorTextEditD0Ev @ 33 NONAME
-	_ZN16NmEditorTextEditD1Ev @ 34 NONAME
-	_ZN16NmEditorTextEditD2Ev @ 35 NONAME
-	_ZN19NmRecipientLineEdit11qt_metacallEN11QMetaObject4CallEiPPv @ 36 NONAME
-	_ZN19NmRecipientLineEdit11qt_metacastEPKc @ 37 NONAME
-	_ZN19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 38 NONAME
-	_ZN19NmRecipientLineEdit16emailAddressListEv @ 39 NONAME
-	_ZN19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 40 NONAME
-	_ZN19NmRecipientLineEdit16staticMetaObjectE @ 41 NONAME DATA 16
-	_ZN19NmRecipientLineEdit17handleTextChangedERK7QString @ 42 NONAME
-	_ZN19NmRecipientLineEdit19getStaticMetaObjectEv @ 43 NONAME
-	_ZN19NmRecipientLineEdit22insertSelectedContactsERK8QVariant @ 44 NONAME
-	_ZN19NmRecipientLineEdit24generateEmailAddressListEv @ 45 NONAME
-	_ZN19NmRecipientLineEditC1EP13QGraphicsItem @ 46 NONAME
-	_ZN19NmRecipientLineEditC2EP13QGraphicsItem @ 47 NONAME
-	_ZN19NmRecipientLineEditD0Ev @ 48 NONAME
-	_ZN19NmRecipientLineEditD1Ev @ 49 NONAME
-	_ZN19NmRecipientLineEditD2Ev @ 50 NONAME
-	_ZN20NmAttachmentListItem10screenSizeEN2Qt11OrientationE @ 51 NONAME
-	_ZN20NmAttachmentListItem11constructUiEv @ 52 NONAME
-	_ZN20NmAttachmentListItem11qt_metacallEN11QMetaObject4CallEiPPv @ 53 NONAME
-	_ZN20NmAttachmentListItem11qt_metacastEPKc @ 54 NONAME
-	_ZN20NmAttachmentListItem12setTextColorE6QColor @ 55 NONAME
-	_ZN20NmAttachmentListItem13itemActivatedEv @ 56 NONAME
-	_ZN20NmAttachmentListItem15hideProgressBarEv @ 57 NONAME
-	_ZN20NmAttachmentListItem15itemLongPressedE7QPointF @ 58 NONAME
-	_ZN20NmAttachmentListItem15mousePressEventEP24QGraphicsSceneMouseEvent @ 59 NONAME
-	_ZN20NmAttachmentListItem15setFileNameTextERK7QString @ 60 NONAME
-	_ZN20NmAttachmentListItem15setFileSizeTextERK7QString @ 61 NONAME
-	_ZN20NmAttachmentListItem16staticMetaObjectE @ 62 NONAME DATA 16
-	_ZN20NmAttachmentListItem17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 63 NONAME
-	_ZN20NmAttachmentListItem17removeProgressBarEv @ 64 NONAME
-	_ZN20NmAttachmentListItem19getStaticMetaObjectEv @ 65 NONAME
-	_ZN20NmAttachmentListItem19resetFileNameLengthEN2Qt11OrientationE @ 66 NONAME
-	_ZN20NmAttachmentListItem19setProgressBarValueEi @ 67 NONAME
-	_ZN20NmAttachmentListItem20longPressedActivatedEv @ 68 NONAME
-	_ZN20NmAttachmentListItem4initEv @ 69 NONAME
-	_ZN20NmAttachmentListItemC1EP13QGraphicsItem @ 70 NONAME
-	_ZN20NmAttachmentListItemC2EP13QGraphicsItem @ 71 NONAME
-	_ZN20NmAttachmentListItemD0Ev @ 72 NONAME
-	_ZN20NmAttachmentListItemD1Ev @ 73 NONAME
-	_ZN20NmAttachmentListItemD2Ev @ 74 NONAME
-	_ZN20NmBaseViewScrollArea11qt_metacallEN11QMetaObject4CallEiPPv @ 75 NONAME
-	_ZN20NmBaseViewScrollArea11qt_metacastEPKc @ 76 NONAME
-	_ZN20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 77 NONAME
-	_ZN20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 78 NONAME
-	_ZN20NmBaseViewScrollArea16longPressGestureERK7QPointF @ 79 NONAME
-	_ZN20NmBaseViewScrollArea16staticMetaObjectE @ 80 NONAME DATA 16
-	_ZN20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 81 NONAME
-	_ZN20NmBaseViewScrollArea19getStaticMetaObjectEv @ 82 NONAME
-	_ZN20NmBaseViewScrollArea20handleMouseMoveEventEP24QGraphicsSceneMouseEvent @ 83 NONAME
-	_ZN20NmBaseViewScrollArea21handleMousePressEventEP24QGraphicsSceneMouseEvent @ 84 NONAME
-	_ZN20NmBaseViewScrollArea22handleLongPressGestureERK7QPointF @ 85 NONAME
-	_ZN20NmBaseViewScrollArea23handleMouseReleaseEventEP24QGraphicsSceneMouseEvent @ 86 NONAME
-	_ZN20NmBaseViewScrollAreaC1EP13QGraphicsItem @ 87 NONAME
-	_ZN20NmBaseViewScrollAreaC2EP13QGraphicsItem @ 88 NONAME
-	_ZN20NmBaseViewScrollAreaD0Ev @ 89 NONAME
-	_ZN20NmBaseViewScrollAreaD1Ev @ 90 NONAME
-	_ZN20NmBaseViewScrollAreaD2Ev @ 91 NONAME
-	_ZN22NmAttachmentListWidget11constructUiEv @ 92 NONAME
-	_ZN22NmAttachmentListWidget11longPressedEi7QPointF @ 93 NONAME
-	_ZN22NmAttachmentListWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 94 NONAME
-	_ZN22NmAttachmentListWidget11qt_metacastEPKc @ 95 NONAME
-	_ZN22NmAttachmentListWidget12setTextColorE6QColor @ 96 NONAME
-	_ZN22NmAttachmentListWidget13itemActivatedEi @ 97 NONAME
-	_ZN22NmAttachmentListWidget15hideProgressBarEi @ 98 NONAME
-	_ZN22NmAttachmentListWidget15rearrangeLayoutEv @ 99 NONAME
-	_ZN22NmAttachmentListWidget16insertAttachmentEiRK7QStringS2_ @ 100 NONAME
-	_ZN22NmAttachmentListWidget16removeAttachmentEi @ 101 NONAME
-	_ZN22NmAttachmentListWidget16staticMetaObjectE @ 102 NONAME DATA 16
-	_ZN22NmAttachmentListWidget17handleLongPressedE7QPointF @ 103 NONAME
-	_ZN22NmAttachmentListWidget17setAttachmentSizeEiRK7QString @ 104 NONAME
-	_ZN22NmAttachmentListWidget18insertItemToLayoutEP20NmAttachmentListItem @ 105 NONAME
-	_ZN22NmAttachmentListWidget18orientationChangedEN2Qt11OrientationE @ 106 NONAME
-	_ZN22NmAttachmentListWidget19getStaticMetaObjectEv @ 107 NONAME
-	_ZN22NmAttachmentListWidget19handleItemActivatedEv @ 108 NONAME
-	_ZN22NmAttachmentListWidget19setProgressBarValueEii @ 109 NONAME
-	_ZN22NmAttachmentListWidget4initEv @ 110 NONAME
-	_ZN22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 111 NONAME
-	_ZN22NmAttachmentListWidget8findItemEPK7QObject @ 112 NONAME
-	_ZN22NmAttachmentListWidgetC1EP13QGraphicsItem @ 113 NONAME
-	_ZN22NmAttachmentListWidgetC2EP13QGraphicsItem @ 114 NONAME
-	_ZN22NmAttachmentListWidgetD0Ev @ 115 NONAME
-	_ZN22NmAttachmentListWidgetD1Ev @ 116 NONAME
-	_ZN22NmAttachmentListWidgetD2Ev @ 117 NONAME
-	_ZNK14NmHtmlLineEdit10metaObjectEv @ 118 NONAME
-	_ZNK14NmHtmlLineEdit10textCursorEv @ 119 NONAME
-	_ZNK14NmHtmlLineEdit11toPlainTextEv @ 120 NONAME
-	_ZNK14NmHtmlLineEdit6toHtmlEv @ 121 NONAME
-	_ZNK14NmHtmlLineEdit8documentEv @ 122 NONAME
-	_ZNK16NmEditorTextEdit10metaObjectEv @ 123 NONAME
-	_ZNK16NmEditorTextEdit13contentHeightEv @ 124 NONAME
-	_ZNK16NmEditorTextEdit15customTextColorEv @ 125 NONAME
-	_ZNK19NmRecipientLineEdit10metaObjectEv @ 126 NONAME
-	_ZNK20NmAttachmentListItem10metaObjectEv @ 127 NONAME
-	_ZNK20NmAttachmentListItem16progressBarValueEv @ 128 NONAME
-	_ZNK20NmBaseViewScrollArea10metaObjectEv @ 129 NONAME
-	_ZNK22NmAttachmentListWidget10metaObjectEv @ 130 NONAME
-	_ZNK22NmAttachmentListWidget13progressValueEi @ 131 NONAME
-	_ZNK22NmAttachmentListWidget5countEv @ 132 NONAME
-	_ZTI14NmHtmlLineEdit @ 133 NONAME
-	_ZTI16NmEditorTextEdit @ 134 NONAME
-	_ZTI19NmRecipientLineEdit @ 135 NONAME
-	_ZTI20NmAttachmentListItem @ 136 NONAME
-	_ZTI20NmBaseViewScrollArea @ 137 NONAME
-	_ZTI22NmAttachmentListWidget @ 138 NONAME
-	_ZTV14NmHtmlLineEdit @ 139 NONAME
-	_ZTV16NmEditorTextEdit @ 140 NONAME
-	_ZTV19NmRecipientLineEdit @ 141 NONAME
-	_ZTV20NmAttachmentListItem @ 142 NONAME
-	_ZTV20NmBaseViewScrollArea @ 143 NONAME
-	_ZTV22NmAttachmentListWidget @ 144 NONAME
-	_ZThn16_N14NmHtmlLineEditD0Ev @ 145 NONAME
-	_ZThn16_N14NmHtmlLineEditD1Ev @ 146 NONAME
-	_ZThn16_N16NmEditorTextEditD0Ev @ 147 NONAME
-	_ZThn16_N16NmEditorTextEditD1Ev @ 148 NONAME
-	_ZThn16_N19NmRecipientLineEditD0Ev @ 149 NONAME
-	_ZThn16_N19NmRecipientLineEditD1Ev @ 150 NONAME
-	_ZThn16_N20NmAttachmentListItemD0Ev @ 151 NONAME
-	_ZThn16_N20NmAttachmentListItemD1Ev @ 152 NONAME
-	_ZThn16_N20NmBaseViewScrollAreaD0Ev @ 153 NONAME
-	_ZThn16_N20NmBaseViewScrollAreaD1Ev @ 154 NONAME
-	_ZThn16_N22NmAttachmentListWidgetD0Ev @ 155 NONAME
-	_ZThn16_N22NmAttachmentListWidgetD1Ev @ 156 NONAME
-	_ZThn8_N14NmHtmlLineEditD0Ev @ 157 NONAME
-	_ZThn8_N14NmHtmlLineEditD1Ev @ 158 NONAME
-	_ZThn8_N16NmEditorTextEditD0Ev @ 159 NONAME
-	_ZThn8_N16NmEditorTextEditD1Ev @ 160 NONAME
-	_ZThn8_N19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 161 NONAME
-	_ZThn8_N19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 162 NONAME
-	_ZThn8_N19NmRecipientLineEditD0Ev @ 163 NONAME
-	_ZThn8_N19NmRecipientLineEditD1Ev @ 164 NONAME
-	_ZThn8_N20NmAttachmentListItem15mousePressEventEP24QGraphicsSceneMouseEvent @ 165 NONAME
-	_ZThn8_N20NmAttachmentListItem17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 166 NONAME
-	_ZThn8_N20NmAttachmentListItemD0Ev @ 167 NONAME
-	_ZThn8_N20NmAttachmentListItemD1Ev @ 168 NONAME
-	_ZThn8_N20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 169 NONAME
-	_ZThn8_N20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 170 NONAME
-	_ZThn8_N20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 171 NONAME
-	_ZThn8_N20NmBaseViewScrollAreaD0Ev @ 172 NONAME
-	_ZThn8_N20NmBaseViewScrollAreaD1Ev @ 173 NONAME
-	_ZThn8_N22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 174 NONAME
-	_ZThn8_N22NmAttachmentListWidgetD0Ev @ 175 NONAME
-	_ZThn8_N22NmAttachmentListWidgetD1Ev @ 176 NONAME
+	_ZN16NmEditorTextEdit18setCustomTextColorERK5QPairIb6QColorE @ 19 NONAME
+	_ZN16NmEditorTextEdit18setCustomTextColorEbRK6QColor @ 20 NONAME
+	_ZN16NmEditorTextEdit18updateEditorHeightEv @ 21 NONAME
+	_ZN16NmEditorTextEdit19getStaticMetaObjectEv @ 22 NONAME
+	_ZN16NmEditorTextEdit20updateScrollPositionERK7QPointF @ 23 NONAME
+	_ZN16NmEditorTextEdit21updateCustomTextColorEv @ 24 NONAME
+	_ZN16NmEditorTextEdit26editorContentHeightChangedEv @ 25 NONAME
+	_ZN16NmEditorTextEdit4initEP20NmBaseViewScrollArea @ 26 NONAME
+	_ZN16NmEditorTextEditC1EP13QGraphicsItem @ 27 NONAME
+	_ZN16NmEditorTextEditC2EP13QGraphicsItem @ 28 NONAME
+	_ZN16NmEditorTextEditD0Ev @ 29 NONAME
+	_ZN16NmEditorTextEditD1Ev @ 30 NONAME
+	_ZN16NmEditorTextEditD2Ev @ 31 NONAME
+	_ZN19NmRecipientLineEdit11qt_metacallEN11QMetaObject4CallEiPPv @ 32 NONAME
+	_ZN19NmRecipientLineEdit11qt_metacastEPKc @ 33 NONAME
+	_ZN19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 34 NONAME
+	_ZN19NmRecipientLineEdit16emailAddressListEv @ 35 NONAME
+	_ZN19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 36 NONAME
+	_ZN19NmRecipientLineEdit16staticMetaObjectE @ 37 NONAME DATA 16
+	_ZN19NmRecipientLineEdit17handleTextChangedERK7QString @ 38 NONAME
+	_ZN19NmRecipientLineEdit19getStaticMetaObjectEv @ 39 NONAME
+	_ZN19NmRecipientLineEdit22insertSelectedContactsERK8QVariant @ 40 NONAME
+	_ZN19NmRecipientLineEdit24generateEmailAddressListEv @ 41 NONAME
+	_ZN19NmRecipientLineEditC1EP13QGraphicsItem @ 42 NONAME
+	_ZN19NmRecipientLineEditC2EP13QGraphicsItem @ 43 NONAME
+	_ZN19NmRecipientLineEditD0Ev @ 44 NONAME
+	_ZN19NmRecipientLineEditD1Ev @ 45 NONAME
+	_ZN19NmRecipientLineEditD2Ev @ 46 NONAME
+	_ZN20NmAttachmentListItem10screenSizeEN2Qt11OrientationE @ 47 NONAME
+	_ZN20NmAttachmentListItem11constructUiEv @ 48 NONAME
+	_ZN20NmAttachmentListItem11qt_metacallEN11QMetaObject4CallEiPPv @ 49 NONAME
+	_ZN20NmAttachmentListItem11qt_metacastEPKc @ 50 NONAME
+	_ZN20NmAttachmentListItem12gestureEventEP13QGestureEvent @ 51 NONAME
+	_ZN20NmAttachmentListItem12setTextColorE6QColor @ 52 NONAME
+	_ZN20NmAttachmentListItem13itemActivatedEv @ 53 NONAME
+	_ZN20NmAttachmentListItem15hideProgressBarEv @ 54 NONAME
+	_ZN20NmAttachmentListItem15itemLongPressedE7QPointF @ 55 NONAME
+	_ZN20NmAttachmentListItem15setFileNameTextERK7QString @ 56 NONAME
+	_ZN20NmAttachmentListItem15setFileSizeTextERK7QString @ 57 NONAME
+	_ZN20NmAttachmentListItem16staticMetaObjectE @ 58 NONAME DATA 16
+	_ZN20NmAttachmentListItem17removeProgressBarEv @ 59 NONAME
+	_ZN20NmAttachmentListItem19getStaticMetaObjectEv @ 60 NONAME
+	_ZN20NmAttachmentListItem19resetFileNameLengthEN2Qt11OrientationE @ 61 NONAME
+	_ZN20NmAttachmentListItem19setProgressBarValueEi @ 62 NONAME
+	_ZN20NmAttachmentListItem4initEv @ 63 NONAME
+	_ZN20NmAttachmentListItemC1EP13QGraphicsItem @ 64 NONAME
+	_ZN20NmAttachmentListItemC2EP13QGraphicsItem @ 65 NONAME
+	_ZN20NmAttachmentListItemD0Ev @ 66 NONAME
+	_ZN20NmAttachmentListItemD1Ev @ 67 NONAME
+	_ZN20NmAttachmentListItemD2Ev @ 68 NONAME
+	_ZN20NmBaseViewScrollArea11qt_metacallEN11QMetaObject4CallEiPPv @ 69 NONAME
+	_ZN20NmBaseViewScrollArea11qt_metacastEPKc @ 70 NONAME
+	_ZN20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 71 NONAME
+	_ZN20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 72 NONAME
+	_ZN20NmBaseViewScrollArea16longPressGestureERK7QPointF @ 73 NONAME
+	_ZN20NmBaseViewScrollArea16staticMetaObjectE @ 74 NONAME DATA 16
+	_ZN20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 75 NONAME
+	_ZN20NmBaseViewScrollArea19getStaticMetaObjectEv @ 76 NONAME
+	_ZN20NmBaseViewScrollArea20handleMouseMoveEventEP24QGraphicsSceneMouseEvent @ 77 NONAME
+	_ZN20NmBaseViewScrollArea21handleMousePressEventEP24QGraphicsSceneMouseEvent @ 78 NONAME
+	_ZN20NmBaseViewScrollArea22handleLongPressGestureERK7QPointF @ 79 NONAME
+	_ZN20NmBaseViewScrollArea23handleMouseReleaseEventEP24QGraphicsSceneMouseEvent @ 80 NONAME
+	_ZN20NmBaseViewScrollAreaC1EP13QGraphicsItem @ 81 NONAME
+	_ZN20NmBaseViewScrollAreaC2EP13QGraphicsItem @ 82 NONAME
+	_ZN20NmBaseViewScrollAreaD0Ev @ 83 NONAME
+	_ZN20NmBaseViewScrollAreaD1Ev @ 84 NONAME
+	_ZN20NmBaseViewScrollAreaD2Ev @ 85 NONAME
+	_ZN22NmAttachmentListWidget11constructUiEv @ 86 NONAME
+	_ZN22NmAttachmentListWidget11longPressedEi7QPointF @ 87 NONAME
+	_ZN22NmAttachmentListWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 88 NONAME
+	_ZN22NmAttachmentListWidget11qt_metacastEPKc @ 89 NONAME
+	_ZN22NmAttachmentListWidget12setTextColorE6QColor @ 90 NONAME
+	_ZN22NmAttachmentListWidget13itemActivatedEi @ 91 NONAME
+	_ZN22NmAttachmentListWidget15hideProgressBarEi @ 92 NONAME
+	_ZN22NmAttachmentListWidget15rearrangeLayoutEv @ 93 NONAME
+	_ZN22NmAttachmentListWidget16insertAttachmentEiRK7QStringS2_ @ 94 NONAME
+	_ZN22NmAttachmentListWidget16removeAttachmentEi @ 95 NONAME
+	_ZN22NmAttachmentListWidget16staticMetaObjectE @ 96 NONAME DATA 16
+	_ZN22NmAttachmentListWidget17handleLongPressedE7QPointF @ 97 NONAME
+	_ZN22NmAttachmentListWidget17setAttachmentSizeEiRK7QString @ 98 NONAME
+	_ZN22NmAttachmentListWidget18insertItemToLayoutEP20NmAttachmentListItem @ 99 NONAME
+	_ZN22NmAttachmentListWidget18orientationChangedEN2Qt11OrientationE @ 100 NONAME
+	_ZN22NmAttachmentListWidget19getStaticMetaObjectEv @ 101 NONAME
+	_ZN22NmAttachmentListWidget19handleItemActivatedEv @ 102 NONAME
+	_ZN22NmAttachmentListWidget19setProgressBarValueEii @ 103 NONAME
+	_ZN22NmAttachmentListWidget4initEv @ 104 NONAME
+	_ZN22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 105 NONAME
+	_ZN22NmAttachmentListWidget8findItemEPK7QObject @ 106 NONAME
+	_ZN22NmAttachmentListWidgetC1EP13QGraphicsItem @ 107 NONAME
+	_ZN22NmAttachmentListWidgetC2EP13QGraphicsItem @ 108 NONAME
+	_ZN22NmAttachmentListWidgetD0Ev @ 109 NONAME
+	_ZN22NmAttachmentListWidgetD1Ev @ 110 NONAME
+	_ZN22NmAttachmentListWidgetD2Ev @ 111 NONAME
+	_ZNK14NmHtmlLineEdit10metaObjectEv @ 112 NONAME
+	_ZNK14NmHtmlLineEdit10textCursorEv @ 113 NONAME
+	_ZNK14NmHtmlLineEdit11toPlainTextEv @ 114 NONAME
+	_ZNK14NmHtmlLineEdit6toHtmlEv @ 115 NONAME
+	_ZNK14NmHtmlLineEdit8documentEv @ 116 NONAME
+	_ZNK16NmEditorTextEdit10metaObjectEv @ 117 NONAME
+	_ZNK16NmEditorTextEdit13contentHeightEv @ 118 NONAME
+	_ZNK16NmEditorTextEdit15customTextColorEv @ 119 NONAME
+	_ZNK19NmRecipientLineEdit10metaObjectEv @ 120 NONAME
+	_ZNK20NmAttachmentListItem10metaObjectEv @ 121 NONAME
+	_ZNK20NmAttachmentListItem16progressBarValueEv @ 122 NONAME
+	_ZNK20NmBaseViewScrollArea10metaObjectEv @ 123 NONAME
+	_ZNK22NmAttachmentListWidget10metaObjectEv @ 124 NONAME
+	_ZNK22NmAttachmentListWidget13progressValueEi @ 125 NONAME
+	_ZNK22NmAttachmentListWidget5countEv @ 126 NONAME
+	_ZTI14NmHtmlLineEdit @ 127 NONAME
+	_ZTI16NmEditorTextEdit @ 128 NONAME
+	_ZTI19NmRecipientLineEdit @ 129 NONAME
+	_ZTI20NmAttachmentListItem @ 130 NONAME
+	_ZTI20NmBaseViewScrollArea @ 131 NONAME
+	_ZTI22NmAttachmentListWidget @ 132 NONAME
+	_ZTV14NmHtmlLineEdit @ 133 NONAME
+	_ZTV16NmEditorTextEdit @ 134 NONAME
+	_ZTV19NmRecipientLineEdit @ 135 NONAME
+	_ZTV20NmAttachmentListItem @ 136 NONAME
+	_ZTV20NmBaseViewScrollArea @ 137 NONAME
+	_ZTV22NmAttachmentListWidget @ 138 NONAME
+	_ZThn16_N14NmHtmlLineEditD0Ev @ 139 NONAME
+	_ZThn16_N14NmHtmlLineEditD1Ev @ 140 NONAME
+	_ZThn16_N16NmEditorTextEditD0Ev @ 141 NONAME
+	_ZThn16_N16NmEditorTextEditD1Ev @ 142 NONAME
+	_ZThn16_N19NmRecipientLineEditD0Ev @ 143 NONAME
+	_ZThn16_N19NmRecipientLineEditD1Ev @ 144 NONAME
+	_ZThn16_N20NmAttachmentListItemD0Ev @ 145 NONAME
+	_ZThn16_N20NmAttachmentListItemD1Ev @ 146 NONAME
+	_ZThn16_N20NmBaseViewScrollAreaD0Ev @ 147 NONAME
+	_ZThn16_N20NmBaseViewScrollAreaD1Ev @ 148 NONAME
+	_ZThn16_N22NmAttachmentListWidgetD0Ev @ 149 NONAME
+	_ZThn16_N22NmAttachmentListWidgetD1Ev @ 150 NONAME
+	_ZThn8_N14NmHtmlLineEditD0Ev @ 151 NONAME
+	_ZThn8_N14NmHtmlLineEditD1Ev @ 152 NONAME
+	_ZThn8_N16NmEditorTextEditD0Ev @ 153 NONAME
+	_ZThn8_N16NmEditorTextEditD1Ev @ 154 NONAME
+	_ZThn8_N19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 155 NONAME
+	_ZThn8_N19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 156 NONAME
+	_ZThn8_N19NmRecipientLineEditD0Ev @ 157 NONAME
+	_ZThn8_N19NmRecipientLineEditD1Ev @ 158 NONAME
+	_ZThn8_N20NmAttachmentListItemD0Ev @ 159 NONAME
+	_ZThn8_N20NmAttachmentListItemD1Ev @ 160 NONAME
+	_ZThn8_N20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 161 NONAME
+	_ZThn8_N20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 162 NONAME
+	_ZThn8_N20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 163 NONAME
+	_ZThn8_N20NmBaseViewScrollAreaD0Ev @ 164 NONAME
+	_ZThn8_N20NmBaseViewScrollAreaD1Ev @ 165 NONAME
+	_ZThn8_N22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 166 NONAME
+	_ZThn8_N22NmAttachmentListWidgetD0Ev @ 167 NONAME
+	_ZThn8_N22NmAttachmentListWidgetD1Ev @ 168 NONAME
 
--- a/emailuis/nmailuiwidgets/inc/nmailuiwidgetsheaders.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/inc/nmailuiwidgetsheaders.h	Wed Jun 23 17:00:39 2010 +0100
@@ -32,7 +32,6 @@
 #include <xqservicerequest.h>
 #include <qtcontacts.h>
 #include <qmobilityglobal.h>
-#include <mobcntmodel.h>
 #include <xqserviceutil.h>
 #include <xqappmgr.h>
 #include <xqserviceipcmarshal.h>
@@ -47,6 +46,7 @@
 #include <hbdocumentloader.h>
 #include <hbinstance.h>
 #include <hbcolorscheme.h>
+#include <hbtapgesture.h>
 
 // nmail
 #include <nmaddress.h>
--- a/emailuis/nmailuiwidgets/inc/nmattachmentlistitem.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/inc/nmattachmentlistitem.h	Wed Jun 23 17:00:39 2010 +0100
@@ -24,7 +24,7 @@
 
 class HbProgressBar;
 class HbTextItem;
-class QTimer;
+class HbTapGesture;
 
 class NMAILUIWIDGETS_EXPORT NmAttachmentListItem : public HbWidget
 {
@@ -42,12 +42,10 @@
     void hideProgressBar();
 
 protected: 
-    void mousePressEvent( QGraphicsSceneMouseEvent *event );
-    void mouseReleaseEvent( QGraphicsSceneMouseEvent *event );
+    virtual void gestureEvent(QGestureEvent *event);
     
 private slots:
     void removeProgressBar();
-    void longPressedActivated();
 
 signals: 
     void itemActivated();
@@ -63,9 +61,6 @@
     HbTextItem *mFileNameText; //owned
     HbTextItem *mFileSizeText; //owned
     HbProgressBar *mProgressBar; //owned
-    QTimer *mTimer; //owned
-    bool mButtonPressed;
-    QPointF mLongPressedPoint;
     QColor mTextColor;
 };
 
--- a/emailuis/nmailuiwidgets/inc/nmeditortextedit.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/inc/nmeditortextedit.h	Wed Jun 23 17:00:39 2010 +0100
@@ -36,10 +36,6 @@
     void init(NmBaseViewScrollArea *bgScrollArea);
     qreal contentHeight() const;
 
-    void sendMousePressEvent(QGraphicsSceneMouseEvent *event);
-    void sendMouseReleaseEvent(QGraphicsSceneMouseEvent *event);
-    void sendMouseMoveEvent(QGraphicsSceneMouseEvent *event);
-    void sendLongPressEvent(const QPointF &point);
     void setCustomTextColor(const QPair<bool, QColor> &customColor);
     void setCustomTextColor(bool useCustom, const QColor& color = Qt::black);
     QPair<bool, QColor> customTextColor() const;
@@ -61,6 +57,7 @@
     int mHeaderHeight;
     QPointF mBgScrollPosition;
     bool mFirstTime;
+    bool mFirstTimeToScrollPosUpdate;
     
     QPair<bool, QColor> mCustomTextColor;//!<This property keeps info about using customTextColor and color to use. 
 };
--- a/emailuis/nmailuiwidgets/inc/nmrecipientlineedit.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/inc/nmrecipientlineedit.h	Wed Jun 23 17:00:39 2010 +0100
@@ -54,12 +54,12 @@
 
 private:
     // mEmailAddressList contains all emailaddress that appear in the lineedit and 
-    // all emailaddress corresponding to the name inserted from PhoneBook,
-    // including invalid emailaddress user typed or invalid emailaddress picked from PhoneBook.
+    // all emailaddress corresponding to the contact's name added from Contacts,
+    // including invalid emailaddress user typed or invalid emailaddress added from Contacts.
     // Emailaddress validation check is conducted in nmeditorview.
     QList<NmAddress> mEmailAddressList; 
 	
-    QList<NmAddress> mContactsSelectedFromPhoneBook;
+    QList<NmAddress> mRecipientsAddedFromContacts;
 	
     // Flag "need to generate mEmailAddressList" is used whenever editing made after 
     // the emailaddress validation check failed.
--- a/emailuis/nmailuiwidgets/nmailuiwidgets.pro	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/nmailuiwidgets.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -42,8 +42,7 @@
     LIBS += -lnmailbase \
             -lxqservice \
             -lxqserviceutil \
-            -lqtcontacts \
-            -lmobcntmodel
+            -lqtcontacts
 
     defBlock = \      
       "$${LITERAL_HASH}if defined(MARM)" \
--- a/emailuis/nmailuiwidgets/src/nmattachmentlistitem.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/src/nmattachmentlistitem.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -23,7 +23,6 @@
 static const int PROGRESSBAR_MIN = 0; 
 static const int PROGRESSBAR_MAX = 100;
 static const int PROGRESSBAR_HIDE_COUNTDOWN = 500;
-static const int LONGPRESS_TIMER = 2000;
 
 // Hardcoded file size length. Maximum (999.9 Mb) fits into size field.
 static const int FILE_SIZE_FIELD_LENGTH = 120;
@@ -47,12 +46,15 @@
     : HbWidget( parent ),
       mFileNameText(NULL),
       mFileSizeText(NULL),
-      mProgressBar(NULL),
-      mTimer(NULL),
-      mButtonPressed(false),
-      mLongPressedPoint(0,0)
+      mProgressBar(NULL)
 {
+    NM_FUNCTION;
+    
     init( );
+	
+    // Informs GestureFramework that NmAttachmentListItem widget is interested 
+    // Tap gesture and TapAndHold gesture.
+    grabGesture(Qt::TapGesture);
 }
 
 /*!
@@ -61,6 +63,8 @@
  */
 void NmAttachmentListItem::setTextColor(const QColor color)
 {
+    NM_FUNCTION;
+    
     mTextColor=color;
 }
 
@@ -69,11 +73,10 @@
  */
 NmAttachmentListItem::~NmAttachmentListItem( )
 {
+    NM_FUNCTION;
+    
     HbStyleLoader::unregisterFilePath(FILE_PATH_WIDGETML);
     HbStyleLoader::unregisterFilePath(FILE_PATH_CSS);
-    
-    delete mTimer;
-    mTimer = NULL; 
 }
 
 /*!
@@ -81,6 +84,8 @@
  */
 void NmAttachmentListItem::setFileNameText(const QString &fileName)
 {
+    NM_FUNCTION;
+    
     if (mFileNameText){
         if (mTextColor.isValid()){
             mFileNameText->setTextColor(mTextColor);
@@ -95,6 +100,8 @@
  */
 void NmAttachmentListItem::setFileSizeText(const QString &fileSize)
 {
+    NM_FUNCTION;
+    
     if (mFileSizeText){
         if (mTextColor.isValid()){
             mFileSizeText->setTextColor(mTextColor);
@@ -109,6 +116,8 @@
  */
 void NmAttachmentListItem::resetFileNameLength(Qt::Orientation orientation)
 {
+    NM_FUNCTION;
+    
 	QSizeF reso = screenSize(orientation);
 	
 	if (orientation == Qt::Horizontal) {
@@ -124,6 +133,8 @@
  */
 void NmAttachmentListItem::setProgressBarValue(const int value)
 {
+    NM_FUNCTION;
+    
     //first check if value is 0 or below -> hide progressbar
     if ( 0 >= value ){
         removeProgressBar();
@@ -150,6 +161,8 @@
 */
 int NmAttachmentListItem::progressBarValue() const
 {
+    NM_FUNCTION;
+    
     int ret = 0;
     if ( mProgressBar ){
         ret = mProgressBar->progressValue();
@@ -163,6 +176,8 @@
 */
 void NmAttachmentListItem::hideProgressBar()
 {
+    NM_FUNCTION;
+    
     QTimer::singleShot(PROGRESSBAR_HIDE_COUNTDOWN,this, SLOT(removeProgressBar()));
 }
 
@@ -171,16 +186,13 @@
 */
 void NmAttachmentListItem::init( )
 {
+    NM_FUNCTION;
+    
     constructUi();
 
     //set default values
     setFlag(QGraphicsItem::ItemIsFocusable);
     setFlag(QGraphicsItem::ItemIsSelectable);
-
-    //set temporary longpress timer
-    mTimer = new QTimer(this);
-    mTimer->setSingleShot(true);
-    connect(mTimer, SIGNAL(timeout()), this, SLOT(longPressedActivated()));
 }
 
 /*!
@@ -188,6 +200,8 @@
 */
 void NmAttachmentListItem::constructUi()
 {
+    NM_FUNCTION;
+    
     //construct default ui.    
     HbStyleLoader::registerFilePath(FILE_PATH_WIDGETML);
     HbStyleLoader::registerFilePath(FILE_PATH_CSS);
@@ -205,38 +219,12 @@
 
 
 /*!
-    \reimp
- */
-void NmAttachmentListItem::mousePressEvent( QGraphicsSceneMouseEvent *event )
-{
-    NMLOG("NmAttachmentListItem::mousePressEvent");
-
-    mButtonPressed = true;
-    mLongPressedPoint = event->scenePos();
-    if(mTimer){
-        mTimer->start(LONGPRESS_TIMER);        
-    }
-}
-
-/*!
-    \reimp
- */
-void NmAttachmentListItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
-    Q_UNUSED(event);
-    NMLOG("NmAttachmentListItem::mouseReleasedEvent");
-    if ( mTimer && mButtonPressed ){
-        emit itemActivated();
-        mButtonPressed = false;
-        mTimer->stop();
-    }
-}
-
-/*!
     Hides the download progress bar
  */
 void NmAttachmentListItem::removeProgressBar()
 {
+    NM_FUNCTION;
+    
 	if ( mProgressBar ){
 	    HbStyle::setItemName( mProgressBar, "" );
 	    mProgressBar->deleteLater();
@@ -245,18 +233,6 @@
 	}
 }
 
-/*!
-
- */
-void NmAttachmentListItem::longPressedActivated()
-{
-    //check first if button is not released already
-    if ( mButtonPressed ){
-        NMLOG("NmAttachmentListItem::longPressedActivated");
-        emit itemLongPressed(mLongPressedPoint);
-        mButtonPressed = false;
-    }
-}
 
 /*!
     This function returns screen size depending on the orientation.
@@ -264,6 +240,8 @@
  */
 QSize NmAttachmentListItem::screenSize(Qt::Orientation orientation)
 {
+    NM_FUNCTION;
+    
     QSize ret(0,0);
     HbDeviceProfile currentP = HbDeviceProfile::current();
     HbDeviceProfile altP(currentP.alternateProfileName());
@@ -290,3 +268,35 @@
     return ret;
 }
 
+/*!
+    This function handles gestures
+ */
+void NmAttachmentListItem::gestureEvent(QGestureEvent *event)
+{
+    NM_FUNCTION;
+    
+    if (HbTapGesture *tap = qobject_cast<HbTapGesture *>(event->gesture(Qt::TapGesture))) {
+        switch(tap->tapStyleHint()) {
+        case HbTapGesture::Tap:
+            {
+                if (tap->state() == Qt::GestureFinished) {
+                    emit itemActivated();
+                }
+             }
+             break;
+            
+         case HbTapGesture::TapAndHold:
+             {
+                 if (tap->state() == Qt::GestureFinished) {
+                 emit itemLongPressed(event->mapToGraphicsScene(tap->position()));
+                 }
+             }    
+             break;
+        }
+    }
+    else {
+           HbWidget::gestureEvent(event);
+    }
+}
+
+
--- a/emailuis/nmailuiwidgets/src/nmattachmentlistwidget.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/src/nmattachmentlistwidget.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -106,6 +106,8 @@
     mLayout(NULL),
     mOrientation(Qt::Vertical)
 {
+    NM_FUNCTION;
+    
     init( );
 }
 
@@ -115,6 +117,8 @@
  */
 NmAttachmentListWidget::~NmAttachmentListWidget( )
 {
+    NM_FUNCTION;
+    
     mItemList.clear();
 }
 
@@ -124,6 +128,8 @@
  */
 void NmAttachmentListWidget::setTextColor(const QColor color)
 {
+    NM_FUNCTION;
+    
     mTextColor=color;
 }
 
@@ -137,6 +143,8 @@
         const QString &fileName, 
         const QString &fileSize)
 {   
+    NM_FUNCTION;
+    
     NmAttachmentListItem *item = new NmAttachmentListItem(this);
     item->setObjectName(QString("nmattachmentlistitem_%1").arg(index));
 
@@ -163,8 +171,10 @@
  */
 void NmAttachmentListWidget::removeAttachment(int index)
 {
+    NM_FUNCTION;
+    
     if(!mLayout) {
-        NMLOG("NmAttachmentListWidget::removeAttachment: Layout loading failed!");
+        NM_ERROR(1,"NmAttachmentListWidget::removeAttachment(): layout loading failed");
         return;
     }
 
@@ -189,6 +199,8 @@
         int index, 
         const QString &fileSize)
 {
+    NM_FUNCTION;
+    
 	if (index>=0 && index<mItemList.count()) {
 	    mItemList.at(index)->setFileSizeText(fileSize);
 	}
@@ -199,6 +211,8 @@
  */
 int NmAttachmentListWidget::count() const
 {
+    NM_FUNCTION;
+    
     return mItemList.count();
 }
 
@@ -207,6 +221,8 @@
  */
 int NmAttachmentListWidget::progressValue(int index) const
 {
+    NM_FUNCTION;
+    
     int ret(NmNotFoundError);
     if(index >= 0 && index < mItemList.count()){
         ret = mItemList.at(index)->progressBarValue();
@@ -220,6 +236,8 @@
  */
 void NmAttachmentListWidget::hideProgressBar(int index)
 {
+    NM_FUNCTION;
+    
     if(index >= 0 && index < mItemList.count()){
         mItemList.at(index)->hideProgressBar();
     }
@@ -234,6 +252,8 @@
     const QStyleOptionGraphicsItem *option,
     QWidget *widget)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(option);
     Q_UNUSED(widget);
     if (painter&&mLayout){
@@ -270,6 +290,8 @@
  */
 void NmAttachmentListWidget::setProgressBarValue(int index, int value)
 {
+    NM_FUNCTION;
+    
     if(index >= 0 && index < mItemList.count()){
         mItemList[index]->setProgressBarValue(value);
     }
@@ -280,6 +302,8 @@
  */
 void NmAttachmentListWidget::init( )
 {
+    NM_FUNCTION;
+    
     //Get mainwindow for orientation changes
     HbMainWindow *mw = hbInstance->allMainWindows().at(0);
 
@@ -288,7 +312,7 @@
         connect(mw, SIGNAL(orientationChanged(Qt::Orientation)),this, SLOT(orientationChanged(Qt::Orientation)));
         mOrientation = mw->orientation();
     } else {
-        NMLOG("NmAttachmentListWidget::init: mainWindow missing!");
+        NM_ERROR(1,"NmAttachmentListWidget::init: mainWindow missing!");
     }
 
     //construct UI after orientation has been figured out
@@ -303,6 +327,8 @@
  */
 void NmAttachmentListWidget::constructUi()
 {
+    NM_FUNCTION;
+    
     setObjectName(QString(ATTACHMENT_WIDGET));
     HbDocumentLoader loader;
     bool loadingOk = false;
@@ -319,10 +345,10 @@
             mLayout = dynamic_cast<QGraphicsGridLayout*>(layout());
             mLayout->setContentsMargins(0,0,0,0);
         } else {
-            NMLOG("NmAttachmentListWidget::constructUi: Widget doesn't have layout!");
+            NM_ERROR(1,"NmAttachmentListWidget::constructUi: Widget doesn't have layout!");
         }
     } else {
-        NMLOG("NmAttachmentListWidget::constructUi: DocML loading failed.");
+        NM_ERROR(1,"NmAttachmentListWidget::constructUi: DocML loading failed.");
     }
 
 }
@@ -332,13 +358,15 @@
 */
 void NmAttachmentListWidget::handleLongPressed(QPointF point)
 {
+    NM_FUNCTION;
+    
     QObject *sender = QObject::sender();
     int index = findItem(sender);
     if(NmNotFoundError != index){
         emit longPressed(index, point);
     }
     else {
-        NMLOG("NmAttachmentListWidget::handleLongPressed: item cannot found!");
+        NM_ERROR(1,"NmAttachmentListWidget::handleLongPressed: item cannot found!");
     }
 
 }
@@ -348,13 +376,15 @@
 */
 void NmAttachmentListWidget::handleItemActivated()
 {
+    NM_FUNCTION;
+    
     QObject *sender = QObject::sender();
     int index = findItem(sender);
     if(NmNotFoundError != index){
         emit itemActivated(index);
     }
     else {
-        NMLOG("NmAttachmentListWidget::handleItemActivated: item cannot found!");
+        NM_ERROR(1,"NmAttachmentListWidget::handleItemActivated: item cannot found!");
     }
 }
 
@@ -364,8 +394,8 @@
 */
 void NmAttachmentListWidget::orientationChanged(Qt::Orientation orientation)
 {
-    NMLOG("NmAttachmentListWidget::orientationChanged");
-
+    NM_FUNCTION;
+    
     //be sure that orientation has been changed
     if(mOrientation != orientation){
         mOrientation = orientation;
@@ -381,6 +411,8 @@
 */
 int NmAttachmentListWidget::findItem(const QObject *obj)
 {
+    NM_FUNCTION;
+    
     int found(NmNotFoundError);
     int index(0);
 
@@ -401,8 +433,10 @@
 */
 void NmAttachmentListWidget::insertItemToLayout(NmAttachmentListItem* item)
 {
+    NM_FUNCTION;
+    
     if(!mLayout) {
-        NMLOG("NmAttachmentListWidget::insertItemToLayout: Layout loading failed!");
+        NM_ERROR(1,"NmAttachmentListWidget::insertItemToLayout: Layout loading failed!");
         return;
     }
     int layout_count = mLayout->count();
@@ -424,8 +458,10 @@
 */
 void NmAttachmentListWidget::rearrangeLayout()
 {
+    NM_FUNCTION;
+    
     if(!mLayout) {
-        NMLOG("NmAttachmentListWidget::rearrangeLayout: Layout loading failed!");
+        NM_ERROR(1,"NmAttachmentListWidget::rearrangeLayout: Layout loading failed!");
         return;
     }
 
--- a/emailuis/nmailuiwidgets/src/nmbaseviewscrollarea.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/src/nmbaseviewscrollarea.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -23,6 +23,7 @@
 NmBaseViewScrollArea::NmBaseViewScrollArea(QGraphicsItem *parentView) :
     HbScrollArea(parentView)
     {
+    NM_FUNCTION;
     }
 
 /*!
@@ -30,6 +31,7 @@
 */
 NmBaseViewScrollArea::~NmBaseViewScrollArea()
     {
+    NM_FUNCTION;
     }
 
 /*!
@@ -38,6 +40,8 @@
 */
 void NmBaseViewScrollArea::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
+    NM_FUNCTION;
+    
     if (event){
         emit handleMousePressEvent(event);
         HbScrollArea::mousePressEvent(event);
@@ -50,6 +54,8 @@
 */
 void NmBaseViewScrollArea::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
 {
+    NM_FUNCTION;
+    
     if (event){
         emit handleMouseReleaseEvent(event);
         HbScrollArea::mouseReleaseEvent(event);
@@ -62,6 +68,8 @@
 */
 void NmBaseViewScrollArea::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
 {
+    NM_FUNCTION;
+    
     if (event){
         emit handleMouseMoveEvent(event);
         HbScrollArea::mouseMoveEvent(event);
@@ -73,6 +81,8 @@
 */
 void NmBaseViewScrollArea::longPressGesture(const QPointF &point)
 {
+    NM_FUNCTION;
+    
     emit handleLongPressGesture(point);
 }
 
--- a/emailuis/nmailuiwidgets/src/nmeditortextedit.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/src/nmeditortextedit.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -21,7 +21,7 @@
 static const double Un = 6.66;
 static const double BodyMargin = Un;
 static const int ChromeHeight = 160;
-static const double FieldHeightWhenSecondaryFont = 5 * Un;
+static const double FieldHeightWhenSecondaryFont = 7.46 * Un;
 static const int GroupBoxTitleHeight = 42;
 static const double HeightOfTheHeaderOnStartup =
     2 * FieldHeightWhenSecondaryFont + GroupBoxTitleHeight;
@@ -30,8 +30,10 @@
     Constructor
 */
 NmEditorTextEdit::NmEditorTextEdit(QGraphicsItem *parent) :
-    HbTextEdit(parent)
+    HbTextEdit(parent),
+    mFirstTimeToScrollPosUpdate(true)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -39,10 +41,13 @@
 */
 NmEditorTextEdit::~NmEditorTextEdit()
 {
+    NM_FUNCTION;
 }
 
 void NmEditorTextEdit::init(NmBaseViewScrollArea *bgScrollArea)
 {
+    NM_FUNCTION;
+    
     mPreviousContentsHeight = 0;
     mFirstTime = true;
     mCustomTextColor = QPair<bool, QColor>(false,Qt::black);
@@ -53,13 +58,10 @@
     document()->setDocumentMargin(BodyMargin);
 
     mScrollArea = this->scrollArea();
-    mScrollArea->setLongPressEnabled(true);
+
     // Enable scrolling using cursor
     setScrollable(true);
     mScrollArea->setScrollDirections(Qt::Horizontal);
-    // Let all mouse events go into background scroll area which handles the scrolling
-    setAcceptedMouseButtons(Qt::NoButton);
-    mScrollArea->setAcceptedMouseButtons(Qt::NoButton);
 
     connect(this, SIGNAL(contentsChanged()), this, SLOT(updateEditorHeight()));
     connect(this, SIGNAL(cursorPositionChanged(int, int)),
@@ -72,6 +74,8 @@
  */
 qreal NmEditorTextEdit::contentHeight() const
 {
+    NM_FUNCTION;
+    
     QSizeF s = document()->size();
     return s.height();
 }
@@ -82,6 +86,8 @@
  */
 void NmEditorTextEdit::updateEditorHeight()
 {
+    NM_FUNCTION;
+    
     // Get current body content height
     qreal heightOfTheTextEdit = contentHeight();
 
@@ -103,6 +109,8 @@
  */
 void NmEditorTextEdit::setScrollPosition(int oldPos, int newPos)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(oldPos);
 
     if (mFirstTime) {
@@ -151,6 +159,14 @@
 */
 void NmEditorTextEdit::updateScrollPosition(const QPointF &newPosition)
 {
+    NM_FUNCTION;
+    
+    // Temporary fix: When this is called for the first time, the editor is scrolled down for 
+    // some reason so this will restore the scroll position.
+    if(mFirstTimeToScrollPosUpdate) {
+        mFirstTimeToScrollPosUpdate = false;
+        mBackgroundScrollArea->scrollContentsTo(QPointF(0,0));        
+    }
     mBgScrollPosition = newPosition;
 }
 
@@ -160,6 +176,8 @@
  */
 void NmEditorTextEdit::updateCustomTextColor()
 {
+    NM_FUNCTION;
+    
     if (mCustomTextColor.first) {
         QTextCursor tcursor = textCursor();
         QTextCharFormat fmt;
@@ -190,55 +208,21 @@
  */
 void NmEditorTextEdit::setHeaderHeight(int newHeight)
 {
+    NM_FUNCTION;
+    
     mHeaderHeight = newHeight;
     updateEditorHeight();
 }
 
 /*!
-    sendMousePressEvent. Function is used to relay mouse press event to base class
-*/
-void NmEditorTextEdit::sendMousePressEvent(QGraphicsSceneMouseEvent *event)
-{
-    if (event) {
-        HbAbstractEdit::mousePressEvent(event);
-    }
-}
-
-/*!
-    sendMouseReleaseEvent. Function is used to relay mouse release event to base class
-*/
-void NmEditorTextEdit::sendMouseReleaseEvent(QGraphicsSceneMouseEvent *event)
-{
-    if (event) {
-        HbAbstractEdit::mouseReleaseEvent(event);
-    }
-}
-
-/*!
-    sendMouseMoveEvent. Function is used to relay mouse move event to base class
-*/
-void NmEditorTextEdit::sendMouseMoveEvent(QGraphicsSceneMouseEvent *event)
-{
-    if (event) {
-        HbAbstractEdit::mouseMoveEvent(event);
-    }
-}
-
-/*!
-    sendLongPressEvent. Opens the context menu of the editor
-*/
-void NmEditorTextEdit::sendLongPressEvent(const QPointF &point)
-{
-    showContextMenu(point);
-}
-
-/*!
    Sets flag is custom text color should be used and sets the custom color.
    
    Function does not affect the color of existing content, only text that will be entered later.
  */
 void NmEditorTextEdit::setCustomTextColor(const QPair<bool, QColor> &customColor)
 {
+    NM_FUNCTION;
+    
     mCustomTextColor = customColor;
 }
 
@@ -250,6 +234,8 @@
  */
 void NmEditorTextEdit::setCustomTextColor(bool useCustom, const QColor& color)
 {   
+    NM_FUNCTION;
+    
     mCustomTextColor.first = useCustom;
     //check and set custom color
     mCustomTextColor.first ? mCustomTextColor.second = color : 
@@ -264,5 +250,7 @@
  */
 QPair<bool, QColor> NmEditorTextEdit::customTextColor() const
 {
+    NM_FUNCTION;
+    
     return mCustomTextColor;
 }
--- a/emailuis/nmailuiwidgets/src/nmhtmllineedit.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/src/nmhtmllineedit.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -25,6 +25,7 @@
 NmHtmlLineEdit::NmHtmlLineEdit(QGraphicsItem *parent) :
     HbLineEdit(parent)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -32,6 +33,7 @@
  */
 NmHtmlLineEdit::~NmHtmlLineEdit()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -41,40 +43,56 @@
  */
 void NmHtmlLineEdit::setDocument(QTextDocument *document)
 {
+    NM_FUNCTION;
+    
     HbAbstractEdit::setDocument(document);
 }
 
 QTextDocument *NmHtmlLineEdit::document() const
 {
+    NM_FUNCTION;
+    
     return HbAbstractEdit::document();
 }
 
 void NmHtmlLineEdit::setTextCursor(const QTextCursor &cursor)
 {
+    NM_FUNCTION;
+    
     HbAbstractEdit::setTextCursor(cursor);
 }
 
 QTextCursor NmHtmlLineEdit::textCursor() const
 {
+    NM_FUNCTION;
+    
     return HbAbstractEdit::textCursor();
 }
 
 QString NmHtmlLineEdit::toHtml() const
 {
+    NM_FUNCTION;
+    
     return HbAbstractEdit::toHtml();
 }
 
 void NmHtmlLineEdit::setHtml(const QString &text)
 {
+    NM_FUNCTION;
+    
     HbAbstractEdit::setHtml(text);
 }
 
 QString NmHtmlLineEdit::toPlainText () const
 {
+    NM_FUNCTION;
+    
     return HbAbstractEdit::toPlainText();
 }
 
 void NmHtmlLineEdit::setPlainText (const QString &text)
 {
+    NM_FUNCTION;
+    
     HbAbstractEdit::setPlainText(text);
 }
--- a/emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -29,6 +29,8 @@
     : NmHtmlLineEdit(parent),
     mNeedToGenerateEmailAddressList(true)
 {
+    NM_FUNCTION;
+    
     connect(this, SIGNAL(textChanged(QString)), this, SLOT(handleTextChanged(QString)));
 }
 
@@ -38,6 +40,7 @@
 */
 NmRecipientLineEdit::~NmRecipientLineEdit()
 {
+    NM_FUNCTION;
 }
 
 
@@ -46,6 +49,8 @@
 */
 QList<NmAddress> NmRecipientLineEdit::emailAddressList()
 {
+    NM_FUNCTION;
+    
     if (mNeedToGenerateEmailAddressList) {
         // Empty mEmailAddressList.
         mEmailAddressList.clear();
@@ -61,14 +66,11 @@
 #ifdef Q_OS_SYMBIAN
 /*!
    This Slot inserts the selected contacts from Contacts-picker into the lineedit cursor position.    
-   "You shouldn't be able to convert the parameter selectedContacts into a QStringlist or QString,
-   you need to convert selectedContacts into a CntServicesContactList." -- Comments from 
-   Contacts-picker author Erkinheimo Joonas (Nokia-D/Espoo)
-   Contacts-Picker should be working in TB 10.1 MCL wk16 release, 
-   Custom metatypes problem will be fixed in wk16 by QtHighway.
 */
 void NmRecipientLineEdit::insertSelectedContacts(const QVariant &selectedContacts)
 {
+    NM_FUNCTION;
+    
     if (!selectedContacts.isNull()) {
         CntServicesContactList contactList;
         contactList = qVariantValue<CntServicesContactList>(selectedContacts);
@@ -87,12 +89,14 @@
                 NmHtmlLineEdit::keyPressEvent(&contactEmailAddressKeyEvent);
             }
             else {
-                // Handle a rare case: there's another contact has same name but has different emailaddress.
-                for (int i = 0; i != mContactsSelectedFromPhoneBook.count(); ++i) {
-                    if (mContactsSelectedFromPhoneBook.at(i).displayName() == contactName &&
-                  	    mContactsSelectedFromPhoneBook.at(i).address() != contactEmailAddress) {
-                        // Differentiate this contact's name by adding a * mark
-                        contactName.append("*");
+                // Handle a rare case: there are contacts has same name but different emailaddress.
+                for (int i = 0; i != mRecipientsAddedFromContacts.count(); ++i) {
+                    if (mRecipientsAddedFromContacts.at(i).displayName() == contactName &&
+                  	    mRecipientsAddedFromContacts.at(i).address() != contactEmailAddress) {
+                        // Differentiate this contact by supplying it's emailaddress
+                        contactName.append("<");
+                        contactName.append(contactEmailAddress);
+                        contactName.append(">");
                     }
                 }
                 
@@ -114,13 +118,13 @@
             contact.setAddress(contactEmailAddress);
             contact.setDisplayName(contactName);
             
-            // Add this NmAddress formated contact into mContactsSelectedFromPhoneBook.
-            mContactsSelectedFromPhoneBook.append(contact);
+            // Add this NmAddress formated contact into mRecipientsAddedFromContacts.
+            mRecipientsAddedFromContacts.append(contact);
         }
     }
     else {
         //Request returned NULL 
-        NMLOG("ContactsPicker request returned NULL.");
+        NM_COMMENT("ContactsPicker request returned NULL.");
     }
         
 }
@@ -137,6 +141,8 @@
 */
 void NmRecipientLineEdit::keyPressEvent(QKeyEvent *keyEvent)
 {
+    NM_FUNCTION;
+    
 	bool eventHandled = false;
 	
     if (keyEvent) {
@@ -184,6 +190,8 @@
 */
 void NmRecipientLineEdit::inputMethodEvent(QInputMethodEvent *event)
 {
+    NM_FUNCTION;
+    
 	bool eventHandled = false;
 	
     if (event) {
@@ -220,47 +228,67 @@
 
  
 /*!
-   Generate emailaddress list from the content of the lineedit.
+   Generate a list of all the email addresses from the content of the lineedit.
 */
 void NmRecipientLineEdit::generateEmailAddressList()
 {   
+    NM_FUNCTION;
+    
     // Remove whitespace from the start and the end of the lineedit content. 
     QString contentOfLineedit = (this->text()).trimmed();
     
-    // Split the lineedit content into individual items wherever a Semicolon(";") occurs, 
-    // empty entries don't appear in the result.
+    // Split the lineedit content by semicolon(";").
     QStringList itemsOfLineeditContent = contentOfLineedit.split(Semicolon, QString::SkipEmptyParts);
         
-    // Loop through all the items in the itemsOfLineeditContent list.
+    // Loop through all the items of the lineedit content.
     for (int i = 0; i != itemsOfLineeditContent.count(); ++i) {
         // Remove whitespace from the start and the end of the item.
         QString itemInLineedit = itemsOfLineeditContent.at(i).trimmed();
 
-        if (mContactsSelectedFromPhoneBook.count() > 0) {
-            // Loop through all the elements in the mContactsSelectedFromPhoneBook list.
-            for (int j = 0; j != mContactsSelectedFromPhoneBook.count(); ++j) {
-                NmAddress contact = mContactsSelectedFromPhoneBook.at(j);		
-                // If the item matches either the name or the emailaddress of this contact.
-                if (itemInLineedit == contact.displayName() || itemInLineedit == contact.address()) {
-                    // Add the contact into mEmailAddressList.
-                    mEmailAddressList.append(contact);  
-                }
-                else {
-                    // Form the item into Qmail NmAddress format.
-                    NmAddress recipient;
-                    recipient.setAddress(itemInLineedit);
-                    // no display name info available, so don't us it
-                    recipient.setDisplayName(QString()); 
-                    // Add this NmAddress formated lineedit item into mEmailAddressList.
-                    mEmailAddressList.append(recipient);  
-                }
+        // Get the count of the recipients added from Contacts.
+        int countOfRecipientsAddedFromContacts = mRecipientsAddedFromContacts.count();
+        
+        // If there is recipient added from Contacts.
+        if (countOfRecipientsAddedFromContacts > 0) {
+            QStringList listOfAddedContactsName;
+            QStringList listOfAddedContactsAddress;
+            
+            // Loop through all the recipients added from Contacts.
+            for (int j = 0; j != countOfRecipientsAddedFromContacts; ++j) {
+                NmAddress contact = mRecipientsAddedFromContacts.at(j);          
+                listOfAddedContactsName.append(contact.displayName());
+                listOfAddedContactsAddress.append(contact.address());
+            }
+                
+            int indexInAddedContactsName = listOfAddedContactsName.indexOf(itemInLineedit);
+            int indexInAddedContactsAddress = listOfAddedContactsAddress.indexOf(itemInLineedit);
+            
+            // If this itemInLineedit matches the name of one added contact.
+            if (indexInAddedContactsName >= 0) {
+                // Add the recipient into mEmailAddressList.
+                mEmailAddressList.append(mRecipientsAddedFromContacts.at(indexInAddedContactsName));  
+            }
+            // If this itemInLineedit matches the emailaddress of one added contact.
+            else if (indexInAddedContactsAddress >= 0) { 
+                // Add the recipient into mEmailAddressList.
+                mEmailAddressList.append(mRecipientsAddedFromContacts.at(indexInAddedContactsAddress));  
+            }
+            // This itemInLineedit is not added from Contacts
+            else { 
+                // Form the item into NmAddress format.
+                NmAddress recipient;
+                recipient.setAddress(itemInLineedit);
+                // There is no display name info available, so leave display name empty.
+                recipient.setDisplayName(QString()); 
+                // Add this NmAddress formated lineedit item into mEmailAddressList.
+                mEmailAddressList.append(recipient);  
             }
         }
-        else {
-            // Form the item into Qmail NmAddress format.
+        else { // There is no recipient is added from Contacts
+            // Form the item into NmAddress format.
             NmAddress recipient;
             recipient.setAddress(itemInLineedit);
-            // no display name info available, so don't us it
+            // There is no display name info available, so leave display name emapty.
             recipient.setDisplayName(QString()); 
             // Add this NmAddress formated lineedit item into mEmailAddressList.
             mEmailAddressList.append(recipient);  
@@ -274,6 +302,8 @@
 */
 void NmRecipientLineEdit::handleTextChanged(const QString &text)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(text);
     mNeedToGenerateEmailAddressList = true;
 }
--- a/emailuis/nmailuiwidgetsplugin/src/nmailuiwidgetsplugin.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmailuiwidgetsplugin/src/nmailuiwidgetsplugin.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
 *
 */
 
+#include "emailtrace.h"
+
 #include "nmailuiwidgetsplugin.h"
 #include <nmrecipientlineedit.h>
 #include <nmhtmllineedit.h>
@@ -24,6 +26,8 @@
 
 QObject *NMailUiWidgetsPlugin::createObject(const QString& type, const QString &name )
 {
+    NM_FUNCTION;
+    
     if( type == NmBaseViewScrollArea::staticMetaObject.className() ) {
         QObject *object = new NmBaseViewScrollArea;
         object->setObjectName(name);
--- a/emailuis/nmframeworkadapter/inc/nmframeworkadapter.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/inc/nmframeworkadapter.h	Wed Jun 23 17:00:39 2010 +0100
@@ -20,6 +20,7 @@
 
 #include <nmcommon.h>
 #include <nmdataplugininterface.h>
+#include <nmapplicationstateinterface.h>
 #include <CFSMailCommon.h>
 #include <MFSMailEventObserver.h>
 
@@ -33,22 +34,25 @@
 class NmOperation;
 class NmMessageCreationOperation;
 class CFSMailClient;
+class CFSMailBox;
+class CFSMailFolder;
 class CFSMailMessage;
 class CFSMailMessagePart;
 class NmStoreEnvelopesOperation;
 class NmAddAttachmentsOperation;
-class NmCheckOutboxOperation;
 class NmMailboxSearchObserver;
 class NmMessageSendingOperation;
+class CEmailExtension;
 
 
 class NmFrameworkAdapter :
     public QObject,
     public NmDataPluginInterface,
+    public NmApplicationStateInterface,
     public MFSMailEventObserver
 {
     Q_OBJECT
-    Q_INTERFACES(NmDataPluginInterface)
+    Q_INTERFACES(NmDataPluginInterface NmApplicationStateInterface)
 
 public:
 
@@ -78,7 +82,13 @@
             const NmId& mailboxId,
             const NmId& folderId,
             QList<NmMessageEnvelope*> &messageMetaDataList);
-    
+
+    int listMessages(
+            const NmId& mailboxId,
+            const NmId& folderId,
+            QList<NmMessageEnvelope*> &messageMetaDataList,
+            const int maxAmountOfEnvelopes);
+
     int listMessages(
             const NmId& mailboxId,
             const NmId& folderId,
@@ -95,6 +105,12 @@
             const NmId &folderId,
             const NmId &messageId,
             const NmId &messagePartId);
+			
+    QPointer<NmOperation> fetchMessageParts( 
+        const NmId &mailboxId,
+        const NmId &folderId,
+        const NmId &messageId,
+        const QList<NmId> &messagePartIds);
     
     XQSharableFile messagePartFile(
             const NmId &mailboxId,
@@ -167,8 +183,6 @@
             const NmMessage &message, 
             const NmId &attachmentPartId);
 
-    QPointer<NmCheckOutboxOperation> checkOutbox(const NmId& mailboxId);
-    
     NmSyncState syncState(const NmId& mailboxId) const;
     
     NmConnectState connectionState(const NmId& mailboxId) const;
@@ -177,19 +191,16 @@
             const NmId &mailboxId, 
             const NmId &folderId, 
             NmFolder *&folder );
-			
-	int listMessages(
-            const NmId& mailboxId,
-            const NmId& folderId,
-            QList<NmMessageEnvelope*> &messageMetaDataList,
-            const int maxAmountOfEnvelopes);
 
     int search(const NmId &mailboxId,
                const QStringList &searchStrings);
 
     int cancelSearch(const NmId &mailboxId);
 
-
+    void updateActiveFolder(const NmId &mailboxId, const NmId &folderId);
+    
+    QPointer<NmOperation> removeDraftMessage(NmMessage *message);
+    
 signals:
 
     void mailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds);
@@ -206,7 +217,7 @@
     
     void connectionEvent(NmConnectState state, const NmId mailboxId, int errorCode);
 
-    void matchFound(const NmId &messageId);
+    void matchFound(const NmId &messageId, const NmId &folderId);
 
     void searchComplete();
 
@@ -224,7 +235,11 @@
             const NmId &folderId,
             const NmId &messageId,
             NmMessagePart &messagePart);
-        
+
+    void getMessagesFromFolderL(CFSMailFolder *folder,
+                                QList<NmMessageEnvelope*> &messageEnvelopeList,
+                                const int maxEnvelopeCount);
+
     void listMessagesL(  
             const NmId &mailboxId,
             const NmId &folderId,
@@ -273,16 +288,22 @@
     
     void handleSyncstateEvent(TAny* param1, TFSMailMsgId mailbox);
     
-	void getFolderByIdL(
+    void getFolderByIdL(
             const NmId& mailboxId, 
             const NmId& folderId, 
             NmFolder*& unreadCount );
+    
+    void doUpdateActiveFolderL(const NmId &mailboxId, const NmId &folderId);
+    
+    CEmailExtension* getEMailStateExtensionL();      
 
 
 private: // Data
 
     CFSMailClient* mFSfw; // Singleton, not owned
     NmMailboxSearchObserver *mSearchObserver; // Owned
+    CFSMailBox* mCurrentMailBox; // Owned
+    CEmailExtension* mEmailExtension; // not owned
 };
 
 
--- a/emailuis/nmframeworkadapter/inc/nmframeworkadapterheaders.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/inc/nmframeworkadapterheaders.h	Wed Jun 23 17:00:39 2010 +0100
@@ -35,10 +35,11 @@
 // nmailuiengine 
 #include <nmoperation.h>
 #include <nmstoreenvelopesoperation.h>
-#include <nmcheckoutboxoperation.h>
 #include <nmmessagesendingoperation.h>
 #include <nmaddattachmentsoperation.h>
 #include <nmmessagecreationoperation.h>
+#include <nmdataplugininterface.h>
+#include <nmapplicationstateinterface.h>
 
 // nmailbase
 #include <nmmailbox.h>
@@ -49,21 +50,23 @@
 
 // emailcommon
 #include <nmcleanuputils.h>
+#include <cmailboxstateext.h>
 
 // nmframeworkadapter
 #include "nmframeworkadapter.h"
 #include "nmfwaaddattachmentsoperation.h"
 #include "nmfwaremoveattachmentoperation.h"
-#include "nmfwacheckoutboxoperation.h"
 #include "nmfwamessagecreationoperation.h"
 #include "nmfwaforwardmessagecreationoperation.h"
 #include "nmfwareplymessagecreationoperation.h"
 #include "nmfwamessagefetchingoperation.h"
 #include "nmfwamessagepartfetchingoperation.h"
+#include "nmfwamessagepartsfetchingoperation.h"
 #include "nmfwamessagesendingoperation.h"
 #include "nmfwastoreenvelopesoperation.h"
 #include "nmfwastoremessageoperation.h"
 #include "nmmailboxsearchobserver.h"
+#include "nmfwaremovedraftmessageoperation.h"
 
 // fs email
 #include <CFSMailCommon.h>
--- a/emailuis/nmframeworkadapter/inc/nmfwaaddattachmentsoperation.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/inc/nmfwaaddattachmentsoperation.h	Wed Jun 23 17:00:39 2010 +0100
@@ -42,6 +42,7 @@
     
 protected:
     void doRunAsyncOperation();
+    void doCompleteOperation();
     void doCancelOperation();
 
 private:
--- a/emailuis/nmframeworkadapter/inc/nmfwacheckoutboxoperation.h	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * 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:
- *
- */
-
-#ifndef NMFWACHECKOUTBOXOPERATION_H_
-#define NMFWACHECKOUTBOXOPERATION_H_
-
-#include <nmcheckoutboxoperation.h>
-#include <nmcommon.h>
-
-class CFSMailClient;
-
-class NmFwaCheckOutboxOperation : public NmCheckOutboxOperation
-{
-    Q_OBJECT
-public:
-    NmFwaCheckOutboxOperation(
-        const NmId &mailboxId,
-        CFSMailClient &mailClient);
-    
-    bool getMessageId(NmId &messageId) const;
-
-private:
-    void doRunAsyncOperation();
-    void doRunAsyncOperationL();
-    ~NmFwaCheckOutboxOperation();
-    
-private:
-    NmId mMailboxId;
-    CFSMailClient &mMailClient;
-    bool mFound;
-    NmId mMessageId;
-
-};
-
-#endif /* NMFWACHECKOUTBOXOPERATION_H_ */
--- a/emailuis/nmframeworkadapter/inc/nmfwamessagefetchingoperation.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/inc/nmfwamessagefetchingoperation.h	Wed Jun 23 17:00:39 2010 +0100
@@ -39,6 +39,7 @@
 
 protected:
     void doRunAsyncOperation();
+    void doCompleteOperation();
     void doCancelOperation();
     
 private:
--- a/emailuis/nmframeworkadapter/inc/nmfwamessagepartfetchingoperation.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/inc/nmfwamessagepartfetchingoperation.h	Wed Jun 23 17:00:39 2010 +0100
@@ -40,6 +40,7 @@
 
 protected:
     void doRunAsyncOperation();
+    void doCompleteOperation();
     void doCancelOperation();
     
 private:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmframeworkadapter/inc/nmfwamessagepartsfetchingoperation.h	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2010 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:
+ *
+ */
+
+#ifndef NMFWAMESSAGEPARTSFETCHINGOPERATION_H_
+#define NMFWAMESSAGEPARTSFETCHINGOPERATION_H_
+
+#include <nmoperation.h>
+#include <MFSMailRequestObserver.h>
+
+class NmMessage;
+class CFSMailClient;
+
+class NmFwaMessagePartsFetchingOperation : public NmOperation, public MFSMailRequestObserver
+{
+    Q_OBJECT
+public:
+    NmFwaMessagePartsFetchingOperation(
+        const NmId &mailboxId,
+        const NmId &folderId,
+        const NmId &messageId,
+        const QList<NmId> &messagePartIds,
+        CFSMailClient &mailClient);
+    
+    // from MFSMailRequestObserver
+    void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
+
+protected:
+    void doRunAsyncOperation();
+    void doCompleteOperation();
+    void doCancelOperation();
+    
+private:
+    ~NmFwaMessagePartsFetchingOperation();
+    void doRunAsyncOperationL();
+
+private:
+    NmId mMailboxId;
+    NmId mFolderId;
+    NmId mMessageId;
+    RArray<TFSMailMsgId> mMessagePartIds;
+    
+    CFSMailClient &mMailClient;
+    
+    int mLastProgressValue;
+    
+    TInt mRequestId;
+};
+
+#endif /* NMFWAMESSAGEPARTSFETCHINGOPERATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmframeworkadapter/inc/nmfwaremovedraftmessageoperation.h	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,60 @@
+/*
+ * 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:
+ *
+ */
+
+#ifndef NMFWAREMOVEDRAFTMESSAGEOPERATION_H_
+#define NMFWAREMOVEDRAFTMESSAGEOPERATION_H_
+
+#include <QPointer>
+#include <nmoperation.h>
+#include <nmcommon.h>
+#include <CFSMailCommon.h>
+#include <MFSMailRequestObserver.h>
+
+class NmMessage;
+class NmDataPluginInterface;
+class CFSMailClient;
+
+class NmFwaRemoveDraftMessageOperation : public NmOperation,
+                                         public MFSMailRequestObserver
+{
+    Q_OBJECT
+public:
+    NmFwaRemoveDraftMessageOperation(NmDataPluginInterface &pluginInterface,
+                                 NmMessage *message,
+                                 CFSMailClient &mailClient);
+    
+    // from MFSMailRequestObserver
+    void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
+
+protected:
+    void doRunAsyncOperation();
+    void doCompleteOperation();
+    void doCancelOperation();
+
+private:
+    ~NmFwaRemoveDraftMessageOperation();
+
+    void removeMessageL();
+
+private:
+    NmDataPluginInterface &mPluginInterface;
+    NmMessage *mMessage;    // Owned
+    CFSMailClient &mMailClient;
+    TInt mRequestId;
+};
+
+#endif /* NMFWAREMOVEDRAFTMESSAGEOPERATION_H_ */
--- a/emailuis/nmframeworkadapter/inc/nmmailboxsearchobserver.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/inc/nmmailboxsearchobserver.h	Wed Jun 23 17:00:39 2010 +0100
@@ -47,7 +47,7 @@
     
 signals:
 
-    void matchFound(const NmId &messageId);
+    void matchFound(const NmId &messageId, const NmId &folderId);
 
     void searchComplete();
 };
--- a/emailuis/nmframeworkadapter/nmframeworkadapter.pro	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/nmframeworkadapter.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -13,7 +13,7 @@
 #
 # Description: 
 #
-# Version : %version: 26 %
+# Version : %version: e003sa37#30 %
 TEMPLATE = lib
 TARGET = nmframeworkadapter
 
@@ -36,9 +36,10 @@
            inc/nmfwaaddattachmentsoperation.h \
            inc/nmfwaremoveattachmentoperation.h \
            inc/nmfwastoremessageoperation.h \
-           inc/nmfwacheckoutboxoperation.h \
            inc/nmfwamessagepartfetchingoperation.h \
-           inc/nmmailboxsearchobserver.h
+           inc/nmmailboxsearchobserver.h \
+           inc/nmfwamessagepartsfetchingoperation.h \
+           inc/nmfwaremovedraftmessageoperation.h
 
 SOURCES += src/nmframeworkadapter.cpp \
            src/nmfwamessagefetchingoperation.cpp \
@@ -50,9 +51,10 @@
            src/nmfwaaddattachmentsoperation.cpp \
            src/nmfwaremoveattachmentoperation.cpp \
            src/nmfwastoremessageoperation.cpp \
-           src/nmfwacheckoutboxoperation.cpp \
            src/nmfwamessagepartfetchingoperation.cpp \
-           src/nmmailboxsearchobserver.cpp
+           src/nmmailboxsearchobserver.cpp \
+           src/nmfwamessagepartsfetchingoperation.cpp \
+           src/nmfwaremovedraftmessageoperation.cpp
 
 RESOURCES +=
 
@@ -63,7 +65,10 @@
 symbian*: {
     INCLUDEPATH += /epoc32/include/ecom \
     ../../emailservices/emailframework/inc \
-    ../../emailservices/emailframework/commonlib/inc \
+# <qmail>    
+#    ../../emailservices/emailframework/commonlib/inc \
+    ../../emailservices/emailcommon/inc \
+# </qmail>     
     ../../inc
     INCLUDEPATH += /epoc32/include/ecom
 
--- a/emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -38,18 +38,18 @@
 */
 NmFrameworkAdapter::NmFrameworkAdapter()
 : mFSfw(NULL),
-  mSearchObserver(NULL)
+  mSearchObserver(NULL),
+  mCurrentMailBox(NULL),
+  mEmailExtension(NULL)
 {
-    NMLOG("NmFrameworkAdapter::NmFrameworkAdapter() <---");
-
+    NM_FUNCTION;
+    
     // get s60 email framework
     TRAP_IGNORE(mFSfw = CFSMailClient::NewL());
 
     if (mFSfw) {
         TRAP_IGNORE(mFSfw->AddObserverL(*this));
     }
-
-    NMLOG("NmFrameworkAdapter::NmFrameworkAdapter() --->");
 }
 
 /*!
@@ -57,6 +57,16 @@
 */
 NmFrameworkAdapter::~NmFrameworkAdapter()
 {
+    NM_FUNCTION;
+    
+    if (mCurrentMailBox && mEmailExtension) {
+        mCurrentMailBox->ReleaseExtension( mEmailExtension );
+    }
+    delete mCurrentMailBox;
+    mCurrentMailBox = NULL;
+    
+    mEmailExtension = NULL;    
+    
     if (mSearchObserver) {
         delete mSearchObserver;
         mSearchObserver = NULL;
@@ -79,6 +89,8 @@
  */
 int NmFrameworkAdapter::listMailboxIds(QList<NmId>& mailboxIdList)
 {
+    NM_FUNCTION;
+    
     QList<NmMailbox*> mailboxList;
     int ret = listMailboxes(mailboxList);
 
@@ -103,6 +115,8 @@
  */
 int NmFrameworkAdapter::listMailboxes(QList<NmMailbox*>& mailboxList)
 {
+    NM_FUNCTION;
+    
     // get list of mailboxes from all plugins
     TFSMailMsgId id;
     id.SetNullId();
@@ -139,6 +153,8 @@
  */
 int NmFrameworkAdapter::getMailboxById(const NmId& id, NmMailbox*& mailbox)
 {
+    NM_FUNCTION;
+    
     const TFSMailMsgId mailMsgId(id.pluginId32(), id.id32());
     CFSMailBox *box(NULL);
     TRAPD(err, box = mFSfw->GetMailBoxByUidL(mailMsgId));
@@ -159,6 +175,8 @@
  */
 int NmFrameworkAdapter::deleteMailboxById(const NmId& /*id*/)
 {
+    NM_FUNCTION;
+    
     return 0;
 }
 
@@ -173,6 +191,8 @@
  */
 int NmFrameworkAdapter::getFolderById( const NmId& mailboxId, const NmId& folderId, NmFolder*& folder )
     {
+    NM_FUNCTION;
+    
     TRAPD(err, getFolderByIdL( mailboxId, folderId, folder ) );
     return err;
     }
@@ -182,6 +202,8 @@
  */
 void NmFrameworkAdapter::getFolderByIdL( const NmId& mailboxId, const NmId& folderId, NmFolder*& folder )
     {
+    NM_FUNCTION;
+    
     CFSMailFolder* fsFolder(NULL);
 	if (mFSfw)
 		{
@@ -217,6 +239,8 @@
     const NmId& messageId,
     NmMessage*& message)
 {
+    NM_FUNCTION;
+    
     TRAPD(err, getMessageByIdL(mailboxId,folderId,messageId,message));
     return err;
 }
@@ -230,6 +254,8 @@
     const NmId& messageId,
     NmMessage*& message)
 {
+    NM_FUNCTION;
+    
     // select message details to be listed
     TFSMailDetails details(EFSMsgDataStructure);
 
@@ -262,6 +288,8 @@
     const NmId& mailboxId,
     QList<NmFolder*>& folderList)
 {
+    NM_FUNCTION;
+    
     CFSMailBox* currentMailbox = NULL;
     TRAPD (err, currentMailbox = mFSfw->GetMailBoxByUidL(mailboxId));
     if (KErrNone == err) {
@@ -276,6 +304,91 @@
     }
 }
 
+
+/*!
+    Fetches all the messages from the given folder and appends their meta data
+    into the given list.
+
+    \param folder The folder instance.
+    \param messageEnvelopeList The list where the data is stored to.
+    \param maxEnvelopeCount The maximum number of messages to get.
+*/
+void NmFrameworkAdapter::getMessagesFromFolderL(
+     CFSMailFolder *folder,
+     QList<NmMessageEnvelope*> &messageEnvelopeList,
+     const int maxEnvelopeCount)
+{
+    NM_FUNCTION;
+    
+    if (!folder || maxEnvelopeCount < 1) {
+        return;
+    }
+
+    int blockSize = NmListMessagesBlock;
+    int maxItemCount = NmMaxItemsInMessageList;
+
+    if (maxEnvelopeCount < NmMaxItemsInMessageList) {
+        maxItemCount = maxEnvelopeCount;
+
+        if(maxEnvelopeCount < NmListMessagesBlock) {
+            blockSize = maxEnvelopeCount;
+        }
+    }
+
+    // First prepare all the parameters and select message details to be listed.
+    TFSMailDetails details(EFSMsgDataEnvelope);
+
+    // Set the sorting criteria.
+    TFSMailSortCriteria criteria;
+    criteria.iField = EFSMailSortByDate;
+    criteria.iOrder = EFSMailDescending;
+    RArray<TFSMailSortCriteria> sorting;
+    CleanupClosePushL(sorting);
+    sorting.Append(criteria);
+   
+    // Get the message list from the backend.
+    MFSMailIterator* iterator(NULL);
+    iterator = folder->ListMessagesL(details, sorting);
+
+    if (iterator) {
+        CleanupStack::PushL(iterator);
+        RPointerArray<CFSMailMessage> messages;
+        CleanupResetAndDestroy<CFSMailMessage>::PushL(messages);
+
+        // The message list is fetched in blocks to prevent OOM in protocol
+        // plugin side.
+        bool moreMessagesToFollow(false);
+        moreMessagesToFollow = iterator->NextL(TFSMailMsgId(), blockSize, messages);
+
+        for (int i = blockSize;
+             i < maxItemCount && moreMessagesToFollow;
+             i += blockSize) {
+            moreMessagesToFollow =
+                iterator->NextL(messages[i-1]->GetMessageId(), blockSize, messages);
+        }
+
+        // Add all the found emails into the result list.
+        const TInt messageCount(messages.Count());
+
+        for (TInt i = 0; i < messageCount; ++i) {
+            NmMessageEnvelope *newEnvelope(NULL);
+            newEnvelope = messages[i]->GetNmMessageEnvelope();
+
+            if (newEnvelope) {
+                messageEnvelopeList.append(newEnvelope);
+            }
+        }
+
+        CleanupStack::PopAndDestroy(&messages);
+        CleanupStack::Pop(iterator);
+        delete iterator;
+        iterator = NULL;
+    }
+
+    CleanupStack::PopAndDestroy(); // sorting  
+}
+
+
 /*!
     Returns list of envelopes from the backend for specific mailbox and folder.
 
@@ -291,111 +404,77 @@
     const NmId &folderId,
     QList<NmMessageEnvelope*> &messageEnvelopeList)
 {
+    NM_FUNCTION;
+    
     TRAPD(err, listMessagesL(mailboxId,folderId,messageEnvelopeList, NmMaxItemsInMessageList));
     return err;
 }
 
+
+/*!
+    Fetches the meta data for each message in the given mailbox and given
+    folder.
+
+    \param mailboxId The ID of the mailbox of which messages to list.
+    \param folderId The ID of the folder of which messages to list.
+    \param messageEnvelopeList The list where the message data is stored to.
+                               Note that the ownership is transferred!
+    \param maxAmountOfEnvelopes The maximum number of messages to list.
+
+    \return If success, KErrNone, an error code otherwise.
+*/
 int NmFrameworkAdapter::listMessages(
         const NmId& mailboxId,
         const NmId& folderId,
         QList<NmMessageEnvelope*> &messageEnvelopeList,
         const int maxAmountOfEnvelopes)
-    {
+{
+    NM_FUNCTION;
+    
     TInt err = KErrNone;
     TRAP(err, listMessagesL(mailboxId,folderId, messageEnvelopeList,maxAmountOfEnvelopes) );
     return err;
-    }
+}
+
 
 /*!
-    Leaving version of list messages
- */
+    Fetches the meta data for each message in the given mailbox and given
+    folder. Note that this private method can leave.
+*/
 void NmFrameworkAdapter::listMessagesL(
         const NmId &mailboxId,
         const NmId &folderId,
         QList<NmMessageEnvelope*> &messageEnvelopeList,
         const int maxAmountOfEnvelopes)
 {
-    CFSMailBox * currentMailbox(NULL);
-    CFSMailFolder* folder(NULL);
-
-    //If we are requesting 0 or less mails so we can return
-    if( maxAmountOfEnvelopes <= 0)
-        {
+    NM_FUNCTION;
+    
+    // If we are requesting 0 or less mails, we can just return.
+    if (maxAmountOfEnvelopes <= 0) {
         return;
-        }
+    }
 
-    int blockSize = NmListMessagesBlock;
-    int maxLimit = NmMaxItemsInMessageList;
-    if( maxAmountOfEnvelopes < NmMaxItemsInMessageList )
-        {
-        maxLimit = maxAmountOfEnvelopes;
-        if(maxAmountOfEnvelopes < NmListMessagesBlock)
-            {
-            blockSize = maxAmountOfEnvelopes;
-            }
-        }
-   
+    CFSMailBox *mailbox(NULL);
+    mailbox = mFSfw->GetMailBoxByUidL(mailboxId);
 
-    currentMailbox = mFSfw->GetMailBoxByUidL(mailboxId);
-    if (!currentMailbox) {
+    if (!mailbox) {
         User::Leave(KErrNotFound);
     }
-    CleanupStack::PushL(currentMailbox);
-    folder = mFSfw->GetFolderByUidL(currentMailbox->GetId(), TFSMailMsgId(folderId));
+
+    CleanupStack::PushL(mailbox);
+
+    CFSMailFolder* folder(NULL);
+    folder = mFSfw->GetFolderByUidL(mailbox->GetId(), TFSMailMsgId(folderId));
 
     if (folder) {
         CleanupStack::PushL(folder);
-        // First prepare all the parameters
-        // select message details to be listed
-        TFSMailDetails details(EFSMsgDataEnvelope);
-
-        // set sorting criteria
-        TFSMailSortCriteria criteria;
-        criteria.iField = EFSMailSortByDate;
-        criteria.iOrder = EFSMailDescending;
-        RArray<TFSMailSortCriteria> sorting;
-        CleanupClosePushL(sorting);
-        sorting.Append(criteria);
-
-        TFSMailMsgId currentMessageId; // first call contains NULL id as begin id
-        // get messages list from the backend
-        MFSMailIterator* iterator(NULL);
-
-        iterator = folder->ListMessagesL(details, sorting);
-        if (iterator) {
-            CleanupStack::PushL(iterator);
-            RPointerArray<CFSMailMessage> messages;
-            CleanupResetAndDestroy<CFSMailMessage>::PushL(messages);
+        getMessagesFromFolderL(folder, messageEnvelopeList, maxAmountOfEnvelopes);
+        CleanupStack::PopAndDestroy(folder);        
+    }
 
-            //Message list is fetched in blocks to prevent OOM in protocol plugin side
-            bool moreMessagesToFollow(false);
-            moreMessagesToFollow = iterator->NextL(
-                TFSMailMsgId(), blockSize, messages);
-            for ( int i = blockSize;
-                  i < maxLimit && moreMessagesToFollow ;
-                  i += blockSize ) {
-                moreMessagesToFollow = iterator->NextL(
-                    messages[i-1]->GetMessageId(), blockSize, messages);
-            }
+    CleanupStack::PopAndDestroy(mailbox);
+}
 
-            //Add all found emails to the result list
-            for(TInt i=0; i<messages.Count(); i++) {
-                NmMessageEnvelope* newEnvelope(NULL);
-                newEnvelope = messages[i]->GetNmMessageEnvelope();
-                if (newEnvelope) {
-                    messageEnvelopeList.append(newEnvelope);
-                }
-            }
-            CleanupStack::PopAndDestroy( &messages );
-            CleanupStack::Pop(iterator);
-            delete iterator;
-           	iterator = NULL;
-        }
-        CleanupStack::PopAndDestroy(); // sorting
-        CleanupStack::PopAndDestroy(folder);
-    }
-    CleanupStack::PopAndDestroy(currentMailbox);
-}
 
 /*! 
     Returns list of messages from the backend for specific mailbox and folder.
@@ -413,10 +492,13 @@
     QList<NmMessage*> &messageList,
     const int maxAmountOfMessages)
 {
+    NM_FUNCTION;
+    
     TRAPD(err, listMessagesL(mailboxId,folderId,messageList, maxAmountOfMessages));
     return err;
 }
 
+
 /*!
     Leaving version of list messages with NmMessageList input
  */
@@ -426,6 +508,8 @@
         QList<NmMessage*> &messageList,
         const int maxAmountOfEnvelopes)
 {
+    NM_FUNCTION;
+    
     CFSMailBox * currentMailbox(NULL);
     CFSMailFolder* folder(NULL);
 
@@ -437,6 +521,7 @@
 
     int blockSize = NmListMessagesBlock;
     int maxLimit = NmMaxItemsInMessageList;
+
     if( maxAmountOfEnvelopes < NmMaxItemsInMessageList )
         {
         maxLimit = maxAmountOfEnvelopes;
@@ -446,7 +531,6 @@
             }
         }
    
-
     currentMailbox = mFSfw->GetMailBoxByUidL(mailboxId);
     if (!currentMailbox) {
         User::Leave(KErrNotFound);
@@ -516,6 +600,7 @@
     CleanupStack::PopAndDestroy(currentMailbox);
 }
 
+
 /*!
     Starts an asynchronous search for messages with the given search strings.
     This is part of the public interface.
@@ -530,14 +615,16 @@
 int NmFrameworkAdapter::search(const NmId &mailboxId,
                                const QStringList &searchStrings)
 {
+    NM_FUNCTION;
+    
     if (!mSearchObserver) {
         mSearchObserver = new NmMailboxSearchObserver();
     }
 
     // Set connections for forwarding the signals emitted by the search
     // observer.
-    connect(mSearchObserver, SIGNAL(matchFound(const NmId &)),
-            this, SIGNAL(matchFound(const NmId &)), Qt::UniqueConnection);
+    connect(mSearchObserver, SIGNAL(matchFound(const NmId &, const NmId &)),
+            this, SIGNAL(matchFound(const NmId &, const NmId &)), Qt::UniqueConnection);
     connect(mSearchObserver, SIGNAL(searchComplete()),
             this, SIGNAL(searchComplete()), Qt::UniqueConnection);
 
@@ -550,11 +637,14 @@
     Cancels the search if one is ongoing.
 
     \param mailboxId The ID of the mailbox running the search.
+    
 
     \return A possible error code.
 */
 int NmFrameworkAdapter::cancelSearch(const NmId &mailboxId)
 {
+    NM_FUNCTION;
+    
     // Get the mailbox with the given ID.
     CFSMailBox *mailbox(NULL);
     TRAPD(err, mailbox = mFSfw->GetMailBoxByUidL(mailboxId));
@@ -566,6 +656,59 @@
     return err;
 }
 
+/*!
+    Indicates application state information to protocol plugins
+    \param mailboxId Id of active mailbox, 0 if application is closed.
+    \param folderId Id of active folder, 0 if application is closed.
+*/
+void NmFrameworkAdapter::updateActiveFolder(
+    const NmId &mailboxId, const NmId &folderId)
+{
+    TRAP_IGNORE(doUpdateActiveFolderL(mailboxId, folderId));
+}
+
+/*!
+   Removes draft message asynchronously
+ */
+QPointer<NmOperation> NmFrameworkAdapter::removeDraftMessage(NmMessage *message)
+{
+    NM_FUNCTION;
+    
+    QPointer<NmOperation> oper = new NmFwaRemoveDraftMessageOperation(*this, message, *mFSfw);
+    return oper;
+}
+
+/*!
+   function to process updateActiveFolder. This method may leave.
+ */
+void NmFrameworkAdapter::doUpdateActiveFolderL(
+    const NmId &mailboxId, const NmId &folderId)
+{
+    if ((mFSfw) && (!mCurrentMailBox || mCurrentMailBox->GetId()!=mailboxId)) {
+        mEmailExtension = NULL;        
+        delete mCurrentMailBox;
+        mCurrentMailBox = NULL;
+        mCurrentMailBox = mFSfw->GetMailBoxByUidL(mailboxId);
+        }
+    CEmailExtension *extension = getEMailStateExtensionL();
+    CMailboxStateExtension *boxExtension = 
+        static_cast<CMailboxStateExtension*>(extension);        
+    if (boxExtension) {
+        boxExtension->NotifyActiveFolderChanged(mailboxId, folderId);    
+    }
+}
+
+/*!
+   function to process updateActiveFolder. This method may leave.
+ */
+CEmailExtension* NmFrameworkAdapter::getEMailStateExtensionL()
+{      
+    if (!mEmailExtension && mCurrentMailBox) {
+        mEmailExtension = 
+            mCurrentMailBox->ExtensionL(KEmailMailboxStateExtensionUid);
+    }    
+    return mEmailExtension;
+}
 
 /*!
     Starts an asynchronous search for messages with the given search strings.
@@ -581,6 +724,8 @@
                                  const QStringList &searchStrings,
                                  NmMailboxSearchObserver &searchObserver)
 {
+    NM_FUNCTION;
+    
     // CFSMailBox has no support for search using folder IDs.
     Q_UNUSED(folderIds); 
 
@@ -628,6 +773,8 @@
     const NmId &folderId,
     const NmId &messageId )
 {
+    NM_FUNCTION;
+    
     NmOperation *oper = new NmFwaMessageFetchingOperation(mailboxId, folderId, messageId, *mFSfw);
     return oper;
 }
@@ -648,12 +795,37 @@
     const NmId &messageId,
     const NmId &messagePartId)
 {
+    NM_FUNCTION;
+    
     QPointer<NmOperation> oper = new NmFwaMessagePartFetchingOperation(
             mailboxId, folderId, messageId, messagePartId, *mFSfw);
     return oper;
 }
 
 /*!
+    Starts a message parts fetching operation.
+
+    \param mailboxId Id of the mailbox containing the folder.
+    \param folderId Id of the folder containing the message.
+    \param messageId Id of message containing the message parts
+    \param messagePartIds ids of message parts
+
+    \return An NmOperation object for the operation, ownership is transferred to caller
+ */
+QPointer<NmOperation> NmFrameworkAdapter::fetchMessageParts( 
+    const NmId &mailboxId,
+    const NmId &folderId,
+    const NmId &messageId,
+    const QList<NmId> &messagePartIds)
+{
+    NM_FUNCTION;
+    
+    QPointer<NmOperation> oper = new NmFwaMessagePartsFetchingOperation(
+            mailboxId, folderId, messageId, messagePartIds, *mFSfw);
+    return oper;  
+}
+
+/*!
     Returns sharable file handle to message part content
 
     \param mailboxId Id of the mailbox containing the folder.
@@ -669,6 +841,8 @@
         const NmId &messageId,
         const NmId &messagePartId)
 {
+    NM_FUNCTION;
+    
     XQSharableFile retFile;
     TFSMailDetails details(EFSMsgDataEnvelope);
     TFSMailMsgId fsMboxId(mailboxId);
@@ -705,6 +879,8 @@
     const NmId& mailboxId,
     NmFolderType folderType )
 {
+    NM_FUNCTION;
+    
     TFSMailMsgId folderId;
     NmId resultId(0);
     CFSMailBox * currentMailbox(NULL);
@@ -754,6 +930,8 @@
  */
 int NmFrameworkAdapter::refreshMailbox(NmId mailboxId)
 {
+    NM_FUNCTION;
+    
     TRAPD(err, RefreshMailboxL(mailboxId)); // return value not used
     return ( err == KErrNone ) ? NmNoError : NmGeneralError;
 }
@@ -766,6 +944,8 @@
  */
 int NmFrameworkAdapter::goOnline(const NmId& mailboxId)
 {
+    NM_FUNCTION;
+    
     TRAPD(err, GoOnlineL(mailboxId)); // return value not used
     return ( err == KErrNone ) ? NmNoError : NmGeneralError;
 }
@@ -778,6 +958,8 @@
  */
 int NmFrameworkAdapter::goOffline(const NmId& mailboxId)
 {
+    NM_FUNCTION;
+    
     TRAPD(err, GoOfflineL(mailboxId)); // return value not used
     return ( err == KErrNone ) ? NmNoError : NmGeneralError;
 }
@@ -800,6 +982,8 @@
     const NmId &messageId,
     NmMessagePart &messagePart)
 {
+    NM_FUNCTION;
+    
     TRAPD(err, contentToMessagePartL(mailboxId,folderId,messageId,messagePart));
     return err;
 }
@@ -813,6 +997,8 @@
     const NmId &messageId,
     NmMessagePart &messagePart)
 {
+    NM_FUNCTION;
+    
     CFSMailMessagePart* cfsPart = CFSMailMessagePart::NewLC(messageId,messagePart);
     cfsPart->SetMailBoxId(TFSMailMsgId(mailboxId));
     cfsPart->SetFolderId(TFSMailMsgId(folderId));
@@ -887,6 +1073,8 @@
 	const NmId &folderId,
 	const QList<NmId> &messageIdList)
 {
+    NM_FUNCTION;
+    
     TInt err = NmNoError;
     RArray<TFSMailMsgId> messageIds;
     for (TInt i=0; i<messageIdList.size(); i++) {
@@ -917,8 +1105,9 @@
 	const NmId &folderId,
 	const QList<const NmMessageEnvelope*> &envelopeList)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(folderId);
-    NMLOG("NmFrameworkAdapter::storeEnvelopes() <---");
 
     QPointer<NmStoreEnvelopesOperation> operation(NULL);
     RPointerArray<CFSMailMessage> envelopeMessages;
@@ -935,7 +1124,6 @@
                 *mFSfw);
         }
 
-    NMLOG("NmFrameworkAdapter::storeEnvelopes() --->");
     return operation;
 }
 
@@ -948,6 +1136,8 @@
  */
 QPointer<NmMessageCreationOperation> NmFrameworkAdapter::createNewMessage(const NmId &mailboxId)
 {
+    NM_FUNCTION;
+    
     QPointer<NmMessageCreationOperation> oper =
         new NmFwaMessageCreationOperation(mailboxId, *mFSfw);
     return oper;
@@ -965,6 +1155,8 @@
     const NmId &mailboxId,
     const NmId &originalMessageId)
 {
+    NM_FUNCTION;
+    
     QPointer<NmMessageCreationOperation> oper =
         new NmFwaForwardMessageCreationOperation(mailboxId, originalMessageId, *mFSfw);
     return oper;
@@ -984,6 +1176,8 @@
     const NmId &originalMessageId,
     const bool replyAll)
 {
+    NM_FUNCTION;
+    
     QPointer<NmMessageCreationOperation> oper =
         new NmFwaReplyMessageCreationOperation(mailboxId, originalMessageId, replyAll, *mFSfw);
     return oper;
@@ -994,6 +1188,8 @@
  */
 int NmFrameworkAdapter::saveMessage(const NmMessage &message)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(message);
     return NmNoError;
 }
@@ -1003,6 +1199,8 @@
  */
 QPointer<NmOperation> NmFrameworkAdapter::saveMessageWithSubparts(const NmMessage &message)
 {
+    NM_FUNCTION;
+    
     CFSMailMessage * cfsMessage = NULL;
     QPointer<NmOperation> oper(NULL);
 
@@ -1028,6 +1226,8 @@
     TAny* param2,
     TAny* param3)
 {
+    NM_FUNCTION;
+    
     switch (aEvent) {
         // Mailbox related events:
         case TFSEventNewMailbox:
@@ -1141,6 +1341,8 @@
     const NmId& folderId,
     const NmId& messageId)
 {
+    NM_FUNCTION;
+    
     TRAPD(error, removeMessageL(mailboxId, folderId, messageId));
     return error;
 }
@@ -1152,6 +1354,8 @@
 */
 void NmFrameworkAdapter::subscribeMailboxEvents(const NmId& mailboxId)
 {
+    NM_FUNCTION;
+    
     TRAP_IGNORE(mFSfw->SubscribeMailboxEventsL(mailboxId, *this));
 }
 
@@ -1162,11 +1366,15 @@
 */
 void NmFrameworkAdapter::unsubscribeMailboxEvents(const NmId& mailboxId)
 {
+    NM_FUNCTION;
+    
     mFSfw->UnsubscribeMailboxEvents(mailboxId, *this);
 }
 
 NmId NmFrameworkAdapter::getMailboxIdByMailMsgId(TFSMailMsgId mailbox)
 {
+    NM_FUNCTION;
+    
     NmId nmId(0);
 
     QList<NmId> mailboxIds;
@@ -1191,6 +1399,8 @@
     const NmId& folderId,
     const NmId& messageId)
 {
+    NM_FUNCTION;
+    
     CFSMailFolder* folder = mFSfw->GetFolderByUidL( TFSMailMsgId(mailboxId), TFSMailMsgId(folderId));
     CleanupStack::PushL(folder);
     if ( folder ) {
@@ -1206,6 +1416,8 @@
 QPointer<NmMessageSendingOperation> NmFrameworkAdapter::sendMessage(
     NmMessage *message)
 {
+    NM_FUNCTION;
+    
     QPointer<NmMessageSendingOperation>oper = new NmFwaMessageSendingOperation(*this, message, *mFSfw);
 	return oper;
 }
@@ -1217,6 +1429,8 @@
     const NmMessage &message,
     const QList<QString> &fileList)
 {
+    NM_FUNCTION;
+    
     QPointer<NmAddAttachmentsOperation>oper = new NmFwaAddAttachmentsOperation(message, fileList, *mFSfw);
     return oper;
 }
@@ -1228,26 +1442,19 @@
     const NmMessage &message,
     const NmId &attachmentPartId)
 {
+    NM_FUNCTION;
+    
     QPointer<NmOperation> oper = new NmFwaRemoveAttachmentOperation(message, attachmentPartId, *mFSfw);
     return oper;
 }
 
 /*!
-   Checks outbox for messages
- */
-QPointer<NmCheckOutboxOperation> NmFrameworkAdapter::checkOutbox(const NmId& mailboxId)
-{
-    QPointer<NmCheckOutboxOperation> oper =
-        new NmFwaCheckOutboxOperation(mailboxId, *mFSfw);
-
-    return oper;
-}
-
-/*!
     Returns the current sync state of the given mailbox
  */
 NmSyncState NmFrameworkAdapter::syncState(const NmId& mailboxId) const
 {
+    NM_FUNCTION;
+    
    CFSMailBox* mailBox = NULL;
    TRAPD(err, mailBox = mFSfw->GetMailBoxByUidL(TFSMailMsgId(mailboxId)) );
    if (KErrNone == err && mailBox) {
@@ -1270,6 +1477,8 @@
  */
 NmConnectState NmFrameworkAdapter::connectionState(const NmId& mailboxId) const
 {
+    NM_FUNCTION;
+    
     CFSMailBox* mailBox = NULL;
     TRAPD(err, mailBox = mFSfw->GetMailBoxByUidL(TFSMailMsgId(mailboxId)) );
     if (KErrNone == err && mailBox) {
@@ -1294,6 +1503,8 @@
 CFSMailMessage* NmFrameworkAdapter::mailMessageFromEnvelopeL(
     const NmMessageEnvelope& envelope)
 {
+    NM_FUNCTION;
+    
     NmMessage* nmMessage = new(ELeave) NmMessage( envelope );
     CFSMailMessage* message = CFSMailMessage::NewL( *nmMessage );
     delete nmMessage;
@@ -1309,6 +1520,8 @@
         CFSMailMessagePart *cfsParent,
         NmMessagePart *nmParent)
 {
+    NM_FUNCTION;
+    
     User::LeaveIfNull(cfsParent);
     User::LeaveIfNull(nmParent);
 
@@ -1332,6 +1545,8 @@
  */
 int NmFrameworkAdapter::RefreshMailboxL(NmId mailboxId)
 {
+    NM_FUNCTION;
+    
     int result(KErrNotFound);
     CFSMailBox *currentMailbox(NULL);
     currentMailbox = mFSfw->GetMailBoxByUidL(mailboxId);
@@ -1349,6 +1564,8 @@
  */
 int NmFrameworkAdapter::GoOnlineL(const NmId& mailboxId)
 {
+    NM_FUNCTION;
+    
     int result(KErrNotFound);
     CFSMailBox *currentMailbox(NULL);
     currentMailbox = mFSfw->GetMailBoxByUidL(mailboxId);
@@ -1366,6 +1583,8 @@
  */
 int NmFrameworkAdapter::GoOfflineL(const NmId& mailboxId)
 {
+    NM_FUNCTION;
+    
 	int result(KErrNotFound);
     CFSMailBox *currentMailbox(NULL);
     currentMailbox = mFSfw->GetMailBoxByUidL(mailboxId);
@@ -1383,6 +1602,8 @@
  */
 void NmFrameworkAdapter::handleMailboxEvent( TFSMailMsgId mailbox, NmMailboxEvent event)
 {
+    NM_FUNCTION;
+    
     QList<NmId> mailboxIds;
     NmId nmId;
     if (event == NmMailboxDeleted) {
@@ -1403,6 +1624,8 @@
     NmMessageEvent event,
     TFSMailMsgId mailbox)
 {
+    NM_FUNCTION;
+    
     NmId nmMsgId(0);
     QList<NmId> messageIds;
     RArray<TFSMailMsgId>* newFsEntries = reinterpret_cast<RArray<TFSMailMsgId>*> (param1);
@@ -1423,6 +1646,8 @@
  */
 void NmFrameworkAdapter::handleMailMoved(TAny* param1,TAny* param2,TAny* param3, TFSMailMsgId mailbox)
 {
+    NM_FUNCTION;
+    
     NmId nmMsgId(0);
     QList<NmId> messageIds;
     RArray<TFSMailMsgId>* newFsEntries = reinterpret_cast<RArray<TFSMailMsgId>*> (param1);
@@ -1448,6 +1673,8 @@
  */
 void NmFrameworkAdapter::handleMailCopied(TAny* param1,TAny* param2, TFSMailMsgId mailbox)
 {
+    NM_FUNCTION;
+    
     NmId nmMsgId(0);
     QList<NmId> messageIds;
     RArray<TFSMailMsgId>* newFsEntries = reinterpret_cast<RArray<TFSMailMsgId>*> (param1);
@@ -1466,6 +1693,8 @@
 
 void NmFrameworkAdapter::handleSyncstateEvent(TAny* param1, TFSMailMsgId mailbox)
 {
+    NM_FUNCTION;
+    
     TSSMailSyncState* state = static_cast<TSSMailSyncState*>( param1 );
     NmOperationCompletionEvent event;
     event.mMailboxId = NmConverter::mailMsgIdToNmId(mailbox);
--- a/emailuis/nmframeworkadapter/src/nmfwaaddattachmentsoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmfwaaddattachmentsoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -39,6 +39,8 @@
     CFSMailClient &mailClient) :
         mMailClient(mailClient)
 {
+    NM_FUNCTION;
+    
     // Take own copy of the file list.
     mFileList.clear();
     for (int i=0; i<fileList.count(); ++i) {
@@ -53,6 +55,8 @@
  */
 NmFwaAddAttachmentsOperation::~NmFwaAddAttachmentsOperation()
 {
+    NM_FUNCTION;
+    
     // Cancel all running operations.
     doCancelOperation();
     mFileList.clear(); 
@@ -67,6 +71,8 @@
  */
 void NmFwaAddAttachmentsOperation::doRunAsyncOperation()
 {
+    NM_FUNCTION;
+    
     TRAPD(err, doRunAsyncOperationL());
     // Trap harness catches an error.
     if (err != KErrNone) {
@@ -104,6 +110,8 @@
  */
 void NmFwaAddAttachmentsOperation::doRunAsyncOperationL()
 {
+    NM_FUNCTION;
+    
     if (mFileList.count() > 0) {
         // Add new attachment from first file in the list.
         HBufC *fileName = NmConverter::qstringToHBufCLC(mFileList.first());
@@ -124,6 +132,8 @@
 void NmFwaAddAttachmentsOperation::RequestResponseL(TFSProgress aEvent,
                                                     TInt aRequestId)
 {
+    NM_FUNCTION;
+    
     int err = NmNoError;
 
     // Request id should always be valid. If not,
@@ -192,12 +202,24 @@
 }
 
 /*!
+ * Complete the operation
+ */
+void NmFwaAddAttachmentsOperation::doCompleteOperation()
+{
+    NM_FUNCTION;
+    
+    mRequestId = NmNotFoundError;
+}
+
+/*!
     Cancels the async operation. \sa NmOperation
  */
 void NmFwaAddAttachmentsOperation::doCancelOperation()
 {
-    if (mRequestId != KErrNotFound) {
+    NM_FUNCTION;
+    
+    if (mRequestId >= 0) {
         TRAP_IGNORE(mMailClient.CancelL(mRequestId));
+        mRequestId = NmNotFoundError;
     }
-    mRequestId = NmCancelError;
 }
--- a/emailuis/nmframeworkadapter/src/nmfwacheckoutboxoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,115 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#include "nmframeworkadapterheaders.h"
-
-NmFwaCheckOutboxOperation::NmFwaCheckOutboxOperation(
-    const NmId &mailboxId,
-    CFSMailClient &mailClient) :
-        mMailboxId(mailboxId),
-        mMailClient(mailClient),
-        mFound(false),
-        mMessageId(0)
-{
-}
-
-NmFwaCheckOutboxOperation::~NmFwaCheckOutboxOperation()
-{
-}
-
-void NmFwaCheckOutboxOperation::doRunAsyncOperation()
-{
-    TRAPD(err, doRunAsyncOperationL());
-    
-    if (err) {
-        completeOperation(NmGeneralError);
-    }
-}
-
-/*!
-    Gets the id of the message with index '0' in the Outbox .
-
-    \return true if there is a message in Outbox.
- */
-bool NmFwaCheckOutboxOperation::getMessageId(NmId &messageId) const
-{
-    messageId = mMessageId;
-    return mFound;
-}
-
-void NmFwaCheckOutboxOperation::doRunAsyncOperationL()
-{
-    int err = NmNotFoundError;
-
-    TFSMailMsgId mailboxId(mMailboxId.pluginId32(), mMailboxId.id32());
-    
-    CFSMailBox *mailbox = mMailClient.GetMailBoxByUidL(mailboxId);
-    
-    if (mailbox) {
-        CleanupStack::PushL(mailbox);
-    
-        TFSMailMsgId folderId = mailbox->GetStandardFolderId(EFSOutbox);
-
-        CFSMailFolder *folder =
-            mMailClient.GetFolderByUidL(mailboxId, folderId);
-
-        if (folder) {
-            CleanupStack::PushL(folder);
-
-            TFSMailSortCriteria sortCriteria;
-            sortCriteria.iField = EFSMailSortByDate;
-            sortCriteria.iOrder = EFSMailDescending;
-            
-            RArray<TFSMailSortCriteria> sortArray;
-            CleanupClosePushL(sortArray);
-            sortArray.AppendL(sortCriteria);
-            
-            MFSMailIterator *iter = folder->ListMessagesL(
-                EFSMsgDataIdOnly, sortArray);
-            
-            CleanupStack::PopAndDestroy(); // sortArray
-
-            if (iter) {
-                CleanupDeletePushL(iter);
-
-                TFSMailMsgId nullId;
-                TInt numberOfItems = 1;
-                RPointerArray<CFSMailMessage> messages;
-
-                CleanupClosePushL(messages);
-                TBool unused = iter->NextL(nullId, numberOfItems, messages);
-
-                if (messages.Count() > 0) {
-                    mMessageId = messages[0]->GetMessageId().GetNmId();
-                    mFound = true;
-                }
-
-                messages.ResetAndDestroy();
-                CleanupStack::PopAndDestroy(); // messages
-
-                CleanupStack::PopAndDestroy(iter);
-                
-                err = NmNoError;
-            }
-            CleanupStack::PopAndDestroy(folder);
-        }
-        CleanupStack::PopAndDestroy(mailbox);
-    }
-
-    completeOperation(err);
-}
-
--- a/emailuis/nmframeworkadapter/src/nmfwaforwardmessagecreationoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmfwaforwardmessagecreationoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -24,14 +24,18 @@
     NmFwaMessageCreationOperation(mailboxId, mailClient),
     mOriginalMessageId(originalMessageId)
 {
+    NM_FUNCTION;
 }
 
 NmFwaForwardMessageCreationOperation::~NmFwaForwardMessageCreationOperation()
 {
+    NM_FUNCTION;
 }
 
 void NmFwaForwardMessageCreationOperation::doRunAsyncOperation()
 {
+    NM_FUNCTION;
+    
     const TFSMailMsgId mailMsgId(mMailboxId.pluginId32(), mMailboxId.id32());
 
     CFSMailBox *mailBox = NULL;
--- a/emailuis/nmframeworkadapter/src/nmfwamessagecreationoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmfwamessagecreationoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -40,6 +40,7 @@
         mMailClient(mailClient),
         mRequestId(NmNotFoundError)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -47,9 +48,10 @@
  */
 NmFwaMessageCreationOperation::~NmFwaMessageCreationOperation()
 {
+    NM_FUNCTION;
+    
     doCancelOperation();
     delete mMessage;
-    NMLOG("NmFwaMessageCreationOperation::~NmFwaMessageCreationOperation --->");
 }
 
 /*!
@@ -59,6 +61,8 @@
  */
 void NmFwaMessageCreationOperation::doRunAsyncOperation()
 {
+    NM_FUNCTION;
+    
     const TFSMailMsgId mailMsgId(mMailboxId.pluginId32(), mMailboxId.id32());
 
     CFSMailBox *mailBox = NULL;
@@ -105,6 +109,8 @@
  */
 void NmFwaMessageCreationOperation::doCompleteOperation()
 {
+    NM_FUNCTION;
+    
     mRequestId = NmNotFoundError;
 }
 
@@ -113,6 +119,8 @@
  */
 void NmFwaMessageCreationOperation::doCancelOperation()
 {
+    NM_FUNCTION;
+    
     if (mRequestId >= 0) {
         TRAP_IGNORE(mMailClient.CancelL(mRequestId));
         mRequestId = NmNotFoundError;
@@ -127,6 +135,8 @@
  */
 NmMessage *NmFwaMessageCreationOperation::getMessage()
 {
+    NM_FUNCTION;
+    
     // Ownership changes
     NmMessage *ret = mMessage;
     mMessage = NULL;
@@ -141,6 +151,8 @@
  */
 NmId NmFwaMessageCreationOperation::getMessageId()
 {
+    NM_FUNCTION;
+    
     NmId messageId;
     
     if (mMessage) {
@@ -159,6 +171,8 @@
 void NmFwaMessageCreationOperation::RequestResponseL(TFSProgress aEvent,
                                                      TInt aRequestId)
 {
+    NM_FUNCTION;
+    
     TFSProgress::TFSProgressStatus status = aEvent.iProgressStatus;
 
     if (aRequestId == mRequestId) {
--- a/emailuis/nmframeworkadapter/src/nmfwamessagefetchingoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmfwamessagefetchingoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -29,16 +29,20 @@
         mRequestId(0)
 
 {
+    NM_FUNCTION;
 }
 
 NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation()
 {
+    NM_FUNCTION;
+    
     doCancelOperation();
-    NMLOG("NmFwaMessageFetchingOperation::~NmFwaMessageFetchingOperation --->");
 }
 
 void NmFwaMessageFetchingOperation::doRunAsyncOperation()
 {
+    NM_FUNCTION;
+    
     const TFSMailMsgId mailboxId(mMailboxId.pluginId32(), mMailboxId.id32());
     const TFSMailMsgId folderId(mFolderId.pluginId32(), mFolderId.id32());
     const TFSMailMsgId messageId(mMessageId.pluginId32(), mMessageId.id32());
@@ -62,9 +66,27 @@
     }
 }
 
+/*!
+ * Complete the operation
+ */
+void NmFwaMessageFetchingOperation::doCompleteOperation()
+{
+    NM_FUNCTION;
+    
+    mRequestId = NmNotFoundError;
+}
+
+/*!
+    Cancels the async operation. \sa NmOperation
+ */
 void NmFwaMessageFetchingOperation::doCancelOperation()
 {
-    TRAP_IGNORE(mMailClient.CancelL(mRequestId));
+    NM_FUNCTION;
+    
+    if (mRequestId >= 0) {
+        TRAP_IGNORE(mMailClient.CancelL(mRequestId));
+        mRequestId = NmNotFoundError;
+    }
 }
 
 /*!
@@ -75,6 +97,8 @@
  */
 void NmFwaMessageFetchingOperation::RequestResponseL(TFSProgress aEvent, TInt aRequestId)
 {
+    NM_FUNCTION;
+    
     if (aRequestId == mRequestId) {
         if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) {
             completeOperation(NmNoError);
--- a/emailuis/nmframeworkadapter/src/nmfwamessagepartfetchingoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmfwamessagepartfetchingoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -35,7 +35,7 @@
     mRequestId(0)
 
 {
-    
+    NM_FUNCTION;
 }
 
 /*!
@@ -43,8 +43,9 @@
  */
 NmFwaMessagePartFetchingOperation::~NmFwaMessagePartFetchingOperation()
 {
+    NM_FUNCTION;
+    
     doCancelOperation();
-    NMLOG("NmFwaMessagePartFetchingOperation::~NmFwaMessagePartFetchingOperation --->");
 }
 
 /*!
@@ -52,6 +53,8 @@
  */
 void NmFwaMessagePartFetchingOperation::RequestResponseL(TFSProgress aEvent, TInt aRequestId)
 {
+    NM_FUNCTION;
+    
     if (aRequestId == mRequestId) {
         if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) {
             completeOperation(aEvent.iError);
@@ -81,6 +84,8 @@
  */
 void NmFwaMessagePartFetchingOperation::doRunAsyncOperation()
 {
+    NM_FUNCTION;
+    
     TRAPD(err, doRunAsyncOperationL());
     if (err != KErrNone) {
         completeOperation(NmGeneralError);
@@ -92,6 +97,8 @@
  */
 void NmFwaMessagePartFetchingOperation::doRunAsyncOperationL()
 {
+    NM_FUNCTION;
+    
     const TFSMailMsgId mailboxId(mMailboxId.pluginId32(), mMailboxId.id32());
     const TFSMailMsgId folderId(mFolderId.pluginId32(), mFolderId.id32());
     const TFSMailMsgId messageId(mMessageId.pluginId32(), mMessageId.id32());
@@ -119,9 +126,24 @@
 }
 
 /*!
+ * Complete the operation
+ */
+void NmFwaMessagePartFetchingOperation::doCompleteOperation()
+{
+    NM_FUNCTION;
+    
+    mRequestId = NmNotFoundError;
+}
 
+/*!
+    Cancels the async operation. \sa NmOperation
  */
 void NmFwaMessagePartFetchingOperation::doCancelOperation()
 {
-    TRAP_IGNORE(mMailClient.CancelL(mRequestId));
+    NM_FUNCTION;
+    
+    if (mRequestId >= 0) {
+        TRAP_IGNORE(mMailClient.CancelL(mRequestId));
+        mRequestId = NmNotFoundError;
+    }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmframeworkadapter/src/nmfwamessagepartsfetchingoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "nmframeworkadapterheaders.h"
+
+/*!
+
+ */
+NmFwaMessagePartsFetchingOperation::NmFwaMessagePartsFetchingOperation(
+        const NmId &mailboxId,
+        const NmId &folderId,
+        const NmId &messageId,
+        const QList<NmId> &messagePartIds,
+        CFSMailClient &mailClient)
+  : mMailboxId(mailboxId), 
+    mFolderId(folderId), 
+    mMessageId(messageId), 
+    mMailClient(mailClient), 
+    mLastProgressValue(0), 
+    mRequestId(0)
+
+{
+    NM_FUNCTION;
+    
+    // Take own copy of the message part id list.
+    mMessagePartIds.Reset();
+    for (int i=0; i<messagePartIds.count(); ++i) {
+        mMessagePartIds.Append(
+            NmConverter::nmIdToMailMsgId(
+                messagePartIds.at(i)));
+    }
+    
+}
+
+/*!
+
+ */
+NmFwaMessagePartsFetchingOperation::~NmFwaMessagePartsFetchingOperation()
+{
+    NM_FUNCTION;
+    
+    doCancelOperation();
+}
+
+/*!
+
+ */
+void NmFwaMessagePartsFetchingOperation::RequestResponseL(TFSProgress aEvent, TInt aRequestId)
+{
+    NM_FUNCTION;
+    
+    if (aRequestId == mRequestId) {
+        if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) {
+            completeOperation(aEvent.iError);
+        }
+        else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled) {
+            completeOperation(NmCancelError);
+        }
+        else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_Status) {
+            int progress = 0;
+            if (aEvent.iMaxCount > 0) {
+                // calculate progress per cents
+                qreal counterValue = aEvent.iCounter;
+                qreal maxCount = aEvent.iMaxCount;
+                progress = (counterValue / maxCount)*100;
+            }
+            if (progress > mLastProgressValue) {
+                // send only increasing values to prevent downward changing percentage
+                mLastProgressValue = progress;
+                updateOperationProgress(mLastProgressValue);
+            }
+        }
+    }
+}
+
+/*!
+
+ */
+void NmFwaMessagePartsFetchingOperation::doRunAsyncOperation()
+{
+    NM_FUNCTION;
+    
+    TRAPD(err, doRunAsyncOperationL());
+    if (err != KErrNone) {
+        completeOperation(NmGeneralError);
+    }
+}
+
+/*!
+    Leaving version from doRunAsyncOperation
+ */
+void NmFwaMessagePartsFetchingOperation::doRunAsyncOperationL()
+{
+    NM_FUNCTION;
+    
+    if (mMessagePartIds.Count() > 0) {
+        
+        const TFSMailMsgId mailboxId(mMailboxId.pluginId32(), mMailboxId.id32());
+        const TFSMailMsgId folderId(mFolderId.pluginId32(), mFolderId.id32());
+        const TFSMailMsgId messageId(mMessageId.pluginId32(), mMessageId.id32());
+        
+        CFSMailMessage *message(NULL);
+        message = mMailClient.GetMessageByUidL(mailboxId, folderId, messageId, EFSMsgDataEnvelope);
+        CleanupStack::PushL(message);
+       
+        if (message) {
+            CFSMailMessagePart* messagePart = message->ChildPartL( mMessagePartIds[0] );
+            CleanupStack::PushL(messagePart);
+            if (messagePart) {            
+                mRequestId = messagePart->FetchMessagesPartsL(mMessagePartIds,*this,0);
+            }
+            else {
+                completeOperation(NmNotFoundError);
+            }
+            CleanupStack::PopAndDestroy(messagePart);
+        }
+        else {
+            completeOperation(NmNotFoundError);
+        }
+        CleanupStack::PopAndDestroy(message);
+    }
+    else {
+        completeOperation(NmNotFoundError);
+    }
+}
+
+/*!
+ * Complete the operation
+ */
+void NmFwaMessagePartsFetchingOperation::doCompleteOperation()
+{
+    NM_FUNCTION;
+    
+    mRequestId = NmNotFoundError;
+}
+
+/*!
+    Cancels the async operation. \sa NmOperation
+ */
+void NmFwaMessagePartsFetchingOperation::doCancelOperation()
+{
+    NM_FUNCTION;
+    
+    if (mRequestId >= 0) {
+        TRAP_IGNORE(mMailClient.CancelL(mRequestId));
+        mRequestId = NmNotFoundError;
+    }
+}
--- a/emailuis/nmframeworkadapter/src/nmfwamessagesendingoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmfwamessagesendingoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -43,6 +43,8 @@
         mRequestId(NmNotFoundError),
         mSaved(false)
 {
+    NM_FUNCTION;
+    
     mMailClient.IncReferenceCount();
 }
 
@@ -51,13 +53,14 @@
  */
 NmFwaMessageSendingOperation::~NmFwaMessageSendingOperation()
 {
+    NM_FUNCTION;
+    
     if (mSaveOperation && mSaveOperation->isRunning()) {
         mSaveOperation->cancelOperation();
     }
     doCancelOperation();
     mMailClient.Close(); // decrease ref count
     delete mMessage;
-    NMLOG("NmFwaMessageSendingOperation::~NmFwaMessageSendingOperation --->");
 }
 
 /*!
@@ -65,6 +68,8 @@
  */
 const NmMessage *NmFwaMessageSendingOperation::getMessage() const
 {
+    NM_FUNCTION;
+    
     return mMessage;
 }
 
@@ -76,6 +81,8 @@
  */
 void NmFwaMessageSendingOperation::doRunAsyncOperation()
 {
+    NM_FUNCTION;
+    
     int err = NmNoError;
     
     if (mSaved) {
@@ -103,6 +110,8 @@
  */
 void NmFwaMessageSendingOperation::doCompleteOperation()
 {
+    NM_FUNCTION;
+    
     mRequestId = NmNotFoundError;
 }
 
@@ -111,6 +120,8 @@
  */
 void NmFwaMessageSendingOperation::doCancelOperation()
 {
+    NM_FUNCTION;
+    
     if (mRequestId >= 0) {
         TRAP_IGNORE(mMailClient.CancelL(mRequestId));
         mRequestId = NmNotFoundError;
@@ -129,6 +140,8 @@
 void NmFwaMessageSendingOperation::RequestResponseL(TFSProgress aEvent,
                                                     TInt aRequestId)
 {
+    NM_FUNCTION;
+    
     TFSProgress::TFSProgressStatus status = aEvent.iProgressStatus;
 
     if (aRequestId == mRequestId) {
@@ -149,6 +162,8 @@
  */
 void NmFwaMessageSendingOperation::handleCompletedSaveOperation(int error)
 {
+    NM_FUNCTION;
+    
     if (error == NmNoError) {
         mSaved = true;
         doRunAsyncOperation();
@@ -163,6 +178,8 @@
 */
 int NmFwaMessageSendingOperation::saveMessageWithSubparts()
 {
+    NM_FUNCTION;
+    
     int ret = NmNotFoundError;
     if (mMessage) {
         if (mSaveOperation && mSaveOperation->isRunning()) {
@@ -189,7 +206,8 @@
  */
 int NmFwaMessageSendingOperation::sendMessageL()
 {
-    NMLOG("NmFwaMessageSendingOperation::sendMessageL");
+    NM_FUNCTION;
+    
     int ret = NmNotFoundError;
     
     if (mMessage) {
--- a/emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmfwaremoveattachmentoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -40,6 +40,8 @@
         mMessage(message),
         mMailClient(mailClient)
 {
+    NM_FUNCTION;
+    
     // Take a copy because original will be deleted during the operation
     mAttachmentPartId.setId(attachmentPartId.id());
 }
@@ -49,6 +51,8 @@
  */
 NmFwaRemoveAttachmentOperation::~NmFwaRemoveAttachmentOperation()
 {
+    NM_FUNCTION;
+    
     doCancelOperation();
 }
 
@@ -60,6 +64,8 @@
  */
 void NmFwaRemoveAttachmentOperation::doRunAsyncOperation()
 {
+    NM_FUNCTION;
+    
     TRAPD(err, doRunAsyncOperationL());
     if (err != KErrNone) {
         completeOperation(NmGeneralError);
@@ -72,6 +78,8 @@
  */
 void NmFwaRemoveAttachmentOperation::doRunAsyncOperationL()
 {
+    NM_FUNCTION;
+    
     CFSMailMessage *msg = NULL;
 
     msg = CFSMailMessage::NewL(mMessage);
@@ -110,6 +118,8 @@
 void NmFwaRemoveAttachmentOperation::RequestResponseL(TFSProgress aEvent,
                                                       TInt aRequestId)
 {
+    NM_FUNCTION;
+    
     if (aRequestId == mRequestId) {
         TFSProgress::TFSProgressStatus status = aEvent.iProgressStatus;
         if (status == TFSProgress::EFSStatus_RequestComplete) {
@@ -143,6 +153,8 @@
  */
 void NmFwaRemoveAttachmentOperation::doCancelOperation()
 {
+    NM_FUNCTION;
+    
     if (mRequestId >= 0) {
         TRAP_IGNORE(mMailClient.CancelL(mRequestId));
         mRequestId = KErrNotFound;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmframeworkadapter/src/nmfwaremovedraftmessageoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+#include "nmframeworkadapterheaders.h"
+
+/*!
+    \class NmFwaRemoveDraftMessageOperation
+    
+    \brief NmFwaRemoveDraftMessageOperation is an async operation which deletes a draft message.
+    
+    NmFwaRemoveDraftMessageOperation is an async operation which cdeletes a draft message. 
+    \sa NmOperation
+ */
+
+/*!
+    Constructor
+    
+    \param message pointer to the message under sent, ownership is transferred to operation
+    \param mailClient Reference to mail client object.
+ */
+NmFwaRemoveDraftMessageOperation::NmFwaRemoveDraftMessageOperation(
+    NmDataPluginInterface &pluginInterface,
+    NmMessage *message,
+    CFSMailClient &mailClient) :
+        mPluginInterface(pluginInterface),
+        mMessage(message),
+        mMailClient(mailClient),
+        mRequestId(NmNotFoundError)
+{
+    NM_FUNCTION;
+    
+    mMailClient.IncReferenceCount();
+}
+
+/*!
+    Destructor
+ */
+NmFwaRemoveDraftMessageOperation::~NmFwaRemoveDraftMessageOperation()
+{
+    NM_FUNCTION;
+    
+    doCancelOperation();
+    mMailClient.Close(); // decrease ref count
+    delete mMessage;
+    mMessage = NULL;
+}
+
+/*!
+    Called after base object construction via timer event, runs the
+    async operation.
+    
+    \sa NmOperation
+ */
+void NmFwaRemoveDraftMessageOperation::doRunAsyncOperation()
+{
+    NM_FUNCTION;
+    
+    TRAPD( err, removeMessageL() );
+        
+    if (err != KErrNone) {
+        completeOperation(NmGeneralError);
+    }
+}
+
+/*!
+    
+ */
+void NmFwaRemoveDraftMessageOperation::doCompleteOperation()
+{
+    NM_FUNCTION;
+    
+    mRequestId = NmNotFoundError;
+}
+
+/*!
+    
+ */
+void NmFwaRemoveDraftMessageOperation::doCancelOperation()
+{
+    NM_FUNCTION;
+
+    // remove draft operation is not cancellable
+}
+    
+/*!
+    Asynchronous request response message.
+    
+    \param aEvent Plugin event description.
+    \param aRequestId Request id of asyncronous operation.
+ */
+void NmFwaRemoveDraftMessageOperation::RequestResponseL(TFSProgress aEvent,
+                                                    TInt aRequestId)
+{
+    NM_FUNCTION;
+    
+    TFSProgress::TFSProgressStatus status = aEvent.iProgressStatus;
+
+    if (aRequestId == mRequestId) {
+        if (status == TFSProgress::EFSStatus_RequestComplete && !aEvent.iError) {
+            completeOperation(NmNoError);
+        }
+        else {
+            completeOperation(NmGeneralError);
+        }
+    }
+}
+
+/*!
+    Removes the message.
+ */
+void NmFwaRemoveDraftMessageOperation::removeMessageL()
+{
+    NM_FUNCTION;
+    
+    TFSMailMsgId mailboxId( mMessage->envelope().mailboxId() );
+    TFSMailMsgId folderId( mMessage->envelope().folderId() );
+    TFSMailMsgId messageId( mMessage->envelope().messageId() );
+    
+    CFSMailFolder* folder = mMailClient.GetFolderByUidL( mailboxId, folderId );
+    CleanupStack::PushL(folder);
+    if ( folder ) {
+        // try to use the asynchronous version first
+        TRAPD(err, mRequestId = folder->RemoveMessageL( messageId, *this ));
+        
+        if(err == KErrFSMailPluginNotSupported) {
+            // async version not supported, use sync version
+            folder->RemoveMessageL( messageId );
+            completeOperation(NmNoError);
+        }
+    }
+    else {
+        User::Leave( KErrNotFound );
+    }
+    CleanupStack::PopAndDestroy(folder);
+}
--- a/emailuis/nmframeworkadapter/src/nmfwareplymessagecreationoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmfwareplymessagecreationoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -26,14 +26,18 @@
     mOriginalMessageId(originalMessageId),
     mReplyAll(replyAll)
 {
+    NM_FUNCTION;
 }
 
 NmFwaReplyMessageCreationOperation::~NmFwaReplyMessageCreationOperation()
 {
+    NM_FUNCTION;
 }
 
 void NmFwaReplyMessageCreationOperation::doRunAsyncOperation()
 {
+    NM_FUNCTION;
+    
     const TFSMailMsgId mailMsgId(mMailboxId.pluginId32(), mMailboxId.id32());
 
     CFSMailBox *mailBox(NULL);
--- a/emailuis/nmframeworkadapter/src/nmfwastoreenvelopesoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmfwastoreenvelopesoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -25,19 +25,22 @@
         mMailClient(mailClient),
         mRequestId(0)
 {
+    NM_FUNCTION;
+    
     mMessages = messages;
 }
 
 NmFwaStoreEnvelopesOperation::~NmFwaStoreEnvelopesOperation()
 {
-    NMLOG("NmFwaStoreEnvelopesOperation::~NmFwaStoreEnvelopesOperation() <---");
+    NM_FUNCTION;
+    
     mMessages.ResetAndDestroy();
-    NMLOG("NmFwaStoreEnvelopesOperation::~NmFwaStoreEnvelopesOperation() --->");
 }
 
 void NmFwaStoreEnvelopesOperation::doRunAsyncOperation()
 {
-    NMLOG("NmFwaStoreEnvelopesOperation::doRunAsyncOperation() <---");
+    NM_FUNCTION;
+    
     const TFSMailMsgId mailboxId(mMailboxId.pluginId32(), mMailboxId.id32());
     CFSMailBox *mailbox(NULL);
     TRAP_IGNORE( mailbox = mMailClient.GetMailBoxByUidL(mailboxId) );
@@ -56,14 +59,13 @@
         delete mailbox;
         mailbox = NULL;
     }
-    NMLOG("NmFwaStoreEnvelopesOperation::doRunAsyncOperation() --->");
 }
 
 void NmFwaStoreEnvelopesOperation::doCancelOperation()
 {
-    NMLOG("NmFwaStoreEnvelopesOperation::doCancelOperation() <---");
+    NM_FUNCTION;
+    
     TRAP_IGNORE(mMailClient.CancelL(mRequestId));
-    NMLOG("NmFwaStoreEnvelopesOperation::doCancelOperation() --->");
 }
 
 /**
@@ -74,7 +76,8 @@
  */
 void NmFwaStoreEnvelopesOperation::RequestResponseL(TFSProgress aEvent, TInt aRequestId)
 {
-    NMLOG("NmFwaStoreEnvelopesOperation::RequestResponseL() <---");
+    NM_FUNCTION;
+    
     if (aRequestId == mRequestId) {
         if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete && aEvent.iParam) {
             completeOperation(NmNoError);
@@ -86,5 +89,4 @@
             completeOperation(NmGeneralError);
         }
     }
-    NMLOG("NmFwaStoreEnvelopesOperation::RequestResponseL() --->");
 }
--- a/emailuis/nmframeworkadapter/src/nmfwastoremessageoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmfwastoremessageoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -25,16 +25,21 @@
         mRequestId(NmNotFoundError),
         mStatus(EStoreHeader)
 {
+    NM_FUNCTION;
 }
 
 NmFwaStoreMessageOperation::~NmFwaStoreMessageOperation()
 {
+    NM_FUNCTION;
+    
     doCancelOperation();
     delete mMessage;
 }
 
 void NmFwaStoreMessageOperation::doRunAsyncOperation()
 {
+    NM_FUNCTION;
+    
     TInt err = KErrNone;
 
     if (mMessage) {
@@ -75,11 +80,15 @@
  */
 void NmFwaStoreMessageOperation::doCompleteOperation()
 {
+    NM_FUNCTION;
+    
     mRequestId = NmNotFoundError;
 }
 
 void NmFwaStoreMessageOperation::doCancelOperation()
 {
+    NM_FUNCTION;
+    
     if (mRequestId >= 0) {
         TRAP_IGNORE(mMailClient.CancelL(mRequestId));
         mRequestId = NmNotFoundError;
@@ -95,6 +104,8 @@
 void NmFwaStoreMessageOperation::RequestResponseL(TFSProgress aEvent,
                                                      TInt aRequestId)
 {
+    NM_FUNCTION;
+    
     if (aRequestId == mRequestId) {
         if (aEvent.iProgressStatus ==
                 TFSProgress::EFSStatus_RequestComplete) {
--- a/emailuis/nmframeworkadapter/src/nmmailboxsearchobserver.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmframeworkadapter/src/nmmailboxsearchobserver.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -29,7 +29,7 @@
 */
 NmMailboxSearchObserver::NmMailboxSearchObserver()
 {
-    
+    NM_FUNCTION;
 }
 
 
@@ -38,7 +38,7 @@
 */
 NmMailboxSearchObserver::~NmMailboxSearchObserver()
 {
-    
+    NM_FUNCTION;
 }
 
 
@@ -52,11 +52,14 @@
 */
 void NmMailboxSearchObserver::MatchFoundL(CFSMailMessage *aMatchMessage)
 {
+    NM_FUNCTION;
+    
     if (aMatchMessage) {
         NmMessage *message = aMatchMessage->GetNmMessage();
 
         if (message) {
-            emit matchFound(message->envelope().messageId());
+            NmMessageEnvelope messageEnvelope = message->envelope();
+            emit matchFound(messageEnvelope.messageId(), messageEnvelope.folderId());
             delete message;
         }
     }
@@ -69,6 +72,8 @@
 */
 void NmMailboxSearchObserver::SearchCompletedL()
 {
+    NM_FUNCTION;
+    
     emit searchComplete();
 }
 
@@ -80,6 +85,8 @@
 void NmMailboxSearchObserver::ClientRequiredSearchPriority(
     TInt *apRequiredSearchPriority)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(apRequiredSearchPriority);
 }
 
--- a/emailuis/nmhswidget/conf/nmhswidgetmail.docml	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/conf/nmhswidgetmail.docml	Wed Jun 23 17:00:39 2010 +0100
@@ -1,88 +1,93 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.0">
-	  <widget name="emailLayoutWidget" type="HbWidget">
-	      <widget name="iconSeparator" type="HbLabel">
-	          <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-	          <icon iconName="note_warning" name="icon"/>
-	          <real name="z" value="1"/>
-	          <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
-	          <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-	          <sizehint height="2" type="PREFERRED" width="50un"/>
-	      </widget>
-	      <widget name="iconNewMail" type="HbLabel">
-	          <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-	          <real name="z" value="2"/>
-	          <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
-	          <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Ignored" verticalStretch="0"/>
-	          <sizehint type="PREFERRED" width="1.25un"/>
-	      </widget>
-	      <widget name="labelSender" type="HbLabel">
-	          <real name="z" value="3"/>
-	          <string name="plainText" value="Mail Spammer"/>
-	          <sizehint height="var(hb-param-text-height-tiny)" type="PREFERRED" width="33.43284un"/>
-	          <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-	          <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
-	      </widget>
-	      <widget name="labelTime" type="HbLabel">
-	          <real name="z" value="4"/>
-	          <string name="plainText" value="12:45pm"/>
-	          <sizehint height="var(hb-param-text-height-tiny)" type="FIXED" width="13un"/>
-	          <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-	          <enums name="alignment" value="AlignRight|AlignTop|AlignTrailing"/>
-                  <fontspec name="fontSpec" role="Secondary" textheight="2.5un"/>
-	      </widget>
-	      <widget name="labelSubject" type="HbLabel">
-	          <real name="z" value="5"/>
-	          <string name="plainText" value="Check out great new medication.."/>
-	          <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-	          <sizehint height="var(hb-param-text-height-tiny)" type="PREFERRED" width="35un"/>
-	          <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
-	      </widget>
-	      <widget name="iconThree" type="HbLabel">
-	          <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-	          <icon iconName="note_warning" name="icon"/>
-	          <real name="z" value="6"/>
-	          <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-	          <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
-	      </widget>
-	      <widget name="iconTwo" type="HbLabel">
-	          <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-	          <icon iconName="note_warning" name="icon"/>
-	          <real name="z" value="7"/>
-	          <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-	          <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
-	      </widget>
-	      <widget name="iconOne" type="HbLabel">
-	          <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-	          <icon iconName="note_warning" name="icon"/>
-	          <real name="z" value="8"/>
-	          <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-	          <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
-	      </widget>
-	      <real name="z" value="1"/>
-	      <sizehint height="11.1un" type="FIXED" width="46un"/>
-	      <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-	      <layout type="anchor">
-	          <anchoritem dst="iconSeparator" dstEdge="LEFT" spacing="2" src="" srcEdge="LEFT"/>
-	          <anchoritem dst="iconSeparator" dstEdge="TOP" spacing="0" src="" srcEdge="TOP"/>
-	          <anchoritem dst="iconSeparator" dstEdge="RIGHT" spacing="-2" src="" srcEdge="RIGHT"/>
-	          <anchoritem dst="iconNewMail" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="LEFT"/>
-	          <anchoritem dst="iconNewMail" dstEdge="TOP" spacing="0.5un" src="iconSeparator" srcEdge="BOTTOM"/>
-	          <anchoritem dst="iconNewMail" dstEdge="BOTTOM" spacing="-0.5un" src="" srcEdge="BOTTOM"/>
-	          <anchoritem dst="labelSender" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="iconNewMail" srcEdge="RIGHT"/>
-	          <anchoritem dst="labelSender" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="iconSeparator" srcEdge="BOTTOM"/>
-	          <anchoritem dst="labelTime" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="RIGHT"/>
-	          <anchoritem dst="labelTime" dstEdge="TOP" spacing="0" src="labelSender" srcEdge="TOP"/>
-	          <anchoritem dst="labelTime" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="labelSender" srcEdge="RIGHT"/>
-	          <anchoritem dst="labelSubject" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="iconNewMail" srcEdge="RIGHT"/>
-	          <anchoritem dst="labelSubject" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="labelSender" srcEdge="BOTTOM"/>
-	          <anchoritem dst="iconThree" dstEdge="TOP" spacing="0" src="labelSubject" srcEdge="TOP"/>
-	          <anchoritem dst="iconThree" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="RIGHT"/>
-	          <anchoritem dst="iconTwo" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="iconThree" srcEdge="LEFT"/>
-	          <anchoritem dst="iconTwo" dstEdge="TOP" spacing="0" src="labelSubject" srcEdge="TOP"/>
-	          <anchoritem dst="iconOne" dstEdge="TOP" spacing="0" src="labelSubject" srcEdge="TOP"/>
-	          <anchoritem dst="iconOne" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="iconTwo" srcEdge="LEFT"/>
-	          <anchoritem dst="labelSubject" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="iconOne" srcEdge="LEFT"/>
-	      </layout>
-	  </widget>
+<hbdocument version="1.1">
+    <widget name="emailLayoutWidget" type="HbWidget">
+        <widget name="iconSeparator" type="HbLabel">
+            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+            <icon iconName="note_warning" name="icon"/>
+            <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
+            <real name="z" value="1"/>
+            <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="2" type="PREFERRED" width="50un"/>
+        </widget>
+        <widget name="iconNewMail" type="HbLabel">
+            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+            <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
+            <real name="z" value="2"/>
+            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Ignored" verticalStretch="0"/>
+            <sizehint type="PREFERRED" width="1.25un"/>
+        </widget>
+        <widget name="labelSender" type="HbLabel">
+            <real name="z" value="3"/>
+            <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="var(hb-param-text-height-secondary)" type="PREFERRED" width="33.43284un"/>
+            <string name="plainText" value="Mail Spammer"/>
+            <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+        </widget>
+        <widget name="labelTime" type="HbLabel">
+            <enums name="alignment" value="AlignRight|AlignTop|AlignTrailing"/>
+            <real name="z" value="4"/>
+            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="var(hb-param-text-height-tiny)" type="FIXED" width="10un"/>
+            <string name="plainText" value="12:45pm"/>
+            <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+        </widget>
+        <widget name="labelSubject" type="HbLabel">
+            <real name="z" value="5"/>
+            <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="var(hb-param-text-height-secondary)" type="PREFERRED" width="35un"/>
+            <string name="plainText" value="Check out great new medication.."/>
+            <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+        </widget>
+        <widget name="iconThree" type="HbLabel">
+            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+            <icon iconName="note_warning" name="icon"/>
+            <real name="z" value="6"/>
+            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
+        </widget>
+        <widget name="iconTwo" type="HbLabel">
+            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+            <icon iconName="note_warning" name="icon"/>
+            <real name="z" value="7"/>
+            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
+        </widget>
+        <widget name="iconOne" type="HbLabel">
+            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+            <icon iconName="note_warning" name="icon"/>
+            <real name="z" value="8"/>
+            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="var(hb-param-graphic-size-secondary)" type="FIXED" width="var(hb-param-graphic-size-secondary)"/>
+        </widget>
+        <real name="z" value="1"/>
+        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+        <sizehint height="9.75un" type="FIXED" width="46un"/>
+        <sizehint type="MINIMUM" width="46un"/>
+        <sizehint height="48.39un" type="MAXIMUM" width="46un"/>
+        <layout type="anchor">
+            <anchoritem dst="iconSeparator" dstEdge="LEFT" spacing="2" src="" srcEdge="LEFT"/>
+            <anchoritem dst="iconSeparator" dstEdge="TOP" spacing="0" src="" srcEdge="TOP"/>
+            <anchoritem dst="iconSeparator" dstEdge="RIGHT" spacing="-2" src="" srcEdge="RIGHT"/>
+            <anchoritem dst="iconNewMail" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="LEFT"/>
+            <anchoritem dst="iconNewMail" dstEdge="TOP" spacing="1un" src="iconSeparator" srcEdge="BOTTOM"/>
+            <anchoritem dst="iconNewMail" dstEdge="BOTTOM" spacing="-1un" src="" srcEdge="BOTTOM"/>
+            <anchoritem dst="labelSubject" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="iconNewMail" srcEdge="RIGHT"/>
+            <anchoritem dst="labelSubject" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-vertical)" src="labelSender" srcEdge="BOTTOM"/>
+            <anchoritem dst="labelSubject" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="iconOne" srcEdge="LEFT"/>
+            <anchoritem dst="labelSender" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="iconNewMail" srcEdge="RIGHT"/>
+            <anchoritem dst="labelSender" dstEdge="TOP" spacing="1un" src="iconSeparator" srcEdge="BOTTOM"/>
+            <anchoritem dst="labelSender" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="labelTime" srcEdge="LEFT"/>
+            <anchoritem dst="labelTime" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="RIGHT"/>
+            <anchoritem dst="labelTime" dstEdge="CENTERV" spacing="0un" src="labelSender" srcEdge="CENTERV"/>
+            <anchoritem dst="iconOne" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="iconTwo" srcEdge="LEFT"/>
+            <anchoritem dst="iconOne" dstEdge="CENTERV" spacing="0un" src="labelSubject" srcEdge="CENTERV"/>
+            <anchoritem dst="iconThree" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="RIGHT"/>
+            <anchoritem dst="iconThree" dstEdge="CENTERV" spacing="0un" src="iconOne" srcEdge="CENTERV"/>
+            <anchoritem dst="iconTwo" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="iconThree" srcEdge="LEFT"/>
+            <anchoritem dst="iconTwo" dstEdge="CENTERV" spacing="0un" src="iconOne" srcEdge="CENTERV"/>
+        </layout>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+    </metadata>
 </hbdocument>
--- a/emailuis/nmhswidget/conf/nmhswidgettitle.docml	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/conf/nmhswidgettitle.docml	Wed Jun 23 17:00:39 2010 +0100
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<hbdocument version="1.0">
+<hbdocument version="1.1">
     <widget name="titleLayoutWidget" type="HbWidget">
         <widget name="mailboxNameLabel" type="HbLabel">
             <real name="z" value="1"/>
             <sizepolicy horizontalPolicy="Ignored" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-            <sizehint height="var(hb-param-text-height-tiny)" type="PREFERRED" width="34.92537un"/>
+            <sizehint height="var(hb-param-text-height-secondary)" type="PREFERRED" width="34.92537un"/>
             <string name="plainText" value="Mailbox gmail"/>
-            <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+            <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
         </widget>
         <widget name="mailboxIcon" type="HbLabel">
             <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
@@ -14,35 +14,42 @@
             <real name="z" value="2"/>
             <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
             <sizehint height="11un" type="FIXED" width="11un"/>
+            <sizehint height="11un" type="MINIMUM" width="11un"/>
+            <sizehint height="11un" type="MAXIMUM" width="11un"/>
         </widget>
         <widget name="unreadCountLabel" type="HbLabel">
             <enums name="alignment" value="AlignRight|AlignVCenter|AlignTrailing"/>
             <real name="z" value="3"/>
             <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-            <sizehint height="var(hb-param-text-height-tiny)" type="FIXED" width="6un"/>
+            <sizehint height="var(hb-param-text-height-secondary)" type="FIXED" width="6un"/>
             <string locid="txt_mail_widget_list_l1" name="plainText" value="(999)"/>
-            <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+            <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
         </widget>
         <widget name="collapseExpandIcon" type="HbPushButton">
             <icon iconName="note_warning" name="icon"/>
             <real name="z" value="4"/>
             <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
             <sizehint height="5.5un" type="FIXED" width="5.5un"/>
+            <sizehint height="5.5un" type="MINIMUM" width="5.5un"/>
+            <sizehint height="5.5un" type="MAXIMUM" width="5.5un"/>
             <string name="alignment" value="AlignVCenter|AlignHCenter"/>
         </widget>
         <real name="z" value="1"/>
         <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
-        <sizehint height="7un" type="FIXED" width="46un"/>
+        <sizehint height="7.5un" type="FIXED" width="46un"/>
         <layout type="anchor">
             <anchoritem dst="mailboxIcon" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="LEFT"/>
             <anchoritem dst="mailboxIcon" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
             <anchoritem dst="mailboxNameLabel" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-horizontal)" src="mailboxIcon" srcEdge="RIGHT"/>
             <anchoritem dst="mailboxNameLabel" dstEdge="TOP" spacing="var(hb-param-margin-gene-top)" src="" srcEdge="TOP"/>
             <anchoritem dst="mailboxNameLabel" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="unreadCountLabel" srcEdge="LEFT"/>
-            <anchoritem dst="unreadCountLabel" dstEdge="TOP" spacing="0un" src="mailboxNameLabel" srcEdge="TOP"/>
-            <anchoritem dst="unreadCountLabel" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="collapseExpandIcon" srcEdge="LEFT"/>
             <anchoritem dst="collapseExpandIcon" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="" srcEdge="RIGHT"/>
             <anchoritem dst="collapseExpandIcon" dstEdge="CENTERV" spacing="0un" src="unreadCountLabel" srcEdge="CENTERV"/>
+            <anchoritem dst="unreadCountLabel" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-middle-horizontal)" src="collapseExpandIcon" srcEdge="LEFT"/>
+            <anchoritem dst="unreadCountLabel" dstEdge="CENTERV" spacing="0un" src="mailboxNameLabel" srcEdge="CENTERV"/>
         </layout>
     </widget>
+    <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+    </metadata>
 </hbdocument>
--- a/emailuis/nmhswidget/inc/nmhswidgetemailrow.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/inc/nmhswidgetemailrow.h	Wed Jun 23 17:00:39 2010 +0100
@@ -22,10 +22,10 @@
 #include <QDateTime>
 #include <hbwidget.h>
 #include "nmcommon.h"
+#include "nmmessageenvelope.h"
 
 //FORWARD DECLARATIONS:
 class HbLabel;
-class NmMessageEnvelope;
 
 class NmHsWidgetEmailRow : public HbWidget
 {
@@ -36,6 +36,8 @@
     ~NmHsWidgetEmailRow();
     NmId messageId();
     bool loadDocML();
+    void setFontsSize( bool read );
+    void setFontsColor( bool pressed );
 
 public slots:
     void updateMailData( const NmMessageEnvelope& envelope );
@@ -51,6 +53,7 @@
 protected:
     void mousePressEvent(QGraphicsSceneMouseEvent *event);
     void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+    bool event( QEvent *event );
     
 private:
     HbLabel *mSenderLabel;
@@ -61,6 +64,7 @@
     NmId mMessageId;
     QDateTime mMessageSentTime;
     QList <HbLabel*> mStatusIcons;  
+    NmMessageEnvelope mEnvelope;
     
 };
 
--- a/emailuis/nmhswidget/inc/nmhswidgettitlerow.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/inc/nmhswidgettitlerow.h	Wed Jun 23 17:00:39 2010 +0100
@@ -34,6 +34,8 @@
     bool loadDocML();
     
     void setAccountIcon(const QString& accountIconName );
+    void setExpandCollapseIcon(const bool& expand);
+    void setFontsColor( bool pressed );
     
 private:
 
@@ -49,6 +51,8 @@
     
 protected:
     void mousePressEvent(QGraphicsSceneMouseEvent *event);
+    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
+    bool event( QEvent *event );
     
 private:
     HbLabel *mMailboxIcon;
--- a/emailuis/nmhswidget/nmhswidget.pro	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/nmhswidget.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -68,7 +68,6 @@
 
 INCLUDEPATH += ./inc \
     ../../inc \
-    ../nmailuiengine/inc \
     ../inc
 DEPENDPATH += .
 TRANSLATIONS = mailwidget.ts
--- a/emailuis/nmhswidget/src/nmhswidget.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/src/nmhswidget.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -14,7 +14,6 @@
  * Description: 
  *
  */
-#include <QDebug>
 #include <QtGui>
 #include <QGraphicsLinearLayout>
 #include <hbcolorscheme.h>
@@ -29,6 +28,7 @@
 #include "nmhswidgetemailrow.h"
 #include "nmhswidgetconsts.h"
 #include "nmhswidgetdatetimeobserver.h"
+#include "emailtrace.h"
 
 NmHsWidget::NmHsWidget(QGraphicsItem *parent, Qt::WindowFlags flags)
     : HbWidget(parent, flags), 
@@ -36,16 +36,14 @@
       mRowLayout(0),
       mTitleRow(0),
       mAccountId(0),
-      mAccountIconName(0),
+      mAccountIconName(),
       mTranslator(0),
       mBackgroundFrameDrawer(0),
-      mIsExpanded(true),
+      mIsExpanded(false),
       mStaticWidget(true),
       mDateObserver(0)
 {
-    qDebug() << "NmHsWidget::NmHsWidget IN -->>";
-       
-    qDebug() << "NmHsWidget::NmHsWidget OUT <<--";
+    NM_FUNCTION;
 }
 
 /*!
@@ -53,27 +51,19 @@
 */
 NmHsWidget::~NmHsWidget()
 {
-    qDebug() << "NmHsWidget::~NmHsWidget IN -->>";
-    if(mTranslator){
-        delete mTranslator;
-        mTranslator = NULL;
-    }
-    
-    if(mEngine){
-        delete mEngine;
-        mEngine = NULL;
-        }
-    
-    if(mBackgroundFrameDrawer){
-        delete mBackgroundFrameDrawer;
-        mBackgroundFrameDrawer = NULL;
-        }
-		
-	if(mDateObserver){
-        delete mDateObserver;
-        mDateObserver = NULL;
-        }
-    qDebug() << "NmHsWidget::~NmHsWidget OUT <<--";
+    NM_FUNCTION;
+
+    delete mTranslator;
+    mTranslator = NULL;
+
+    delete mEngine;
+    mEngine = NULL;
+
+    delete mBackgroundFrameDrawer;
+    mBackgroundFrameDrawer = NULL;
+
+    delete mDateObserver;
+    mDateObserver = NULL;
 }
 
 /*!
@@ -83,12 +73,11 @@
 */
 void NmHsWidget::onShow()
 {
-    qDebug() << "NmHsWidget::onShow IN -->>";
+    NM_FUNCTION;
     if (mEngine)
         {
         mEngine->activate();
         }
-    qDebug() << "NmHsWidget::onShow OUT <<--";
 }
 
 /*!
@@ -98,12 +87,11 @@
 */
 void NmHsWidget::onHide()
 {
-    qDebug() << "NmHsWidget::onHide IN -->>";
+    NM_FUNCTION;
     if (mEngine)
         {
         mEngine->suspend();
         }
-    qDebug() << "NmHsWidget::onHide OUT <<--";
 }
 
 /*!
@@ -113,17 +101,15 @@
 */
 bool NmHsWidget::setupLocalization()
 {
-    qDebug() << "NmHsWidget::setupLocalization IN -->>";
+    NM_FUNCTION;
     
     //Use correct localisation
     bool ret(false); 
     mTranslator = new QTranslator();
     QString lang = QLocale::system().name();
     ret = mTranslator->load(KNmHsWidgetLocFileName + lang, KNmHsWidgetLocLocation);
-    qDebug() << "NmHsWidget::setupLocalization mTranslator->load loadSucceed:"<<ret;
     QCoreApplication::installTranslator(mTranslator);
 
-    qDebug() << "NmHsWidget::setupLocalization OUT <<--";
     return ret;
 }
 
@@ -133,7 +119,8 @@
 */
 void NmHsWidget::setupUi()
 {
-    qDebug() << "NmHsWidget::setupUi IN -->>";
+    NM_FUNCTION;
+    
     setContentsMargins( KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
             KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
     
@@ -151,8 +138,6 @@
    //set to NULL to indicate that ownership transferred
    mBackgroundFrameDrawer = NULL;
    setBackgroundItem( backgroundLayoutItem );
-   
-   qDebug() << "NmHsWidget::setupUi OUT -->>";
 }
 
 /*!
@@ -162,9 +147,9 @@
 */
 void NmHsWidget::onInitialize()
 {
-    QT_TRY{
-        qDebug() << "NmHsWidget::onInitialize IN -->>";
-        
+    NM_FUNCTION;
+    
+    QT_TRY{       
         setupUi();
         //emit error if localization fails
         if(!setupLocalization()){
@@ -204,6 +189,7 @@
         updateMailData();
         mTitleRow->updateUnreadCount(mEngine->unreadCount());
         mTitleRow->setAccountIcon(mAccountIconName);
+        mTitleRow->setExpandCollapseIcon(mIsExpanded);
         
         //Get signals about changes in mail data
         connect(mEngine, SIGNAL( mailDataChanged() )
@@ -229,7 +215,6 @@
 	        //to place widget properly after adding to homescreen
 	        parentWidget()->resize(preferredSize()); 
 		}
-        qDebug() << "NmHsWidget::onInitialize OUT <<--";  
     }
     QT_CATCH(...){
         emit error();
@@ -244,9 +229,7 @@
 */
 void NmHsWidget::onUninitialize()
 {
-    qDebug() << "NmHsWidget::onUninitialize IN -->>";
-    
-    qDebug() << "NmHsWidget::onUninitialize OUT <<--";
+    NM_FUNCTION;
 }
 
 /*!
@@ -254,7 +237,8 @@
 */
 void NmHsWidget::updateMailData()
 {
-    qDebug() << "NmHsWidget::updateData IN -->>";
+    NM_FUNCTION;
+    
     QList<NmMessageEnvelope> envelopes;
     int count = 0;
     if (mIsExpanded) {
@@ -267,7 +251,6 @@
         {
         mMailRows[i]->updateMailData( envelopes[i] );
         }
-    qDebug() << "NmHsWidget::updateData OUT <<--"; 
 }
 
 /*!
@@ -276,12 +259,13 @@
 */
 void NmHsWidget::setAccountId(const QString &text)
 {
-    qDebug() << "NmHsWidget::setAccountId IN -->>"; 
+    NM_FUNCTION;
+    
     bool ok;
     quint64 id = text.toULongLong(&ok);
     if (!ok)
         {
-        qDebug() << "NmHsWidget::setAccountId: invalid account ID data, signal finished()!!!"; 
+        NM_ERROR(1,"NmHsWidget::setAccountId: invalid account ID data, signal finished()!!!"); 
         //No valid account id so give up
         emit finished();
         }
@@ -289,7 +273,6 @@
         {
         mAccountId.setId(id);
         }
-    qDebug() << "NmHsWidget::setAccountId OUT <<--"; 
 }
 
 /*!
@@ -298,7 +281,7 @@
 */
 QString NmHsWidget::accountId() const
 {
-    qDebug() << "NmHsWidget::accountId()"; 
+    NM_FUNCTION;
     return QString::number(mAccountId.id());
 }
 
@@ -307,9 +290,8 @@
 */
 void NmHsWidget::setAccountIconName(const QString &text)
 {
-    qDebug() << "NmHsWidget::setAccountIconName IN -->>"; 
+    NM_FUNCTION;
     mAccountIconName = text;
-    qDebug() << "NmHsWidget::setAccountIconName OUT <<--"; 
 }
 
 /*!
@@ -317,7 +299,7 @@
 */
 QString NmHsWidget::accountIconName() const
 {
-    qDebug() << "NmHsWidget::accountIconName()"; 
+    NM_FUNCTION;
     return mAccountIconName;
 }
 
@@ -326,9 +308,8 @@
 */
 void NmHsWidget::handleExpandCollapseEvent()
 {
-    qDebug() << "NmHsWidget::handleExpandCollapseEvent IN -->>";
+    NM_FUNCTION;
     toggleExpansionState();
-    qDebug() << "NmHsWidget::handleExpandCollapseEvent OUT <<--"; 
 }
 
 /*!
@@ -337,7 +318,7 @@
 */
 void NmHsWidget::toggleExpansionState()
 {
-    qDebug() << "NmHsWidget::setExpanded IN -->>"; 
+    NM_FUNCTION;
 
     mIsExpanded = !mIsExpanded;
     
@@ -349,7 +330,7 @@
     //handle state change drawing
     updateMailData();
     
-    qDebug() << "NmHsWidget::setExpanded OUT <<--"; 
+    mTitleRow->setExpandCollapseIcon(mIsExpanded);
 }
 
 /*!
@@ -357,7 +338,7 @@
 */
 void NmHsWidget::setWidgetStateProperty(QString value)
 {
-    qDebug() << "NmHsWidget::setWidgetStateProperty IN -->>"; 
+    NM_FUNCTION;
     if (value == KNmHsWidgetStateCollapsed)
         {
         mIsExpanded = false;
@@ -366,7 +347,6 @@
         {
         mIsExpanded = true;
         }
-    qDebug() << "NmHsWidget::setWidgetStateProperty OUT <<--"; 
 }
 
 /*!
@@ -374,7 +354,7 @@
 */
 QString NmHsWidget::widgetStateProperty()
 {
-    qDebug() << "NmHsWidget::widgetStateProperty()";
+    NM_FUNCTION;
     if (mIsExpanded)
         {
         return KNmHsWidgetStateExpanded;
@@ -392,9 +372,7 @@
 */
 void NmHsWidget::updateMailRowsList(const int mailCount)
 {
-    qDebug() << "NmHsWidget::updateMailRowsList IN -->>";
-    qDebug() << "NmHsWidget - mMailRows.count() == " <<  mMailRows.count();
-    qDebug() << "NmHsWidget - ordered count == " <<  mailCount;
+    NM_FUNCTION;
     
     int neededRowsCount = mailCount;
     //force size when static and expanded
@@ -408,10 +386,9 @@
         //more mails to show than rows
         if (mMailRows.count() < neededRowsCount)
             {
-            qDebug() << "NmHsWidget - add new mail row";
             NmHsWidgetEmailRow *row = new NmHsWidgetEmailRow();
             if( !row->loadDocML()){
-                qDebug() << "NmHsWidget::updateMailRowsList row->loadDocML() fails";
+                NM_ERROR(1,"NmHsWidget::updateMailRowsList row->loadDocML() fails");
                 //if docml loading fails no point to proceed
                 //but memoryleak must be prevented
                 delete row;
@@ -429,7 +406,6 @@
         //too many rows
         else if (mMailRows.count() > neededRowsCount)
             {
-            qDebug() << "NmHsWidget - remove mail row";
             mRowLayout->removeItem(mMailRows.last());
             delete mMailRows.takeLast();
             }
@@ -443,7 +419,6 @@
         {
         this->updateMailRowsVisibility(mailCount);
         }
-    qDebug() << "NmHsWidget::updateMailRowsList OUT <<--";
 }
 
 /*!
@@ -453,7 +428,7 @@
 */
 void NmHsWidget::updateMailRowsVisibility(const int visibleCount)
 {
-    qDebug() << "NmHsWidget::updateMailRowsVisibility IN -->>";
+    NM_FUNCTION;
   
     // set visible as many rows as requested by visibleCount param
     bool isVisible;
@@ -466,8 +441,6 @@
             }
         mMailRows.at(i)->setVisible(isVisible);
         }
-    
-    qDebug() << "NmHsWidget::updateMailRowsVisibility OUT <<--";
 }
 
 /*!
@@ -477,7 +450,7 @@
 */
 void NmHsWidget::onEngineException(const int& exc)
     {
-    qDebug() << "NmHsWidget:onEngineException IN -->>";
+    NM_FUNCTION;
     switch (exc)
         {
         case (NmEngineExcAccountDeleted):
--- a/emailuis/nmhswidget/src/nmhswidgetdatetimeobserver.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/src/nmhswidgetdatetimeobserver.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,7 +15,7 @@
 *
 */
 
-#include <QDebug>
+#include "emailtrace.h"
 #include "nmhswidgetdatetimeobserver.h"
 #include "nmhswidgetdatetimeobserver_p.h"
 
@@ -28,9 +28,8 @@
     QObject(parent),
     d_ptr(0)
 {
-    qDebug() << "NmHsWidgetDateTimeObserver::NmHsWidgetDateTimeObserver --> IN";
+    NM_FUNCTION;
     d_ptr = new NmHsWidgetDateTimeObserverPrivate(this);
-    qDebug() << "NmHsWidgetDateTimeObserver::NmHsWidgetDateTimeObserver <-- OUT";
 }
 
 /*!
@@ -40,9 +39,8 @@
 */
 NmHsWidgetDateTimeObserver::~NmHsWidgetDateTimeObserver()
 {
-    qDebug() << "NmHsWidgetDateTimeObserver::~NmHsWidgetDateTimeObserver --> IN";
+    NM_FUNCTION;
     delete d_ptr;
-    qDebug() << "NmHsWidgetDateTimeObserver::~NmHsWidgetDateTimeObserver <-- OUT";
 }
 
 /*!
@@ -52,7 +50,6 @@
 */
 void NmHsWidgetDateTimeObserver::handleCompletion()
 {
-    qDebug() << "NmHsWidgetDateTimeObserver::handleCompletion --> IN";
+    NM_FUNCTION;
     emit dateTimeChanged();
-    qDebug() << "NmHsWidgetDateTimeObserver::handleCompletion <-- OUT";
 }
--- a/emailuis/nmhswidget/src/nmhswidgetdatetimeobserver_p.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/src/nmhswidgetdatetimeobserver_p.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,10 +15,10 @@
 *
 */
 
-#include <QDebug>
 #include <bacntf.h>
 #include "nmhswidgetdatetimeobserver.h"
 #include "nmhswidgetdatetimeobserver_p.h"
+#include "emailtrace.h"
 
 /*!
     \fn NmHsWidgetDateTimeObserverPrivate::NmHsWidgetDateTimeObserverPrivate()
@@ -29,12 +29,11 @@
 NmHsWidgetDateTimeObserverPrivate::NmHsWidgetDateTimeObserverPrivate(NmHsWidgetDateTimeObserver *q) :
     q_ptr(q)
 {
-    qDebug() << "NmHsWidgetDateTimeObserverPrivate::NmHsWidgetDateTimeObserverPrivate --> IN" ;
+    NM_FUNCTION;
     TCallBack callback( LocaleChangeCallback, this );
     //TODO: Handle leave properly
     TRAP_IGNORE(iLocaleNotifier = CEnvironmentChangeNotifier::NewL( CActive::EPriorityStandard, callback ));
     iLocaleNotifier->Start();
-    qDebug() << "NmHsWidgetDateTimeObserverPrivate::NmHsWidgetDateTimeObserverPrivate <-- OUT" ;
 }
 
 /*!
@@ -44,12 +43,9 @@
 */
 NmHsWidgetDateTimeObserverPrivate::~NmHsWidgetDateTimeObserverPrivate()
 {
-    qDebug() << "NmHsWidgetDateTimeObserverPrivate::~NmHsWidgetDateTimeObserverPrivate --> IN" ;
-    if(iLocaleNotifier){
-        delete iLocaleNotifier;
-        iLocaleNotifier = NULL;
-    }
-    qDebug() << "NmHsWidgetDateTimeObserverPrivate::~NmHsWidgetDateTimeObserverPrivate <-- OUT" ;
+    NM_FUNCTION;
+    delete iLocaleNotifier;
+    iLocaleNotifier = NULL;
 }
 
 /*!
@@ -61,7 +57,7 @@
 */
 TInt NmHsWidgetDateTimeObserverPrivate::HandleLocaleChange()
 {
-    qDebug() << "NmHsWidgetDateTimeObserverPrivate::HandleLocaleChange";
+    NM_FUNCTION;
     TInt handled = 0;
     if( iLocaleNotifier->Change() & ( EChangesSystemTime | EChangesLocale | EChangesMidnightCrossover ))
         {
@@ -79,7 +75,7 @@
 */
 TInt NmHsWidgetDateTimeObserverPrivate::LocaleChangeCallback(TAny* aThisPtr)
 {
-    qDebug() << "NmHsWidgetDateTimeObserverPrivate::LocaleChangeCallback" ;
+    NM_FUNCTION;
     TInt ret = static_cast<NmHsWidgetDateTimeObserverPrivate*>(aThisPtr)->HandleLocaleChange();
     return ret;
 }
--- a/emailuis/nmhswidget/src/nmhswidgetemailengine.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/src/nmhswidgetemailengine.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -16,7 +16,6 @@
  */
 
 #include <xqservicerequest.h>
-#include <QDebug>
 #include <QTimer>
 #include <QDir>
 #include <qpluginloader.h>
@@ -29,6 +28,7 @@
 #include "nmfolder.h"
 #include "nmdatapluginfactory.h"
 #include "nmhswidgetconsts.h"
+#include "emailtrace.h"
 
 /*!
  Constructor
@@ -36,7 +36,7 @@
 NmHsWidgetEmailEngine::NmHsWidgetEmailEngine(const NmId& monitoredMailboxId) :
     mMailboxId(monitoredMailboxId), 
     mFolderId(0), 
-    mAccountName(0), 
+    mAccountName(),
     mUnreadCount(-1),
     mEmailInterface(0), 
     mFactory(0), 
@@ -45,9 +45,7 @@
     mSuspended(false),
     mUpdateTimer(0)
 {
-    qDebug() << "NmHsWidgetEmailEngine() -- START";
-
-    qDebug() << "NmHsWidgetEmailEngine() -- END";
+    NM_FUNCTION;
 }
 
 /*!
@@ -58,7 +56,7 @@
  */
 bool NmHsWidgetEmailEngine::initialize()
 {
-    qDebug() << "initialize() -- START";
+    NM_FUNCTION;
         
     if (!constructNmPlugin()) {
         //if plugin connection fails, there's no reason to proceed
@@ -71,7 +69,6 @@
     mUpdateTimer->setInterval(NmHsWidgetEmailEngineUpdateTimerValue);
     connect(mUpdateTimer, SIGNAL(timeout()), this, SLOT(handleUpdateTimeout()) );
     
-    qDebug() << "initialize() -- END";
     return true;
 }
 
@@ -82,20 +79,20 @@
  */
 bool NmHsWidgetEmailEngine::constructNmPlugin()
 {
-    qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- START";
+    NM_FUNCTION;
 
     QObject* pluginInstance(0);
     //Get data plugin factory instance
     mFactory = NmDataPluginFactory::instance();
     if (!mFactory) {
-        qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- mFactory FAILED";
+        NM_ERROR(1,"NmHsWidgetEmailEngine::constructNmPlugin() -- mFactory FAILED");
         return false;
     }
 
     //Get plugin instance
     pluginInstance = mFactory->pluginInstance(mMailboxId);
     if (!pluginInstance) {
-        qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- pluginInstance FAILED";
+        NM_ERROR(1,"NmHsWidgetEmailEngine::constructNmPlugin() -- pluginInstance FAILED");
         return false;
     }
 
@@ -103,7 +100,7 @@
     mEmailInterface = mFactory->interfaceInstance(pluginInstance);
 
     if (!mEmailInterface) {
-        qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- mEmailInterface FAILED";
+        NM_ERROR(1,"NmHsWidgetEmailEngine::constructNmPlugin() -- mEmailInterface FAILED");
         return false;       
     }
     //Verify that the mailbox we are interested actually exists.
@@ -111,7 +108,7 @@
     QList<NmId> ids; 
     mEmailInterface->listMailboxIds(ids);
     if(!ids.contains(mMailboxId)){
-        qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- !ids.contains(mMailboxId) FAILED";
+        NM_ERROR(1,"NmHsWidgetEmailEngine::constructNmPlugin() -- !ids.contains(mMailboxId) FAILED");
         emit exceptionOccured(NmEngineExcAccountDeleted);
         return false;
     }
@@ -121,7 +118,6 @@
     //This is valid at least for IMAP accounts. 
     //Folder ID is then retrieved later when first message event is received
     mFolderId = mEmailInterface->getStandardFolderId(mMailboxId, NmFolderInbox);
-    qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- mFolderId==" << mFolderId.id();
 
     //Subscription is needed - otherwise the signals will not be received
     mEmailInterface->subscribeMailboxEvents(mMailboxId);
@@ -135,8 +131,6 @@
     connect(pluginInstance, SIGNAL( mailboxEvent(NmMailboxEvent, const QList<NmId>& ) ), this,
         SLOT( handleMailboxEvent(NmMailboxEvent, const QList<NmId>&) ));
 
-    qDebug() << "NmHsWidgetEmailEngine::constructNmPlugin() -- OK";
-
     return true;
 }
 
@@ -146,13 +140,11 @@
  */
 void NmHsWidgetEmailEngine::resetEnvelopeList()
 {
-    qDebug() << "NmHsWidgetEmailEngine::resetEnvelopeList() -- START";
+    NM_FUNCTION;
 
     while (!mEnvelopeList.isEmpty()) {
         delete mEnvelopeList.takeFirst();
     }
-
-    qDebug() << "NmHsWidgetEmailEngine::resetEnvelopeList() -- END";
 }
 
 /*!
@@ -160,7 +152,7 @@
  */
 NmHsWidgetEmailEngine::~NmHsWidgetEmailEngine()
 {
-    qDebug() << "~NmHsWidgetEmailEngine -- START";
+    NM_FUNCTION;
 
     resetEnvelopeList();
     if (mFactory) {
@@ -171,8 +163,6 @@
         mUpdateTimer->stop();
         delete mUpdateTimer;
     }
-    
-    qDebug() << "~NmHsWidgetEmailEngine -- END";
 }
 
 /*!
@@ -186,7 +176,7 @@
  */
 int NmHsWidgetEmailEngine::getEnvelopes(QList<NmMessageEnvelope> &list, int maxEnvelopeAmount)
 {
-    qDebug() << "NmHsWidgetEmailEngine::getEnvelopes()";
+    NM_FUNCTION;
     list.clear(); //Reset the parameter list to avoid side effects
     int i = 0;
     for (; i < mEnvelopeList.count() && i < maxEnvelopeAmount; i++) {
@@ -203,7 +193,7 @@
  */
 int NmHsWidgetEmailEngine::unreadCount()
 {
-    qDebug() << "NmHsWidgetEmailEngine::unreadCount()";
+    NM_FUNCTION;
     return mUnreadCount;
 }
 
@@ -214,7 +204,7 @@
  */
 QString NmHsWidgetEmailEngine::accountName()
 {
-    qDebug() << "NmHsWidgetEmailEngine::accountName()";
+    NM_FUNCTION;
     return mAccountName;
 }
 
@@ -231,9 +221,9 @@
  */
 bool NmHsWidgetEmailEngine::updateData()
 {
-    qDebug() << "NmHsWidgetEmailEngine::updateData() -- START";
+    NM_FUNCTION;
     if (!mEmailInterface) {
-        qDebug() << "NmHsWidgetEmailEngine::updateData() -- Interface missing";
+        NM_ERROR(1,"NmHsWidgetEmailEngine::updateData() -- Interface missing");
         emit exceptionOccured(NmEngineExcFailure); //fatal error
         return false; //if interface is missing there's nothing to do
     }
@@ -276,8 +266,6 @@
     }else{
         return false;
     }
-
-    qDebug() << "NmHsWidgetEmailEngine::updateData() -- END";
     return true;
 }
 
@@ -290,12 +278,12 @@
     const QList<NmId> &messageIds,
     const NmId& mailboxId)
 {
-    qDebug() << "NmHsWidgetEmailEngine::handleMessageEvent() -- START";
+    NM_FUNCTION;
     Q_UNUSED(event);
     Q_UNUSED(messageIds);
     
     if (!mEmailInterface) {
-        qDebug() << "NmHsWidgetEmailEngine::handleMessageEvent() -- Interface missing";
+        NM_ERROR(1,"NmHsWidgetEmailEngine::handleMessageEvent() -- Interface missing");
         emit exceptionOccured(NmEngineExcFailure); //fatal error
         return; //if interface is missing there's nothing to do
     }
@@ -315,7 +303,6 @@
             mUpdateTimer->start();
         }
     }
-    qDebug() << "NmHsWidgetEmailEngine::handleMessageEvent() -- END";
 }
 
 /*!
@@ -323,7 +310,7 @@
  */
 void NmHsWidgetEmailEngine::handleMailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds)
 {
-    qDebug() << "NmHsWidgetEmailEngine::handleMailboxEvent() -- START";
+    NM_FUNCTION;
     if (mailboxIds.contains(mMailboxId)) {
         switch (event) {
             case (NmMailboxChanged): {
@@ -344,7 +331,6 @@
                 break;
         }
     }
-    qDebug() << "NmHsWidgetEmailEngine::handleMailboxEvent() -- END";
 }
 
 /*!
@@ -352,12 +338,11 @@
  */
 void NmHsWidgetEmailEngine::handleUpdateTimeout()
 {
-    qDebug() << "NmHsWidgetEmailEngine::handleUpdateTimeout() -- START";
+    NM_FUNCTION;
     if (mUpdateTimer){
         mUpdateTimer->stop();
     }
     updateData();
-    qDebug() << "NmHsWidgetEmailEngine::updateAccount() -- END";
 }
 
 /*!
@@ -367,7 +352,7 @@
  */
 bool NmHsWidgetEmailEngine::updateAccount()
 {
-    qDebug() << "NmHsWidgetEmailEngine::updateAccount() -- START";
+    NM_FUNCTION;
 
     NmMailbox* box = NULL;
     if (mEmailInterface) {
@@ -383,7 +368,6 @@
         box = NULL;
         emit accountNameChanged(mAccountName);
     }
-    qDebug() << "NmHsWidgetEmailEngine::updateAccount() -- END";
     return true;
 }
 
@@ -393,9 +377,8 @@
  */
 void NmHsWidgetEmailEngine::suspend()
 {
-    qDebug() << "NmHsWidgetEmailEngine::suspend() -- START";
+    NM_FUNCTION;
     mSuspended = true;
-    qDebug() << "NmHsWidgetEmailEngine::suspend() -- END";
 }
 
 /*!
@@ -405,7 +388,7 @@
  */
 void NmHsWidgetEmailEngine::activate()
 {
-    qDebug() << "NmHsWidgetEmailEngine::activate() -- START";
+    NM_FUNCTION;
     mSuspended = false;
     if (mAccountEventReceivedWhenSuspended) {
         mAccountEventReceivedWhenSuspended = false;
@@ -415,7 +398,6 @@
         mMessageEventReceivedWhenSuspended = false;
         updateData();
     }
-    qDebug() << "NmHsWidgetEmailEngine::activate() -- END";
 }
 
 /*!
@@ -424,7 +406,7 @@
  */
 void NmHsWidgetEmailEngine::launchMailAppInboxView()
 {
-    qDebug() << "NmHsWidgetEmailEngine::launchMailAppInboxView() -- START";
+    NM_FUNCTION;
 
     XQServiceRequest request(
         emailFullServiceNameMailbox,
@@ -436,8 +418,6 @@
 
     request.setArguments(list);
     request.send();
-
-    qDebug() << "NmHsWidgetEmailEngine::launchMailAppInboxView() -- END";
 }
 
 /*!
@@ -447,7 +427,7 @@
  */
 void NmHsWidgetEmailEngine::launchMailAppMailViewer(const NmId &messageId)
 {
-    qDebug() << "NmHsWidgetEmailEngine::launchMailAppMailViewer() -- START";
+    NM_FUNCTION;
 
     XQServiceRequest request(
        emailFullServiceNameMessage,
@@ -461,6 +441,4 @@
 
     request.setArguments(list);
     request.send();
-
-    qDebug() << "NmHsWidgetEmailEngine::launchMailAppMailViewer() -- END";
 }
--- a/emailuis/nmhswidget/src/nmhswidgetemailrow.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/src/nmhswidgetemailrow.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,18 +15,19 @@
  *
  */
 
-#include <QDebug>
 #include <QGraphicsLinearLayout>
 #include <hbdocumentloader.h>
 #include <hblabel.h>
 #include <hbextendedlocale.h>
 #include <HbFrameDrawer>
 #include <HbFrameItem>
+#include <HbColorScheme>
+#include <HbEvent>
 #include "nmicons.h"
 #include "nmcommon.h"
 #include "nmhswidgetemailrow.h"
 #include "nmhswidgetconsts.h"
-#include "nmmessageenvelope.h"
+#include "emailtrace.h"
 
 NmHsWidgetEmailRow::NmHsWidgetEmailRow(QGraphicsItem *parent, Qt::WindowFlags flags) :
     HbWidget(parent, flags), 
@@ -37,9 +38,7 @@
     mSeparatorIcon(0), 
     mMessageId(0)
 {
-    qDebug() << "NmHsWidgetEmailRow::NmHsWidgetEmailRow IN -->>";
-
-    qDebug() << "NmHsWidgetEmailRow::NmHsWidgetEmailRow OUT <<--";
+    NM_FUNCTION;
 }
 
 /*!
@@ -47,9 +46,7 @@
  */
 NmHsWidgetEmailRow::~NmHsWidgetEmailRow()
 {
-    qDebug() << "NmHsWidgetEmailRow::~NmHsWidgetEmailRow IN -->>";
-
-    qDebug() << "NmHsWidgetEmailRow::~NmHsWidgetEmailRow OUT <<--";
+    NM_FUNCTION;
 }
 
 /*!
@@ -57,7 +54,7 @@
  */
 NmId NmHsWidgetEmailRow::messageId()
 {
-    qDebug() << "NmHsWidgetEmailRow::messageId()";
+    NM_FUNCTION;
     return mMessageId;
 
 }
@@ -69,17 +66,17 @@
  */
 bool NmHsWidgetEmailRow::loadDocML()
 {
+    NM_FUNCTION;
+    
     HbFrameDrawer* backgroundFrameDrawer = 0;
     HbFrameItem* backgroundLayoutItem = 0;
-    QT_TRY{
-        qDebug() << "NmHsWidgetEmailRow::loadDocML IN -->>";
-    
+    QT_TRY{   
         // Use document loader to load the contents
         HbDocumentLoader loader;
         bool ok(false);
         loader.load(KNmHsWidgetMailRowDocML, &ok);
         if (!ok) {
-            qDebug() << "NmHsWidgetEmailRow::loadDocML fail @ loader <<--";
+            NM_ERROR(1,"NmHsWidgetEmailRow::loadDocML fail @ loader");
             return false;
         }
     
@@ -94,7 +91,7 @@
         //find container widget
         QGraphicsWidget *container = loader.findWidget(KNmHsWidgetMailRowContainer);
         if (!container) {
-            qDebug() << "NmHsWidgetEmailRow::loadDocML fail @ container <<--";
+            NM_ERROR(1,"NmHsWidgetEmailRow::loadDocML fail @ container");
             return false;
         }
         layout->addItem(container);
@@ -118,13 +115,12 @@
     
         //Verify that items are valid
         if (!mSenderLabel || !mSubjectLabel || !mTimeLabel || !mNewMailIcon || !mSeparatorIcon) {
-            qDebug() << "NmHsWidgetEmailRow::loadDocML fail @ labels & icons <<--";
+            NM_ERROR(1,"NmHsWidgetEmailRow::loadDocML fail @ labels & icons");
             return false;
         }
         //Verify all mStatusIcons
         for (int i = 0; i < mStatusIcons.length(); i++) {
             if (!mStatusIcons[i]) {
-                qDebug() << "NmHsWidgetEmailRow::loadDocML status icons <<--";
                 return false;
             }
         }
@@ -142,7 +138,6 @@
         //hide all the icons first to avoid blinking
         hideIcons();
     
-        qDebug() << "NmHsWidgetEmailRow::loadDocML OK OUT <<--";
         return true;
     }
     QT_CATCH(...){
@@ -160,8 +155,10 @@
  */
 void NmHsWidgetEmailRow::updateMailData(const NmMessageEnvelope& envelope)
 {
-    qDebug() << "NmHsWidgetEmailRow::updateMailData IN -->>";
+    NM_FUNCTION;
 
+    mEnvelope = NmMessageEnvelope(envelope);
+    
     //hide all icons, so no previous data is messing with the new
     hideIcons();
 
@@ -183,7 +180,10 @@
     
     //set new icons to widget based on the data
     setIconsToWidget( envelope );
-    qDebug() << "NmHsWidgetEmailRow::updateMailData OUT <<--";
+    
+    //set fonts color and size
+    setFontsSize(mEnvelope.isRead());
+    setFontsColor(false);
     }
 
 /*!
@@ -191,7 +191,7 @@
 */
 void NmHsWidgetEmailRow::updateDateTime()
     {
-    qDebug() << "NmHsWidgetEmailRow::updateDateTime IN -->>";
+    NM_FUNCTION;
     //Set Date with locale support
     //Time shown if message is sent today, otherwise show date
     HbExtendedLocale locale = HbExtendedLocale::system();
@@ -207,7 +207,6 @@
         QString dateSpec = r_qtn_date_without_year;
         mTimeLabel->setPlainText( locale.format(mMessageSentTime.date(), dateSpec) );
         }
-    qDebug() << "NmHsWidgetEmailRow::updateDateTime OUT <<--";
     }
 
 /*!
@@ -215,12 +214,11 @@
  */
 void NmHsWidgetEmailRow::hideIcons()
 {
-    qDebug() << "NmHsWidgetEmailRow::hideIcons IN -->>";
+    NM_FUNCTION;
     for (int i = 0; i < mStatusIcons.count(); i++) {
         mStatusIcons[i]->hide();
     }
     mNewMailIcon->hide();
-    qDebug() << "NmHsWidgetEmailRow::hideIcons OUT <<--";
 }
 
 /*!
@@ -228,7 +226,7 @@
  */
 void NmHsWidgetEmailRow::setIconsToWidget(const NmMessageEnvelope& envelope)
 {
-    qDebug() << "NmHsWidgetEmailRow::setIconsToWidget IN -->>";
+    NM_FUNCTION;
 
     bool unreadMail = !envelope.isRead();
     bool attachment = envelope.hasAttachments();
@@ -267,18 +265,69 @@
         mStatusIcons[count]->setIcon(iconList[count]);
         mStatusIcons[count]->show();
     }
+}
 
-    qDebug() << "NmHsWidgetEmailRow::setIconsToWidget OUT <<--";
-}
+
+/*!
+    sets fonts size. Unread and read mails are shown differently
+*/
+void NmHsWidgetEmailRow::setFontsSize( bool read )
+    {
+    NM_FUNCTION;
+    HbFontSpec fontSpec;
+    
+    if(!read){
+        fontSpec.setRole(HbFontSpec::Primary);
+        mTimeLabel->fontSpec().setRole(HbFontSpec::Primary);
+    }
+    else{
+        fontSpec.setRole(HbFontSpec::Secondary);
+        mTimeLabel->fontSpec().setRole(HbFontSpec::Secondary);
+    }  
+    
+    HbStyle style;
+    qreal size;
+    bool found = style.parameter(QString("hb-param-text-height-secondary"), size );
+    if (found) {
+        fontSpec.setTextHeight(size);
+    }
+    
+    mSenderLabel->setFontSpec(fontSpec);
+    mSubjectLabel->setFontSpec(fontSpec);
+    }
+
+/*!
+    sets fonts color.
+*/
+void NmHsWidgetEmailRow::setFontsColor( bool pressed )
+    {
+    NM_FUNCTION;;
+    QColor newFontColor;
+    
+    if(pressed){
+        newFontColor = HbColorScheme::color("qtc_hs_list_item_pressed");
+    }
+    else if(mEnvelope.isRead()){
+        newFontColor = HbColorScheme::color("qtc_hs_list_item_content_normal");
+    }
+    else{
+        newFontColor = HbColorScheme::color("qtc_hs_list_item_title_normal");
+    }
+ 
+    mSenderLabel->setTextColor(newFontColor);
+    mSubjectLabel->setTextColor(newFontColor);
+    mTimeLabel->setTextColor(newFontColor);
+    }
+
 
 /*!
  mousePressEvent(QGraphicsSceneMouseEvent *event)
  */
 void NmHsWidgetEmailRow::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
-    qDebug() << "NmHsWidgetTitleRow::mousePressEvent() IN -->>";
+    NM_FUNCTION;
     Q_UNUSED(event); 
-    qDebug() << "NmHsWidgetTitleRow::mousePressEvent() OUT <<--";
+    setFontsColor(true);
 }
 
 /*!
@@ -286,8 +335,22 @@
 */
 void NmHsWidgetEmailRow::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
 {
-    qDebug() << "NmHsWidgetTitleRow::mouseReleaseEvent() IN -->>";
+    NM_FUNCTION;
     Q_UNUSED(event);
+    setFontsColor(false);
     emit mailViewerLaunchTriggered(mMessageId);
-    qDebug() << "NmHsWidgetTitleRow::mouseReleaseEvent() OUT <<--";
 }
+
+/*
+ * NmHsWidgetEmailRow::event()
+ */
+bool NmHsWidgetEmailRow::event( QEvent *event )
+{
+    NM_FUNCTION;
+    QEvent::Type eventType = event->type();
+    if( eventType == HbEvent::ThemeChanged ){
+        setFontsColor(false);
+        return true;
+    }
+    return HbWidget::event(event);
+}
--- a/emailuis/nmhswidget/src/nmhswidgetplugin.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/src/nmhswidgetplugin.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -21,6 +21,7 @@
 
 #include "nmhswidgetplugin.h"
 #include "nmhswidget.h"
+#include "emailtrace.h"
 
 #ifdef COVERAGE_MEASUREMENT
 #pragma CTC SKIP
@@ -40,7 +41,7 @@
                                              QServiceContext *context,
                                              QAbstractSecuritySession *session)
 {
-    qDebug() << "NmHsWidgetPlugin::createInstance";
+    NM_FUNCTION;
     Q_UNUSED(context);
     Q_UNUSED(session);
 
--- a/emailuis/nmhswidget/src/nmhswidgettitlerow.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmhswidget/src/nmhswidgettitlerow.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,15 +15,17 @@
  *
  */
 
-#include <QDebug>
 #include <QtGui>
 #include <QGraphicsLinearLayout>
 #include <hbdocumentloader.h>
 #include <hblabel.h>
 #include <HbPushButton>
+#include <HbColorScheme>
+#include <HbEvent>
 #include "nmicons.h"
 #include "nmhswidgettitlerow.h"
 #include "nmhswidgetconsts.h"
+#include "emailtrace.h"
 
 NmHsWidgetTitleRow::NmHsWidgetTitleRow(QGraphicsItem *parent, Qt::WindowFlags flags) :
     HbWidget(parent, flags), 
@@ -31,12 +33,10 @@
     mMailboxInfo(0), 
     mUnreadCountLabel(0),
     mCollapseExpIconLabel(0), 
-    mAccountName(0), 
+    mAccountName(),
     mUnreadCount(0)
 {
-    qDebug() << "NmHsWidgetTitleRow::NmHsWidgetTitleRow IN -->>";
-
-    qDebug() << "NmHsWidgetTitleRow::NmHsWidgetTitleRow OUT <<--";
+    NM_FUNCTION;
 }
 
 /*!
@@ -44,9 +44,7 @@
  */
 NmHsWidgetTitleRow::~NmHsWidgetTitleRow()
 {
-    qDebug() << "NmHsWidgetTitleRow::~NmHsWidgetTitleRow IN -->>";
-
-    qDebug() << "NmHsWidgetTitleRow::~NmHsWidgetTitleRow OUT <<--";
+    NM_FUNCTION;
 }
 
 /*!
@@ -55,15 +53,14 @@
  */
 bool NmHsWidgetTitleRow::loadDocML()
 {
+    NM_FUNCTION;
     QT_TRY{
-        qDebug() << "NmHsWidgetTitleRow::loadDocML IN -->>";
-    
         // Use document loader to load the contents
         HbDocumentLoader loader;
         bool ok(false);
         loader.load(KNmHsWidgetTitleRowDocML, &ok);
         if (!ok) {
-            qDebug() << "NmHsWidgetTitleRow::loadDocML Fail @ loader -->>";
+            NM_ERROR(1,"NmHsWidgetTitleRow::loadDocML Fail @ loader");
             return false; //failure
         }
     
@@ -78,7 +75,7 @@
         // find container widget
         QGraphicsWidget *container = loader.findWidget(KNmHsWidgetTitleRowContainer);
         if (!container) {
-            qDebug() << "NmHsWidgetTitleRow::loadDocML Fail @ container -->>";
+            NM_ERROR(1,"NmHsWidgetTitleRow::loadDocML Fail @ container");
             return false;
         }
         layout->addItem(container);
@@ -92,14 +89,16 @@
             KNmHsWidgetTitleRowCollapseExpandIconLabel));
     
         if (!mMailboxIcon || !mMailboxInfo || !mUnreadCountLabel || !mCollapseExpIconLabel) {
-            qDebug() << "NmHsWidgetTitleRow::loadDocML Fail @ icons & labels -->>";
+            NM_ERROR(1,"NmHsWidgetTitleRow::loadDocML Fail @ icons & labels");
             return false;
         }
     
         //Expand collapse button
         connect(mCollapseExpIconLabel, SIGNAL(clicked()), this, SIGNAL(expandCollapseButtonPressed()));
-    
-        qDebug() << "NmHsWidgetTitleRow::loadDocML OUT <<--";
+        
+        //set fonts color
+        setFontsColor(false);
+
         return true;
     }
     QT_CATCH(...){
@@ -112,10 +111,9 @@
  */
 void NmHsWidgetTitleRow::updateAccountName(const QString& accountName)
 {
-    qDebug() << "NmHsWidgetTitleRow::updateAccountName IN -->>";
+    NM_FUNCTION;
     mAccountName = accountName;
     updateData();
-    qDebug() << "NmHsWidgetTitleRow::updateAccountName OUT <<--";
 }
 
 /*!
@@ -123,9 +121,8 @@
  */
 void NmHsWidgetTitleRow::setAccountIcon(const QString& accountIconName)
 {
-    qDebug() << "NmHsWidgetTitleRow::setAccountIcon -- accountIconName" << accountIconName;
+    NM_FUNCTION;
     mMailboxIcon->setIcon(accountIconName);
-    qDebug() << "NmHsWidgetTitleRow::setAccountIcon OUT <<--";
 }
 
 /*!
@@ -133,10 +130,26 @@
  */
 void NmHsWidgetTitleRow::updateUnreadCount(const int& unreadCount)
 {
-    qDebug() << "NmHsWidgetTitleRow::updateUnreadCount IN -->>";
+    NM_FUNCTION;
     mUnreadCount = unreadCount;
     updateData();
-    qDebug() << "NmHsWidgetTitleRow::updateUnreadCount OUT <<--";
+}
+
+
+/*!
+ Slot for updating expand collapse icon
+ */
+void NmHsWidgetTitleRow::setExpandCollapseIcon(const bool& expand)
+{
+    NM_FUNCTION;
+    if(expand){
+        HbIcon icon("qtg_mono_arrow_up");
+        mCollapseExpIconLabel->setIcon(icon);
+    }
+    else{
+        HbIcon icon("qtg_mono_arrow_down");
+        mCollapseExpIconLabel->setIcon(icon);
+    }
 }
 
 /*!
@@ -144,7 +157,7 @@
  */
 void NmHsWidgetTitleRow::updateData()
 {
-    qDebug() << "NmHsWidgetTitleRow::updateData() IN -->>";
+    NM_FUNCTION;
     mMailboxInfo->setPlainText(mAccountName);
     //If unread count is -1, hide the unread count label completely.
     //This indicates that there are no mails at all (or the initial sync is not done)
@@ -156,16 +169,60 @@
     else {
         mUnreadCountLabel->setVisible(false);
     }
-    qDebug() << "NmHsWidgetTitleRow::updateData() OUT <<--";
 }
 
 /*!
+    sets fonts color.
+    param bool pressed indicates if row is pressed down or not
+*/
+void NmHsWidgetTitleRow::setFontsColor( bool pressed )
+    {
+    NM_FUNCTION;
+    QColor newFontColor;
+    
+    if(pressed){
+        newFontColor = HbColorScheme::color("qtc_hs_list_item_pressed");
+    }
+    else{
+        newFontColor = HbColorScheme::color("qtc_hs_list_item_title_normal");
+    }
+ 
+    mMailboxInfo->setTextColor(newFontColor);
+    mUnreadCountLabel->setTextColor(newFontColor);
+    }
+
+
+/*!
  mousePressEvent(QGraphicsSceneMouseEvent *event)
  */
 void NmHsWidgetTitleRow::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
-    qDebug() << "NmHsWidgetTitleRow::mousePressEvent() IN -->>";
+    NM_FUNCTION;
     Q_UNUSED(event); 
-	emit mailboxLaunchTriggered();
-    qDebug() << "NmHsWidgetTitleRow::mousePressEvent() OUT <<--";
+    setFontsColor(true);
+}
+
+/*!
+    mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+*/
+void NmHsWidgetTitleRow::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+    NM_FUNCTION;
+    Q_UNUSED(event);
+    setFontsColor(false);
+    emit mailboxLaunchTriggered();
 }
+
+/*
+ * NmHsWidgetTitleRow::event()
+ */
+bool NmHsWidgetTitleRow::event( QEvent *event )
+{
+    NM_FUNCTION;
+    QEvent::Type eventType = event->type();
+    if( eventType == HbEvent::ThemeChanged ){
+        setFontsColor(false);
+        return true;
+    }
+    return HbWidget::event(event);
+}
--- a/emailuis/nmindicatorplugin/inc/nmindicator.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmindicatorplugin/inc/nmindicator.h	Wed Jun 23 17:00:39 2010 +0100
@@ -50,36 +50,22 @@
 
     bool handleInteraction(InteractionType type);
     QVariant indicatorData(int role) const;
-    HbIndicatorInterface::Category category() const;
-    bool acceptIcon(bool sending);
-    void updateGlobalStatus(bool sending);
 
 protected: // From HbIndicatorInterface
 
     bool handleClientRequest(RequestType type, const QVariant &parameter);
 
-signals:
-
-    void indicatorIconLost();
-    void globalStatusChanged(bool sending);
-    void mailboxLaunched(quint64 mailboxId);
-
 private slots:
 
-    void hideSendIndicator();
+    void delayedAction();
     
 private:
 
     void storeMailboxData(QVariant mailboxData);
-    void showSendProgress();
-    bool isSending() const;
 
 private:
 
 	NmMailboxInfo mMailbox;
-    bool mShowIndicator;
-    bool mSendingState;
-    bool mShowSendProgress;
 	bool mActive;
 };
 
--- a/emailuis/nmindicatorplugin/inc/nmindicatorplugin.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmindicatorplugin/inc/nmindicatorplugin.h	Wed Jun 23 17:00:39 2010 +0100
@@ -36,7 +36,6 @@
 public:
 
      NmIndicatorPlugin();
-
     ~NmIndicatorPlugin();
 
 public: // From HbIndicatorPluginInterface
@@ -47,22 +46,13 @@
     HbIndicatorInterface* createIndicator(const QString &indicatorType);
     int error() const;
 
-public slots:
-
-    bool indicatorIconLost();
-    bool showMailbox(quint64 mailboxId);
-    void indicatorDeactivated(QObject *indicator);
-    void globalStatusChanged(bool sending);
-
 private:
+    
     Q_DISABLE_COPY(NmIndicatorPlugin)
 
     int mError;
     QStringList mIndicatorTypes;
     QTranslator *mTranslator; // owned
-    QList<NmIndicator*> mIndicators;
-    NmIndicator *mStatusBarIndicator;
-    bool mSending;
 };
 
 #endif // NMINDICATORPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmindicatorplugin/inc/nmsendingindicator.h	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2010 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: Mail Indicator class for sending progress state
+ *
+ */
+
+#ifndef NMSENDINGINDICATOR_H
+#define NMSENDINGINDICATOR_H
+
+#include <QObject>
+#include <hbindicatorinterface.h>
+
+static const QString NmSendingIndicatorType = "com.nokia.nmail.indicatorplugin.send/1.0";
+
+class NmSendingIndicator : public HbIndicatorInterface
+{
+    Q_OBJECT
+
+public:
+
+    NmSendingIndicator(const QString &indicatorType);
+    ~NmSendingIndicator();
+
+public: // From HbIndicatorInterface
+
+    QVariant indicatorData(int role) const;
+
+    bool handleClientRequest(RequestType type, const QVariant &parameter);
+
+private slots:
+
+    void hideSendIndicator();
+};
+
+#endif // NMSENDINGINDICATOR_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmindicatorplugin/inc/nmsyncindicator.h	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2010 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: Mail Indicator class
+ *
+ */
+
+#include <hbindicatorinterface.h>
+
+#ifndef NMSYNCINDICATOR_H
+#define NMSYNCINDICATOR_H
+
+class NmSyncIndicator : public HbIndicatorInterface
+{
+public:
+    NmSyncIndicator();
+    virtual ~NmSyncIndicator();
+    virtual QVariant indicatorData(int role) const;   
+    static const char IndicatorType[];
+};
+
+#endif /* NMSYNCINDICATOR_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmindicatorplugin/inc/nmunreadindicator.h	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2010 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: Mail Indicator class for showing global unread state
+ *
+ */
+
+#ifndef NMUNREADINDICATOR_H
+#define NMUNREADINDICATOR_H
+
+#include <QObject>
+#include <hbindicatorinterface.h>
+
+static const QString NmUnreadIndicatorType = "com.nokia.nmail.indicatorplugin.unread/1.0";
+
+class NmUnreadIndicator : public HbIndicatorInterface
+{
+    Q_OBJECT
+
+public:
+
+    NmUnreadIndicator(const QString &indicatorType);
+    ~NmUnreadIndicator();
+
+public: // From HbIndicatorInterface
+
+    QVariant indicatorData(int role) const;
+};
+
+#endif // NMUNREADINDICATOR_H
+
--- a/emailuis/nmindicatorplugin/nmindicatorplugin.pro	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmindicatorplugin/nmindicatorplugin.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -26,9 +26,15 @@
 INCLUDEPATH += ../../inc
 
 HEADERS += inc/nmindicatorplugin.h \
-           inc/nmindicator.h
+           inc/nmindicator.h \
+           inc/nmsendingindicator.h \
+           inc/nmsyncindicator.h \
+           inc/nmunreadindicator.h
 SOURCES += src/nmindicatorplugin.cpp \
-           src/nmindicator.cpp
+           src/nmindicator.cpp \
+           src/nmsendingindicator.cpp \
+           src/nmsyncindicator.cpp \
+           src/nmunreadindicator.cpp
 
 symbian {
     TARGET.EPOCALLOWDLLDATA=1
--- a/emailuis/nmindicatorplugin/src/nmindicator.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmindicatorplugin/src/nmindicator.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -27,8 +27,8 @@
 #include <HbStringUtil>
 
 const int NmMailboxInfoItemCount = 8;
-const int NmSendingStateDelay = 2000; // delay for 'send in progress' indicator
 const int NmMaxOutboxCount = 99;
+const int NmActivationDelay = 100; // 0.1s
 
 /*!
     \class NmMailboxInfo
@@ -40,7 +40,8 @@
 */
 NmMailboxInfo::NmMailboxInfo()
 {
-    NMLOG("NmMailboxInfo::NmMailboxInfo");
+    NM_FUNCTION;
+
     mId = 0;
     mSyncState = SyncComplete;
     mConnectState = Disconnected;
@@ -61,10 +62,7 @@
         HbIndicatorInterface::NotificationCategory,
         InteractionActivated)
 {
-    NMLOG("NmIndicator::NmIndicator");
-    mShowIndicator = false;
-    mSendingState = false;
-    mShowSendProgress = false;
+    NM_FUNCTION;
     mActive = false;
 }
 
@@ -73,7 +71,7 @@
 */
 NmIndicator::~NmIndicator()
 {
-    NMLOG("NmIndicator::~NmIndicator");
+    NM_FUNCTION;
 }
 
 /*!
@@ -90,28 +88,31 @@
 */
 bool NmIndicator::handleInteraction(InteractionType type)
 {
-    NMLOG("NmIndicator::handleInteraction");
+    NM_FUNCTION;
+
     bool handled = false;
     if (type == InteractionActivated) {
         mActive = false;
         handled = true;
 
-        // This indicator is responsible showing the status bar icon
-        if (mShowIndicator) {
-            // Do not show any indicators anymore
-            mShowIndicator = false;
-            emit dataChanged();
-
-            // Notify that the icon will be lost now
-            emit indicatorIconLost();
-        }
-        emit mailboxLaunched(mMailbox.mId.id());
-        emit deactivate();
+        QVariantMap data;
+        emit userActivated(data);
+        
+        // The action will be delayed to improve the usability
+        QTimer::singleShot(NmActivationDelay, this, SLOT(delayedAction()));
     }
     return handled;
 }
 
 /*!
+     Deactivate the indicator  
+*/
+void NmIndicator::delayedAction() 
+{
+    emit deactivate();
+}
+
+/*!
     \fn QVariant HbIndicatorInterface::indicatorData(int role) const = 0
 
     Returns the data stored under the given role. The indicator should at least have data elements for
@@ -127,28 +128,30 @@
 */
 QVariant NmIndicator::indicatorData(int role) const
 {
-    NMLOG(QString("NmIndicator::indicatorData %1").arg(role));
+    NM_FUNCTION;
+
     switch(role) {
         case PrimaryTextRole:
-            {
-            return mMailbox.mName;
+            if (mActive) {                
+                return mMailbox.mName;
             }
+            break;
         case SecondaryTextRole:
-            {
-            if (mMailbox.mOutboxMails>0) {
-                int outboxCount = mMailbox.mOutboxMails;
-                if (outboxCount>NmMaxOutboxCount) {
-                    outboxCount = NmMaxOutboxCount;
+            if (mActive) {
+                if (mMailbox.mOutboxMails>0) {
+                    int outboxCount = mMailbox.mOutboxMails;
+                    if (outboxCount>NmMaxOutboxCount) {
+                        outboxCount = NmMaxOutboxCount;
+                    }
+                    QString text = QString(hbTrId("txt_mail_status_menu_waiting_to_send")).
+                        arg(HbStringUtil::convertDigits(QString::number(outboxCount)));
+                    return text;
                 }
-                QString text = QString(hbTrId("txt_mail_status_menu_waiting_to_send")).
-                    arg(HbStringUtil::convertDigits(QString::number(outboxCount)));
-                return text;
-		    }
-            else if (mMailbox.mUnreadMails>0) {
-                return hbTrId("txt_mail_status_menu_new_mail");
-			}
+                else if (mMailbox.mUnreadMails>0) {
+                    return hbTrId("txt_mail_status_menu_new_mail");
+                }
+            }
             break;
-            }
         case DecorationNameRole:
             {
 			// Icon for the mailbox in the menu
@@ -162,11 +165,6 @@
             }
             break;
 		    }
-        case MonoDecorationNameRole:
-			if (mShowIndicator) {
-				return QString("qtg_status_new_email");
-			}
-			break;
         default:
         	break;
     }
@@ -174,40 +172,6 @@
 }
 
 /*!
-    Timer callback for hiding 'send in progress' indicator
-*/
-void NmIndicator::hideSendIndicator()
-{
-    if (mShowSendProgress) {
-        NMLOG("NmIndicator::hideSendIndicator - hide progress state");
-        mShowSendProgress = false;
-        emit dataChanged();
-    }
-}
-
-/*!
-    Checks if any mailbox is in sending state at the moment
-    \return true if any mailbox is in sending state
-*/
-bool NmIndicator::isSending() const
-{
-	return mSendingState;
-}
-
-/*!
-    Return type of the indicator
-    \sa HbIndicatorInterface
-*/
-HbIndicatorInterface::Category NmIndicator::category() const
-{
-	NMLOG("NmIndicatorPlugin::Category");
-    if (mMailbox.mOutboxMails>0 && mShowSendProgress) {
-        return HbIndicatorInterface::ProgressCategory;
-    }
-    return HbIndicatorInterface::NotificationCategory;
-}
-
-/*!
     Handles the requests sent from the client
     \a type is a type of the request.
     \a parameter is extra parameter from the client. Can be invalid, if not given.
@@ -220,7 +184,8 @@
 bool NmIndicator::handleClientRequest( RequestType type,
         const QVariant &parameter)
 {
-    NMLOG("NmIndicator::handleClientRequest");
+    NM_FUNCTION;
+
     bool handled(false);
     switch (type) {
         case RequestActivate:
@@ -239,12 +204,6 @@
             // also the deactivation may give updated data
 			storeMailboxData(parameter);
 
-            // This indicator was responsible showing the status bar icon
-            if (mShowIndicator) {
-                // Notify that the icon will be lost now
-                emit indicatorIconLost();
-            }
-
             emit deactivate();
             }
             break;
@@ -255,25 +214,12 @@
 }
 
 /*!
-    Start showing the 'send in progress' indicator
- */
-void NmIndicator::showSendProgress()
-{
-    // Activate the progress indicator
-    if (!mShowSendProgress && mActive) {
-        mShowSendProgress = true;
-
-        // Hide the progress state after some delay
-        QTimer::singleShot(NmSendingStateDelay, this, SLOT(hideSendIndicator()));
-    }
-}
-
-/*!
 	Stores mailbox data to member variable mMailbox.
  */
 void NmIndicator::storeMailboxData(QVariant mailboxData)
 {
-    NMLOG("NmIndicator::storeMailboxData");
+    NM_FUNCTION;
+
     QList<QVariant> infoList = mailboxData.toList();
 
     if (infoList.count() >= NmMailboxInfoItemCount) {
@@ -284,33 +230,6 @@
         mMailbox.mConnectState = infoList.at(4).value<NmConnectState>();
         mMailbox.mOutboxMails = infoList.at(5).toInt();
         mMailbox.mMailboxIconName = infoList.at(6).toString();
-
-        bool oldSendingState = mSendingState;
-        mSendingState = infoList.at(7).toInt();
-
-        // Sending state now activated
-        if (!oldSendingState && mSendingState) {
-            showSendProgress();
-        }
-
-        // Notify the global state
-        emit globalStatusChanged(mSendingState);
+        bool sendingState = infoList.at(7).toInt();
     }
 }
-
-/*!
-    Used for asking if this indicator can take status bar icon responsibility.
-    \param sending global sending state
-    \return true if the icon was accepted
- */
-bool NmIndicator::acceptIcon(bool sending)
-{
-    mSendingState = sending;
-
-    if (mActive) {
-        mShowIndicator = true;
-        emit dataChanged();
-    }
-    return mActive;
-}
-
--- a/emailuis/nmindicatorplugin/src/nmindicatorplugin.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmindicatorplugin/src/nmindicatorplugin.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -17,19 +17,20 @@
 
 #include "nmindicatorplugin.h"
 #include "nmindicator.h"
+#include "nmsendingindicator.h"
+#include "nmsyncindicator.h"
+#include "nmunreadindicator.h"
 
 #include <QCoreApplication>
 #include <QLocale>
 #include <QVariant>
 #include <QTimer>
 
-#include <xqservicerequest.h>
-#include <email_services_api.h>
-
 Q_EXPORT_PLUGIN(NmIndicatorPlugin)
 
 const int NmMaxIndicatorCount = 10;
-static const QString emailServiceNameMailbox = "nmail.com.nokia.symbian.IEmailInboxView";
+static const QString NmIndicatorName = "com.nokia.nmail.indicatorplugin_%1/1.0";
+
 
 /*!
     \class NmIndicatorPlugin
@@ -40,8 +41,9 @@
      Class constructor.
 */
 NmIndicatorPlugin::NmIndicatorPlugin()
-: mError(0), mTranslator(0), mStatusBarIndicator(0), mSending(false)
+: mError(0), mTranslator(0)
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -49,7 +51,8 @@
 */
 NmIndicatorPlugin::~NmIndicatorPlugin()
 {
-    NMLOG("NmIndicatorPlugin::~NmIndicatorPlugin");
+    NM_FUNCTION;
+    
 	delete mTranslator;
 }
 
@@ -58,11 +61,16 @@
  */
 QStringList NmIndicatorPlugin::indicatorTypes() const
 {
+    NM_FUNCTION;
+    
     QStringList types;
     for (int i=0; i<NmMaxIndicatorCount; i++) {
-		QString name = QString("com.nokia.nmail.indicatorplugin_%1/1.0").arg(i);
+		QString name = QString(NmIndicatorName).arg(i);
 		types << name;
     }
+    types << NmSendingIndicatorType;
+	types << NmSyncIndicator::IndicatorType;
+    types << NmUnreadIndicatorType;
     return types;
 }
 
@@ -73,6 +81,8 @@
 bool NmIndicatorPlugin::accessAllowed(const QString &indicatorType,
     const QVariantMap &securityInfo) const
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(indicatorType)
     Q_UNUSED(securityInfo)
 
@@ -81,30 +91,14 @@
     return true;
 }
 
-
-/*!
-    Called when any of the indicator receive updated status of the global status
- */
-void NmIndicatorPlugin::globalStatusChanged(bool sending)
-{
-    mSending = sending;
-
-    // Pass the information to the indicator handling the status bar icon
-    if (mStatusBarIndicator) {
-        mStatusBarIndicator->acceptIcon(sending);
-    }
-    else {
-		// No indicator is showing the status now.
-		indicatorIconLost();
-	}
-}
-
 /*!
 	Creates an indicator of type indicatorType. Ownership is passed to the caller.
  */
 HbIndicatorInterface* NmIndicatorPlugin::createIndicator(
         const QString &indicatorType)
 {
+    NM_FUNCTION;
+
     if (!mTranslator) {
         mTranslator = new QTranslator();
         QString lang = QLocale::system().name();
@@ -114,12 +108,19 @@
         QCoreApplication::installTranslator(mTranslator);
     }
 
-    NmIndicator* indicator = new NmIndicator(indicatorType);
-    connect(indicator, SIGNAL(indicatorIconLost()), this, SLOT(indicatorIconLost()));
-    connect(indicator, SIGNAL(destroyed(QObject *)), this, SLOT(indicatorDeactivated(QObject *)));
-    connect(indicator, SIGNAL(globalStatusChanged(bool)), this, SLOT(globalStatusChanged(bool)));
-    connect(indicator, SIGNAL(mailboxLaunched(quint64)), this, SLOT(showMailbox(quint64)));
-    mIndicators.append(indicator);
+    HbIndicatorInterface *indicator;
+    if (indicatorType == NmSendingIndicatorType) {
+        indicator = new NmSendingIndicator(indicatorType);
+    }
+    else if (indicatorType == NmUnreadIndicatorType) {
+        indicator = new NmUnreadIndicator(indicatorType);
+    }
+    else if (indicatorType == NmSyncIndicator::IndicatorType) {
+        indicator = new NmSyncIndicator();
+    }
+    else {
+        indicator = new NmIndicator(indicatorType);
+    }
 
     return indicator;
 }
@@ -129,65 +130,7 @@
  */
 int NmIndicatorPlugin::error() const
 {
+    NM_FUNCTION;
+    
     return mError;
 }
-
-/*!
-    Called when an indicator signals about lost indicator.
-    \param true if a new indicator was found
- */
-bool NmIndicatorPlugin::indicatorIconLost()
-{
-    bool found(false);
-    mStatusBarIndicator = NULL;
-
-    foreach (NmIndicator* indicator, mIndicators) {
-        // Find a new candidate to handle the status bar icon
-        if (indicator->acceptIcon(mSending)) {
-			mStatusBarIndicator = indicator;
-			found = true;
-            break;
-        }
-    }
-    return found;
-}
-
-/*!
-    Remove destroyed indicators from the list.
-    \param indicator item that has been deleted
- */
-void NmIndicatorPlugin::indicatorDeactivated(QObject *indObject)
-{
-    NMLOG(QString("NmIndicatorPlugin::indicatorDeactivated %1").arg((int)indObject));
-    NmIndicator *indicator = static_cast<NmIndicator*>(indObject);
-    mIndicators.removeAll(indicator);
-    if (mStatusBarIndicator == indicator) {
-		mStatusBarIndicator = NULL;
-
-		// Find new indicator to take care of the status bar icon
-		indicatorIconLost();
-	}
-}
-
-/*!
-    Opens inbox view to specific mailbox
-    \return true if inbox is succesfully opened
-*/
-bool NmIndicatorPlugin::showMailbox(quint64 mailboxId)
-{
-    NMLOG("NmIndicatorPlugin::showMailbox");
-    XQServiceRequest request(
-        emailServiceNameMailbox,
-        emailOperationViewInbox,
-        true);
-
-    QList<QVariant> list;
-    list.append(QVariant(mailboxId));
-
-    request.setArguments(list);
-
-    int returnValue(-1);
-    return request.send(returnValue);
-}
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmindicatorplugin/src/nmsendingindicator.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+#include "nmsendingindicator.h"
+#include <QTimer>
+#include <nmcommon.h>
+
+const int NmSendingStateDelay = 2000; // delay for 'send in progress' indicator
+
+/*!
+    \class NmSendingIndicator
+    \brief Handles sending progress indicator
+*/
+
+/*!
+     Class constructor.
+*/
+NmSendingIndicator::NmSendingIndicator(const QString &indicatorType)
+:HbIndicatorInterface(indicatorType,
+        HbIndicatorInterface::ProgressCategory,
+        HbIndicatorInterface::NoInteraction)
+{
+}
+
+/*!
+    Class destructor.
+*/
+NmSendingIndicator::~NmSendingIndicator()
+{
+}
+
+/*!
+    \fn QVariant HbIndicatorInterface::indicatorData(int role) const = 0
+
+    No texts or icons show by this indicator
+*/
+QVariant NmSendingIndicator::indicatorData(int role) const
+{
+    if (role==MonoDecorationNameRole) {
+		// Must return non-empty to make the indicator visible
+		return " ";
+	}
+
+    return QVariant();
+}
+
+/*!
+    Timer callback for hiding 'send in progress' indicator
+*/
+void NmSendingIndicator::hideSendIndicator()
+{
+    NM_FUNCTION;
+    emit deactivate();
+}
+
+/*!
+    Handles the requests sent from the client
+    \a type is a type of the request.
+    \a parameter is extra parameter from the client. Can be invalid, if not given.
+
+    Should return true, when the request is handled.
+    Default implementation returns false.
+
+    \sa RequestType, HbIndicator
+*/
+bool NmSendingIndicator::handleClientRequest( RequestType type,
+        const QVariant &parameter)
+{
+    NM_FUNCTION;
+    Q_UNUSED(parameter);
+
+    switch (type) {
+        case RequestActivate:
+            {
+            // Hide the progress state after some delay
+            QTimer::singleShot(NmSendingStateDelay, this, SLOT(hideSendIndicator()));
+            }
+            break;
+        default:
+            break;
+    }
+    return false;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmindicatorplugin/src/nmsyncindicator.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#include "nmsyncindicator.h"
+
+const char NmSyncIndicator::IndicatorType[] = "com.nokia.hb.nmsyncindicator/1.0";
+
+NmSyncIndicator::NmSyncIndicator() :
+HbIndicatorInterface(NmSyncIndicator::IndicatorType, ProgressCategory, NoInteraction)
+{
+}
+
+NmSyncIndicator::~NmSyncIndicator()
+{
+}
+
+QVariant NmSyncIndicator::indicatorData(int role) const
+{
+    if (role == MonoDecorationNameRole )
+    {
+        // Must return non-empty to make the indicator visible
+        return " ";
+    }
+    else
+    {
+        return QVariant();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmindicatorplugin/src/nmunreadindicator.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+#include "nmunreadindicator.h"
+#include <nmcommon.h>
+
+/*!
+    \class NmUnreadIndicator
+    \brief Handles global unread indicator
+*/
+
+/*!
+     Class constructor.
+*/
+NmUnreadIndicator::NmUnreadIndicator(const QString &indicatorType)
+:HbIndicatorInterface(indicatorType,
+        HbIndicatorInterface::NotificationCategory,
+        HbIndicatorInterface::NoInteraction)
+{
+}
+
+/*!
+    Class destructor.
+*/
+NmUnreadIndicator::~NmUnreadIndicator()
+{
+}
+
+/*!
+    \fn QVariant HbIndicatorInterface::indicatorData(int role)
+
+    This indicator just shows the "@" in the status bar
+*/
+QVariant NmUnreadIndicator::indicatorData(int role) const
+{
+    if (role==MonoDecorationNameRole) {
+        return QString("qtg_status_new_email");
+    }
+
+    return QVariant();
+}
--- a/emailuis/nmsettingui/inc/nmsettingscommon.h	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmsettingui/inc/nmsettingscommon.h	Wed Jun 23 17:00:39 2010 +0100
@@ -26,7 +26,8 @@
     };
 
     enum MailboxProperty {
-        MailboxName = 0
+        MailboxName = 0,
+        MailboxAddress
     };
 
 }
--- a/emailuis/nmsettingui/src/nmmailboxentryitem.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmsettingui/src/nmmailboxentryitem.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -44,6 +44,7 @@
 : CpSettingFormEntryItemData(itemDataHelper, mailboxName, mailboxDescription, mailboxIcon, parent),
   mMailboxId(mailboxId.id())
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -51,6 +52,7 @@
 */
 NmMailboxEntryItem::~NmMailboxEntryItem()
 {
+    NM_FUNCTION;
 }
 
 /*!
@@ -58,7 +60,8 @@
 */
 CpBaseSettingView *NmMailboxEntryItem::createSettingView() const
 {
-	NMLOG("NmMailboxEntryItem::createSettingView");
+    NM_FUNCTION;
+    
     return 0;
 }
 
@@ -67,5 +70,7 @@
 */
 const NmId &NmMailboxEntryItem::id() const
 {
+    NM_FUNCTION;
+    
     return mMailboxId;
 }
--- a/emailuis/nmsettingui/src/nmmailboxselectionview.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmsettingui/src/nmmailboxselectionview.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -51,6 +51,8 @@
   mSettingsFactory(settingsFactory),
   mRefreshForm(false)
 {
+    NM_FUNCTION;
+    
     QScopedPointer<QSignalMapper> signalMapper(new QSignalMapper());
 
     // Connect the form's activated signal.
@@ -81,6 +83,8 @@
 */
 NmMailboxSelectionView::~NmMailboxSelectionView()
 {
+    NM_FUNCTION;
+    
     delete mItemDataHelper;
     delete mModel;
     delete mSignalMapper;
@@ -95,7 +99,8 @@
 */
 void NmMailboxSelectionView::buttonClick(QObject *item)
 {
-    NMLOG("NmMailboxSelectionView::buttonClick");
+    NM_FUNCTION;
+    
     NmMailboxEntryItem *entryItem = static_cast<NmMailboxEntryItem *>(item);
     const NmId &id = entryItem->id();
     const QString &name = entryItem->text();
@@ -111,7 +116,7 @@
 */
 void NmMailboxSelectionView::itemActivate(const QModelIndex &index)
 {
-    NMLOG("NmMailboxSelectionView::itemActivate");
+    NM_FUNCTION;
     
     HbDataForm *form = qobject_cast<HbDataForm*>(widget());
     HbDataFormModel *model = static_cast<HbDataFormModel *>(form->model());
@@ -141,7 +146,8 @@
 */
 void NmMailboxSelectionView::populateDataModel(const QList<NmMailbox *> &mailboxList)
 {
-    NMLOG("NmMailboxSelectionView::populateDataModel");
+    NM_FUNCTION;
+    
     mModel->clear();
     foreach (NmMailbox *mailbox, mailboxList) {
         NmId id = mailbox->id();
@@ -164,8 +170,8 @@
 void NmMailboxSelectionView::mailboxListChanged(const NmId &mailboxId,
     NmSettings::MailboxEventType type)
 {
-    NMLOG("NmMailboxSelectionView::mailboxListChanged");
-
+    NM_FUNCTION;
+    
     switch (type) {
         case NmSettings::MailboxDeleted: {
             // Search correct item.
@@ -191,7 +197,6 @@
             break;
         }
     }
-    NMLOG("NmMailboxSelectionView::mailboxListChanged - OK");
 }
 
 /*!
@@ -204,8 +209,8 @@
 void NmMailboxSelectionView::mailboxPropertyChanged(const NmId &mailboxId,
     QVariant property, QVariant value)
 {
-    NMLOG("NmMailboxSelectionView::mailboxPropertyChanged");
-
+    NM_FUNCTION;
+    
     // Search correct item.
     NmMailboxEntryItem *entryItem = 0;
     const int itemCount(mModel->rowCount());
@@ -228,6 +233,4 @@
         default:
             break;
     }
-
-    NMLOG("NmMailboxSelectionView::mailboxPropertyChanged - OK");
 }
--- a/emailuis/nmsettingui/src/nmmailboxsettingsmanager.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmsettingui/src/nmmailboxsettingsmanager.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -43,8 +43,8 @@
 */
 QStringList pluginFolders()
 {
-    NMLOG(QString("NmMailboxSettingsManager - HELPER FUNCTIONS - pluginFolders"));
-
+    NM_FUNCTION;
+    
     const QString nmSettingsPluginFolderPath("resource/qt/plugins/nmail/settings");
     QStringList pluginDirectories;
     QFileInfoList driveList = QDir::drives();
@@ -57,8 +57,7 @@
             pluginDirectories.append(pluginDirectory);
         }
     }
-
-    NMLOG(QString("NmMailboxSettingsManager - HELPER FUNCTIONS - pluginFolders - OK"));
+    
     return pluginDirectories;
 }
 
@@ -71,6 +70,8 @@
 NmMailboxSettingsManager::NmMailboxSettingsManager()
 : mDataManager(0)
 {
+    NM_FUNCTION;
+    
     QScopedPointer<NmDataManager> dataManager(new NmDataManager());
     loadPlugins();
     mDataManager = dataManager.take();
@@ -82,6 +83,8 @@
 */
 NmMailboxSettingsManager::~NmMailboxSettingsManager()
 {
+    NM_FUNCTION;
+    
     unloadPlugins();
     qDeleteAll(mPluginLoaders);
     mPluginLoaders.clear();
@@ -98,6 +101,8 @@
 */
 void NmMailboxSettingsManager::listMailboxes(QList<NmMailbox *> &mailboxList)
 {
+    NM_FUNCTION;
+    
     mDataManager->listMailboxes(mailboxList);
 }
 
@@ -110,6 +115,8 @@
 */
 HbIcon &NmMailboxSettingsManager::mailboxIcon(const NmId &mailboxId) const
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(mailboxId);
     // TODO: use some branding feature when it is available.
     return NmIcons::getIcon(NmIcons::NmIconDefaultMailbox);
@@ -128,8 +135,8 @@
 void NmMailboxSettingsManager::populateModel(HbDataFormModel &model,
     HbDataForm &form, const NmId &mailboxId) const
 {
-    NMLOG(QString("NmMailboxSettingsManager::populateModel"));
-
+    NM_FUNCTION;
+    
     NmSettingsPluginInterface *plugin = 0;
 
     foreach (QPluginLoader *loader, mPluginLoaders) {
@@ -165,7 +172,6 @@
             break;
         }
     }
-    NMLOG(QString("NmMailboxSettingsManager::populateModel - OK"));
 }
 
 
@@ -175,8 +181,8 @@
 */
 void NmMailboxSettingsManager::loadPlugins()
 {
-    NMLOG(QString("NmMailboxSettingsManager::loadPlugins"));
-
+    NM_FUNCTION;
+    
     QStringList directories(pluginFolders());
 
     foreach (const QString &directoryPath, directories) {
@@ -190,8 +196,6 @@
             loader.take();
         }
     }
-
-    NMLOG(QString("NmMailboxSettingsManager::loadPlugins - OK"));
 }
 
 
@@ -200,13 +204,11 @@
 */
 void NmMailboxSettingsManager::unloadPlugins()
 {
-    NMLOG(QString("NmMailboxSettingsManager::unloadPlugins"));
-
+    NM_FUNCTION;
+    
     foreach (QPluginLoader *loader, mPluginLoaders) {
         loader->unload();
     }
-
-    NMLOG(QString("NmMailboxSettingsManager::unloadPlugins - OK"));
 }
 
 // End of file.
--- a/emailuis/nmsettingui/src/nmmailboxsettingview.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmsettingui/src/nmmailboxsettingview.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -56,6 +56,8 @@
       mModel(NULL),
       mMailboxId(mailboxId.id())
 {
+    NM_FUNCTION;
+    
     setTitle(mailboxName);
 
     HbDocumentLoader documentLoader;
@@ -74,6 +76,9 @@
     }
 
     if (mForm) {
+        // Fix for dataform item recycling.
+        mForm->setItemRecycling(false);
+
         // Set the form for the view.
         setWidget(mForm);
 
@@ -96,8 +101,8 @@
 */
 NmMailboxSettingView::~NmMailboxSettingView()
 {
-    NMLOG("NmMailboxSettingView::~NmMailboxSettingView()");
-
+    NM_FUNCTION;
+    
     if (mForm) {
         mForm->removeAllConnection();
         delete mForm;
@@ -116,6 +121,8 @@
 void NmMailboxSettingView::mailboxListChanged(const NmId &mailboxId,
     NmSettings::MailboxEventType type)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(mailboxId);
     Q_UNUSED(type);
 
@@ -137,6 +144,8 @@
                                                   QVariant property,
                                                   QVariant value)
 {
+    NM_FUNCTION;
+    
     Q_UNUSED(mailboxId);
 
     switch (property.toInt()) {
--- a/emailuis/nmsettingui/src/nmsettingsformcustomitems.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmsettingui/src/nmsettingsformcustomitems.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,6 +15,8 @@
 *
 */
 
+#include "emailtrace.h"
+
 #include <QModelIndex>
 #include <HbPushButton>
 #include <HbAbstractViewItem>
@@ -37,6 +39,7 @@
 NmSettingsFormCustomItems::NmSettingsFormCustomItems(QGraphicsItem *parent)
 : HbDataFormViewItem(parent)
 {
+    NM_FUNCTION;
 }
 
 
@@ -45,6 +48,7 @@
 */
 NmSettingsFormCustomItems::~NmSettingsFormCustomItems()
 {
+    NM_FUNCTION;
 }
 
 
@@ -53,11 +57,15 @@
 */
 HbAbstractViewItem *NmSettingsFormCustomItems::createItem()
 {
+    NM_FUNCTION;
+    
     return new NmSettingsFormCustomItems(*this);
 }
 
 bool NmSettingsFormCustomItems::canSetModelIndex(const QModelIndex &index) const
 {
+    NM_FUNCTION;
+    
     int type(index.data(HbDataFormModelItem::ItemTypeRole).toInt());
     return type==NmButtonItem;
 }
@@ -67,6 +75,8 @@
 */
 void NmSettingsFormCustomItems::restore()
 {
+    NM_FUNCTION;
+    
     HbDataFormModelItem::DataItemType itemType = static_cast<HbDataFormModelItem::DataItemType>(
         modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt());
      if (itemType==NmButtonItem) {
@@ -91,6 +101,8 @@
 */
 HbWidget *NmSettingsFormCustomItems::createCustomWidget()
 {
+    NM_FUNCTION;
+    
     HbDataFormModelItem::DataItemType itemType =
         static_cast<HbDataFormModelItem::DataItemType>(
             modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt());
--- a/emailuis/nmsettingui/src/nmsettingsviewfactory.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmsettingui/src/nmsettingsviewfactory.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -64,6 +64,8 @@
    mSettingsManager(new NmMailboxSettingsManager()), mSettingsViewLauncher(0),mPrevView(0),
    mMessageBox(0)
 {
+    NM_FUNCTION;
+    
     createMessageBox();
 }
 
@@ -90,6 +92,8 @@
      mSettingsManager(new NmMailboxSettingsManager()), mSettingsViewLauncher(viewLauncher),
      mPrevView(0), mMessageBox(0)
 {
+    NM_FUNCTION;
+    
     createMessageBox();
 }
 
@@ -99,6 +103,8 @@
 */
 NmSettingsViewFactory::~NmSettingsViewFactory()
 {
+    NM_FUNCTION;
+    
     delete mSettingsManager;
     delete mMessageBox;
 }
@@ -113,16 +119,15 @@
 */
 CpBaseSettingView *NmSettingsViewFactory::createSettingView() const
 {
-    NMLOG(QString("NmSettingsViewFactory::createSettingView(): Begin."));
-
+    NM_FUNCTION;
+    
     CpBaseSettingView *view = 0;
     QList<NmMailbox *> mailboxList;
     mSettingsManager->listMailboxes(mailboxList);
     const int mailboxCount(mailboxList.count());
 
     // Log the number of mailboxes.
-    NMLOG(QString("NmSettingsViewFactory::createSettingView(): Mailbox count is ") +
-          QString::number(mailboxCount));
+    NM_COMMENT(QString("NmSettingsViewFactory::createSettingView(): mailbox count is %1").arg(mailboxCount));
 
     switch(mailboxCount) {
         case 0: {
@@ -156,8 +161,7 @@
                 SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)),
                 view, SLOT(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
     }
-
-    NMLOG(QString("NmSettingsViewFactory::createSettingView(): End."));
+    
     return view;
 }
 
@@ -171,8 +175,8 @@
 void NmSettingsViewFactory::launchSettingView(const NmId &mailboxId,
                                               const QString &mailboxName) const
 {
-    NMLOG(QString("NmSettingsViewFactory::launchSettingView"));
-
+    NM_FUNCTION;
+    
     // There's always at least one valid main window available.
     HbMainWindow *mainWindow = hbInstance->allMainWindows().takeFirst();
 
@@ -233,8 +237,6 @@
     mPrevView = mainWindow->currentView();
     mainWindow->addView(view);
     mainWindow->setCurrentView(view);
-
-    NMLOG(QString("NmSettingsViewFactory::launchSettingView - OK"));
 }
 
 
@@ -245,8 +247,8 @@
 */
 void NmSettingsViewFactory::backPress()
 {
-    NMLOG(QString("NmSettingsViewFactory::backPress"));
-
+    NM_FUNCTION;
+    
     emit aboutToClose();
     HbMainWindow *mainWindow = hbInstance->allMainWindows().takeFirst();
     QList<HbView *> views = mainWindow->views();
@@ -260,8 +262,6 @@
         }
         mPrevView = 0;
     }
-
-    NMLOG(QString("NmSettingsViewFactory::backPress - OK"));
 }
 
 /*!
@@ -271,9 +271,11 @@
 */
 void NmSettingsViewFactory::launchWizard(HbAction *action)
 {
+    NM_FUNCTION;
+    
     if (action == mMessageBox->primaryAction()) {
         // Launch mail wizard.
-        NMLOG(QString("NmSettingsViewFactory::launchWizard(): Launching the mail wizard."));
+        NM_COMMENT(QString("NmSettingsViewFactory::launchWizard(): launching the mail wizard"));
         QStringList args;
         args << mailWizardStartArgs;
         QProcess::startDetached(mailWizardStartExe, args);
@@ -285,6 +287,8 @@
 */
 void NmSettingsViewFactory::createMessageBox()
 {
+    NM_FUNCTION;
+    
     mMessageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion);
     mMessageBox->setText(hbTrId("txt_mail_dialog_no_mailboxes_create_new"));
     mMessageBox->setTimeout(HbMessageBox::NoTimeout);
--- a/emailuis/nmsettingui/src/nmsettingsviewlauncher.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/emailuis/nmsettingui/src/nmsettingsviewlauncher.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -59,11 +59,9 @@
     const NmId &mailboxId,
     const QString &mailboxName)
 {
-    NMLOG(QString("NmSettingsViewLauncher::launchSettingsView"));
-
+    NM_FUNCTION;
+    
     mSettingsViewFactory->launchSettingView(mailboxId, mailboxName);
-
-    NMLOG(QString("NmSettingsViewLauncher::launchSettingsView - OK"));
 }
 
 // End of file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/cmailboxstateext.h	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "../emailservices/emailcommon/inc/cmailboxstateext.h"
\ No newline at end of file
--- a/inc/emailshutdownconst.h	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/*
-* 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:
-* Constant definitions for Email shutdown
-*
-*/
-
-#include "../emailservices/emailservermonitor/inc/emailshutdownconst.h"
--- a/inc/emailshutdownconst.hrh	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-/*
-* 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:
-* Constant definitions for Cmail shutdown
-*
-*/
-
-#include "../emailservices/emailservermonitor/inc/emailshutdownconst.hrh"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/nmapplicationstateinterface.h	Wed Jun 23 17:00:39 2010 +0100
@@ -0,0 +1,18 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: 
+*
+*/
+
+#include "../emailuis/nmailuiengine/inc/nmapplicationstateinterface.h"
--- a/inc/nmmessagesearchlistmodel.h	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 
-*
-*/
-
-#include "../emailuis/nmailuiengine/inc/nmmessagesearchlistmodel.h"
-
-// End of file.
--- a/ipsservices/ipssosaoplugin/inc/IpsSosAOImapPopLogic.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosaoplugin/inc/IpsSosAOImapPopLogic.h	Wed Jun 23 17:00:39 2010 +0100
@@ -134,6 +134,11 @@
      */
     inline TInt GetMailboxLogicIndex( TMsvId aMailboxId );
 
+    /**
+     * Removes orphaned logics. (mailbox has been deleted but logic has not been )
+     */
+    void RemoveOrphanLogicsL();
+    
 private:
     
     CMsvSession&                        iSession;
--- a/ipsservices/ipssosaoplugin/ipssosaoplugin.pro	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosaoplugin/ipssosaoplugin.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -104,7 +104,6 @@
     -lmsgs \
     -letext \
     -limcm \
-    -lgsecomplugin \
     -leikcore \
     -lipssosplugin \
     -lxqsettingsmanager \
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOImapPopLogic.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOImapPopLogic.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -23,6 +23,7 @@
 #include <msvids.h>
 #include <msvuids.h>
 
+
 // becuase of RD_IPS_AO_PLUGIN flag, can be removed
 // when flag is removed
 #include "ipsplgsosbaseplugin.hrh"
@@ -31,7 +32,9 @@
 #include "IpsSosAOMboxLogic.h"
 #include "IpsSosAOEMNResolver.h"
 //<QMail>
+
 #include "IpsSosAOSettingsHandler.h"
+#include "IpsSosAoExtendedSettingsManager.h"
 //</QMail>
 
 
@@ -240,7 +243,7 @@
         case MMsvSessionObserver::EMsvEntriesChanged:
             {
             TMsvId parent = (*(TMsvId*) (aArg2));
-            //we check that parent is the root. if not, it cannot be a 
+            //we check that parent is the root. if not, it cannot be an 
             //event from service, thus can't be from connection change..
             if ( parent == KMsvRootIndexEntryId )
                 {
@@ -264,9 +267,16 @@
             }
             break;
         case MMsvSessionObserver::EMsvEntriesDeleted:
-            // NOTE: if mailbox is deleted somewhere else than ips plugin
-            // in here need to put logic for removing corresponding 
-            // mailboxlogic object
+            {
+            TMsvId parent = (*(TMsvId*) (aArg2));
+            //we check that parent is the root. if not, it cannot be an 
+            //event indicating deleted mailbox entry
+            if ( parent == KMsvRootIndexEntryId )
+                {
+                RemoveOrphanLogicsL();
+                }
+            }
+            break;
         case MMsvSessionObserver::EMsvEntriesMoved:
         default:
             break;
@@ -429,6 +439,9 @@
         CleanupStack::PopAndDestroy(settings);
 		//</QMail>
         }
+    
+    //finally, check for orphans ( mailbox has been deleted )
+    RemoveOrphanLogicsL();
     }
 
 // ----------------------------------------------------------------------------
@@ -493,5 +506,33 @@
     return index;
     }
 
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+//
+void CIpsSosAOImapPopLogic::RemoveOrphanLogicsL()
+    {
+    CMsvEntry* cEntry = iSession.GetEntryL( KMsvRootIndexEntryId );
+    CleanupStack::PushL( cEntry );
+    
+    CMsvEntrySelection* popEntries = cEntry->ChildrenWithMtmL( KSenduiMtmPop3Uid );
+    CleanupStack::PushL( popEntries );
+    
+    CMsvEntrySelection* imapEntries = cEntry->ChildrenWithMtmL( KSenduiMtmImap4Uid );
+    CleanupStack::PushL( imapEntries );
+        
+        
+    TInt count = iMailboxLogics.Count();
+    
+    for(TInt i=count-1; i>-1;i--)
+        {
+        if( popEntries->Find(iMailboxLogics[i]->GetMailboxId()) == KErrNotFound &&
+            imapEntries->Find(iMailboxLogics[i]->GetMailboxId()) == KErrNotFound)
+            {
+            StopAndRemoveMailboxL( iMailboxLogics[i]->GetMailboxId() );
+            }
+        }
+    
+    CleanupStack::PopAndDestroy( 3, cEntry );
+    }
 // End of file
 
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOMboxLogic.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOMboxLogic.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -221,7 +221,8 @@
     TRAP_IGNORE( settings = 
             CIpsSosAOSettingsHandler::NewL(iSession, iMailboxId));
     
-    if(settings){
+    if( settings )
+        {
         IpsServices::TIpsSetDataEmnStates state = IpsServices::EMailEmnOff;
         state = settings->EmailNotificationState();
         
@@ -250,11 +251,13 @@
     TRAPD( err, settings = CIpsSosAOSettingsHandler::NewL(
             iSession, iMailboxId) );
     
-    if(settings){
+    if( settings )
+        {
         HBufC* addr = NULL;
         TRAP(err, addr = settings->EmailAddressL());
         
-        if(addr){
+        if( addr )
+            {
             __ASSERT_DEBUG( ( 
                     addr->Length() <= KIpsSosAOTextBufferSize ), 
                     User::Panic( KIpsSosAOPanicLit, KErrGeneral) );
@@ -313,7 +316,8 @@
     TInt cycles = 0;
     
     if ( event == EEventStart && iState == EStateError && 
-            CanConnectIfRoamingL() )
+          ( (iIsRoaming && CanConnectIfRoamingL())||
+             !iIsRoaming ) )
         {
         event = EEventNop;
         iAgent->LoadSettingsL();
@@ -853,7 +857,6 @@
     TRAPD(err, mgr.OpenL());
     
     TCmGenConnSettings set;
-    
     if(err==KErrNone){
         TRAP(err, mgr.ReadGenConnSettingsL(set));
         }
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOSettingsHandler.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOSettingsHandler.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -155,9 +155,9 @@
     QVariant state;
     TBool ok = GetSettingValue(IpsServices::ReceptionActiveProfile, state);
     
-    if(ok ){
-        prof = state.toInt();
-        
+    if( ok )
+        {
+        prof = state.toInt();        
         ret = ProfileIntoAOState(prof);
         }   
     
@@ -170,10 +170,12 @@
     const IpsServices::TIpsSetDataAoStates aAlwaysOnlineState )
     {
     //we're allowed to switch ourselves off, not on.
-    if ( aAlwaysOnlineState == IpsServices::EMailAoOff ){
+    if ( aAlwaysOnlineState == IpsServices::EMailAoOff )
+        {
         if(!SetSettingValue(
                 IpsServices::ReceptionActiveProfile, 
-                IpsServices::EmailSyncProfileManualFetch)){
+                IpsServices::EmailSyncProfileManualFetch))
+            {
         
             CreateKeyValuePair(
                     IpsServices::ReceptionActiveProfile, 
@@ -194,7 +196,8 @@
     QVariant state = NULL;
     TBool ok = GetSettingValue(IpsServices::EmailNotificationState, state);
         
-    if(ok){
+    if(ok)
+        {
         ret = static_cast<IpsServices::TIpsSetDataEmnStates>(state.toInt());
         }
     */
@@ -208,7 +211,8 @@
     const IpsServices::TIpsSetDataEmnStates /*aEmnState*/ )
     {
     /* Not supported yet
-    if(!SetSettingValue(IpsServices::EmailNotificationState, aEmnState)){
+    if(!SetSettingValue(IpsServices::EmailNotificationState, aEmnState))
+        {
         CreateKeyValuePair(IpsServices::EmailNotificationState, aEmnState);
         }
     */
@@ -224,7 +228,8 @@
     QVariant state = NULL;
     TBool ok = GetSettingValue(IpsServices::FirstEmnReceived, state);
             
-    if(ok){
+    if(ok)
+        {
         ret = static_cast<TBool>(state.toInt());
         }
     */
@@ -237,7 +242,8 @@
 void CIpsSosAOSettingsHandler::SetFirstEmnReceived( TBool /*aValue*/ )
     {
     /* Not supported yet
-    if(!SetSettingValue( IpsServices::FirstEmnReceived, aValue )){
+    if(!SetSettingValue( IpsServices::FirstEmnReceived, aValue ))
+        {
         CreateKeyValuePair(IpsServices::FirstEmnReceived, aValue);
         }
     */
@@ -254,7 +260,8 @@
     QVariant state = NULL;
     TBool ok = GetSettingValue(IpsServices::EmnReceivedNotSynced, state);
                 
-    if(ok){
+    if(ok)
+        {
         ret = static_cast<TBool>(state.toInt());
         }
     */
@@ -268,7 +275,8 @@
     {
     /* Not supported yet
     
-    if(!SetSettingValue(IpsServices::EmnReceivedNotSynced, aFlag)){
+    if(!SetSettingValue(IpsServices::EmnReceivedNotSynced, aFlag))
+        {
         CreateKeyValuePair(IpsServices::EmnReceivedNotSynced, aFlag);
         }
     */
@@ -283,7 +291,8 @@
     QVariant state = NULL;
     TBool ok = GetSettingValue(IpsServices::ReceptionWeekDays, state);
                     
-    if(ok){
+    if(ok)
+        {
         ret = static_cast<TUint>(state.toUInt());
         }
     
@@ -298,7 +307,8 @@
     TBool ok = GetSettingValue(IpsServices::ReceptionDayStartTime, value);
     TDateTime time;
     
-    if(ok){
+    if(ok)
+        {
         TInt total = value.toInt();
         TInt minutes = total%KAOMinutesInHour;
         TInt hour = total/KAOMinutesInHour;
@@ -318,7 +328,8 @@
     TBool ok = GetSettingValue(IpsServices::ReceptionDayEndTime, value);
     TDateTime time;
     
-    if(ok){
+    if(ok)
+        {
         TInt total = value.toInt();
         TInt minutes = total%KAOMinutesInHour;
         TInt hour = total/KAOMinutesInHour;
@@ -338,24 +349,28 @@
     TInt high = I64HIGH(aLastUpdateInfo.iLastSuccessfulUpdate.Int64());
     TInt low = I64LOW(aLastUpdateInfo.iLastSuccessfulUpdate.Int64());
    
-    if(!SetSettingValue(IpsServices::AoLastSuccessfulUpdateL, low)){
+    if(!SetSettingValue(IpsServices::AoLastSuccessfulUpdateL, low))
+        {
         CreateKeyValuePair(IpsServices::AoLastSuccessfulUpdateL, low);
         }
         
-    if(!SetSettingValue(IpsServices::AoLastSuccessfulUpdateH, high)){
+    if(!SetSettingValue(IpsServices::AoLastSuccessfulUpdateH, high))
+        {
         CreateKeyValuePair(IpsServices::AoLastSuccessfulUpdateH, high);
         }
         
     if(!SetSettingValue(
             IpsServices::AoLastUpdateFailed, 
-            aLastUpdateInfo.iLastUpdateFailed)){
+            aLastUpdateInfo.iLastUpdateFailed))
+        {
         CreateKeyValuePair(IpsServices::AoLastUpdateFailed, 
                 aLastUpdateInfo.iLastUpdateFailed);
         }
         
     if(!SetSettingValue(
             IpsServices::AoUpdateSuccessfulWithCurSettings, 
-            aLastUpdateInfo.iUpdateSuccessfulWithCurSettings)){
+            aLastUpdateInfo.iUpdateSuccessfulWithCurSettings))
+        {
         CreateKeyValuePair(IpsServices::AoUpdateSuccessfulWithCurSettings, 
                 aLastUpdateInfo.iUpdateSuccessfulWithCurSettings);
         }
@@ -376,22 +391,26 @@
     QVariant success=NULL;
         
     TBool ok = GetSettingValue(IpsServices::AoLastSuccessfulUpdateH, high);
-    if(ok){
+    if( ok )
+        {
         ok = GetSettingValue(IpsServices::AoLastSuccessfulUpdateL, low);
         }
-     if(ok){
+     if( ok )
+         {
          info.iLastSuccessfulUpdate = MAKE_TINT64( high.toInt(), low.toInt() );
          }
     
     ok = GetSettingValue(IpsServices::AoLastUpdateFailed, fail);
     
-    if(ok){
+    if( ok )
+        {
         info.iLastUpdateFailed = static_cast<TBool>(fail.toInt());
         }
     
     ok = GetSettingValue(IpsServices::AoUpdateSuccessfulWithCurSettings, success);
     
-    if(ok){
+    if( ok )
+        {
         info.iUpdateSuccessfulWithCurSettings = static_cast<TBool>(success.toInt());
         }
     
@@ -404,15 +423,18 @@
     {
     QVariant value = NULL;
     TBool ok = EFalse;
-    if(IsDaytime()){
+    if( IsDaytime() )
+        {
         ok = GetSettingValue( IpsServices::ReceptionRefreshPeriodDayTime, value);
         }
-    else{
+    else
+        {
         ok = GetSettingValue(IpsServices::ReceptionRefreshPeriodOther, value);
         }    
     
     TInt ret = 0;
-    if(ok){
+    if( ok )
+        {
         ret = value.toInt();
         }
     
@@ -444,7 +466,8 @@
         QVariant& aValue) const
     {
     bool ret = false;
-    if(iExtMgr){
+    if( iExtMgr )
+        {
         ret = iExtMgr->readSetting(aItem, aValue);
         }
     return ret;
@@ -458,7 +481,8 @@
     {
     bool ret = false;
     
-    if(iExtMgr){
+    if( iExtMgr )
+        {
         ret = iExtMgr->writeSetting(aItem, aData);
         }
     return ret;
@@ -510,7 +534,8 @@
     {
     IpsServices::TIpsSetDataAoStates ret = IpsServices::EMailAoOff;
     
-    if ( aProfile != IpsServices::EmailSyncProfileManualFetch ){
+    if ( aProfile != IpsServices::EmailSyncProfileManualFetch )
+        {
         ret = IpsServices::EMailAoAlways;
         }
     
--- a/ipsservices/ipssosplugin/inc/ipsplgdeleteoperation.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/inc/ipsplgdeleteoperation.h	Wed Jun 23 17:00:39 2010 +0100
@@ -52,6 +52,24 @@
             CMsvSession& aMsvSession,
             TRequestStatus& aObserverRequestStatus,
             CMsvEntrySelection* aEntriesToDelete );
+        
+        /**
+        * Two-phased constructor
+        * 
+        * @param aMsvSession                client/server session to MsvServer
+        * @param aObserverRequestStatus     operations observer status
+        * @param aEntriesToDelete           Message entries to be deleted from server and locally
+        * @param aOperationObserver         observes the progress of this operation
+        * @param aRequestId                 identifier for this instance of operation, 
+        *                                   assigned by the client
+        * @return CIpsPlgCreateForwardMessageOperation* self pointer                                  
+        */
+        static CIpsPlgDeleteOperation* NewL(
+            CMsvSession& aMsvSession,
+            TRequestStatus& aObserverRequestStatus,
+            CMsvEntrySelection* aEntriesToDelete,
+            MFSMailRequestObserver& aOperationObserver,
+            const TInt aRequestId);
         // </qmail>    
 //<qmail> class renamed + comments removed
         virtual ~CIpsPlgDeleteOperation();
@@ -59,6 +77,11 @@
         virtual const TDesC8& ProgressL();
 //</qmail> 
 
+// <qmail>
+    protected:        
+        void SignalFSObserver( TInt aStatus );
+// </qmail>
+        
     private:
         // <qmail>   
         enum TIpsPlgDeleteMessagesState 
@@ -76,7 +99,14 @@
         CIpsPlgDeleteOperation(
             CMsvSession& aMsvSession,
             TRequestStatus& aObserverRequestStatus );
-		//</qmail>	
+		//</qmail>
+        //<qmail>
+        CIpsPlgDeleteOperation(
+            CMsvSession& aMsvSession,
+            TRequestStatus& aObserverRequestStatus,
+            MFSMailRequestObserver& aOperationObserver,
+            const TInt aRequestId);
+        //</qmail>
         // <qmail> 
         /**
         * 2nd phase constructor
@@ -128,6 +158,9 @@
         CMsvOperation*              iOperation; // owned
         CMsvEntry*                  iEntry; // owned
         CMsvEntrySelection*         iEntrySelection; // owned
+        MFSMailRequestObserver* iOperationObserver;  // not owned
+        TFSProgress iFSProgress;
+        TInt iFSRequestId;
         // <qmail> removed member iEntryCount
         TInt                        iSetFlagIndex;
         CMsvEntry*                  iSetFlagEntry; // owned
--- a/ipsservices/ipssosplugin/inc/ipsplgheaders.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/inc/ipsplgheaders.h	Wed Jun 23 17:00:39 2010 +0100
@@ -165,7 +165,7 @@
 
 // operations
 #include "ipsplgtimeroperation.h"
-#include "ipsplgoperationwait.h"
+// <qmail> removing #include "ipsplgoperationwait.h"
 #include "ipsplgonlineoperation.h"
 // <qmail>
 #include "ipsplgcreatemessageoperation.h"
--- a/ipsservices/ipssosplugin/inc/ipsplgonlineoperation.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/inc/ipsplgonlineoperation.h	Wed Jun 23 17:00:39 2010 +0100
@@ -57,17 +57,19 @@
      * @param aFSMailBoxId mailbox id
      * @param aFSOperationObserver callback interface to caller for reporting progress (completion) statuses
      * @param aFSRequestId id of the request
+     * @param aSignallingAllowed for asynchronous request response message
      */
     // <qmail> priority parameter has been removed
 	// <qmail> MFSMailRequestObserver& changed to pointer
-	// <qmail> aSignallingAllowed parameter has been removed
+	// <qmail> aSignallingAllowed parameter has been returned
     CIpsPlgOnlineOperation(
         CMsvSession& aMsvSession,
         TRequestStatus& aObserverRequestStatus,
         CIpsPlgTimerOperation& aActivityTimer,
         TFSMailMsgId aFSMailBoxId,
         MFSMailRequestObserver* aFSOperationObserver,
-        TInt aFSRequestId );
+        TInt aFSRequestId,
+        TBool aSignallingAllowed=ETrue );
 
     /**
     * Base constructor
@@ -150,7 +152,9 @@
         // Return this if iSubOperation==NULL.
         TBuf8<1>                iDummyProg;
         
-        // <qmail> removed: TBool           iSignallingAllowed;
+        // <qmail> boolean returned
+        TBool           iSignallingAllowed;
+        // </qmail>
         MFSMailRequestObserver* iFSOperationObserver; //not owned
     };
 
--- a/ipsservices/ipssosplugin/inc/ipsplgoperationwait.h	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
-* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* 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:  Operation waiter for running asyncronous operations
-*                synchronously
-*
-*/
-
-#ifndef IPSOPERATIONWAIT_H
-#define IPSOPERATIONWAIT_H
-
-
-#include <e32base.h>
-
-NONSHARABLE_CLASS( CIpsPlgOperationWait ) : public CActive
-    {
-    public:
-    
-        /**
-        *
-        */    
-        static CIpsPlgOperationWait* NewL( TInt aPriority = EPriorityStandard );
-        
-        /**
-        *
-        */    
-        static CIpsPlgOperationWait* NewLC( TInt aPriority = EPriorityStandard );
-    
-        /**
-        *
-        */
-        CIpsPlgOperationWait( TInt aPriority );
-
-        /**
-        *
-        */
-        virtual ~CIpsPlgOperationWait();
-
-        /**
-        *
-        */
-        void ConstructL();
-
-        /**
-        *
-        */
-        void Start();
-
-
-    protected:
-
-        /**
-        * From CActive
-        */
-        virtual void DoCancel();
-
-        /**
-        * From CActive
-        */
-        virtual void RunL();
-
-    private:
-        
-        /**
-        *
-        */    
-        void StopScheduler();
-
-    private: // Data
-
-        CActiveSchedulerWait iWait;
-
-    };
-
-
-
-#endif /* IPSOPERATIONWAIT_H */
--- a/ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/inc/ipsplgpop3connectop.h	Wed Jun 23 17:00:39 2010 +0100
@@ -44,10 +44,13 @@
 	    * @param aFSOperationObserver observer callback pointer
 	    * @param aFSRequestId client assigned identifier for the request instance
 	    * @param aEventHandler event handler for sending sync events
+	    * @param aSignallingAllowed for asynchronous request response message
+	    * @param aFetchWillFollow used when connection must be kept open
 	    * @return new instance of the class
 	    */
 		// <qmail> MFSMailRequestObserver& changed to pointer
-		// <qmail> aSignallingAllowed parameter removed
+		// <qmail> aSignallingAllowed parameter added
+        // <qmail> aFetchWillFollow parameter added
         static CIpsPlgPop3ConnectOp* NewL(
             CMsvSession& aMsvSession,
             TRequestStatus& aObserverRequestStatus,
@@ -57,7 +60,9 @@
             TFSMailMsgId aFSMailBoxId,
             MFSMailRequestObserver* aFSOperationObserver,
             TInt aFSRequestId,
-            CIpsPlgEventHandler* aEventHandler );
+            CIpsPlgEventHandler* aEventHandler,
+            TBool aSignallingAllowed=ETrue,
+            TBool aFetchWillFollow=EFalse );
 
         /**
         *
@@ -91,6 +96,8 @@
         TIpsOpType IpsOpType() const;
 // </qmail>
 
+        TInt GetOperationErrorCodeL( );
+        
     protected:
 
         /**
@@ -109,7 +116,8 @@
         *
         */
 		// <qmail> MFSMailRequestObserver& changed to pointer
-		// <qmail> aSignallingAllowed parameter removed
+		// <qmail> aSignallingAllowed parameter added
+        // <qmail> aFetchWillFollow parameter added
         CIpsPlgPop3ConnectOp(
             CMsvSession& aMsvSession,
             TRequestStatus& aObserverRequestStatus,
@@ -119,7 +127,9 @@
             TFSMailMsgId aFSMailBoxId,
             MFSMailRequestObserver* aFSOperationObserver,
             TInt aFSRequestId,
-            CIpsPlgEventHandler* aEventHandler );
+            CIpsPlgEventHandler* aEventHandler,
+            TBool aSignallingAllowed,
+            TBool aFetchWillFollow );
 
         /**
         *
@@ -134,7 +144,8 @@
         void DoPopulateL();
 	    // <qmail> removed TBool ValidateL() (did nothing)
 	    // <qmail> removed void DoQueryPasswordL() not used any more
-        void DoDisconnect();
+        // <qmail> DoDisconnect -> DoDisconnectL
+        void DoDisconnectL();
 		// </qmail>
         
         // <qmail> removed flag methods as they were not used or even defined anywhere
@@ -165,7 +176,10 @@
 	    TBool                                           iForcePopulate;
 	    // <qmail> removed iSelection;
 	    CIpsPlgEventHandler*                            iEventHandler; // not owned
-        TBool                                           iAlreadyConnected;
+	    // <qmail> iAlreadyConnected removed
+        // <qmail>
+        TBool                                           iFetchWillFollow;
+        // </qmail>
     };
 
 #endif
--- a/ipsservices/ipssosplugin/inc/ipsplgsmtpservice.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/inc/ipsplgsmtpservice.h	Wed Jun 23 17:00:39 2010 +0100
@@ -78,26 +78,12 @@
         TFSMailMsgId aMailBoxId,
         CFSMailMessage& aMessage );
 
-    /**
-     * Creates new email message to message store
-     *
-     * @param aMailBoxId msv entry id to mailbox which setting are used
-     * @param aSession Msv Session
-     * @since FS 1.0
-     * @return pointer created fs message object
-     */
-    CFSMailMessage* CreateNewSmtpMessageL(
-        const TFSMailMsgId& aMailBoxId );
-
-    CFSMailMessage* CreateForwardSmtpMessageL(
-        const TFSMailMsgId& aMailBoxId,
-        const TFSMailMsgId& aOriginalMessageId );
-
-    CFSMailMessage* CreateReplySmtpMessageL(
-        const TFSMailMsgId& aMailBoxId,
-        const TFSMailMsgId& aOriginalMessageId,
-        TBool aReplyToAll );
-
+    // <qmail> removing unused functions
+    // CreateNewSmtpMessageL
+    // CreateForwardSmtpMessageL
+    // CreateReplySmtpMessageL
+    // </qmail>
+            
 // <qmail> moved for public access
     /**
      * Creates proper fs message object and set flags
--- a/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h	Wed Jun 23 17:00:39 2010 +0100
@@ -176,6 +176,15 @@
         const TFSMailMsgId& aMailBoxId,
         const TFSMailMsgId& aFolderId,
         const RArray<TFSMailMsgId>& aMessages );
+		
+//<qmail>
+    virtual void DeleteMessagesByUidL(
+        const TFSMailMsgId& aMailBoxId,
+        const TFSMailMsgId& aFolderId,
+        const RArray<TFSMailMsgId>& aMessages,
+        MFSMailRequestObserver& aOperationObserver,
+        const TInt aRequestId);
+//</qmail>
 
     // MESSAGE STORE OPERATIONS
 
--- a/ipsservices/ipssosplugin/ipssosplugin.pro	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/ipssosplugin.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -53,7 +53,7 @@
 inc/ipsplgcreatereplymessageoperation.h \
 inc/ipsplgnewchildpartfromfileoperation.h \
 inc/ipsplgremovechildpartoperation.h \
-inc/ipsplgoperationwait.h \
+# <qmail> inc/ipsplgoperationwait.h \ removed
 inc/ipsplgpop3connectop.h \
 inc/ipsplgpop3fetchoperation.h \
 inc/ipsplgpop3plugin.h \
@@ -98,7 +98,7 @@
 src/ipsplgcreatereplymessageoperation.cpp \
 src/ipsplgnewchildpartfromfileoperation.cpp \
 src/ipsplgremovechildpartoperation.cpp \
-src/ipsplgoperationwait.cpp \
+# <qmail> removed src/ipsplgoperationwait.cpp \
 src/ipsplgpop3connectop.cpp \
 src/ipsplgpop3fetchoperation.cpp \
 src/ipsplgpop3plugin.cpp \
@@ -161,8 +161,6 @@
     -lmsgs \
     -letext \
     -limcm \
-    -lgsecomplugin \
-    -lgsframework \
     -lfsmailframework \
     -lfsfwcommonlib \
     -lbafl \
--- a/ipsservices/ipssosplugin/src/ipsplgdeleteoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/src/ipsplgdeleteoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -41,6 +41,8 @@
         aMsvSession, 
         CActive::EPriorityStandard, 
         aObserverRequestStatus),
+    iOperationObserver(NULL),
+    iFSRequestId(KErrNotFound),
     iState( ESetFlags ) // <qmail>
     //</qmail> iBlank removed    
     {
@@ -49,6 +51,30 @@
     }
 //</qmail>
 
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::CIpsPlgDeleteOperation
+// ----------------------------------------------------------------------------
+//
+//<qmail>
+CIpsPlgDeleteOperation::CIpsPlgDeleteOperation(
+    CMsvSession& aMsvSession,
+    TRequestStatus& aObserverRequestStatus,
+    MFSMailRequestObserver& aOperationObserver,
+    const TInt aRequestId)
+    :
+    CMsvOperation( 
+        aMsvSession, 
+        CActive::EPriorityStandard, 
+        aObserverRequestStatus),
+    iOperationObserver(&aOperationObserver),
+    iFSRequestId(aRequestId),
+    iState( ESetFlags )
+    {
+    FUNC_LOG;
+    CActiveScheduler::Add(this);
+    }
+//</qmail>
+
 
 // ----------------------------------------------------------------------------
 // CIpsPlgDeleteOperation::ConstructL
@@ -115,6 +141,28 @@
     return self;
     }
 
+// <qmail>
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::NewL
+// ----------------------------------------------------------------------------
+//
+CIpsPlgDeleteOperation* CIpsPlgDeleteOperation::NewL(
+    CMsvSession& aMsvSession,
+    TRequestStatus& aObserverRequestStatus,
+    CMsvEntrySelection* aEntriesToDelete,
+    MFSMailRequestObserver& aOperationObserver,
+    const TInt aRequestId)
+    {
+    FUNC_LOG;
+    CIpsPlgDeleteOperation* self=new (ELeave) CIpsPlgDeleteOperation(
+        aMsvSession, aObserverRequestStatus, aOperationObserver, aRequestId );
+    CleanupStack::PushL(self);
+    self->ConstructL( aEntriesToDelete );
+    CleanupStack::Pop( self ); 
+    return self;
+    }
+// </qmail>
+
 // ----------------------------------------------------------------------------
 // CIpsPlgDeleteOperation::~CIpsPlgDeleteOperation
 // ----------------------------------------------------------------------------
@@ -161,6 +209,7 @@
     if ( iStatus.Int() != KErrNone )
         {
         // something failed, just complete
+        SignalFSObserver(iStatus.Int());
         TRequestStatus* status = &iObserverRequestStatus;
         User::RequestComplete(status, iStatus.Int());
         return;
@@ -177,6 +226,7 @@
         
         if ( err != KErrNone )
             {
+            SignalFSObserver(err);
             TRequestStatus* status = &iObserverRequestStatus;
             User::RequestComplete(status, iStatus.Int());
             }
@@ -198,6 +248,8 @@
         }
     else
         {
+        // Inform observer
+        SignalFSObserver(iStatus.Int());
         // nothing left to process, so complete the observer
         TRequestStatus* status = &iObserverRequestStatus;
         User::RequestComplete(status, iStatus.Int());
@@ -244,6 +296,7 @@
     // if error then complete this pass with the error code
     if ( err )
         {
+        SignalFSObserver(err);
         TRequestStatus* status = &iStatus;
         User::RequestComplete(status, err);
         }
@@ -279,6 +332,7 @@
     // if error then complete this pass with the error code
     if ( err )
         {
+        SignalFSObserver(err);
         TRequestStatus* status = &iStatus;
         User::RequestComplete( status, err );
         }
@@ -335,7 +389,25 @@
     
     return ret;
     }
-// </qmail>    
+// </qmail>
+
+//<qmail> 
+// ----------------------------------------------------------------------------
+// CIpsPlgDeleteOperation::SignalFSObserver
+// ----------------------------------------------------------------------------
+//
+void CIpsPlgDeleteOperation::SignalFSObserver(TInt aStatus)
+    {
+    if (iOperationObserver)
+        {
+        iFSProgress.iProgressStatus = TFSProgress::EFSStatus_RequestComplete;
+        iFSProgress.iError = aStatus;
+        iFSProgress.iParam = NULL;
+    
+        TRAP_IGNORE( iOperationObserver->RequestResponseL( iFSProgress, iFSRequestId ) );
+        }
+    }
+// </qmail>
 
 //  End of File
 
--- a/ipsservices/ipssosplugin/src/ipsplgmessagepartstoreroperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/src/ipsplgmessagepartstoreroperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -287,9 +287,13 @@
 	RFile file = aPart->GetContentFileL();
 	CleanupClosePushL(file);
 
+    // if we don't do SetSize(0) characters from the original mail are left in the end of the mail
+	// if the modified mail contains less characters.
+	User::LeaveIfError( file.SetSize( 0 ) );
+
 	// Write new content to text/html part file - async function
-	file.Write(0, *iDataBuffer, iDataBuffer->Length(), iStatus);
-
+	file.Write( 0, *iDataBuffer, iDataBuffer->Length(), iStatus );
+	
 	CleanupStack::PopAndDestroy(2, data16);
 	SetActive();
 	}
--- a/ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -308,8 +308,8 @@
     TBool unread( aEmlEntry.Unread() );
 
 // <qmail>
-    if ( !LogicalXor( unread, msgFlags & EFSMsgFlag_Read ) ||
-         !LogicalXor( unread, msgFlags & EFSMsgFlag_Read_Locally ))
+    if ( LogicalXor( unread, msgFlags & EFSMsgFlag_Read ) ||
+         LogicalXor( unread, msgFlags & EFSMsgFlag_Read_Locally ))
 // </qmail>
         {
         aEmlEntry.SetUnread( !unread );
--- a/ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/src/ipsplgonlineoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -36,14 +36,15 @@
 // ----------------------------------------------------------------------------
 // <qmail> priority parameter has been removed
 // <qmail> MFSMailRequestObserver& changed to pointer
-// <qmail> aSignallingAllowed parameter has been removed
+// <qmail> aSignallingAllowed parameter has been returned
 CIpsPlgOnlineOperation::CIpsPlgOnlineOperation(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
     CIpsPlgTimerOperation& aActivityTimer,
     TFSMailMsgId aFSMailBoxId,
     MFSMailRequestObserver* aFSOperationObserver,
-    TInt aFSRequestId )
+    TInt aFSRequestId,
+    TBool aSignallingAllowed )
     :
     CIpsPlgBaseOperation(
         aMsvSession, 
@@ -55,6 +56,7 @@
     iMtmReg( NULL ), 
     iSubOperation( NULL ),
     iError( KErrNone ),
+    iSignallingAllowed( aSignallingAllowed ),
     iFSOperationObserver( aFSOperationObserver )
     {
     FUNC_LOG;
@@ -216,7 +218,9 @@
     {
     FUNC_LOG;
     // <qmail> clean up this function
-    if( iFSOperationObserver )
+    // <qmail>
+    if( iSignallingAllowed )
+    // </qmail>    
         {
         // Initialize the progress data
         TFSProgress prog = { TFSProgress::EFSStatus_RequestComplete, 1, 1, aStatus, NULL };
@@ -226,9 +230,13 @@
             {
             prog.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled;
             }
-        
-        // do the actual signalling
-        TRAP_IGNORE( iFSOperationObserver->RequestResponseL( prog, iFSRequestId ) );
+        // <qmail>
+        if( iFSOperationObserver )
+            {
+            // do the actual signalling
+            TRAP_IGNORE( iFSOperationObserver->RequestResponseL( prog, iFSRequestId ) );
+            }
+        // </qmail>
         }
     }
 
--- a/ipsservices/ipssosplugin/src/ipsplgoperationwait.cpp	Tue May 18 11:08:56 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,123 +0,0 @@
-/*
-* Copyright (c) 2006 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: 
-*       Simple wait operation for async functions
-*
-*/
-
-
-#include "emailtrace.h"
-#include "ipsplgheaders.h"
-
-
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
-CIpsPlgOperationWait* CIpsPlgOperationWait::NewL( 
-    TInt aPriority )
-    {
-    FUNC_LOG;
-    CIpsPlgOperationWait* self = CIpsPlgOperationWait::NewLC( aPriority );
-    CleanupStack::Pop( self );
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
-CIpsPlgOperationWait* CIpsPlgOperationWait::NewLC( 
-    TInt aPriority )
-    {
-    FUNC_LOG;
-    CIpsPlgOperationWait* self = new( ELeave ) CIpsPlgOperationWait( aPriority );
-    CleanupStack::PushL( self );
-    self->ConstructL();
-    return self;
-    }
-
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
-CIpsPlgOperationWait::CIpsPlgOperationWait( TInt aPriority ) : CActive( aPriority )
-    {
-    FUNC_LOG;
-    }
-    
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
-CIpsPlgOperationWait::~CIpsPlgOperationWait()
-    {
-    FUNC_LOG;
-    Cancel();
-    }
-    
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
-void CIpsPlgOperationWait::ConstructL()
-    {
-    FUNC_LOG;
-    CActiveScheduler::Add( this );
-    }
-
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
-void CIpsPlgOperationWait::Start( )
-    {
-    FUNC_LOG;
-    SetActive();
-    iWait.Start();
-    }
-    
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
-void CIpsPlgOperationWait::DoCancel()
-    {
-    FUNC_LOG;
-    if( iStatus == KRequestPending )
-        {
-        TRequestStatus* s=&iStatus;
-        User::RequestComplete( s, KErrCancel );
-        }
-    StopScheduler();
-    }
-    
-// ---------------------------------------------------------------------------
-// ---------------------------------------------------------------------------
-//
-void CIpsPlgOperationWait::RunL()
-    {
-    FUNC_LOG;
-    StopScheduler();
-    }
-
-void CIpsPlgOperationWait::StopScheduler()
-    {
-    FUNC_LOG;
-    if ( iWait.IsStarted() )
-        {
-        /*if (iWait.CanStopNow())
-            {*/
-        iWait.AsyncStop();
-        /*    }
-        else
-            {
-            iWait.AsyncStop(TCallBack(SchedulerStoppedCallBack, env));
-            }*/
-        }
-    }
-
--- a/ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/src/ipsplgpop3connectop.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -30,7 +30,8 @@
 // CIpsPlgPop3ConnectOp::NewL()
 // ----------------------------------------------------------------------------
 // <qmail> MFSMailRequestObserver& changed to pointer
-// <qmail> aSignallingAllowed parameter removed
+// <qmail> aSignallingAllowed parameter added
+// <qmail> aFetchWillFollow parameter added
 CIpsPlgPop3ConnectOp* CIpsPlgPop3ConnectOp::NewL(
     CMsvSession& aMsvSession,                           
     TRequestStatus& aObserverRequestStatus,
@@ -40,7 +41,9 @@
     TFSMailMsgId aFSMailBoxId,
     MFSMailRequestObserver* aFSOperationObserver,
     TInt aFSRequestId,
-    CIpsPlgEventHandler* aEventHandler )
+    CIpsPlgEventHandler* aEventHandler,
+    TBool aSignallingAllowed,
+    TBool aFetchWillFollow )
     {
     FUNC_LOG;
     CIpsPlgPop3ConnectOp* op = new(ELeave) CIpsPlgPop3ConnectOp(
@@ -52,7 +55,9 @@
         aFSMailBoxId,
         aFSOperationObserver,
         aFSRequestId,
-        aEventHandler );
+        aEventHandler,
+        aSignallingAllowed,
+        aFetchWillFollow );
 
     CleanupStack::PushL( op );
     op->ConstructL();
@@ -112,7 +117,7 @@
 void CIpsPlgPop3ConnectOp::DoRunL()
     {
     FUNC_LOG;
-    // <qmail> move TInt err declaration later, and narrow the scope
+    TInt err( KErrNone );
 
     // <qmail> remove EQueryingDetails state
     if ( iState == EStartConnect )
@@ -133,35 +138,46 @@
     else if ( iState == EConnected )
         {
         // Connect completed
-// <qmail> Login details checking removed
-        User::LeaveIfError( iStatus.Int() );
+        // <qmail> Login details checking removed
+        err = GetOperationErrorCodeL( );
+        User::LeaveIfError( err );
+
         if ( iForcePopulate && Connected() )
             {
             iState = EPopulate;
             DoPopulateL();
             }
+        // <qmail>
+        else if( iFetchWillFollow && Connected() )
+            {
+            // Leave connection open to make fetch
+            // operation possible
+            iState = EIdle;
+            CompleteObserver( KErrNone );
+            }
+        // </qmail>
         else
             {
             // <qmail>
             // start disconnecting
             iState = EDisconnecting;
-            DoDisconnect();
+            DoDisconnectL();
             // </qmail>
             }
         }
     else if ( iState == EPopulate )
         {
-        // <qmail> suboperation has completed, the result is in 'this->iStatus'
+        err = GetOperationErrorCodeL( );
         if ( iEventHandler )
             {
-            iEventHandler->SetNewPropertyEvent( iService, KIpsSosEmailSyncCompleted, iStatus.Int() );
+            iEventHandler->SetNewPropertyEvent( iService, KIpsSosEmailSyncCompleted, err );
             }
         CIpsPlgSyncStateHandler::SaveSuccessfulSyncTimeL( iMsvSession, iService );
 
         // <qmail>
         // start disconnecting
         iState = EDisconnecting;
-        DoDisconnect();
+        DoDisconnectL();
         // </qmail>
         }
     // <qmail>
@@ -240,7 +256,9 @@
 //
 // <qmail> priority parameter has been removed
 // <qmail> MFSMailRequestObserver& changed to pointer
-// <qmail> aSignallingAllowed parameter removed
+// <qmail> aSignallingAllowed parameter added
+// <qmail> aFetchWillFollow parameter added
+// <qmail> iAlreadyConnected removed
 CIpsPlgPop3ConnectOp::CIpsPlgPop3ConnectOp(
     CMsvSession& aMsvSession,
     TRequestStatus& aObserverRequestStatus,
@@ -250,7 +268,9 @@
     TFSMailMsgId aFSMailBoxId,
     MFSMailRequestObserver* aFSOperationObserver,
     TInt aFSRequestId,
-    CIpsPlgEventHandler* aEventHandler )
+    CIpsPlgEventHandler* aEventHandler,
+    TBool aSignallingAllowed,
+    TBool aFetchWillFollow )
     :
     CIpsPlgOnlineOperation(
         aMsvSession,
@@ -258,11 +278,12 @@
         aActivityTimer, 
         aFSMailBoxId,
         aFSOperationObserver, 
-        aFSRequestId ),
+        aFSRequestId,
+        aSignallingAllowed ),
     iState( EIdle ),
     iForcePopulate( aForcePopulate ),
     iEventHandler( aEventHandler ),
-    iAlreadyConnected( EFalse )
+    iFetchWillFollow( aFetchWillFollow )
     {
     iService = aServiceId; 
     }
@@ -297,7 +318,7 @@
     if ( tentry.Connected() )
         {      
         iState = EConnected;
-		iAlreadyConnected = ETrue;
+        // <qmail> iAlreadyConnected removed
         }
     else
         {
@@ -367,13 +388,35 @@
 
 // <qmail> removed QueryUsrPassL() from here as unneeded
 // <qmail> removed ValidateL() (did nothing)
-// <qmail> removed TInt CIpsPlgPop3ConnectOp::GetOperationErrorCodeL( )
+
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------    
+// 
+TInt CIpsPlgPop3ConnectOp::GetOperationErrorCodeL( )
+    {
+    FUNC_LOG;
+    if ( !iSubOperation )
+        {
+        return KErrNotFound;
+        }
+    if ( !iSubOperation->IsActive() && iSubOperation->iStatus.Int() != KErrNone )
+        {
+        return iSubOperation->iStatus.Int();
+        }
+    
+    TPckgBuf<TPop3Progress> paramPack;
+    paramPack.Copy( iSubOperation->ProgressL() );
+    const TPop3Progress& progress = paramPack();
+    
+    return progress.iErrorCode;
+    }
+
 // <qmail> removed CIpsPlgImap4ConnectOp::CredientialsSetL
 
 //<qmail> new functions
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
-void CIpsPlgPop3ConnectOp::DoDisconnect()
+void CIpsPlgPop3ConnectOp::DoDisconnectL()
     {
     FUNC_LOG;
     // <qmail> unnecessary: iStatus = KRequestPending;
@@ -398,7 +441,7 @@
     if ( limit > 0 )
         {
         // basically doing a _very_rough_ conversion from kilobyte value to number-of-rows
-    limit = ( limit * KPopulateAlgorithmBytesInKilo ) / KPopulateAlgorithmRowLength;
+        limit = ( limit * KPopulateAlgorithmBytesInKilo ) / KPopulateAlgorithmRowLength;
         }
     CleanupStack::PopAndDestroy( 2, settings );
     return limit;
--- a/ipsservices/ipssosplugin/src/ipsplgpop3fetchoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/src/ipsplgpop3fetchoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -145,20 +145,21 @@
 
     iState = EStateConnecting;
     iStatus = KRequestPending;
-    
-    // when connecting for the fetch operation, don't let connect operation to do fetch,
-    // because we do it by ourself. That's why give 0 to connect operation.    
+    // <qmail>
     CIpsPlgPop3ConnectOp* connOp = CIpsPlgPop3ConnectOp::NewL(
         iMsvSession,
         iStatus, 
         iService, 
-        EFalse, 
+        EFalse, // We do fetch by ourselves
         *iActivityTimer,
         iFSMailboxId, 
         iFSOperationObserver, 
         iFSRequestId, 
-        NULL );
+        NULL,
+        EFalse, // Signalling not allowed
+        ETrue ); // Fetch will follow, let connection be open
         
+    // </qmail>    
     delete iSubOperation;
     iSubOperation = connOp;
 
@@ -344,9 +345,8 @@
                 progress.iErrorCode = err;
                 iFetchErrorProgress = paramPack.AllocL();
                 }
+            DoDisconnectL();
             
-            iState = EStateIdle;
-            CompleteObserver( err );
             if ( iEventHandler )
                 {
 				// <qmail>
@@ -355,6 +355,11 @@
                 }
             }
             break;
+        case EStateDisconnecting:
+            {
+            CompleteObserver( iStatus.Int() );
+            }
+            break;
             
         default:
             break;
@@ -409,3 +414,16 @@
     }
 // </qmail>
 
+//<qmail> new function
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+void CIpsPlgPop3FetchOperation::DoDisconnectL()
+    {
+    FUNC_LOG;
+    iState = EStateDisconnecting;
+    InvokeClientMtmAsyncFunctionL( KPOP3MTMDisconnect, iService ); // <qmail> 1 param removed
+    SetActive();
+    }
+// </qmail>
+
+
--- a/ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/src/ipsplgsmtpoperation.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -370,14 +370,14 @@
             // is it safe to change flag from suspended to waiting?
             if ( sendState == KMsvSendStateSuspended )
                 {
+                // <qmail> remove activeschedulerwait
                 CMsvEntry* cEntry = CMsvEntry::NewL(
                     iMsvSession, entry.Id(), TMsvSelectionOrdering() );
                 CleanupStack::PushL( cEntry );
-                CIpsPlgOperationWait* wait = CIpsPlgOperationWait::NewLC( );
                 entry.SetSendingState( KMsvSendStateWaiting );
-                cEntry->ChangeL( entry, wait->iStatus );
-                wait->Start();
-                CleanupStack::PopAndDestroy(2, cEntry ); // wait, cEntry
+                cEntry->ChangeL( entry );
+                CleanupStack::PopAndDestroy( cEntry ); // cEntry
+                // </qmail>
                 }
             // add to send list
             iSelection->AppendL( entry.Id() );
--- a/ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/src/ipsplgsmtpservice.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -242,268 +242,11 @@
     CleanupStack::PopAndDestroy( 3, cEntry );   // >>> cEntry, header, store
     }
 
-// ---------------------------------------------------------------------------
-// CIpsPlgSmtpService::CreateNewSmtpMessageL
-// ---------------------------------------------------------------------------
-//
-CFSMailMessage* CIpsPlgSmtpService::CreateNewSmtpMessageL( 
-    const TFSMailMsgId& aMailBoxId )
-    {
-    FUNC_LOG;
-    TMsvPartList partList( KMsvMessagePartBody );
-    
-    CIpsPlgOperationWait* wait = CIpsPlgOperationWait::NewLC( );
-    
-    TMsvEntry mboxEntry;
-    TMsvId service;
-    iSession.GetEntry( aMailBoxId.Id(), service, mboxEntry );
-    
-    // new mail creating operation. Mail is created asynchronously
-    CImEmailOperation* newMailOp = CImEmailOperation::CreateNewL(
-            wait->iStatus, 
-            iSession,
-            KMsvDraftEntryId,
-            mboxEntry.iRelatedId, 
-            partList, 
-            0, 
-            KUidMsgTypeSMTP );
-    
-    CleanupStack::PushL( newMailOp );
-
-    // wait until new mail is created
-    wait->Start();
-   
-    TMsvId msgId = GetIdFromProgressL( newMailOp->FinalProgress() );
-    
-    CleanupStack::PopAndDestroy( 2, wait );
-    
-    return CreateFSMessageAndSetFlagsL( 
-            msgId, KErrNotFound, aMailBoxId.Id() );
-    }
-    
-// ---------------------------------------------------------------------------
-// CIpsPlgSmtpService::CreateForwardSmtpMessageL
-// ---------------------------------------------------------------------------
-//
-CFSMailMessage* CIpsPlgSmtpService::CreateForwardSmtpMessageL( 
-    const TFSMailMsgId& aMailBoxId,
-    const TFSMailMsgId& aOriginalMessageId )
-    {
-    FUNC_LOG;
-    // 1. part of function checs that body text and all
-    // attachments are fetched
-    TMsvEntry orgMsg;
-    TMsvId service;
-    User::LeaveIfError( iSession.GetEntry( 
-            aOriginalMessageId.Id(), service, orgMsg ) );
-    
-    if ( orgMsg.Id() ==  KMsvNullIndexEntryIdValue )
-        {
-        User::Leave(KErrNotFound);
-        }
-    
-    // In case original message is in Sent folder, it's serviceId must be
-    // changed before starting forward/reply msg creation operation
-    // (after forward msg is created, this is changed back)
-    TMsvId orgServiceId( 0 );
-    if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) && 
-         ( orgMsg.iMtm == KSenduiMtmSmtpUid ) )
-        {
-        orgServiceId = orgMsg.iServiceId;
-        ChangeServiceIdL( orgMsg );
-        }
-
-    TMsvPartList partList( KMsvMessagePartBody | KMsvMessagePartAttachments );
-    
-    CIpsPlgOperationWait* wait = CIpsPlgOperationWait::NewLC( );
-    CImEmailOperation* forwMailOp = CImEmailOperation::CreateForwardL(
-            wait->iStatus, 
-            iSession,
-            orgMsg.Id(),
-            KMsvDraftEntryId, 
-            partList, 
-            0, 
-            KUidMsgTypeSMTP );
-            
-    CleanupStack::PushL( forwMailOp );
-    
-    wait->Start();
-    
-    TMsvId msgId = GetIdFromProgressL( forwMailOp->FinalProgress() );
-    
-    CleanupStack::PopAndDestroy( 2, wait );
-
-    // If original message's serviceId was changed prior to forward/reply msg
-    // creation op, changing it back to the original
-    if ( orgServiceId )
-        {
-        ChangeServiceIdL( orgMsg, orgServiceId );
-        }
-    
-    return CreateFSMessageAndSetFlagsL( msgId, orgMsg.Id(), aMailBoxId.Id() );
-    }
-    
-// ---------------------------------------------------------------------------
-// CIpsPlgSmtpService::CreateReplySmtpMessageL
-// ---------------------------------------------------------------------------
-//
-CFSMailMessage* CIpsPlgSmtpService::CreateReplySmtpMessageL( 
-    const TFSMailMsgId& aMailBoxId,
-    const TFSMailMsgId& aOriginalMessageId,
-    TBool aReplyToAll )
-    {
-    FUNC_LOG;
-    // find orginal message header and check that body is fetched
-    TMsvEntry orgMsg;
-    TMsvId service;
-    User::LeaveIfError( 
-        iSession.GetEntry( aOriginalMessageId.Id(), service, orgMsg ) );
-    
-    if ( orgMsg.Id() ==  KMsvNullIndexEntryIdValue )
-        {
-        User::Leave(KErrNotFound);
-        }
-    
-    // In case original message is in Sent folder, it's serviceId must be
-    // changed before starting forward/reply msg creation operation
-    // (after forward msg is created, this is changed back)
-    TMsvId orgServiceId( 0 );
-    if ( ( orgMsg.Parent() == KMsvSentEntryIdValue ) && 
-         ( orgMsg.iMtm == KSenduiMtmSmtpUid ) )
-        {
-        orgServiceId = orgMsg.iServiceId;
-        ChangeServiceIdL( orgMsg );
-        }
-    
-    // partList flags control e.g. what kind of recipient set is created
-    TMsvPartList partList = KMsvMessagePartBody | KMsvMessagePartDescription
-    | KMsvMessagePartOriginator;        
-    if( aReplyToAll )
-        {
-        partList |= KMsvMessagePartRecipient;
-        }
-    
-    // Ask Symbian messaging fw to create reply message "skeleton"
-    CIpsPlgOperationWait* wait = CIpsPlgOperationWait::NewLC( );
-    CImEmailOperation* replMailOp = CImEmailOperation::CreateReplyL(
-            wait->iStatus, 
-            iSession,
-            orgMsg.Id(),
-            KMsvDraftEntryId, 
-            partList, 
-            0, 
-            KUidMsgTypeSMTP );
-    CleanupStack::PushL( replMailOp );
-    wait->Start();
-    TMsvId msgId = GetIdFromProgressL( replMailOp->FinalProgress() );
-    CleanupStack::PopAndDestroy( 2, wait );
-    
-    // If original message's serviceId was changed prior to forward/reply msg
-    // creation op, changing it back to the original
-    if ( orgServiceId )
-        {
-        ChangeServiceIdL( orgMsg, orgServiceId );
-        }
-
-    // Start finalising new FS style message
-    CFSMailMessage* fsMsg = CreateFSMessageAndSetFlagsL( 
-            msgId, orgMsg.Id(), aMailBoxId.Id() );
-    CleanupStack::PushL( fsMsg ); // ***
-
-    // dig out new reply message's header
-    CMsvEntry* cEntry = iSession.GetEntryL( msgId );
-    CleanupStack::PushL( cEntry ); // ***
-    CMsvStore* store = cEntry->ReadStoreL();
-    CleanupStack::PushL( store ); // ***
-    if( store->IsPresentL( KUidMsgFileIMailHeader ) == EFalse )
-         {
-         User::Leave(KErrCorrupt);
-         }
-    CImHeader* header = CImHeader::NewLC(); // ***
-    header->RestoreL( *store );
-
-    // Start handling recipients
-    HBufC* emailAddr( NULL );
-    CFSMailAddress* fsAddr( NULL );
-    // copy to recipients
-    for( TInt i = 0; i < header->ToRecipients().Count(); i++ )
-        {
-        emailAddr = header->ToRecipients()[i].AllocLC(); // ***
-        fsAddr = CFSMailAddress::NewLC(); // ***
-        fsAddr->SetEmailAddress( *emailAddr ); // Copy created
-        fsMsg->AppendToRecipient( fsAddr ); // No copy
-        CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
-        CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
-        }
-    // copy cc recipients
-    // <cmail>
-    TFSMailMsgId folderId;
-    TFSMailDetails details( EFSMsgDataEnvelope );
-    CFSMailMessage* originalMessage = iPlugin.GetMessageByUidL( aMailBoxId, 
-                                       folderId, aOriginalMessageId, details );
-    CleanupStack::PushL( originalMessage );
-// <qmail> return by value, because Qt types are used for internal CFSMailAddress data storage
-    const RPointerArray<CFSMailAddress>& originalToRecipients = 
-                                            originalMessage->GetToRecipients();
+// <qmail> removing unused functions
+// CreateNewSmtpMessageL
+// CreateForwardSmtpMessageL
+// CreateReplySmtpMessageL
 // </qmail>
-    TInt originalToRecipientsCount = originalToRecipients.Count(); 
-    TBool present = EFalse;
-    // </cmail>
-    for( TInt i = 0; i < header->CcRecipients().Count(); i++ )
-        {
-        emailAddr = header->CcRecipients()[i].AllocLC(); // ***
-        fsAddr = CFSMailAddress::NewLC(); // ***
-        fsAddr->SetEmailAddress( *emailAddr ); // Copy created
-        // <cmail>
-        if( aReplyToAll )
-            {
-            // check if CC recipient read from header was present in To field
-            // of original message. If so, copy it into To recipietns
-            present = EFalse;
-            for( TInt j = 0; j < originalToRecipientsCount; j++ )
-                {
-                if( emailAddr->Find( originalToRecipients[j]->GetEmailAddress())
-                                                              != KErrNotFound )
-                    {
-                    present = ETrue;
-                    break;
-                    }
-                }
-            if( present )
-                {
-                fsMsg->AppendToRecipient( fsAddr ); // No copy
-                }
-            else
-                {
-                fsMsg->AppendCCRecipient( fsAddr ); // No copy
-                }
-            }
-        else
-        {
-            fsMsg->AppendCCRecipient( fsAddr ); // No copy
-        }
-        // </cmail>
-        CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
-        CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
-        }
-    // <cmail>
-    CleanupStack::PopAndDestroy( originalMessage );
-    // </cmail>
-    // copy bcc recipients
-    for( TInt i = 0; i < header->BccRecipients().Count(); i++ )
-        {
-        emailAddr = header->BccRecipients()[i].AllocLC(); // ***
-        fsAddr = CFSMailAddress::NewLC(); // ***
-        fsAddr->SetEmailAddress( *emailAddr ); // Copy created
-        fsMsg->AppendBCCRecipient( fsAddr ); // No copy
-        CleanupStack::Pop( fsAddr ); // fsAddr belong now to fsMsg
-        CleanupStack::PopAndDestroy( emailAddr ); // emailAddr not used
-        }
-
-    CleanupStack::PopAndDestroy( 3, cEntry ); // header, store, cEntry
-    CleanupStack::Pop( fsMsg ); // fsMsg is given to client
-    return fsMsg;
-    }
 
 // ---------------------------------------------------------------------------
 // CIpsPlgSmtpService::ChangeServiceIdL
--- a/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -33,13 +33,7 @@
 
 const TInt KOpGranularity = 2;
 
-_LIT( KMimeTextCalRequest,  "text/calendar; method=REQUEST;" );
-_LIT( KMimeTextCalResponse, "text/calendar; method=RESPONSE;" );
-_LIT( KMimeTextCalCancel,   "text/calendar; method=CANCEL;" );
-_LIT8( KMethod, "method" );
-_LIT8( KRequest, "REQUEST" );
-_LIT8( KResponse, "RESPONSE" );
-_LIT8( KCancel, "CANCEL" );
+// <qmail> remove unused literals
 
 #ifdef __WINS__
 _LIT( KEmulatorIMEI, "123456789012345" );
@@ -497,16 +491,13 @@
         }
     if( sel->Count() )
         {
-        CIpsPlgOperationWait* wait = CIpsPlgOperationWait::NewLC();
+        // <qmail> remove activeschedulerwait
+        TMsvLocalOperationProgress progress;
         if( !aSourceFolderId.IsNullId() )
             {
             CMsvEntry* cEntry = iSession->GetEntryL( aSourceFolderId.Id() );
             CleanupStack::PushL( cEntry );
-            cEntry->MoveL(
-                *sel,
-                           aDestinationFolderId.Id(),//KMsvDraftEntryIdValue
-                           wait->iStatus );
-
+            cEntry->MoveL( *sel, aDestinationFolderId.Id(), progress );
             CleanupStack::PopAndDestroy( cEntry );
             }
         else
@@ -515,13 +506,10 @@
             // because it's equal to destination.
             TMsvId parent = msgEntry->Entry().Parent();
             msgEntry->SetEntryL( parent );
-            msgEntry->CopyL(
-                *sel,
-                             aDestinationFolderId.Id(),//KMsvDraftEntryIdValue
-                             wait->iStatus );
+            msgEntry->CopyL( *sel, aDestinationFolderId.Id(), progress );
             }
-        wait->Start();
-        CleanupStack::PopAndDestroy( wait ); // wait
+        User::LeaveIfError( progress.iError );
+        // </qmail>
         }
     CleanupStack::PopAndDestroy( 2, sel ); // msgEntry, sel
     }
@@ -810,11 +798,11 @@
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
  CFSMailMessage* CIpsPlgSosBasePlugin::CreateMessageToSendL(
-    const TFSMailMsgId& aMailBoxId )
+    const TFSMailMsgId& /*aMailBoxId*/ )
 	{
-    FUNC_LOG;
-    CFSMailMessage* msg = iSmtpService->CreateNewSmtpMessageL( aMailBoxId );
-	return msg;
+    // <qmail> not used any more
+    User::Leave(KErrFSMailPluginNotSupported);
+    return NULL; // prevents compiler warning
 	}
 
 // <qmail>
@@ -851,26 +839,13 @@
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 CFSMailMessage* CIpsPlgSosBasePlugin::CreateForwardMessageL(
-    const TFSMailMsgId& aMailBoxId,
-    const TFSMailMsgId& aOriginalMessageId,
-    const TDesC& aHeaderDescriptor )
+    const TFSMailMsgId& /*aMailBoxId*/,
+    const TFSMailMsgId& /*aOriginalMessageId*/,
+    const TDesC& /*aHeaderDescriptor*/ )
     {
-    FUNC_LOG;
-    CFSMailMessage* msg = iSmtpService->CreateForwardSmtpMessageL(
-        aMailBoxId, aOriginalMessageId );
-    
-    if ( aHeaderDescriptor != KNullDesC )
-        {
-        // Ignoring trap as it is better to provide something in case of the
-        // below fix method fails than nothing.
-        TRAP_IGNORE( FixReplyForwardHeaderL( 
-                        msg, 
-                        aMailBoxId, 
-                        aOriginalMessageId, 
-                        aHeaderDescriptor ) );
-        }
-  
-    return msg;
+    // <qmail> not used any more
+    User::Leave(KErrFSMailPluginNotSupported);
+    return NULL; // prevents compiler warning
     }
 
 // <qmail>
@@ -929,27 +904,14 @@
 // ----------------------------------------------------------------------------
 // ---------------------------------------------------------------------------- 	
 CFSMailMessage* CIpsPlgSosBasePlugin::CreateReplyMessageL( 
-    const TFSMailMsgId& aMailBoxId,
-    const TFSMailMsgId& aOriginalMessageId,
-    const TBool aReplyToAll,
-    const TDesC& aHeaderDescriptor )
+    const TFSMailMsgId& /*aMailBoxId*/,
+    const TFSMailMsgId& /*aOriginalMessageId*/,
+    const TBool /*aReplyToAll*/,
+    const TDesC& /*aHeaderDescriptor*/ )
     {
-    FUNC_LOG;
-    CFSMailMessage* msg = iSmtpService->CreateReplySmtpMessageL(
-        aMailBoxId, aOriginalMessageId, aReplyToAll );
-
-    if ( aHeaderDescriptor != KNullDesC )
-        {
-        // Ignoring trap as it is better to provide something in case of the
-        // below fix method fails than nothing.
-        TRAP_IGNORE( FixReplyForwardHeaderL( 
-                                msg, 
-                                aMailBoxId, 
-                                aOriginalMessageId, 
-                                aHeaderDescriptor ) );
-        }
-
-    return msg;
+    // <qmail> not used any more
+    User::Leave(KErrFSMailPluginNotSupported);
+    return NULL; // prevents compiler warning
     }
 
 // <qmail>
@@ -1151,147 +1113,20 @@
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 CFSMailMessagePart* CIpsPlgSosBasePlugin::NewChildPartFromFileL(
-    const TFSMailMsgId& aMailBoxId,
-    const TFSMailMsgId& /* aParentFolderId */,
-    const TFSMailMsgId& aMessageId,
-    const TFSMailMsgId& /* aParentPartId */,
-    const TDesC& aContentType,
-    const TDesC& aFilePath )
+    const TFSMailMsgId& /*aMailBoxId*/,
+    const TFSMailMsgId& /*aParentFolderId*/,
+    const TFSMailMsgId& /*aMessageId*/,
+    const TFSMailMsgId& /*aParentPartId*/,
+    const TDesC& /*aContentType*/,
+    const TDesC& /*aFilePath*/ )
     {
-    FUNC_LOG;
-    CFSMailMessagePart* result ( NULL );
-    CMsvEntry* cEntry( NULL );
-    CImEmailMessage* message( NULL );
-    RFile file;
-    TInt fileSize( 0 );
-    TBool parentToMultipartAlternative( EFalse );
-
-    // Read attachment size
-    User::LeaveIfError( file.Open( iSession->FileSession(), aFilePath, EFileShareReadersOnly ) );
-
-    //in rare case that file has disappeared while sending
-    //we just won't get the size for it
-    file.Size( fileSize );
-    file.Close();
-
-  // Take ownership of message entry objects since thanks to
-    // "clever" use of active scheduler waits we can re-enter 
-    // this function leading to crashes if somebody clears the cache
-    // while this iteration still needs them
-    TakeMessageEntryLC( aMessageId.Id(), cEntry, message );
-	
-    // Operation waiter needed to implement synchronous operation
-    // on the top of async API
-    CIpsPlgOperationWait* waiter = CIpsPlgOperationWait::NewL();
-    CleanupStack::PushL( waiter );
-
-    // Initialize CMsvAttachment instance for the attachment creation
-    CMsvAttachment* info = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
-    CleanupStack::PushL( info );
-    info->SetAttachmentNameL( aFilePath );
-    info->SetSize( fileSize );
-
-    // Start attachment creation
-    message->AttachmentManager().AddAttachmentL(
-        aFilePath, info, waiter->iStatus );
-    CleanupStack::Pop( info ); // attachment manager takes ownership
-
-    waiter->Start();
-    CleanupStack::PopAndDestroy( waiter );
-    	
-    // Return message entry objects back to cache
-    CleanupStack::Pop( 2 ); // cEntry, message
-    ReturnMessageEntry( cEntry, message );
-
-    // Dig out the entry ID of the new attachment (unbelievable that
-    // there seems to be no better way to do this)
-    message->GetAttachmentsListL( cEntry->Entry().Id( ),
-        CImEmailMessage::EAllAttachments, CImEmailMessage::EThisMessageOnly );
-    TKeyArrayFix key( 0, ECmpTInt32 );
-    CMsvEntrySelection* attachmentIds = message->Selection().CopyLC();
-    attachmentIds->Sort( key );
-    if ( !attachmentIds->Count() )
-        {
-        User::Leave( KErrGeneral );
-        }
-    TMsvId newAttachmentId = (*attachmentIds)[ attachmentIds->Count()-1 ];
-    CleanupStack::PopAndDestroy( attachmentIds );
-
-    CMsvEntry* cAtta = iSession->GetEntryL( newAttachmentId );
-    CleanupStack::PushL( cAtta );
-
-    // Set filename to iDetails
-    TMsvEntry tEntry = cAtta->Entry();
-    tEntry.iDetails.Set( aFilePath );
-    cAtta->ChangeL( tEntry );
-
-    if( cAtta->HasStoreL() )
-        {
-        CMsvStore* store = cAtta->EditStoreL();
-        CleanupStack::PushL( store );
-        CImMimeHeader* mimeHeader = CImMimeHeader::NewLC();
-
-        if( store->IsPresentL( KUidMsgFileMimeHeader ) )
-            {
-            mimeHeader->RestoreL( *store );
-            CDesC8Array& array = mimeHeader->ContentTypeParams();
-            array.AppendL( KMethod );
-            parentToMultipartAlternative = ETrue;
-
-            if( aContentType.Find( KMimeTextCalRequest ) != KErrNotFound )
-                {
-                array.AppendL( KRequest );
-                }
-            else if( aContentType.Find( KMimeTextCalResponse ) != KErrNotFound )
-                {
-                array.AppendL( KResponse );
-                }
-            else if( aContentType.Find( KMimeTextCalCancel ) != KErrNotFound )
-                {
-                array.AppendL( KCancel );
-                }
-            else
-                {
-                parentToMultipartAlternative = EFalse;
-                }
-            mimeHeader->StoreWithoutCommitL( *store );
-            store->CommitL();
-            }
-
-        CleanupStack::PopAndDestroy( 2, store );
-        }
-
-    if( parentToMultipartAlternative &&
-        aFilePath.Find( _L(".ics")) != KErrNotFound )
-        {
-        TMsvEntry tAttaEntry = cAtta->Entry();
-        TMsvId id = tAttaEntry.Parent();
-        CMsvEntry* cParent = iSession->GetEntryL( id );
-        CleanupStack::PushL( cParent );
-
-        TMsvEmailEntry tEntry = cParent->Entry();
-        tEntry.SetMessageFolderType( EFolderTypeAlternative );
-        cParent->ChangeL( tEntry );
-
-        CleanupStack::PopAndDestroy( cParent );
-        }
-    CleanupStack::PopAndDestroy( cAtta );
-
-    // Delete the message entries to get all the changes to disk and
-    // possible store locks released
-    CleanCachedMessageEntries();
-
-    // Create the FS message part object
-    result = iMsgMapper->GetMessagePartL( newAttachmentId, aMailBoxId,
-        aMessageId );
-
-    return result;
+    // <qmail> not used any more
+    User::Leave(KErrFSMailPluginNotSupported);
+    return NULL; // prevents compiler warning
     }
 
 // <qmail>
 // ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------
-// ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------  
 void CIpsPlgSosBasePlugin::NewChildPartFromFileL(
     const TFSMailMsgId& aMailBoxId,
@@ -1321,141 +1156,21 @@
     iOperations.AppendL( watcher ); 
     CleanupStack::Pop( watcher );
     }
-
 // </qmail> 
 
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------  
 CFSMailMessagePart* CIpsPlgSosBasePlugin::NewChildPartFromFileL(
-    const TFSMailMsgId& aMailBoxId,
-    const TFSMailMsgId& /* aParentFolderId */,
-    const TFSMailMsgId& aMessageId,
-    const TFSMailMsgId& /* aParentPartId */,
-    const TDesC& aContentType,
-    RFile& aFile )
+    const TFSMailMsgId& /*aMailBoxId*/,
+    const TFSMailMsgId& /*aParentFolderId*/,
+    const TFSMailMsgId& /*aMessageId*/,
+    const TFSMailMsgId& /*aParentPartId*/,
+    const TDesC& /*aContentType*/,
+    RFile& /*aFile*/ )
     {
-    FUNC_LOG;
-
-    // Initialize helper variables
-    CFSMailMessagePart* result ( NULL );
-    CMsvEntry* cEntry( NULL );
-    CImEmailMessage* message( NULL );
-    TInt fileSize( 0 );
-    TBuf<KMaxFileName> fileName;
-
- // Take ownership of message entry objects since thanks to
-    // "clever" use of active scheduler waits we can re-enter 
-    // this function leading to crashes if somebody clears the cache
-    // while this iteration still needs them
-    TakeMessageEntryLC( aMessageId.Id(), cEntry, message );
-
-    // Operation waiter needed to implement synchronous operation
-    // on the top of async API
-    CIpsPlgOperationWait* waiter = CIpsPlgOperationWait::NewL();
-    CleanupStack::PushL( waiter );
-
-    // Initialize CMsvAttachment instance for the attachment creation
-    CMsvAttachment* info = CMsvAttachment::NewL( CMsvAttachment::EMsvFile );
-    CleanupStack::PushL( info );
-
-    // Read attachment size
-    User::LeaveIfError( aFile.Size( fileSize ) );
-    info->SetSize( fileSize );
-
-    // Read attachment filename
-    User::LeaveIfError( aFile.FullName( fileName ) );
-    info->SetAttachmentNameL( fileName );
-
-    message->AttachmentManager().AddAttachmentL( aFile, info, waiter->iStatus );
-    CleanupStack::Pop( info ); // attachment manager takes ownership
-    
-    waiter->Start();
-    CleanupStack::PopAndDestroy( waiter );
-
- 	// Return message entry objects back to cache
- 	CleanupStack::Pop( 2 ); // cEntry, message
- 	ReturnMessageEntry( cEntry, message );
-
-    // Dig out the entry ID of the new attachment
-    message->GetAttachmentsListL( cEntry->Entry().Id( ),
-        CImEmailMessage::EAllAttachments, CImEmailMessage::EThisMessageOnly );
-    TKeyArrayFix key( 0, ECmpTInt32 );
-    CMsvEntrySelection* attachmentIds = message->Selection().CopyLC();
-    attachmentIds->Sort( key );
-    if ( !attachmentIds->Count() )
-        {
-        User::Leave( KErrGeneral );
-        }
-    TMsvId newAttachmentId = (*attachmentIds)[ attachmentIds->Count()-1 ];
-    CleanupStack::PopAndDestroy( attachmentIds );
-
-    // Meeting request related handling
-    TBool parentToMultipartAlternative( EFalse );
-    CMsvEntry* cAtta = iSession->GetEntryL( newAttachmentId );
-    CleanupStack::PushL( cAtta );
-
-    // Set filename to iDetails
-    TMsvEntry tEntry = cAtta->Entry();
-    tEntry.iDetails.Set( fileName );
-    cAtta->ChangeL( tEntry );
-
-    if( cAtta->HasStoreL() )
-        {
-        CMsvStore* store = cAtta->EditStoreL();
-        CleanupStack::PushL( store );
-        CImMimeHeader* mimeHeader = CImMimeHeader::NewLC();
-
-        if( store->IsPresentL( KUidMsgFileMimeHeader ) )
-            {
-            mimeHeader->RestoreL( *store );
-            CDesC8Array& array = mimeHeader->ContentTypeParams();
-            array.AppendL( KMethod );
-            parentToMultipartAlternative = ETrue;
-
-            if( aContentType.Find( KMimeTextCalRequest ) != KErrNotFound )
-                {
-                array.AppendL( KRequest );
-                }
-            else if( aContentType.Find( KMimeTextCalResponse ) != KErrNotFound )
-                {
-                array.AppendL( KResponse );
-                }
-            else if( aContentType.Find( KMimeTextCalCancel ) != KErrNotFound )
-                {
-                array.AppendL( KCancel );
-                }
-            else
-                {
-                parentToMultipartAlternative = EFalse;
-                }
-            mimeHeader->StoreWithoutCommitL( *store );
-            store->CommitL();
-            }
-        CleanupStack::PopAndDestroy( 2, store );
-        }
-    if( parentToMultipartAlternative && fileName.Find( _L(".ics")) != KErrNotFound )
-        {
-        TMsvEntry tAttaEntry = cAtta->Entry();
-        TMsvId id = tAttaEntry.Parent();
-        CMsvEntry* cParent = iSession->GetEntryL( id );
-        CleanupStack::PushL( cParent );
-
-        TMsvEmailEntry tEntry = cParent->Entry();
-        tEntry.SetMessageFolderType( EFolderTypeAlternative );
-        cParent->ChangeL( tEntry );
-
-        CleanupStack::PopAndDestroy( cParent );
-        }
-    CleanupStack::PopAndDestroy( cAtta );
-
-    // Delete the message entries to get all the changes to disk and
-    // possible store locks released
-    CleanCachedMessageEntries();
-
-    // Create the FS message part object and return it
-    result = iMsgMapper->GetMessagePartL( newAttachmentId, aMailBoxId,
-        aMessageId );
-    return result;
+    // <qmail> not used any more
+    User::Leave(KErrFSMailPluginNotSupported);
+    return NULL; // prevents compiler warning
     }
 
 // ----------------------------------------------------------------------------
@@ -1477,55 +1192,14 @@
 // ----------------------------------------------------------------------------
 //
 void CIpsPlgSosBasePlugin::RemoveChildPartL(
-    const TFSMailMsgId& /* aMailBoxId */,
-    const TFSMailMsgId& /* aParentFolderId */,
-    const TFSMailMsgId& aMessageId,
-    const TFSMailMsgId& /* aParentPartId */,
-    const TFSMailMsgId& aPartId)
+    const TFSMailMsgId& /*aMailBoxId*/,
+    const TFSMailMsgId& /*aParentFolderId*/,
+    const TFSMailMsgId& /*aMessageId*/,
+    const TFSMailMsgId& /*aParentPartId*/,
+    const TFSMailMsgId& /*aPartId*/)
 	{
-    FUNC_LOG;
-    TInt status( KErrNone );
-    CMsvEntry* cEntry( NULL );
-    TMsvEntry tEntry;
-    TMsvId serviceId;
-    status = iSession->GetEntry( aPartId.Id(), serviceId, tEntry );
-
-    if ( ( status == KErrNone ) &&
-         ( tEntry.iType == KUidMsvAttachmentEntry ) )
-        {
-        CImEmailMessage* message( NULL );
-  
-        // We trust that the message ID really refers to a message
-        
-        // Take ownership of message entry objects since thanks to
-        // "clever" use of active scheduler waits we can re-enter 
-        // this function leading to crashes if somebody clears the cache
-        // while this iteration still needs them
-        TakeMessageEntryLC( aMessageId.Id(), cEntry, message );
-
-        MMsvAttachmentManager& attachmentMgr( message->AttachmentManager() );
-
-        CIpsPlgOperationWait* waiter = CIpsPlgOperationWait::NewL();
-        CleanupStack::PushL( waiter );
-
-        attachmentMgr.RemoveAttachmentL(
-            (TMsvAttachmentId) aPartId.Id(), waiter->iStatus );
-
-        waiter->Start();
-        CleanupStack::PopAndDestroy( waiter );
-        	
-        // Return message entry objects to cache
-        CleanupStack::Pop( 2 ); // cEntry, message
-        ReturnMessageEntry( cEntry, message );
-        }
-    else if ( ( status == KErrNone ) &&
-              ( tEntry.iType == KUidMsvFolderEntry ) )
-        {
-        cEntry = iSession->GetEntryL( tEntry.Parent() );
-        CleanupStack::PushL( cEntry );
-        cEntry->DeleteL( tEntry.Id() );
-        CleanupStack::PopAndDestroy( cEntry );
-        }
+    // <qmail> not used any more
+    User::Leave(KErrFSMailPluginNotSupported);
 	}
 
 // <qmail>
@@ -1773,58 +1447,14 @@
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::RemovePartContentL(
-    const TFSMailMsgId& /* aMailBoxId */,
-    const TFSMailMsgId& /* aParentFolderId */,
-    const TFSMailMsgId& /* aMessageId */,
-    const RArray<TFSMailMsgId>& aPartIds )
+    const TFSMailMsgId& /*aMailBoxId*/,
+    const TFSMailMsgId& /*aParentFolderId*/,
+    const TFSMailMsgId& /*aMessageId*/,
+    const RArray<TFSMailMsgId>& /*aPartIds*/ )
     {
-    TInt count( aPartIds.Count() );
-
-    for( TInt i(0); i < count; i++ )
-        {
-        CMsvEntry* cEntry = iSession->GetEntryL( aPartIds[i].Id() );
-        CleanupStack::PushL( cEntry );
-        CMsvStore* store = NULL;
-        TBool hasStore = cEntry->HasStoreL();
-        if ( hasStore )
-            {
-            store = cEntry->EditStoreL();
-            }
-
-        if ( !store || !hasStore )
-            {
-            User::Leave( KErrNotFound );
-            }
-        CleanupStack::PushL( store );
-        MMsvAttachmentManager& attachmentMgr = store->AttachmentManagerL();
-
-        // It is assumed that the attachment file is always in the index 0
-        if ( attachmentMgr.AttachmentCount() )
-            {
-            // delete attachment file
-            CIpsPlgOperationWait* waiter = CIpsPlgOperationWait::NewLC();
-            attachmentMgr.RemoveAttachmentL( 0, waiter->iStatus );
-            waiter->Start();
-            CleanupStack::PopAndDestroy( waiter );
-            store->CommitL();
-
-            // clear complete flag
-            TMsvEntry tEntry( cEntry->Entry() );
-            tEntry.SetComplete( EFalse );
-
-            waiter = CIpsPlgOperationWait::NewLC();
-            CMsvOperation* ops = cEntry->ChangeL( tEntry, waiter->iStatus );
-            CleanupStack::PushL( ops );
-            waiter->Start();
-            CleanupStack::PopAndDestroy( 2, waiter );
-            }
-        else
-            {
-            User::Leave( KErrNotFound );
-            }
-        CleanupStack::PopAndDestroy( store );
-        CleanupStack::PopAndDestroy( cEntry );
-        }
+    // <qmail>
+    User::Leave( KErrFSMailPluginNotSupported );
+    // </qmail>
     }
 
 // ----------------------------------------------------------------------------
@@ -2072,6 +1702,45 @@
     //</qmail>
     }
 
+// <qmail>
+// ----------------------------------------------------------------------------
+// ----------------------------------------------------------------------------
+void CIpsPlgSosBasePlugin::DeleteMessagesByUidL(
+    const TFSMailMsgId& /*aMailBoxId*/,
+    const TFSMailMsgId& /*aFolderId*/,
+	const RArray<TFSMailMsgId>& aMessages,
+    MFSMailRequestObserver& aOperationObserver,
+    const TInt aRequestId)
+    {
+    FUNC_LOG;
+    CMsvEntrySelection* sel=new(ELeave) CMsvEntrySelection;
+    CleanupStack::PushL(sel);
+
+    TInt count = aMessages.Count();
+    TMsvEntry tEntry;
+    TMsvId service;
+    
+    for(TInt i=0; i<count; i++)
+        {
+        iSession->GetEntry( aMessages[i].Id(), service, tEntry );
+        //make sure that only messages get deleted.
+        if( tEntry.iType == KUidMsvMessageEntry )
+            {            
+            sel->AppendL( tEntry.Id() );
+            }
+        }
+        
+    CIpsPlgSingleOpWatcher* watcher = CIpsPlgSingleOpWatcher::NewL( *this );
+    CleanupStack::PushL( watcher );
+    CMsvOperation* op = CIpsPlgDeleteOperation::NewL( *iSession,
+        watcher->iStatus, sel, aOperationObserver, aRequestId );
+    watcher->SetOperation( op );
+    iOperations.AppendL( watcher );
+    CleanupStack::Pop( watcher );
+    CleanupStack::Pop( sel );
+    }
+// </qmail>
+
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::SubscribeMailboxEventsL(
@@ -2779,7 +2448,8 @@
     TBool ret( EFalse );
     for ( TInt i = 0; i < iOperations.Count(); i++ )
         {
-        if( iOperations[i]->BaseOperation()->FSMailboxId() == aMailboxId )
+        if( iOperations[i]->BaseOperation() && 
+            iOperations[i]->BaseOperation()->FSMailboxId() == aMailboxId )
             {
             ret = ETrue;
             }
--- a/ipsservices/nmimapclientplugin/src/nmimapclientplugin.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmimapclientplugin/src/nmimapclientplugin.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -176,7 +176,7 @@
                 SIGNAL(goOffline(const NmId &)),
                 this, SLOT(goOffline(const NmId &)));
         }
-
+        handleRequest(NmActionResponseCommandSettings, mMenuRequest);
         mSettingsViewLauncher->launchSettingsView(id, mailbox->name());
     }
 
--- a/ipsservices/nmipssettings/inc/nmipsimap4settingsmanager.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/inc/nmipsimap4settingsmanager.h	Wed Jun 23 17:00:39 2010 +0100
@@ -32,24 +32,23 @@
 
 public:
         
-    NmIpsImap4SettingsManager(const NmId &mailboxId, CEmailAccounts *account, TImapAccount imapAccount);
-
+    NmIpsImap4SettingsManager(const NmId &mailboxId,
+                              CEmailAccounts *account,
+                              TImapAccount imapAccount);
     virtual ~NmIpsImap4SettingsManager();
-    
     bool readSetting(IpsServices::SettingItem settingItem, QVariant &settingValue);
     bool writeSetting(IpsServices::SettingItem settingItem, const QVariant &settingValue);
-    
     int deleteMailbox();    
     int determineDefaultIncomingPort();
 
 private:    
 
     bool saveSettings();
+    bool saveIAPSettings(uint snapId);
     
 private: // data
 
     CImImap4Settings *mImap4Settings;   // Owned.
-
     TImapAccount mImap4Account;
 };
 
--- a/ipsservices/nmipssettings/inc/nmipspop3settingsmanager.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/inc/nmipspop3settingsmanager.h	Wed Jun 23 17:00:39 2010 +0100
@@ -31,24 +31,23 @@
 {
 public:
         
-    NmIpsPop3SettingsManager(const NmId &mailboxId, CEmailAccounts *account, TPopAccount popAccount);
-
+    NmIpsPop3SettingsManager(const NmId &mailboxId,
+                             CEmailAccounts *account,
+                             TPopAccount popAccount);
     virtual ~NmIpsPop3SettingsManager();
-    
-    bool readSetting(IpsServices::SettingItem settingItem, QVariant &value);
+    bool readSetting(IpsServices::SettingItem settingItem, QVariant &settingValue);
     bool writeSetting(IpsServices::SettingItem settingItem, const QVariant &settingValue);
-    
     int deleteMailbox();
     int determineDefaultIncomingPort();
 
 private:
 
     bool saveSettings();
+    bool saveIAPSettings(uint snapId);
     
-private:
+private: // data
 
     CImPop3Settings *mPop3Settings;   // Owned.
-
     TPopAccount mPop3Account;
 };
 
--- a/ipsservices/nmipssettings/inc/nmipssettingitems.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/inc/nmipssettingitems.h	Wed Jun 23 17:00:39 2010 +0100
@@ -47,7 +47,7 @@
         OutgoingMailServer,                     // String
         IncomingPort,                           // Integer
         OutgoingPort,                           // Integer
-        FolderPath,                              // String: Empty string means 'Default'
+        FolderPath,                             // String: Empty string means 'Default'
         AlwaysOnlineState,                      // Integer: 0=always,1=homeonly,2=off
         EmailNotificationState,                 // Integer: 0=automatic,1=homeonly,2=off
         FirstEmnReceived,                       // Integer: 0=false,1=true
@@ -62,7 +62,8 @@
         OutgoingPassword,                       // String
         SMTPAuthentication,                     // Boolean
         OutgoingSecureSockets,                  // Boolean
-        OutgoingSSLWrapper                      // Boolean
+        OutgoingSSLWrapper,                     // Boolean
+        Connection                              // Unsigned integer, Network Destination ID (SNAP)
     }; 
     
     /**
--- a/ipsservices/nmipssettings/inc/nmipssettingshelper.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/inc/nmipssettingshelper.h	Wed Jun 23 17:00:39 2010 +0100
@@ -22,6 +22,7 @@
 #include <QMap>
 #include <QVariant>
 #include <QDateTime>
+#include <QPersistentModelIndex>
 
 #include "nmsettingscommon.h"
 #include "nmipssettingitems.h"
@@ -37,6 +38,7 @@
 class CpSettingFormItemData;
 class NmIpsSettingsManagerBase;
 class NmId;
+class CmApplSettingsUi;
 
 
 // Constant for User Defined sync profile (EmailProfileOffsetUD)
@@ -70,6 +72,7 @@
     int getCorrectOutgoingAuthenticationRadioButtonIndex();
     void handleReceivingScheduleSettingChange(IpsServices::SettingItem settingItem,
         const QVariant &settingValue);
+    QString destinationNameFromIdentifier(uint identifier);
     
 signals:
 
@@ -112,18 +115,20 @@
     void outgoingSecureConnectionPress(const QModelIndex &index);
     void outgoingAuthenticationChange(int index);
     void outgoingAuthenticationPress(const QModelIndex &index);
+    void connectionButtonPress();
 
 private slots:
 
     void receivingWeekdaysModified();
     void startTimeModified(QTime time);
     void endTimeModified(QTime time);
-    void refreshPeriodModified(int index);
+    void refreshPeriodModified(QPersistentModelIndex, QVariant);
     void handleMailboxDelete(HbAction *action);
     void handleMailboxDeleteUpdate(HbAction *action);
     void handleUserDefinedIncomingPortInput(HbAction *action);
     void handleUserDefinedFolderPathInput(HbAction *action);
     void handleUserDefinedOutgoingPortInput(HbAction *action);
+    void handleConnectionSelected(uint status);
     
 private:
 
@@ -147,13 +152,14 @@
     HbDataFormModelItem *mServerInfoGroupItem;	// Not owned.
 	HbDataForm &mDataForm;
 	HbDataFormModel &mDataFormModel;
-	HbMessageBox *mDeleteConfirmationDialog; // Owned;
-	HbMessageBox *mDeleteInformationDialog; // Owned;
-	HbInputDialog *mIncomingPortInputDialog; // Owned;
-	HbValidator *mIncomingPortInputValidator; // Owned;
-    HbInputDialog *mFolderPathInputDialog; // Owned;
-    HbInputDialog *mOutgoingPortInputDialog; // Owned;
-    HbValidator *mOutgoingPortInputValidator; // Owned;    
+	HbMessageBox *mDeleteConfirmationDialog; // Owned.
+	HbMessageBox *mDeleteInformationDialog; // Owned.
+	HbInputDialog *mIncomingPortInputDialog; // Owned.
+	HbValidator *mIncomingPortInputValidator; // Owned.
+    HbInputDialog *mFolderPathInputDialog; // Owned.
+    HbInputDialog *mOutgoingPortInputDialog; // Owned.
+    HbValidator *mOutgoingPortInputValidator; // Owned.
+    CmApplSettingsUi *mDestinationDialog; // Owned.
     bool mServerInfoDynamicItemsVisible;
     int mRadioButtonPreviousIndex;
 };
--- a/ipsservices/nmipssettings/inc/nmipssettingslabeledcombobox.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/inc/nmipssettingslabeledcombobox.h	Wed Jun 23 17:00:39 2010 +0100
@@ -52,6 +52,7 @@
 signals:
 
     void currentIndexChanged(int index);
+    void propertyChanged(QMap<QString, QVariant> properties);
 
 private slots:
 
--- a/ipsservices/nmipssettings/inc/nmipssettingsmanagerbase.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/inc/nmipssettingsmanagerbase.h	Wed Jun 23 17:00:39 2010 +0100
@@ -24,9 +24,7 @@
 #include "nmipssettingitems.h"
 
 class QVariant;
-class CEmailAccounts;
 class CImSmtpSettings;
-class TSmtpAccount;
 class NmIpsExtendedSettingsManager;
 class NmId;
 
@@ -34,7 +32,9 @@
 {
 public:
 
-    NmIpsSettingsManagerBase(const NmId &mailboxId, CEmailAccounts *account, IpsServices::TIpsSetAccountTypes);
+    NmIpsSettingsManagerBase(const NmId &mailboxId,
+                             CEmailAccounts *account,
+                             IpsServices::TIpsSetAccountTypes);
     virtual ~NmIpsSettingsManagerBase();
     virtual bool readSetting(IpsServices::SettingItem settingItem, QVariant &settingValue);
     virtual bool writeSetting(IpsServices::SettingItem settingItem, const QVariant &settingValue);
@@ -48,8 +48,9 @@
 private:
 
     bool saveSettings();
+    bool saveIAPSettings(uint snapId);
     
-protected: // data.
+protected: // data
 
     CEmailAccounts *mAccount;   // Owned.
     CImSmtpSettings *mSmtpSettings; // Owned.
--- a/ipsservices/nmipssettings/inc/nmipssettingsplugin.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/inc/nmipssettingsplugin.h	Wed Jun 23 17:00:39 2010 +0100
@@ -20,18 +20,20 @@
 
 #include <QObject>
 #include <QVariant>
+#include <QPersistentModelIndex>
+#include <AlwaysOnlineManagerClient.h>
 
 #include "nmsettingsplugininterface.h"
 #include "nmsettingscommon.h"
 
+class QTranslator;
+class QModelIndex;
 class HbDataForm;
 class HbDataFormModel;
 class HbDataFormModelItem;
 class NmId;
 class NmIpsSettingsHelper;
 class NmIpsSettingsManagerBase;
-class QTranslator;
-class QModelIndex;
 
 class NmIpsSettingsPlugin : public QObject, public NmSettingsPluginInterface
 {
@@ -59,7 +61,7 @@
 private slots:
 
     void createUserDefinedMode();
-    void showMailInInboxModified(int index);
+    void showMailInInboxModified(QPersistentModelIndex, QVariant value);
 
 private:
 
@@ -68,19 +70,16 @@
     void initReceivingScheduleItems(HbDataFormModelItem &item);
     void initUserInfoItems(HbDataFormModelItem &item) const;
     void initServerInfoItems(HbDataFormModelItem &item) const;
+    void setAlwaysOnlineState(TAlwaysOnlineServerAPICommands command, NmId mailboxId) const;
 
     Q_DISABLE_COPY(NmIpsSettingsPlugin)
 
-private:
+private: // data.
 
-    // Owned.
-    NmIpsSettingsHelper *mSettingsHelper;
-    // Owned.
-    NmIpsSettingsManagerBase *mSettingsManager;
-    // Not owned.
-    HbDataFormModel *mModel;
-    // Not owned.
-    HbDataForm *mForm;
+    NmIpsSettingsHelper *mSettingsHelper;  // Owned.
+    NmIpsSettingsManagerBase *mSettingsManager; // Owned.
+    HbDataFormModel *mModel; // Not owned.
+    HbDataForm *mForm; // Not owned.
 };
 
 #endif // NMIPSSETTINGS_H
--- a/ipsservices/nmipssettings/inc/nmipssettingstimeeditor.h	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/inc/nmipssettingstimeeditor.h	Wed Jun 23 17:00:39 2010 +0100
@@ -63,10 +63,14 @@
     // Now owned.
     HbPushButton *mButton;
 
+    // Owned.
     HbDialog *mTimePickerDialog;
 
     QTime mTime;
     QString mLabel;
+    
+    // Not owned.
+    HbAction *mPrimaryAction;
 };
 
 #endif // NMIPSSETTINGSTIMEEDITOR_H
--- a/ipsservices/nmipssettings/nmipssettings.pro	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/nmipssettings.pro	Wed Jun 23 17:00:39 2010 +0100
@@ -74,6 +74,9 @@
     LIBS += -lxqsettingsmanager
     LIBS += -leuser
     LIBS += -llibc
+    LIBS += -lcmapplsettingsui
+    LIBS += -lqtbearer
+    LIBS += -lAlwaysOnlineManagerClient
 }
 
 symbian: plugin { # copy qtstub and manifest
--- a/ipsservices/nmipssettings/src/nmipsimap4settingsmanager.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/src/nmipsimap4settingsmanager.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -17,6 +17,7 @@
 
 #include <QVariant>
 #include <imapset.h>
+#include <iapprefs.h>
 #include <cemailaccounts.h>
 #include <xqconversions.h>
 
@@ -32,7 +33,7 @@
 // ======== MEMBER FUNCTIONS ========
 
 /*!
-    Constructor
+    Constructor.
     Creates the CImImap4Settings instance for loading and saving the IMAP4 settings.
     Finds and loads the SMTP account and settings linked to the IMAP4 account.
     \param mailboxId Mailbox identifier.
@@ -53,7 +54,7 @@
 }
 
 /*!
-    Destructor
+    Destructor.
 */
 NmIpsImap4SettingsManager::~NmIpsImap4SettingsManager()
 {
@@ -66,7 +67,8 @@
     \param QVariant SettingValue of the found setting value.
     \return <true> when the setting item was found otherwise <false>.
 */
-bool NmIpsImap4SettingsManager::readSetting(IpsServices::SettingItem settingItem, QVariant &settingValue)
+bool NmIpsImap4SettingsManager::readSetting(IpsServices::SettingItem settingItem,
+                                            QVariant &settingValue)
 {
     bool found(false);
     switch (settingItem) {
@@ -101,7 +103,7 @@
         case IpsServices::IncomingSSLWrapper:
         	settingValue = mImap4Settings->SSLWrapper();
             found = true;
-            break;  
+            break;
         default:
             found = NmIpsSettingsManagerBase::readSetting(settingItem, settingValue);
             break;
@@ -115,7 +117,8 @@
     \param settingValue QVariant of the new setting value.
     \return bool <true> when the setting item was succesfully written, otherwise <false>.
 */
-bool NmIpsImap4SettingsManager::writeSetting(IpsServices::SettingItem settingItem, const QVariant &settingValue)
+bool NmIpsImap4SettingsManager::writeSetting(IpsServices::SettingItem settingItem,
+                                             const QVariant &settingValue)
 {
     HBufC *tmp = 0;
     HBufC8 *tmp8 = 0;
@@ -174,6 +177,9 @@
             mImap4Settings->SetSSLWrapper(settingValue.toBool());
             ret = saveSettings();
             break;  
+        case IpsServices::Connection:
+            ret = saveIAPSettings(settingValue.toUInt());
+            // Fallthrough so SMTP IAP settings are also updated accordingly.
         default:
             ret = NmIpsSettingsManagerBase::writeSetting(settingItem, settingValue);
             break;
@@ -183,7 +189,6 @@
 
 /*!
     Deletes the IMAP4 mailbox.
-
     \return Error code <code>0</code> if mailbox deletion was successful, otherwise error
             code is returned.
 */
@@ -198,6 +203,20 @@
     return error;
 }
 
+
+/*!
+     Determines the default port for the incoming mail server based on the security settings.
+     \return The port number to use.
+ */
+int NmIpsImap4SettingsManager::determineDefaultIncomingPort()
+{
+    int port(IpsServices::standardImap4Port);
+    if (mImap4Settings->SSLWrapper()) {
+        port = IpsServices::imap4OverSslPort;
+    }        
+    return port;
+}
+
 /*!
     Stores the IMAP4 specific settings.
     \return bool <true> when the IMAP4 settings were succesfully written, otherwise <false>.
@@ -210,18 +229,17 @@
 }
 
 /*!
-     Determine the default port for the incoming mail server based on the security settings
-     
-     \return int the port number to use
- */
-int NmIpsImap4SettingsManager::determineDefaultIncomingPort()
+    Stores the IMAP4 specific IAP settings.
+    \return bool <true> when the IMAP4 IAP settings were succesfully written, otherwise <false>.
+*/
+bool NmIpsImap4SettingsManager::saveIAPSettings(uint snapId)
 {
-    int port = 0;    
-    bool sslTls = mImap4Settings->SSLWrapper();    
-    if (sslTls) {
-        port = IpsServices::imap4OverSslPort;
-    } else {
-        port = IpsServices::standardImap4Port;
-    }        
-    return port;
+    TRAPD(err,
+        CImIAPPreferences *prefs = CImIAPPreferences::NewLC();
+        mAccount->LoadImapIapSettingsL(mImap4Account, *prefs);
+        prefs->SetSNAPL(snapId);
+        mAccount->SaveImapIapSettingsL(mImap4Account, *prefs);
+        CleanupStack::PopAndDestroy(prefs);
+    );
+    return (err==KErrNone);
 }
--- a/ipsservices/nmipssettings/src/nmipspop3settingsmanager.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/src/nmipspop3settingsmanager.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -17,6 +17,7 @@
 
 #include <QVariant>
 #include <pop3set.h>
+#include <iapprefs.h>
 #include <cemailaccounts.h>
 #include <xqconversions.h>
 
@@ -32,7 +33,7 @@
 // ======== MEMBER FUNCTIONS ========
 
 /*!
-    Constructor
+    Constructor.
     Creates the CImPop4Settings instance for loading and saving the POP3 settings.
     Finds and loads the SMTP account and settings linked to the POP3 account.
     \param mailboxId Mailbox identifier.
@@ -52,7 +53,7 @@
 }
 
 /*!
-    Destructor
+    Destructor.
 */
 NmIpsPop3SettingsManager::~NmIpsPop3SettingsManager()
 {
@@ -65,40 +66,41 @@
     \param QVariant SettingValue of the found setting value.
     \return <true> when the setting item was found otherwise <false>.
 */
-bool NmIpsPop3SettingsManager::readSetting(IpsServices::SettingItem settingItem, QVariant &value)
+bool NmIpsPop3SettingsManager::readSetting(IpsServices::SettingItem settingItem,
+                                           QVariant &settingValue)
 {
 	bool found(false);
 	switch (settingItem) {
         case IpsServices::IncomingLoginName:
-            value = XQConversions::s60Desc8ToQString(mPop3Settings->LoginName());
+            settingValue = XQConversions::s60Desc8ToQString(mPop3Settings->LoginName());
             found = true;
             break;
         case IpsServices::IncomingPassword:
-            value = XQConversions::s60Desc8ToQString(mPop3Settings->Password());
+            settingValue = XQConversions::s60Desc8ToQString(mPop3Settings->Password());
             found = true;
             break;
         case IpsServices::MailboxName:
-            value = XQConversions::s60DescToQString(mPop3Account.iPopAccountName);
+            settingValue = XQConversions::s60DescToQString(mPop3Account.iPopAccountName);
             found = true;
             break;
         case IpsServices::IncomingMailServer:
-            value = XQConversions::s60DescToQString(mPop3Settings->ServerAddress());
+            settingValue = XQConversions::s60DescToQString(mPop3Settings->ServerAddress());
             found = true;
             break;   
         case IpsServices::IncomingPort:
-            value = mPop3Settings->Port();
+            settingValue = mPop3Settings->Port();
             found = true;
             break;  
         case IpsServices::IncomingSecureSockets:
-            value = mPop3Settings->SecureSockets();
+            settingValue = mPop3Settings->SecureSockets();
             found = true;
             break;  
         case IpsServices::IncomingSSLWrapper:
-            value = mPop3Settings->SSLWrapper();
+            settingValue = mPop3Settings->SSLWrapper();
             found = true;
-            break;  
+            break;
         default:
-            found = NmIpsSettingsManagerBase::readSetting(settingItem, value);
+            found = NmIpsSettingsManagerBase::readSetting(settingItem, settingValue);
             break;
     }
 	return found;
@@ -109,7 +111,8 @@
     \param settingItem SettingItem enum of the setting to replace.
     \param settingValue QVariant of the new setting value.
 */
-bool NmIpsPop3SettingsManager::writeSetting(IpsServices::SettingItem settingItem, const QVariant &settingValue)
+bool NmIpsPop3SettingsManager::writeSetting(IpsServices::SettingItem settingItem,
+                                            const QVariant &settingValue)
 {
     HBufC *tmp = 0;
     HBufC8 *tmp8 = 0;
@@ -159,7 +162,10 @@
         case IpsServices::IncomingSSLWrapper:
             mPop3Settings->SetSSLWrapper(settingValue.toBool());
             ret = saveSettings();
-            break;  
+            break;
+        case IpsServices::Connection:
+            ret = saveIAPSettings(settingValue.toUInt());
+            // Fallthrough so SMTP IAP settings are also updated accordingly.
         default:
             ret = NmIpsSettingsManagerBase::writeSetting(settingItem, settingValue);
             break;
@@ -169,7 +175,6 @@
 
 /*!
     Deletes the POP3 mailbox.
-
     \return Error code <code>0</code> if mailbox deletion was successful, otherwise error
             code is returned.
 */
@@ -185,6 +190,19 @@
 }
 
 /*!
+     Determines the default port for the incoming mail server based on the security settings.
+     \return The port number to use.
+ */
+int NmIpsPop3SettingsManager::determineDefaultIncomingPort()
+{
+    int port(IpsServices::standardPop3Port);
+    if (mPop3Settings->SSLWrapper()) {
+        port = IpsServices::securePop3Port;
+    }        
+    return port;
+}
+
+/*!
     Stores the POP3 specific settings.
     \return bool <true> when the POP3 settings were succesfully written, otherwise <false>.
 */
@@ -196,18 +214,17 @@
 }
 
 /*!
-     Determine the default port for the incoming mail server based on the security settings
-     
-     \return int the port number to use
- */
-int NmIpsPop3SettingsManager::determineDefaultIncomingPort()
+    Stores the POP3 specific IAP settings.
+    \return bool <true> when the POP3 IAP settings were succesfully written, otherwise <false>.
+*/
+bool NmIpsPop3SettingsManager::saveIAPSettings(uint snapId)
 {
-    int port = 0;    
-    bool sslTls = mPop3Settings->SSLWrapper();    
-    if (sslTls) {
-        port = IpsServices::securePop3Port;
-    } else {
-        port = IpsServices::standardPop3Port;
-    }        
-    return port;
+    TRAPD(err,
+        CImIAPPreferences *prefs = CImIAPPreferences::NewLC();
+        mAccount->LoadPopIapSettingsL(mPop3Account, *prefs);
+        prefs->SetSNAPL(snapId);
+        mAccount->SavePopIapSettingsL(mPop3Account, *prefs);
+        CleanupStack::PopAndDestroy(prefs);
+    );
+    return (err==KErrNone);
 }
--- a/ipsservices/nmipssettings/src/nmipssettingscustomitem.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/src/nmipssettingscustomitem.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -78,6 +78,8 @@
     switch (type) {
         case LabeledComboBox: {
             widget = new NmIpsSettingsLabeledComboBox();
+            connect(widget, SIGNAL(propertyChanged(QMap<QString, QVariant>)),
+                    this, SLOT(propertyChanged(QMap<QString, QVariant>)));
             break;
             }
         case TimeEditor: {
--- a/ipsservices/nmipssettings/src/nmipssettingshelper.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/src/nmipssettingshelper.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -16,21 +16,29 @@
 */
 
 #include <QVariant>
+#include <QIntValidator>
+#include <QStringList>
+
 #include <HbAction>
 #include <HbGlobal>
 #include <HbMessageBox>
 #include <HbProgressDialog>
 #include <HbInputDialog>
-#include <cpsettingformitemdata.h>
-#include <hbdataformmodel.h>
-#include <qstringlist.h>
-#include <hbextendedlocale.h>
-#include <hblineedit.h>
+#include <HbDataFormModel>
+#include <HbExtendedLocale>
+#include <HbLineEdit>
 #include <HbValidator>
-#include <QIntValidator>
 #include <HbStringUtil>
 #include <HbDataForm>
 
+#include <cpsettingformitemdata.h>
+
+#include <cmapplsettingsui.h>
+#include <cmmanagerdefines_shim.h>
+#include <qnetworkconfigmanager.h>
+#include <qnetworkconfiguration.h>
+
+
 #include "nmipssettingshelper.h"
 #include "nmipssettingsmanagerbase.h"
 #include "nmipssettingscustomitem.h"
@@ -38,7 +46,7 @@
 
 // CONSTANTS
 
-// Dynamic receiving schedule group items
+// Dynamic receiving schedule group items.
 const IpsServices::SettingItem NmIpsSettingsReceivingSchedule[] = {
         IpsServices::ReceptionInboxSyncWindow,
         IpsServices::ReceptionWeekDays,
@@ -46,6 +54,9 @@
         IpsServices::ReceptionDayEndTime,
         IpsServices::ReceptionRefreshPeriodDayTime};
 
+QTM_USE_NAMESPACE
+
+
 /*!
     \class NmIpsSettingsHelper
     \brief Helper class to save data into database when user has made changes.
@@ -72,8 +83,10 @@
   mFolderPathInputDialog(0),
   mOutgoingPortInputDialog(0),
   mOutgoingPortInputValidator(0),
+  mDestinationDialog(0),
   mServerInfoDynamicItemsVisible(false),
   mRadioButtonPreviousIndex(0)
+
 {
 }
 
@@ -273,23 +286,18 @@
 
                     mReceivingScheduleGroupItem->appendChild(formItemData);
                     insertContentItem(IpsServices::ReceptionRefreshPeriodDayTime, formItemData);
+
+                    // If changes are made to refreshMailItems, conversion table in
+                    // refreshPeriodModified method needs to be updated also.
                     QStringList refreshMailItems;
                     refreshMailItems << hbTrId("txt_mailips_setlabel_val_keep_uptodate")
                                      << hbTrId("txt_mailips_setlabel_val_every_15_minutes")
                                      << hbTrId("txt_mailips_setlabel_val_every_1_hour")
                                      << hbTrId("txt_mailips_setlabel_val_every_4_hours");
                     formItemData->setContentWidgetData(QString("items"), refreshMailItems);
-
-                    QList<QVariant> refreshMailItemValues;
-                    refreshMailItemValues << 5
-                                          << 15
-                                          << 60
-                                          << 240;
-                    QVariant value(refreshMailItemValues);
-                    formItemData->setData(HbDataFormModelItem::DescriptionRole + 1, value);
-
-                    mDataForm.addConnection(formItemData, SIGNAL(itemSelected(int)),
-                        this, SLOT(refreshPeriodModified(int)));
+                    mDataForm.addConnection(
+                        formItemData, SIGNAL(valueChanged(QPersistentModelIndex, QVariant)),
+                        this, SLOT(refreshPeriodModified(QPersistentModelIndex, QVariant)));
                 }
 
                 // Update data
@@ -364,7 +372,6 @@
 
 /*!
     Sets the edit changed flag to indicate that user has edited the field
-
     \param text Reference to the text value in the line edit box.
 */
 void NmIpsSettingsHelper::myNameTextChange(const QString &text)
@@ -403,14 +410,12 @@
                 item->setContentWidgetData(QString("text"), data);
             }
         }
-
     }
     mCurrentLineEditChanged = false;
 }
 
 /*!
     Sets the edit changed flag to indicate that user has edited the field
-
     \param text Reference to the text value in the line edit box.
 */
 void NmIpsSettingsHelper::mailboxNameTextChange(const QString &text)
@@ -430,6 +435,8 @@
 		HbDataFormModelItem *item = mContentItems.value(IpsServices::EmailAddress);
         QVariant data = item->contentWidgetData(QString("text"));
         mSettingsManager.writeSetting(IpsServices::EmailAddress, data);
+        QVariant property(NmSettings::MailboxName);
+        emit mailboxPropertyChanged(mSettingsManager.mailboxId(), property, data);
     }
     mCurrentLineEditChanged = false;
 }
@@ -548,7 +555,6 @@
 
 /*!
     Sets the edit changed flag to indicate that user has edited the field
-
     \param text Reference to the text value in the line edit box.
 */
 void NmIpsSettingsHelper::replyToTextChange(const QString &text)
@@ -577,8 +583,7 @@
 */
 void NmIpsSettingsHelper::handleMailboxDelete(HbAction *action)
 {
-    if (action == mDeleteConfirmationDialog->primaryAction()) {
-        
+    if (action == mDeleteConfirmationDialog->actions().at(0)) {        
         emit goOffline(mSettingsManager.mailboxId());
         mEmitOnline = false;
     
@@ -589,8 +594,7 @@
         // button.
         HbProgressDialog progressNote(HbProgressDialog::WaitDialog);
         progressNote.setText(hbTrId("txt_common_info_deleting"));
-        action = progressNote.primaryAction();
-        progressNote.removeAction(action);
+        progressNote.removeAction(progressNote.actions().at(0));
         progressNote.delayedShow();
     
         if (!mSettingsManager.deleteMailbox()) {
@@ -615,7 +619,7 @@
 }
 
 /*!
-    Handels the event after the mailbox delete information dialog has been dismissed.
+    Handles the event after the mailbox delete information dialog has been dismissed.
 */
 void NmIpsSettingsHelper::handleMailboxDeleteUpdate(HbAction *action)
 {
@@ -750,7 +754,6 @@
 
 /*!
     Sets the edit changed flag to indicate that user has edited the field
-
     \param text Reference to the text value in the line edit box.
 */
 void NmIpsSettingsHelper::incomingMailServerTextChange(const QString &text)
@@ -775,7 +778,6 @@
 
 /*!
     Sets the edit changed flag to indicate that user has edited the field
-
     \param text Reference to the text value in the line edit box.
 */
 void NmIpsSettingsHelper::outgoingMailServerTextChange(const QString &text)
@@ -787,7 +789,6 @@
 /*!
     Saves the incoming port value into database if user has changed the value. If the user wish to
     define the port, a input dialog is shown.
-    
     \param index Used to determine if the default value or a user defined value should be written
 */
 void NmIpsSettingsHelper::incomingPortChange(int index)
@@ -803,7 +804,7 @@
 }
 
 /*!
-    Show a input dialog for allowing the user to specify a incoming port.
+    Shows an input dialog for allowing the user to specify a incoming port.
 */
 void NmIpsSettingsHelper::showIncomingPortInputDialog()
 {    
@@ -828,11 +829,11 @@
 }
 
 /*!
-   Handels the saving of the port new value.
+   Handles the saving of the port new value.
 */
 void NmIpsSettingsHelper::handleUserDefinedIncomingPortInput(HbAction *action)
 {
-    if (action == mIncomingPortInputDialog->primaryAction()) {
+    if (action == mIncomingPortInputDialog->actions().at(0)) {
         QVariant newPort = mIncomingPortInputDialog->value();
         emit goOffline(mSettingsManager.mailboxId());
         mEmitOnline = true;
@@ -846,7 +847,6 @@
 
 /*!
     Used for getting the index to display in the port radio button list 
-    
     \return index Used to set the selected value
 */
 int NmIpsSettingsHelper::getCorrectPortRadioButtonIndex(int currentPort)
@@ -863,7 +863,6 @@
 
 /*!
     Sets the previous index value to indicate that user has edited the field
-
     \param text Reference to the item in the radio button list.
 */
 void NmIpsSettingsHelper::incomingPortPress(const QModelIndex &index)
@@ -913,8 +912,7 @@
 }
 
 /*!
-    Sets the previous index value to indicate that user has edited the field
-
+    Sets the previous index value to indicate that user has edited the field.
     \param text Reference to the item in the radio button list.
 */
 void NmIpsSettingsHelper::incomingSecureConnectionPress(const QModelIndex &index)
@@ -926,8 +924,7 @@
 }
 
 /*!
-    Used for getting the index to display in the secure connection radio button list 
-    
+    Used for getting the index to display in the secure connection radio button list.
     \return index Used to set the selected value
 */
 int NmIpsSettingsHelper::getCorrectSecureRadioButtonIndex(QVariant secureSockets, 
@@ -989,7 +986,7 @@
 {
     HbDataFormModelItem *item = mContentItems.value(IpsServices::FolderPath);
     
-    if (action == mFolderPathInputDialog->primaryAction()) { 
+    if (action == mFolderPathInputDialog->actions().at(0)) { 
         QVariant newFolderPath = mFolderPathInputDialog->value();
         mSettingsManager.writeSetting(IpsServices::FolderPath, newFolderPath);
         //set selected index to default if user inputed empty string.
@@ -1023,7 +1020,7 @@
     HbDataFormModelItem *item = mContentItems.value(IpsServices::ReceptionWeekDays);
     QVariant widgetData = item->contentWidgetData(QString("selectedItems"));
     QList<QVariant> selectedIndexes = widgetData.value< QList<QVariant> >();
-    QVariant itemData = item->data(HbDataFormModelItem::HbDataFormModelItem::DescriptionRole + 1);
+    QVariant itemData = item->data(HbDataFormModelItem::DescriptionRole + 1);
     QList<QVariant> itemValues = itemData.value< QList<QVariant> >();
 
     int days(0);
@@ -1031,8 +1028,13 @@
         days |= itemValues.at(selectedIndex.toInt()).toInt();
     }
 
-    handleReceivingScheduleSettingChange(IpsServices::ReceptionWeekDays, days);
+    QVariant previouslySelectedValue;
+    mSettingsManager.readSetting(IpsServices::ReceptionWeekDays, previouslySelectedValue);
+    if (days != previouslySelectedValue.toInt()) {
+        handleReceivingScheduleSettingChange(IpsServices::ReceptionWeekDays, days);
+    }
 
+    // Although the mode might not be changed we need to still update the button text.
     // Every weekday selected.
     if (days == 0x7f) {
         item->setContentWidgetData(QString("text"),
@@ -1042,42 +1044,56 @@
 
 /*!
     Handles start time modifications.
-	
     \param time Modified start time.
 */
 void NmIpsSettingsHelper::startTimeModified(QTime time)
 {
     int startTime(time.hour()*60 + time.minute());
-    handleReceivingScheduleSettingChange(IpsServices::ReceptionDayStartTime, startTime);
+    QVariant previouslySelectedStartTime;
+    mSettingsManager.readSetting(IpsServices::ReceptionDayStartTime, previouslySelectedStartTime);
+    if (startTime != previouslySelectedStartTime.toInt()) {
+        handleReceivingScheduleSettingChange(IpsServices::ReceptionDayStartTime, startTime);
+    }
 }
 
 /*!
     Handles refresh period modifications.
-
-    \param index selected item index.
+    \param value Selected value as a text.
 */
-void NmIpsSettingsHelper::refreshPeriodModified(int index)
+void NmIpsSettingsHelper::refreshPeriodModified(QPersistentModelIndex, QVariant value)
 {
-    HbDataFormModelItem* item = mContentItems.value(IpsServices::ReceptionRefreshPeriodDayTime);
-    QVariant itemData = item->data(HbDataFormModelItem::HbDataFormModelItem::DescriptionRole + 1);
-    int selectedValue = itemData.value< QList< QVariant > >().at(index).toInt();
-    handleReceivingScheduleSettingChange(IpsServices::ReceptionRefreshPeriodDayTime, selectedValue);
+    QMap<QString, int> conversionTable;
+    conversionTable[hbTrId("txt_mailips_setlabel_val_keep_uptodate")] = 5;
+    conversionTable[hbTrId("txt_mailips_setlabel_val_every_15_minutes")] = 15;
+    conversionTable[hbTrId("txt_mailips_setlabel_val_every_1_hour")] = 60;
+    conversionTable[hbTrId("txt_mailips_setlabel_val_every_4_hours")] = 240;
+
+    int selectedValue(conversionTable.value(value.toString()));
+    QVariant previouslySelectedValue;
+    mSettingsManager.readSetting(IpsServices::ReceptionRefreshPeriodDayTime,
+        previouslySelectedValue);
+    if (selectedValue != previouslySelectedValue.toInt()) {
+        handleReceivingScheduleSettingChange(IpsServices::ReceptionRefreshPeriodDayTime,
+            selectedValue);
+    }
 }
 
 /*!
     Handles end time modifications.
-
     \param time Modified start time.
 */
 void NmIpsSettingsHelper::endTimeModified(QTime time)
 {
     int endTime(time.hour()*60 + time.minute());
-    handleReceivingScheduleSettingChange(IpsServices::ReceptionDayEndTime, endTime);
+    QVariant previouslySelectedEndTime;
+    mSettingsManager.readSetting(IpsServices::ReceptionDayEndTime, previouslySelectedEndTime);
+    if (endTime != previouslySelectedEndTime) {
+        handleReceivingScheduleSettingChange(IpsServices::ReceptionDayEndTime, endTime);
+    }
 }
 
 /*!
     Used for getting the index to display in the inbox path radio button list 
-    
     \return index Used to set the selected value
 */
 int NmIpsSettingsHelper::getCorrectInboxPathRadioButtonIndex(QVariant folderPath)
@@ -1095,7 +1111,6 @@
     Handles receiving schedule item value modifications.
     Takes care of creating 'user defined' mode, coping values from active profile to
     user defined mode, storing changed value and selecting 'user defined' mode.
-
     \param settingItem Changed setting item.
     \param settingValue Setting item's value.
 */
@@ -1128,8 +1143,22 @@
 }
 
 /*!
+     Return the localized name for network destination with id of \a identifier.
+     \param identifier Network destination identifier.
+     \return Name of the network destination.
+ */
+QString NmIpsSettingsHelper::destinationNameFromIdentifier(uint identifier)
+{
+    const QString snapPrefix("S_");
+
+    QNetworkConfigurationManager netMan;
+    QNetworkConfiguration conf = netMan.configurationFromIdentifier( snapPrefix +
+                                                                     QString::number(identifier));
+    return conf.name();
+}
+
+/*!
     Copies receiving schedule settings from currently active profile to given profile.
-
     \param profileMode Mode where receiving schedule settings from active profile are copied to.
 */
 void NmIpsSettingsHelper::copyReceivingScheduleSettingsFromActiveProfile(int profileMode)
@@ -1155,7 +1184,6 @@
 /*!
     Saves the outgoing port value into database if user has changed the value. If the user wish to
     define the port, a input dialog is shown.
-
     \param index Used to determine if the default value or a user defined value should be written
 */
 void NmIpsSettingsHelper::outgoingPortChange(int index)
@@ -1171,8 +1199,7 @@
 }
 
 /*!
-    Show a input dialog for allowing the user to specify a outgoing port.
-
+    Shows an input dialog for allowing the user to specify a outgoing port.
 */
 void NmIpsSettingsHelper::showOutgoingPortInputDialog()
 {
@@ -1197,11 +1224,12 @@
 }
 
 /*!
-    Handels the saving of the port new value.
+    Handles the saving of the port new value.
+    \action Selected action.
 */
 void NmIpsSettingsHelper::handleUserDefinedOutgoingPortInput(HbAction *action)
 {
-    if (action == mOutgoingPortInputDialog->primaryAction()) {
+    if (action == mOutgoingPortInputDialog->actions().at(0)) {
         QVariant newPort = mOutgoingPortInputDialog->value();
         emit goOffline(mSettingsManager.mailboxId());
         mEmitOnline = true;
@@ -1214,8 +1242,24 @@
 }
 
 /*!
-    Sets the previous index value to indicate that user has edited the field
+    Handles the saving of the selected network connection.
+    \param status Dialog exit status \sa CmApplSettingsUi::ApplSettingsError.
+*/
+void NmIpsSettingsHelper::handleConnectionSelected(uint status)
+{
+    if (status == CmApplSettingsUi::ApplSettingsErrorNone) {
+        CmApplSettingsUi::SettingSelection selection = mDestinationDialog->selection();
+        uint destId(selection.id);
+        if (mSettingsManager.writeSetting(IpsServices::Connection, QVariant(destId))) {
+            QString destName(destinationNameFromIdentifier(destId));
+            HbDataFormModelItem *item = mContentItems.value(IpsServices::Connection);
+            item->setContentWidgetData(QString("text"), destName);
+        }
+    }
+}
 
+/*!
+    Sets the previous index value to indicate that user has edited the field.
     \param index Reference to the item in the radio button list.
 */
 void NmIpsSettingsHelper::outgoingPortPress(const QModelIndex &index)
@@ -1227,9 +1271,8 @@
 }
 
 /*!
-    Used for getting the index to display in the outgoing port radio button list
-
-    \return index Used to set the selected value
+    Used for getting the index to display in the outgoing port radio button list.
+    \return index Used to set the selected value.
 */
 int NmIpsSettingsHelper::getCorrectOutgoingPortRadioButtonIndex(int currentPort)
 {
@@ -1244,9 +1287,8 @@
 }
 
 /*!
-    Used for getting the index to display in the outgoing authentication radio button list 
-    
-    \return index Used to set the selected value
+    Used for getting the index to display in the outgoing authentication radio button list.
+    \return index Used to set the selected value.
 */
 int NmIpsSettingsHelper::getCorrectOutgoingAuthenticationRadioButtonIndex()
 {
@@ -1280,6 +1322,7 @@
 
 /*!
     Saves the outgoing secure connection value into database if user has changed the value.
+    \param index Selected radio button index.
 */
 void NmIpsSettingsHelper::outgoingSecureConnectionItemChange(int index)
 {
@@ -1317,9 +1360,8 @@
 }
 
 /*!
-    Sets the previous index value to indicate that user has edited the field
-
-    \param text Reference to the item in the radio button list.
+    Sets the previous index value to indicate that user has edited the field.
+    \param index Reference to the item in the radio button list.
 */
 void NmIpsSettingsHelper::outgoingSecureConnectionPress(const QModelIndex &index)
 {
@@ -1332,6 +1374,7 @@
 /*!
     Saves the outgoing authetication value into database if user has changed the value and
     updates dynamic group items.
+    \param index Selected radio button index.
 */
 void NmIpsSettingsHelper::outgoingAuthenticationChange(int index)
 {
@@ -1369,9 +1412,8 @@
 }
 
 /*!
-    Sets the previous index value to indicate that user has edited the field
-
-    \param text Reference to the item in the radio button list.
+    Sets the previous index value to indicate that user has edited the field.
+    \param index Reference to the item in the radio button list.
 */
 void NmIpsSettingsHelper::outgoingAuthenticationPress(const QModelIndex &index)
 {
@@ -1381,3 +1423,31 @@
     mRadioButtonPreviousIndex = data.toInt();
 }
 
+/*!
+    Launches the connection selection dialog.
+*/
+void NmIpsSettingsHelper::connectionButtonPress()
+{
+    if (!mDestinationDialog) {
+        // Create the dialog and configure it.
+        mDestinationDialog = new CmApplSettingsUi(this);
+
+        mDestinationDialog->setOptions(
+            QFlags<CmApplSettingsUi::SelectionDialogItems>(CmApplSettingsUi::ShowDestinations),
+            QSet<CmApplSettingsUi::BearerTypeFilter>());
+        connect(mDestinationDialog, SIGNAL(finished(uint)),
+                this, SLOT(handleConnectionSelected(uint)));
+    }
+
+    // Set currently active destination as selected.
+    QVariant destId;
+    if (mSettingsManager.readSetting(IpsServices::Connection, destId)) {
+        CmApplSettingsUi::SettingSelection selection;
+        selection.result = CmApplSettingsUi::SelectionTypeDestination;
+        selection.id = destId.toUInt();
+        mDestinationDialog->setSelection(selection);
+    }
+
+    // Open the dialog.
+    mDestinationDialog->open();
+}
--- a/ipsservices/nmipssettings/src/nmipssettingslabeledcombobox.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/src/nmipssettingslabeledcombobox.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -56,9 +56,6 @@
     // Connect signals and slots.
     connect(mComboBox, SIGNAL(currentIndexChanged(int)),
         this, SLOT(comboBoxIndexChanged(int)), Qt::UniqueConnection);
-
-    connect(mComboBox, SIGNAL(currentIndexChanged(int)),
-        this, SIGNAL(currentIndexChanged(int)), Qt::UniqueConnection);
 }
 
 /*!
@@ -134,4 +131,8 @@
 {
     QString label(mLabelTexts.value(index));
     mLabel->setPlainText(label);
+    QMap<QString, QVariant> properties;
+    properties.insert("currentIndex", index);
+    emit propertyChanged(properties);
+    emit currentIndexChanged(index);
 }
--- a/ipsservices/nmipssettings/src/nmipssettingsmanagerbase.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/src/nmipssettingsmanagerbase.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -44,10 +44,11 @@
 */
 NmIpsSettingsManagerBase::NmIpsSettingsManagerBase(const NmId &mailboxId, CEmailAccounts *account, 
     IpsServices::TIpsSetAccountTypes accountType)
-: mAccountType(accountType),
-  mMailboxId(mailboxId.id())
+    : mAccountType(accountType),
+      mMailboxId(mailboxId.id())
 {
-    QScopedPointer<NmIpsExtendedSettingsManager> extendedSettings(new NmIpsExtendedSettingsManager(mailboxId));
+    QScopedPointer<NmIpsExtendedSettingsManager> extendedSettings(
+        new NmIpsExtendedSettingsManager(mailboxId));
 
     QT_TRAP_THROWING(mSmtpSettings = new(ELeave) CImSmtpSettings());
 
@@ -57,7 +58,7 @@
 }
 
 /*!
-    Destructor
+    Destructor.
 */
 NmIpsSettingsManagerBase::~NmIpsSettingsManagerBase()
 {
@@ -73,7 +74,8 @@
     \param QVariant SettingValue of the found setting value.
     \return bool <true> when the setting item was found otherwise <false>.
 */
-bool NmIpsSettingsManagerBase::readSetting(IpsServices::SettingItem settingItem, QVariant &settingValue)
+bool NmIpsSettingsManagerBase::readSetting(IpsServices::SettingItem settingItem,
+                                           QVariant &settingValue)
 {
     bool found(false);
     
@@ -117,7 +119,17 @@
         case IpsServices::OutgoingSSLWrapper:
         	settingValue = mSmtpSettings->SSLWrapper();
             found = true;
-            break;  
+            break;
+        case IpsServices::Connection:
+            settingValue = 0;
+            TRAP_IGNORE(
+                CImIAPPreferences *prefs = CImIAPPreferences::NewLC();
+                mAccount->LoadSmtpIapSettingsL(mSmtpAccount, *prefs);
+                settingValue = (uint)prefs->SNAPPreference();
+                CleanupStack::PopAndDestroy(prefs);
+                found = true;
+            );
+            break;
         default:
             found = mExtendedSettingsManager->readSetting(settingItem, settingValue);
             break;
@@ -131,7 +143,8 @@
     \param settingValue QVariant of the new setting value.
     \return bool <true> when the setting item was succesfully written, otherwise <false>.
 */
-bool NmIpsSettingsManagerBase::writeSetting(IpsServices::SettingItem settingItem, const QVariant &settingValue)
+bool NmIpsSettingsManagerBase::writeSetting(IpsServices::SettingItem settingItem,
+                                            const QVariant &settingValue)
 {
     HBufC *tmp = 0;
     HBufC8 *tmp8 = 0;
@@ -203,7 +216,10 @@
         case IpsServices::OutgoingSSLWrapper:
             mSmtpSettings->SetSSLWrapper(settingValue.toBool());
             ret = saveSettings();
-            break;  
+            break;
+        case IpsServices::Connection:
+            ret = saveIAPSettings(settingValue.toUInt());
+            break;
         default:
             ret = mExtendedSettingsManager->writeSetting(settingItem, settingValue);
             break;    
@@ -212,8 +228,7 @@
 }
 
 /*!     
-    Delete mailbox.
-
+    Deletes the mailbox.
     \return Error code <code>0</code> if mailbox deletion was successful, otherwise error
             code is returned.
 */
@@ -227,6 +242,46 @@
 }
 
 /*!     
+    Returns the NmId of the mailbox.
+    \return Mailbox id.
+*/
+NmId NmIpsSettingsManagerBase::mailboxId() const
+{
+    return mMailboxId;
+}
+
+/*!     
+    Returns the mailbox account type.
+    \return Account type.
+*/
+IpsServices::TIpsSetAccountTypes NmIpsSettingsManagerBase::accountType() const
+{
+    return mAccountType;
+}
+
+/*!
+     Determines the default port for the outgoing mail server based on the security settings.
+     \return The port number to use.
+ */
+int NmIpsSettingsManagerBase::determineDefaultOutgoingPort()
+{
+    int port(IpsServices::standardSmtpPort);
+    if (mSmtpSettings->SSLWrapper()) {
+        port = IpsServices::secureSmtpPort;
+    }        
+    return port;
+}
+
+/*!
+    Returns reference to the Extended Settings Manager.
+    \return Extended Settings Manager reference.
+*/
+NmIpsExtendedSettingsManager &NmIpsSettingsManagerBase::extendedSettingsManager() const
+{
+    return *mExtendedSettingsManager;
+}
+
+/*!
     Stores the SMTP specific settings.
     \return bool <true> when the SMTP settings were succesfully written, otherwise <false>.
 */
@@ -236,44 +291,18 @@
     return (err == KErrNone);
 }
 
-/*!     
-    NmId for the mailbox. 
+/*!
+    Stores the SMTP specific IAP settings.
+    \return bool <true> when the SMTP IAP settings were succesfully written, otherwise <false>.
 */
-NmId NmIpsSettingsManagerBase::mailboxId() const
+bool NmIpsSettingsManagerBase::saveIAPSettings(uint snapId)
 {
-    return mMailboxId;
-}
-
-/*!     
-    Mailbox account type. 
-*/
-IpsServices::TIpsSetAccountTypes NmIpsSettingsManagerBase::accountType() const
-{
-    return mAccountType;
+    TRAPD(err,
+        CImIAPPreferences *prefs = CImIAPPreferences::NewLC();
+        mAccount->LoadSmtpIapSettingsL(mSmtpAccount, *prefs);
+        prefs->SetSNAPL(snapId);
+        mAccount->SaveSmtpIapSettingsL(mSmtpAccount, *prefs);
+        CleanupStack::PopAndDestroy(prefs);
+    );
+    return (err == KErrNone);
 }
-
-/*!
-     Determine the default port for the outgoing mail server based on the security settings
-     
-     \return int the port number to use
- */
-int NmIpsSettingsManagerBase::determineDefaultOutgoingPort()
-{
-    int port = 0;    
-    bool sslTls = mSmtpSettings->SSLWrapper();    
-    if (sslTls) {
-        port = IpsServices::secureSmtpPort;
-    } else {
-        port = IpsServices::standardSmtpPort;
-    }        
-    return port;
-}
-
-/*!
-
-*/
-NmIpsExtendedSettingsManager &NmIpsSettingsManagerBase::extendedSettingsManager() const
-{
-    return *mExtendedSettingsManager;
-}
-
--- a/ipsservices/nmipssettings/src/nmipssettingsmultiselectionitem.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/src/nmipssettingsmultiselectionitem.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -21,6 +21,7 @@
 #include <HbSelectionDialog>
 #include <HbLabel>
 #include <HbExtendedLocale>
+#include <HbAction>
 
 #include "nmipssettingsmultiselectionitem.h"
 
@@ -175,7 +176,12 @@
 */
 void NmIpsSettingsMultiSelectionItem::selectionDialogClosed(HbAction *action)
 {
-    if (action == mSelectionDialog->primaryAction()) {
+    // TODO: Needs to be properly fixed when ever orbit supports
+    // e.g. <code>void finished(int result)</code> type of signaling.
+    // This is kind of hack but we do not want to compare button text to some string to
+    // be certain which button was pressed (NOTE: Buttons are created and placed
+    // by HbSelectionDialog).
+    if (action == mSelectionDialog->actions().at(0)) {
         // Get selected items.
         mSelectedItems = mSelectionDialog->selectedItems();
 
--- a/ipsservices/nmipssettings/src/nmipssettingsplugin.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/src/nmipssettingsplugin.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -15,17 +15,19 @@
 *
 */
 
-#include <hbdataform.h>
-#include <hbdataformmodel.h>
-#include <hbdataformmodelitem.h>
-#include <hblineedit.h>
-#include <cpsettingformitemdata.h>
 #include <qplugin.h>
 #include <QCoreApplication>
 #include <QTranslator>
 #include <QScopedPointer>
 #include <QLocale>
+
 #include <HbStringUtil>
+#include <HbDataForm>
+#include <HbDataFormModel>
+#include <HbDataFormModelItem>
+#include <HbLineEdit>
+
+#include <cpsettingformitemdata.h>
 
 #include "nmipssettingsplugin.h"
 #include "nmipssettingshelper.h"
@@ -41,6 +43,7 @@
 const QString NmIpsSettingsComboItems("comboItems");
 const QString NmIpsSettingsLabelTexts("labelTexts");
 const QString NmIpsSettingsItems("items");
+const int NmIpsSettingsReceptionUserDefinedProfileEnabled(1);
 
 /*!
     \class NmIpsSettingsPlugin
@@ -63,7 +66,6 @@
     QString appName = "mailips_";
     QString commonName = "common_";
     
-
     // Load common strings
 	QScopedPointer<QTranslator> commonTranslator(new QTranslator(this));
     commonTranslator->load(commonName + lang, path);
@@ -96,6 +98,9 @@
 bool NmIpsSettingsPlugin::populateModel(HbDataFormModel &model,
     HbDataForm &form, const NmId &mailboxId)
 {
+    // Turns AlwaysOnline OFF
+    setAlwaysOnlineState(EServerAPIEmailTurnOff, mailboxId);
+    
     // Store model and form pointers.
     mModel = &model;
     mForm = &form;
@@ -133,7 +138,6 @@
         initGroupItems();
         result = true;
     }
-    
     return result;
 }
 
@@ -143,10 +147,15 @@
 void NmIpsSettingsPlugin::aboutToClose()
 {
     QVariant profileIndex;
+    const NmId mailboxId = mSettingsManager->mailboxId();
+    
 	mSettingsManager->readSetting(IpsServices::ReceptionActiveProfile, profileIndex);
 	if ((mSettingsHelper->isOffline()) && (profileIndex.toInt() != IpsServices::EmailSyncProfileManualFetch)) {
-		emit goOnline(mSettingsManager->mailboxId());
+		emit goOnline(mailboxId);
 	}
+	
+	// Turns AlwaysOnline ON
+	setAlwaysOnlineState(EServerAPIEmailTurnOn, mailboxId);
 }
 
 /*!
@@ -203,7 +212,24 @@
 */
 void NmIpsSettingsPlugin::initPreferenceItems(HbDataFormModelItem &item) const
 {
-    // 1. My Name
+
+    // 1. Connection
+    QVariant destId;
+
+    mSettingsManager->readSetting(IpsServices::Connection, destId);
+    QString destName(mSettingsHelper->destinationNameFromIdentifier(destId.toUInt()));
+    HbDataFormModelItem::DataItemType buttonItem =
+        static_cast<HbDataFormModelItem::DataItemType>(
+            HbDataFormModelItem::CustomItemBase + 2);
+    CpSettingFormItemData *connectionButtonItem = new CpSettingFormItemData(buttonItem,
+        hbTrId("txt_mailips_setlabel_connection"));
+    connectionButtonItem->setContentWidgetData(QString("text"), destName);
+    mSettingsHelper->insertContentItem(IpsServices::Connection, connectionButtonItem);
+    mForm->addConnection(connectionButtonItem, SIGNAL(clicked()),
+                         mSettingsHelper, SLOT(connectionButtonPress()));
+    item.appendChild(connectionButtonItem);
+
+    // 2. My Name
     QVariant myName;
     mSettingsManager->readSetting(IpsServices::EmailAlias, myName);
     CpSettingFormItemData *myNameItem = new CpSettingFormItemData(
@@ -216,7 +242,7 @@
                          mSettingsHelper, SLOT(myNameTextChange(QString)));
     item.appendChild(myNameItem);
 
-    // 2. Mailbox Name
+    // 3. Mailbox Name
     QVariant mailboxName;
     mSettingsManager->readSetting(IpsServices::MailboxName, mailboxName);
     CpSettingFormItemData *mailboxNameItem = new CpSettingFormItemData(
@@ -292,21 +318,14 @@
 
     mSettingsHelper->insertContentItem(IpsServices::ReceptionInboxSyncWindow, showMailInInboxItem);
 
+    // If changes are made to showMailItems, conversion table in
+    // showMailInInboxModified method needs to be updated also.
     QStringList showMailItems;
     showMailItems << HbStringUtil::convertDigits("50")
                   << HbStringUtil::convertDigits("100")
                   << HbStringUtil::convertDigits("500")
                   << hbTrId("txt_mailips_setlabel_val_all");
     
-
-    QList<QVariant> showMailItemValues;
-    showMailItemValues << 50
-                       << 100
-                       << 500
-                       << 0;
-    
-    QVariant value(showMailItemValues);
-    showMailInInboxItem->setData(HbDataFormModelItem::DescriptionRole + 1, value);
     showMailInInboxItem->setContentWidgetData(NmIpsSettingsItems, showMailItems);
     showMailInInboxItem->setEnabled(true);
     item.appendChild(showMailInInboxItem);
@@ -315,8 +334,8 @@
     mForm->addConnection(infoItem, SIGNAL(currentIndexChanged(int)),
         mSettingsHelper, SLOT(receivingScheduleChange(int)));
 
-    mForm->addConnection(showMailInInboxItem, SIGNAL(itemSelected(int)),
-        this, SLOT(showMailInInboxModified(int)));
+    mForm->addConnection(showMailInInboxItem, SIGNAL(valueChanged(QPersistentModelIndex, QVariant)),
+        this, SLOT(showMailInInboxModified(QPersistentModelIndex, QVariant)));
 
     // Must be called manually here, because the signal->slot connection set above using
     // HbDataForm::addConnection() is actually established AFTER the properties have first been
@@ -554,6 +573,26 @@
 }
 
 /*!
+    Sets the state of the AlwaysOnline.
+    \param command Command for the state of the AlwaysOnline.
+    \param mailboxId Mailbox id.
+*/
+void NmIpsSettingsPlugin::setAlwaysOnlineState(TAlwaysOnlineServerAPICommands command,
+                                               NmId mailboxId) const
+{
+    RAlwaysOnlineClientSession aosession;
+    TInt err(aosession.Connect());
+    
+    if (err == KErrNone) {
+        TPckgBuf<TMsvId> mboxBuf(mailboxId.id32());
+        
+        TRAP_IGNORE(aosession.RelayCommandL(command, mboxBuf));
+    }
+    
+    aosession.Close();
+}
+
+/*!
     Creates user defined mode if not already exist.
 */
 void NmIpsSettingsPlugin::createUserDefinedMode()
@@ -588,8 +627,8 @@
         mForm->addConnection(syncProfile, SIGNAL(currentIndexChanged(int)),
             mSettingsHelper, SLOT(receivingScheduleChange(int)));
 
-        // Mark that user defined mode exists.
-        userDefineMode.setValue(1);
+        // Set reception user defined profile enabled.
+        userDefineMode.setValue(NmIpsSettingsReceptionUserDefinedProfileEnabled);
         mSettingsManager->writeSetting(IpsServices::ReceptionUserDefinedProfile, userDefineMode);
     }
 }
@@ -597,15 +636,23 @@
 /*!
     Handles mail in inbox modifications.
 
-    \param index Selected value index.
+    \param value Selected value as a text.
 */
-void NmIpsSettingsPlugin::showMailInInboxModified(int index)
+void NmIpsSettingsPlugin::showMailInInboxModified(QPersistentModelIndex, QVariant value)
 {
-    HbDataFormModelItem* item = mSettingsHelper->contentItem(IpsServices::ReceptionInboxSyncWindow);
-    QVariant itemData = item->data(HbDataFormModelItem::HbDataFormModelItem::DescriptionRole + 1);
-    int selectedValue = itemData.value< QList< QVariant > >().at(index).toInt();
-    mSettingsHelper->handleReceivingScheduleSettingChange(
-        IpsServices::ReceptionInboxSyncWindow, selectedValue);
+    QMap<QString, int> conversionTable;
+    conversionTable[HbStringUtil::convertDigits("50")] = 50;
+    conversionTable[HbStringUtil::convertDigits("100")] = 100;
+    conversionTable[HbStringUtil::convertDigits("500")] = 500;
+    conversionTable[hbTrId("txt_mailips_setlabel_val_all")] = 0;
+
+    int selectedValue(conversionTable.value(value.toString()));
+    QVariant previouslySelectedValue;
+    mSettingsManager->readSetting(IpsServices::ReceptionInboxSyncWindow, previouslySelectedValue);
+    if (previouslySelectedValue.toInt() != selectedValue) {
+        mSettingsHelper->handleReceivingScheduleSettingChange(
+            IpsServices::ReceptionInboxSyncWindow, selectedValue);
+    }
 }
 
 Q_EXPORT_PLUGIN2(nmipssettings, NmIpsSettingsPlugin);
--- a/ipsservices/nmipssettings/src/nmipssettingstimeeditor.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmipssettings/src/nmipssettingstimeeditor.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -39,7 +39,8 @@
 NmIpsSettingsTimeEditor::NmIpsSettingsTimeEditor(QGraphicsItem *parent, Qt::WindowFlags wFlags)
     : HbWidget(parent, wFlags),
       mButton(0),
-      mTimePickerDialog(0)
+      mTimePickerDialog(0),
+      mPrimaryAction(0)
 {
     // Create widget layout.
     QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
@@ -130,11 +131,12 @@
 
     // Set dialog actions.
     HbAction *okAction = new HbAction(QString(hbTrId("txt_common_button_ok")), mTimePickerDialog);
-    mTimePickerDialog->setPrimaryAction(okAction);
-
-    HbAction *cancelAction = new HbAction(QString(hbTrId("txt_common_button_cancel")),
-        mTimePickerDialog);
-    mTimePickerDialog->setSecondaryAction( cancelAction );
+    mTimePickerDialog->addAction(okAction);
+    mPrimaryAction = okAction;
+    
+    HbAction *cancelAction = new HbAction(QString(hbTrId("txt_common_button_cancel")), 
+                                          mTimePickerDialog);
+    mTimePickerDialog->addAction(cancelAction);
 
     // Show the dialog.
     mTimePickerDialog->open(this, SLOT(handleTimeAction(HbAction *)));
@@ -145,7 +147,7 @@
  */
 void NmIpsSettingsTimeEditor::handleTimeAction(HbAction *action)
 {
-    if (action == mTimePickerDialog->primaryAction()) {
+    if (action==mPrimaryAction) {
         // Get the time from the picker.
         QTime newTime = static_cast<HbDateTimePicker *> (mTimePickerDialog->contentWidget())->time();
 
--- a/ipsservices/nmpopclientplugin/src/nmpopclientplugin.cpp	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/nmpopclientplugin/src/nmpopclientplugin.cpp	Wed Jun 23 17:00:39 2010 +0100
@@ -33,8 +33,8 @@
     Constructs a new NmPopClientPlugin.
  */
 NmPopClientPlugin::NmPopClientPlugin()
-: mSettingsViewLauncher(NULL),
-mListOptionsMenuRequest(NULL)
+: mListOptionsMenuRequest(NULL),
+mSettingsViewLauncher(NULL)
 {
     NMLOG("NmPopClientPlugin::NmPopClientPlugin()-->");
     NMLOG("<--NmPopClientPlugin::NmPopClientPlugin()");
@@ -182,6 +182,7 @@
                 this, SLOT(goOffline(const NmId &)));
         }
 
+        handleRequest(NmActionResponseCommandSettings, mMenuRequest);
         mSettingsViewLauncher->launchSettingsView(id, mailbox->name());
     }
 
--- a/ipsservices/rom/FreestyleIpsServices.iby	Tue May 18 11:08:56 2010 +0100
+++ b/ipsservices/rom/FreestyleIpsServices.iby	Wed Jun 23 17:00:39 2010 +0100
@@ -23,7 +23,7 @@
 #ifdef FF_EMAIL_FRAMEWORK
 
 ECOM_PLUGIN( ipssosplugin.dll, ipssosplugin.rsc )
-//ECOM_PLUGIN( IPSSosAOPlugin.dll, IPSSosAOPlugin.rsc )
+ECOM_PLUGIN( IPSSosAOPlugin.dll, IPSSosAOPlugin.rsc )
 
 file=ABI_DIR\BUILD_DIR\nmipsmtms.dll		SHARED_LIB_DIR\nmipsmtms.dll        PAGED
 data=DATAZ_\MTM_INFO_FILE_DIR\smtp.rsc           MTM_INFO_FILE_DIR\smtp.rsc