Revision: 201025
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 06 Jul 2010 14:04:34 +0300
changeset 54 997a02608b3a
parent 53 bf7eb7911fc5
child 55 cdd802add233
child 59 16ed8d08d0b1
Revision: 201025 Kit: 2010127
email_plat/email_client_api/email_client_api.metaxml
email_plat/email_client_api/email_client_api.pri
email_plat/email_client_api/emailapidefs.h
email_plat/email_client_api/emailclientapi.hrh
email_plat/email_client_api/emailinterfacefactory.h
email_plat/email_client_api/emailinterfacefactory.inl
email_plat/email_client_api/emailsorting.h
email_plat/email_client_api/memailaddress.h
email_plat/email_client_api/memailclientapi.h
email_plat/email_client_api/memailcontent.h
email_plat/email_client_api/memailfolder.h
email_plat/email_client_api/memailmailbox.h
email_plat/email_client_api/memailmessage.h
email_plat/email_client_api/memailmessagesearch.h
email_plat/email_client_api/mmailboxcontentobserver.h
email_plat/email_client_api/mmailboxsyncobserver.h
email_plat/email_client_api/mmessageiterator.h
email_plat/email_plat.pro
email_plat/nmail_client_api/nmail_client_api.pri
email_plat/nmail_client_api/nmapiemailaddress.h
email_plat/nmail_client_api/nmapifolderlisting.h
email_plat/nmail_client_api/nmapimessagemanager.h
email_plat/nmail_settings_api/nmail_settings_api.pri
email_plat/nmail_settings_api/nmapimailboxsettings.h
email_plat/nmail_settings_api/nmapimailboxsettingsdata.h
emailservices/emailclientapi/bwins/emailclientapiu.def
emailservices/emailclientapi/data/emailclientapi.rss
emailservices/emailclientapi/eabi/emailclientapiu.def
emailservices/emailclientapi/emailclientapi.pro
emailservices/emailclientapi/inc/emailaddress.h
emailservices/emailclientapi/inc/emailapiutils.h
emailservices/emailclientapi/inc/emailapiutils.inl
emailservices/emailclientapi/inc/emailattachment.h
emailservices/emailclientapi/inc/emailclientapiimpl.h
emailservices/emailclientapi/inc/emailclientapiimpl.hrh
emailservices/emailclientapi/inc/emailclientapiimpldefs.h
emailservices/emailclientapi/inc/emailclientpluginmanager.h
emailservices/emailclientapi/inc/emailcontent.h
emailservices/emailclientapi/inc/emailfolder.h
emailservices/emailclientapi/inc/emailinterfacefactoryimpl.h
emailservices/emailclientapi/inc/emailmailbox.h
emailservices/emailclientapi/inc/emailmailboxcache.h
emailservices/emailclientapi/inc/emailmessage.h
emailservices/emailclientapi/inc/emailmessagesearch.h
emailservices/emailclientapi/inc/emailmultipart.h
emailservices/emailclientapi/inc/emailtextcontent.h
emailservices/emailclientapi/inc/messageiterator.h
emailservices/emailclientapi/rom/emailclientapi.iby
emailservices/emailclientapi/src/emailaddress.cpp
emailservices/emailclientapi/src/emailapiutils.cpp
emailservices/emailclientapi/src/emailattachment.cpp
emailservices/emailclientapi/src/emailclientapiimpl.cpp
emailservices/emailclientapi/src/emailcontent.cpp
emailservices/emailclientapi/src/emailfolder.cpp
emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp
emailservices/emailclientapi/src/emailmailbox.cpp
emailservices/emailclientapi/src/emailmailboxcache.cpp
emailservices/emailclientapi/src/emailmessage.cpp
emailservices/emailclientapi/src/emailmessagesearch.cpp
emailservices/emailclientapi/src/emailmultipart.cpp
emailservices/emailclientapi/src/emailtextcontent.cpp
emailservices/emailclientapi/src/implproxy.cpp
emailservices/emailclientapi/src/messageiterator.cpp
emailservices/emailcommon/inc/CFSMailCommon.h
emailservices/emailcommon/inc/CFSMailMessageBase.h
emailservices/emailcommon/inc/CFSMailRequestHandler.h
emailservices/emailcommon/src/CFSMailBox.cpp
emailservices/emailcommon/src/CFSMailMessagePart.cpp
emailservices/emaildebug/inc/emailtrace.h
emailservices/emailframework/src/CFSMailClient.cpp
emailservices/emailstore/base_plugin/inc/BasePlugin.h
emailservices/emailstore/base_plugin/inc/baseplugindelayedops.h
emailservices/emailstore/base_plugin/inc/baseplugindelayedopsprivate.h
emailservices/emailstore/base_plugin/src/BasePlugin.cpp
emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp
emailservices/emailstore/base_plugin/src/basepluginmisc.cpp
emailservices/emailstore/message_store/client/inc/MsgStoreObserverHandler.h
emailservices/emailstore/message_store/client/src/MsgStoreObserverHandler.cpp
emailservices/nmailagent/inc/nmmailagent.h
emailservices/nmailagent/nmailagent.pro
emailservices/nmailagent/src/nmmailagent.cpp
emailservices/nmclientapi/bwins/nmailclientapiu.def
emailservices/nmclientapi/eabi/nmailclientapiu.def
emailservices/nmclientapi/inc/nmapicommonheader.h
emailservices/nmclientapi/inc/nmapienvelopelisting_p.h
emailservices/nmclientapi/inc/nmapieventnotifier_p.h
emailservices/nmclientapi/inc/nmapifolder_p.h
emailservices/nmclientapi/inc/nmapifolderlisting_p.h
emailservices/nmclientapi/inc/nmapiheaders.h
emailservices/nmclientapi/inc/nmapimailbox_p.h
emailservices/nmclientapi/inc/nmapimailboxsettings_p.h
emailservices/nmclientapi/inc/nmapimailboxsettingsdata_p.h
emailservices/nmclientapi/inc/nmapimessagemanager_p.h
emailservices/nmclientapi/inc/nmapipopimapsettingsmanager.h
emailservices/nmclientapi/inc/nmapiprivateheaders.h
emailservices/nmclientapi/nmclientapi.pro
emailservices/nmclientapi/src/nmapidatapluginfactory.cpp
emailservices/nmclientapi/src/nmapiemailaddress.cpp
emailservices/nmclientapi/src/nmapiemailservice.cpp
emailservices/nmclientapi/src/nmapiengine.cpp
emailservices/nmclientapi/src/nmapienvelopelisting.cpp
emailservices/nmclientapi/src/nmapienvelopelisting_p.cpp
emailservices/nmclientapi/src/nmapieventnotifier.cpp
emailservices/nmclientapi/src/nmapieventnotifier_p.cpp
emailservices/nmclientapi/src/nmapifolder.cpp
emailservices/nmclientapi/src/nmapifolderlisting.cpp
emailservices/nmclientapi/src/nmapifolderlisting_p.cpp
emailservices/nmclientapi/src/nmapimailbox.cpp
emailservices/nmclientapi/src/nmapimailboxlisting.cpp
emailservices/nmclientapi/src/nmapimailboxlisting_p.cpp
emailservices/nmclientapi/src/nmapimailboxsettings.cpp
emailservices/nmclientapi/src/nmapimailboxsettings_p.cpp
emailservices/nmclientapi/src/nmapimailboxsettingsdata.cpp
emailservices/nmclientapi/src/nmapimailboxsettingsdata_p.cpp
emailservices/nmclientapi/src/nmapimessagebody.cpp
emailservices/nmclientapi/src/nmapimessageenvelope.cpp
emailservices/nmclientapi/src/nmapimessagemanager.cpp
emailservices/nmclientapi/src/nmapimessagemanager_p.cpp
emailservices/nmclientapi/src/nmapimessagetask.cpp
emailservices/nmclientapi/src/nmapipopimapsettingsmanager.cpp
emailservices/nmclientapi/src/nmapitypesconverter.cpp
emailservices/nmregister/src/nmmailboxregisterinterface.cpp
emailservices/nmregister/translations/nmregister.ts
emailuis/nmailcpplugin/inc/nmsettingsplugin.h
emailuis/nmailcpplugin/src/nmsettingsplugin.cpp
emailuis/nmailui/conf/nmeditorview.docml
emailuis/nmailui/conf/nmmailboxlistview.docml
emailuis/nmailui/conf/nmmessagelistview.docml
emailuis/nmailui/conf/nmmessagesearchlistview.docml
emailuis/nmailui/inc/nmaction.h
emailuis/nmailui/inc/nmactionrequest.h
emailuis/nmailui/inc/nmapplication.h
emailuis/nmailui/inc/nmattachmentmanager.h
emailuis/nmailui/inc/nmattachmentpicker.h
emailuis/nmailui/inc/nmbaseview.h
emailuis/nmailui/inc/nmeditorcontent.h
emailuis/nmailui/inc/nmeditorheader.h
emailuis/nmailui/inc/nmeditorview.h
emailuis/nmailui/inc/nmmailboxlistview.h
emailuis/nmailui/inc/nmmailboxlistviewitem.h
emailuis/nmailui/inc/nmmessagelistview.h
emailuis/nmailui/inc/nmmessagelistviewitem.h
emailuis/nmailui/inc/nmrecipientfield.h
emailuis/nmailui/inc/nmsendserviceinterface.h
emailuis/nmailui/inc/nmuidocumentloader.h
emailuis/nmailui/inc/nmuiheaders.h
emailuis/nmailui/inc/nmuriserviceinterface.h
emailuis/nmailui/inc/nmutilities.h
emailuis/nmailui/inc/nmviewerheader.h
emailuis/nmailui/inc/nmviewerserviceinterface.h
emailuis/nmailui/inc/nmviewerview.h
emailuis/nmailui/inc/nmviewerviewnetreply.h
emailuis/nmailui/inc/nmviewerwebview.h
emailuis/nmailui/src/main.cpp
emailuis/nmailui/src/nmapplication.cpp
emailuis/nmailui/src/nmattachmentlist.cpp
emailuis/nmailui/src/nmattachmentmanager.cpp
emailuis/nmailui/src/nmattachmentpicker.cpp
emailuis/nmailui/src/nmbaseview.cpp
emailuis/nmailui/src/nmeditorcontent.cpp
emailuis/nmailui/src/nmeditorheader.cpp
emailuis/nmailui/src/nmeditortextdocument.cpp
emailuis/nmailui/src/nmeditorview.cpp
emailuis/nmailui/src/nmmailboxlistview.cpp
emailuis/nmailui/src/nmmailboxlistviewitem.cpp
emailuis/nmailui/src/nmmailboxselectiondialog.cpp
emailuis/nmailui/src/nmmailboxserviceinterface.cpp
emailuis/nmailui/src/nmmessagelistview.cpp
emailuis/nmailui/src/nmmessagelistviewitem.cpp
emailuis/nmailui/src/nmmessagesearchlistview.cpp
emailuis/nmailui/src/nmrecipientfield.cpp
emailuis/nmailui/src/nmsendserviceinterface.cpp
emailuis/nmailui/src/nmuidocumentloader.cpp
emailuis/nmailui/src/nmuieffects.cpp
emailuis/nmailui/src/nmuiextensionmanager.cpp
emailuis/nmailui/src/nmuriserviceinterface.cpp
emailuis/nmailui/src/nmutilities.cpp
emailuis/nmailui/src/nmviewerheader.cpp
emailuis/nmailui/src/nmviewerserviceinterface.cpp
emailuis/nmailui/src/nmviewerview.cpp
emailuis/nmailui/src/nmviewerviewnetmanager.cpp
emailuis/nmailui/src/nmviewerviewnetreply.cpp
emailuis/nmailui/src/nmviewerwebview.cpp
emailuis/nmailui/translations/mail.qm
emailuis/nmailui/translations/mail.ts
emailuis/nmailuiengine/bwins/nmailuiengineu.def
emailuis/nmailuiengine/eabi/nmailuiengineu.def
emailuis/nmailuiengine/inc/nmdataplugininterface.h
emailuis/nmailuiengine/inc/nmuiengine.h
emailuis/nmailuiengine/src/nmuiengine.cpp
emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def
emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def
emailuis/nmailuiwidgets/inc/nmeditortextedit.h
emailuis/nmailuiwidgets/inc/nmhtmllineedit.h
emailuis/nmailuiwidgets/inc/nmrecipientlineedit.h
emailuis/nmailuiwidgets/nmailuiwidgets.qrc
emailuis/nmailuiwidgets/src/nmattachmentlistwidget.cpp
emailuis/nmailuiwidgets/src/nmeditortextedit.cpp
emailuis/nmailuiwidgets/src/nmhtmllineedit.cpp
emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp
emailuis/nmframeworkadapter/inc/nmframeworkadapter.h
emailuis/nmframeworkadapter/inc/nmframeworkadapterheaders.h
emailuis/nmframeworkadapter/inc/nmfwadeletemailboxoperation.h
emailuis/nmframeworkadapter/nmframeworkadapter.pro
emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp
emailuis/nmframeworkadapter/src/nmfwadeletemailboxoperation.cpp
emailuis/nmframeworkadapter/src/nmfwaremovedraftmessageoperation.cpp
emailuis/nmhswidget/conf/nmhswidget.docml
emailuis/nmhswidget/conf/nmhswidgetmail.docml
emailuis/nmhswidget/conf/nmhswidgettitle.docml
emailuis/nmhswidget/inc/nmhswidget.h
emailuis/nmhswidget/inc/nmhswidgetconsts.h
emailuis/nmhswidget/inc/nmhswidgetemailengine.h
emailuis/nmhswidget/inc/nmhswidgetemailrow.h
emailuis/nmhswidget/inc/nmhswidgettitlerow.h
emailuis/nmhswidget/nmhswidget.qrc
emailuis/nmhswidget/src/nmhswidget.cpp
emailuis/nmhswidget/src/nmhswidgetdatetimeobserver_p.cpp
emailuis/nmhswidget/src/nmhswidgetemailengine.cpp
emailuis/nmhswidget/src/nmhswidgetemailrow.cpp
emailuis/nmhswidget/src/nmhswidgettitlerow.cpp
emailuis/nmhswidget/translations/mailwidget.ts
emailuis/nmindicatorplugin/src/nmsendingindicator.cpp
emailuis/nmindicatorplugin/src/nmsyncindicator.cpp
emailuis/nmsettingui/inc/nmmailboxsettingview.h
emailuis/nmsettingui/src/nmmailboxsettingsmanager.cpp
emailuis/nmsettingui/src/nmmailboxsettingview.cpp
emailuis/nmsettingui/src/nmsettingsviewfactory.cpp
inc/emailshutdownconst.h
inc/emailshutdownconst.hrh
ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp
ipsservices/ipssosaoplugin/src/IpsSosAOPopAgent.cpp
ipsservices/ipssosplugin/inc/ipsplgcommon.h
ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h
ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp
ipsservices/ipssosplugin/src/ipsplgimap4plugin.cpp
ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp
ipsservices/ipssosplugin/src/ipsplgpop3plugin.cpp
ipsservices/nmipssettings/inc/nmipssettingshelper.h
ipsservices/nmipssettings/src/nmipssettingshelper.cpp
ipsservices/nmipssettings/src/nmipssettingsplugin.cpp
ipsservices/nmipssettings/translations/mailips.qm
ipsservices/nmipssettings/translations/mailips.ts
nmail.pro
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/email_client_api.metaxml	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<api id="df8c92b67351daff85c808d60deaccd2" dataversion="2.0">
+  <name>email client api</name>
+  <description>Email client api allows listing and accessing mailboxes and  email messages. Messages can be created, replied, forwared and searched. Specific mailbox can be launched in the Email application.</description>
+  <type>c++</type>
+  <collection>email_plat</collection>
+  <libs/>
+  <release category="platform" sinceversion="5.0"/>
+  <attributes>
+    <htmldocprovided>no</htmldocprovided>
+    <adaptation>no</adaptation>
+  </attributes>
+</api>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/email_client_api.pri	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,35 @@
+#
+# 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:
+#
+#
+symbian*: {
+    # Build.inf rules
+    BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+            "email_client_api/emailinterfacefactory.h       APP_LAYER_PLATFORM_EXPORT_PATH(emailinterfacefactory.h)" \
+            "email_client_api/emailinterfacefactory.inl     APP_LAYER_PLATFORM_EXPORT_PATH(emailinterfacefactory.inl)" \
+            "email_client_api/emailclientapi.hrh            APP_LAYER_PLATFORM_EXPORT_PATH(emailclientapi.hrh)" \
+            "email_client_api/emailapidefs.h                APP_LAYER_PLATFORM_EXPORT_PATH(emailapidefs.h)" \
+            "email_client_api/emailsorting.h                APP_LAYER_PLATFORM_EXPORT_PATH(emailsorting.h)" \
+            "email_client_api/mmessageiterator.h            APP_LAYER_PLATFORM_EXPORT_PATH(mmessageiterator.h)" \
+            "email_client_api/memailclientapi.h             APP_LAYER_PLATFORM_EXPORT_PATH(memailclientapi.h)" \
+            "email_client_api/memailmailbox.h               APP_LAYER_PLATFORM_EXPORT_PATH(memailmailbox.h)" \
+            "email_client_api/memailmessage.h               APP_LAYER_PLATFORM_EXPORT_PATH(memailmessage.h)" \
+            "email_client_api/memailfolder.h                APP_LAYER_PLATFORM_EXPORT_PATH(memailfolder.h)" \
+            "email_client_api/memailaddress.h               APP_LAYER_PLATFORM_EXPORT_PATH(memailaddress.h)" \
+            "email_client_api/memailcontent.h               APP_LAYER_PLATFORM_EXPORT_PATH(memailcontent.h)" \
+            "email_client_api/memailmessagesearch.h         APP_LAYER_PLATFORM_EXPORT_PATH(memailmessagesearch.h)" \
+            "email_client_api/mmailboxsyncobserver.h        APP_LAYER_PLATFORM_EXPORT_PATH(mmailboxsyncobserver.h)" \
+            "email_client_api/mmailboxcontentobserver.h     APP_LAYER_PLATFORM_EXPORT_PATH(mmailboxcontentobserver.h)"
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/emailapidefs.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,158 @@
+/*
+* 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: Email Client API definitions
+*
+*/
+
+#ifndef __EMAILAPIDEFS
+#define __EMAILAPIDEFS
+
+#include <e32base.h>
+#include <f32file.h>
+
+namespace EmailInterface {
+
+/**
+* Id for message, message part, folder and mailbox entries
+*/
+typedef TUint TEntryId;
+
+/**
+* Interface id. Each implementation of MEmailInterface has unique id value.
+*/
+typedef TInt TEmailTypeId;
+
+const TEntryId KUndefinedEntryId = 0;
+
+/**
+ * base interface for all email interfaces available to clients
+ * @since S60 v5.0
+ */
+class MEmailInterface
+{
+public:
+    /** returns interface id (kind of RTTI) */
+    virtual TEmailTypeId InterfaceId() const = 0;
+
+    /** frees memory allocated by interface impl. */    
+    virtual void Release() = 0;
+};
+
+/**
+ * Defines abstraction for entry ID. Used by message, folder, mailbox etc types.
+ * @since S60 v5.0
+ */
+class TBaseId
+{
+public:
+    inline TBaseId() : iId( KUndefinedEntryId ){}
+    inline TBaseId( TEntryId aId ) : iId( aId ){}
+    
+    TEntryId   iId;
+};
+
+/**
+ * Defines mailbox ID
+ * @since S60 v5.0
+ */
+class TMailboxId : public TBaseId  
+{
+public:
+    inline TMailboxId() : 
+        TBaseId(){}
+    inline TMailboxId( TEntryId aId ) : TBaseId( aId ){}
+    inline TBool operator==( const TMailboxId& aMailboxId ) const {
+        return ( aMailboxId.iId == iId ); }
+};
+
+/**
+ * Defines folder ID which is associated with a mailbox
+ * @since S60 v5.0
+ */
+class TFolderId : public TBaseId
+{
+public:
+    // parent mailbox
+    TMailboxId iMailboxId;
+    inline TFolderId( TEntryId aId, const TMailboxId& aMailboxId ) : 
+        TBaseId( aId ),iMailboxId( aMailboxId.iId ){}
+        
+    inline TFolderId() : TBaseId(), iMailboxId() {}
+    
+    inline TBool operator==( const TFolderId& aFolderId ) const {
+        return ( iMailboxId.iId == aFolderId.iMailboxId.iId &&
+        iId == aFolderId.iId ); }
+        
+    inline TBool operator!=( const TFolderId& aFolderId ) const {
+        return !( aFolderId == *this ); }
+};
+
+/**
+ * Defines email message ID which is associated with a mailbox and folder
+ * @since S60 v5.0
+ */
+class TMessageId : public TBaseId
+{
+public:
+    inline TMessageId() : TBaseId(), iFolderId(){}
+    
+    inline TMessageId( TEntryId aMsgId, TEntryId aFolderId, TMailboxId aMailboxId ) : 
+    TBaseId( aMsgId ), iFolderId( aFolderId, aMailboxId ){}
+
+    inline TBool operator==( const TMessageId& aMessageId ) const {
+        return ( iFolderId == aMessageId.iFolderId &&
+        iId == aMessageId.iId ); }
+        
+    inline TBool operator!=( const TMessageId& aMessageId ) const {
+        return !( aMessageId == *this ); }
+    
+    /**
+    * parent folder id.
+    */
+    TFolderId iFolderId;
+};
+
+
+/**
+ * Message content (part) id
+ * @since S60 v5.0
+ */
+class TMessageContentId : public TBaseId
+{
+public:
+    inline TMessageContentId(): TBaseId(), iMessageId() {}
+    
+    inline TMessageContentId( TEntryId aContentId, TEntryId aMsgId, TEntryId aFolderId, TMailboxId aMailboxId ) : 
+    TBaseId( aContentId ), iMessageId( aMsgId, aFolderId, aMailboxId ){}
+    
+    inline TBool operator==( const TMessageContentId& aContentId ) const {
+        return ( iMessageId == aContentId.iMessageId &&
+        iId == aContentId.iId ); }
+        
+    inline TBool operator!=( const TMessageContentId& aContentId ) const {
+        return !( aContentId == *this ); }
+    
+    // parent message
+    TMessageId iMessageId;
+};
+
+typedef RArray<TMessageId> REmailMessageIdArray;
+
+typedef RArray<TFolderId>  REmailFolderIdArray;
+
+typedef RArray<TMailboxId>     REmailMailboxIdArray;
+
+} // EmailInterface
+
+#endif // __EMAILAPIDEFS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/emailclientapi.hrh	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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: Interface IDs for sub interfaces
+*
+*/
+
+#ifndef __EMAILCLIENTAPI_HRH
+#define __EMAILCLIENTAPI_HRH
+
+// ECom interface UID for email API
+#define KEmailClientFactoryApiUid 0x20022D62
+
+
+// Interface ids (not ECom) for accessing "sub interfaces" via
+// MEmailInterface* CEmailInterfaceFactory::InterfaceL( const TInt aInterfaceId )
+// to be checked if all should be published to clients (some are not
+// meant to be instantiated via factory method but by other means, e.g. 
+// user never instantiates mailbox from scratch but asks it from MEmailClientApi
+
+#define KEmailClientApiInterface 0x20022D63
+#define KEmailIFUidMailbox 0x20022D64
+#define KEmailIFUidMessage 0x20022D65
+#define KEmailIFUidFolder 0x20022D66
+#define KEmailIFUidAddress 0x20022D67
+#define KEmailIFUidMessageContent 0x20022D68
+#define KEmailIFUidSearch 0x20022D69
+#define KEmailIFUidTextContent 0x20022D6B
+#define KEmailIFUidMessageIterator 0x20022D6C
+#define KEmailIFUidMultipart 0x20022D6D
+#define KEmailIFUidAttachment 0x20022D6E
+
+
+#endif // __EMAILCLIENTAPI_HRH
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/emailinterfacefactory.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,119 @@
+/*
+* 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: ECom interface for Email Client API
+*
+*/
+
+
+#ifndef CEMAILINTERFACEFACTORY_H
+#define CEMAILINTERFACEFACTORY_H
+
+#include <e32base.h>
+#include <ecom/ecom.h>
+#include <memailclientapi.h>
+#include <memailcontent.h>
+
+namespace EmailInterface {
+    
+/**
+ * ECom factory class for Email Client API.
+ * @since S60 v5.0
+ * 
+ */
+NONSHARABLE_CLASS( CEmailInterfaceFactory ) : public CBase
+{
+public:       
+        
+    /**
+     * Contructor
+     * @return factory for creating interface instances.
+     */
+    inline static CEmailInterfaceFactory* NewL();
+    
+    /**
+    * destructor
+    */
+    inline ~CEmailInterfaceFactory();
+    
+    /**
+    * Returns email interface pointer by id
+    * @param aInterfaceId interface id, see emailclientapi.hrh for available ids
+    * @return pointer to interface
+    * @exception KErrNotFound if unkown interface id is given
+    *
+    * @code
+    
+     #include <emailinterfacefactory.h>
+    
+     using namespace EmailInterface;
+     
+     CEmailInterfaceFactory* factory = CEmailInterfaceFactory::NewL();
+     CleanupStack::PushL( factory );
+     MEmailInterface* ifPtr = factory->InterfaceL( KEmailClientApiInterface );
+     MEmailClientApi* clientApi = static_cast<MEmailClientApi*>( ifPtr );
+     CleanupReleasePushL( *clientApi );
+     // <do something with clientApi...>
+     CleanupStack::PopAndDestroy( 2 ); // clientApi and factory
+     @endcode
+    * 
+    */
+    virtual EmailInterface::MEmailInterface* InterfaceL(  
+        const TInt aInterfaceId ) = 0;
+
+private:
+    
+        // Unique instance identifier key
+        TUid iDtor_ID_Key;
+};
+
+    
+/**
+ * Cleanup support for pointer arrays with MEmailInterface elements which are 
+ * destroyed with Release() method.
+ * @since S60 v5.0
+   @code
+       using namespace EmailInterface;
+ 
+       RMailboxPtrArray mailboxes; // array of MEmailMailbox pointers
+       // note: PushL can take any pointer array of elements with Release()
+       // method
+       CleanupResetAndRelease<MEmailMailbox>::PushL( mailboxes );
+      // <here some code that might leave>
+       mailClient->GetMailboxesL( mailboxes );
+ 
+       // MEmailMailbox::Release() called for each array element and then
+       // mailboxes.Reset() is called 
+       CleanupStack::PopAndDestroy();  
+   @endcode
+ */
+template<class T>
+NONSHARABLE_CLASS( CleanupResetAndRelease )
+{
+public:
+    /**
+     * Cleanup for elements containing Release() method  
+     */
+    inline static void PushL( RPointerArray<T>& aItem );
+
+    /**
+     * Releases array elements and resets array.
+     */
+    inline static void ResetAndRelease( TAny* aPtr );  
+};
+
+#include "emailinterfacefactory.inl"
+
+} // namespace EmailInterface
+
+#endif // CEMAILINTERFACEFACTORY_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/emailinterfacefactory.inl	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,90 @@
+/*
+* 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:  ECom interface for email interface factory inline implementation
+*
+*/
+
+#include "emailclientapi.hrh"
+
+// LOCAL FUNCTIONS
+
+inline void ResetAndDestroyCleanup( TAny* aAny )
+    {
+    RImplInfoPtrArray* ptrArray = reinterpret_cast<RImplInfoPtrArray*>( aAny );
+    ptrArray->ResetAndDestroy();
+    }
+
+inline void CleanupResetAndDestroyPushL( RImplInfoPtrArray& aArray )
+    {
+    TCleanupItem item( &ResetAndDestroyCleanup, &aArray );
+    CleanupStack::PushL( item );
+    }
+
+// ============================= MEMBER FUNCTIONS =============================
+
+// ----------------------------------------------------------------------------
+// CEmailInterfaceFactory::NewL
+// Two-phased constructor
+// ----------------------------------------------------------------------------
+//
+inline CEmailInterfaceFactory* CEmailInterfaceFactory::NewL( )
+    {
+    // Find implementation for our interface.
+    RImplInfoPtrArray implArray;
+    EmailInterface::CleanupResetAndDestroyPushL( implArray );
+    const TUid ifUid = {KEmailClientFactoryApiUid};
+    REComSession::ListImplementationsL(
+                            ifUid,
+                            implArray );
+    // there should be only one impl so take first
+    TAny* interface = NULL;
+    if ( implArray.Count() )
+        {
+        const TUid uid = implArray[0]->ImplementationUid();        
+        interface = REComSession::CreateImplementationL( 
+            uid, _FOFF( CEmailInterfaceFactory, iDtor_ID_Key ) );
+        }
+    CleanupStack::PopAndDestroy(); // implArray
+        
+    return reinterpret_cast<CEmailInterfaceFactory*>( interface );
+    }
+
+// ----------------------------------------------------------------------------
+// CEmailInterfaceFactory::~CEmailInterfaceFactory
+// Destructor
+// ----------------------------------------------------------------------------
+//
+inline CEmailInterfaceFactory::~CEmailInterfaceFactory()
+    {
+    REComSession::DestroyedImplementation( iDtor_ID_Key );
+    }
+
+template<class T>
+inline void CleanupResetAndRelease<T>::PushL( RPointerArray<T>& aItem ) { 
+     TCleanupItem item( &CleanupResetAndRelease<T>::ResetAndRelease, &aItem );
+     CleanupStack::PushL( item );
+ }
+template<class T>
+inline void CleanupResetAndRelease<T>::ResetAndRelease( TAny* aPtr )
+     {
+     RPointerArray<T>* array = reinterpret_cast<RPointerArray<T>* >( aPtr );
+     for ( TInt i = 0; i < array->Count(); i++ )
+         {
+         T* item = (*array)[i];
+         item->Release();
+         }
+     array->Reset();
+     }
+
+// End Of File
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/emailsorting.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* 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: Email Client sort criteria definition
+*
+*/
+
+#ifndef EMAILSORTING
+#define EMAILSORTING
+
+#include <e32base.h>
+
+namespace EmailInterface {
+
+/**
+* Sort criteria used in searching messages with MEmailMessageSearchAsync 
+* declared in memailmessagesearch.h.
+*/
+class TEmailSortCriteria
+{
+public:
+    /**
+    * Fields for sort criteria
+    */
+    enum TSortField {
+        EDontCare,
+        EByDate,
+        EBySender,
+        EByRecipient,
+        EBySubject,
+        EByPriority,
+        EByFlagStatus,
+        EByUnread,
+        EBySize,
+        EByAttachment,
+    };
+    
+    // is ascending sort order
+    TBool iAscending;
+    
+    // sort by field
+    TSortField iField; 
+
+    inline TEmailSortCriteria() : iAscending( ETrue ), iField( EDontCare ) {}
+};
+
+typedef RArray<TEmailSortCriteria> RSortCriteriaArray;
+
+} // EmailInterface
+
+#endif // EMAILSORTING
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/memailaddress.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,91 @@
+/*
+* 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: Email address in Email Client API
+*
+*/
+
+#ifndef MEMAILADDRESS_H
+#define MEMAILADDRESS_H
+
+#include <emailapidefs.h>
+
+namespace EmailInterface {
+
+/**
+ * Email address that is used as recipient or sender in MEmailMessage and
+ * mailbox address in MEmailMailbox.
+ * @since S60 v5.0
+ */
+class MEmailAddress : public MEmailInterface
+{ 
+public:
+    /**
+     * Association role of the address in message/mailbox.
+     */
+    enum TRole { 
+        // role is undefined
+        EUndefined, 
+        // reply-to address in a message
+        EReplyTo, 
+        // sender of a message
+        ESender, 
+        // to-recipient of a message
+        ETo, 
+        // cc-recipient of a message
+        ECc, 
+        // bcc-recipient of a message
+        EBcc };
+    
+    /**
+     * Sets email address
+     * @param email address 
+     */
+    virtual void SetAddressL( const TDesC& aAddress ) = 0;
+    
+    /**
+     * Returns email address
+     * @return email address
+     */
+    virtual TPtrC Address() const = 0;
+    
+    /**
+     * Sets display name for the address
+     * @param display name
+     */
+    virtual void SetDisplayNameL( const TDesC& aDisplayName ) = 0;
+    
+    /**
+     * Returns display name for the address
+     * @return display name
+     */
+    virtual TPtrC DisplayName() const = 0;
+    
+    /**
+     * Returns role associated with the address
+     * @return role
+     */
+    virtual TRole Role() const = 0;
+    
+    /**
+     * Sets role
+     * @param role
+     */
+    virtual void SetRole( const TRole aRole ) = 0;
+};
+
+typedef RPointerArray<MEmailAddress>    REmailAddressArray;
+
+} // namespace EmailInterface {
+
+#endif // MEMAILADDRESS_H
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/memailclientapi.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* 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: ECom interface for Email Client API
+*
+*/
+
+
+#ifndef MEMAILCLIENTAPI_H
+#define MEMAILCLIENTAPI_H
+
+#include <emailapidefs.h>
+
+namespace EmailInterface {
+
+class MEmailMailbox;
+
+
+typedef RPointerArray<MEmailMailbox> RMailboxPtrArray;
+
+/**
+ * Email client main interface for accessing mailboxes and launching
+ * email editor and viewer.
+ * Use CEmailInterfaceFactory::InterfaceL( KEmailClientApiInterface )
+ * to get instance. Use Release() (from MEmailInterface) when the instance 
+ * is no more needed.
+ * 
+ */
+class MEmailClientApi : public MEmailInterface
+{
+public:
+    
+    /** returns mailbox by id, ownership transferred */
+    virtual MEmailMailbox* MailboxL( const TMailboxId& aId ) = 0;
+    
+    /** 
+     * Conveninence method for accessing mailbox by own addresss.
+     */
+    virtual MEmailMailbox* MailboxL( const TPtrC& aAddress ) = 0;
+        
+    /**
+    * Gets all mailboxes in pointer array. It is recommended to free other
+    * mailboxes besides needed one to optimise memory usage.
+    */    
+    virtual TInt GetMailboxesL( RMailboxPtrArray& aMailboxes ) = 0;
+
+    /**
+    * Launch policy defines behavior when launching email application
+    */
+    enum TLaunchPolicy {
+        // Launch email application as from menu application by the user
+        EDefault,
+        // Shows inbox with unseen messages. If there are no unseen messages
+        // behavior is same as EDefault. This one is not currently supported.
+        EShowLastUnseenMailbox
+    };
+    /**
+     * Launches Email application with defined launch behavior
+     * The method follows "fire and forget" pattern, returns immediately.
+     * @param aPolicy defines behavior for app launch
+     */
+    virtual void LaunchEmailL( const TLaunchPolicy aPolicy ) = 0;
+
+};
+
+}  // namespace EmailInterface
+
+#endif // MEMAILCLIENTAPI_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/memailcontent.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,289 @@
+/*
+* 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: ECom interface for Email Client API
+*
+*/
+
+#ifndef MEMAILCONTENT_H
+#define MEMAILCONTENT_H
+
+#include <emailapidefs.h>
+
+namespace EmailInterface {
+
+_LIT( KContentTypeTextPlain, "text/plain" );
+_LIT( KContentTypeTextHtml, "text/html" );
+
+class MEmailOperationObserver;
+class MEmailAttachment;
+class MEmailMultipart;
+class MEmailTextContent;
+class MEmailMessageContent;
+
+/**
+* Callback interface used for content fetching asynchronously.
+* Object deriving this interface is passed to MEmailMessageContent::FetchL
+* @since S60 v5.0
+*/
+class MEmailFetchObserver
+{
+public:
+    /** Content fetched
+    * @param operation result 
+    */
+    virtual void DataFetchedL( const TInt aResult ) = 0;
+};
+
+typedef RPointerArray<MEmailMessageContent> REmailContentArray;
+
+/**
+* Base interface for mime message parts.
+* @since S60 v5.0
+*/
+class MEmailMessageContent : public MEmailInterface
+{
+public:
+    /** numeric identifier of message content */
+    virtual TMessageContentId Id() const = 0;
+
+// fields as per RFC 2045
+    /**
+     * return sContent-Type field value
+     */
+    virtual TPtrC ContentType() const = 0;
+
+    /**
+     * sets value of Content-Type field
+     * @param content type
+     */
+    virtual void SetContentType( const TDesC& aContentType ) = 0;
+
+    /**
+    /* Returns Content-ID field value.
+     * @return content id
+     */
+    virtual TPtrC ContentId() const = 0;
+
+    /**
+     * Sets value of Content-ID field
+     * @param content id
+     */
+    virtual void SetContentId( const TDesC& aContentId ) = 0;
+
+    /**
+     * Returns value of content-description field
+     * @return content description 
+     */
+    virtual TPtrC ContentDescription() const = 0;
+
+    /**
+     * Sets value of content description field
+     * @param content description 
+     */
+    virtual void SetContentDescription( const TDesC& aContentDescription ) = 0;
+
+    /**
+     * Returns value of content disposition field
+     * @return content disposition
+     */
+    virtual TPtrC ContentDisposition() const = 0;
+
+    /**
+     * Sets value of content-disposition field
+     * @param content disposition
+     */
+    virtual void SetContentDisposition( const TDesC& aContentDisposition ) = 0;
+
+// end of standard  RFC 2045 fields
+
+    /**
+     * returns Content-class field value (non-standard)
+     */
+    virtual TPtrC ContentClass() const = 0;
+
+    /**
+     * Sets value of Content-class field (non-standard)
+     * @param content class
+     */
+    virtual void SetContentClass( const TDesC& aContentClass ) = 0;
+
+    /**
+     * Available (=fetched) size accessor. If this is less than value from
+     * TotalSize(), Fetch() should be used to retrieve more data from
+     * remote mail server.
+     * @return fetched size of the data.
+     */
+    virtual TInt AvailableSize() const = 0;
+
+    /**
+     * Total size accessor
+     * @return total size of message text.
+     */
+    virtual TInt TotalSize( ) const = 0;
+
+    /**
+     * Returns pointer descriptor to content data
+     */
+    virtual TPtrC ContentL() const = 0;
+
+    /**
+     * Sets content data.
+     */
+    virtual void SetContentL( const TDesC& aContent ) = 0;
+
+    /**
+     * Starts fetching rest of content asynchronously.
+     *
+     * If available size after fetch is smaller than total size, next chunk can
+     * be fetched with new invocatin of Fetch method.
+     *
+     * Calling Release() implicitly cancels fetching.
+     * @param aObserver called when when fetch completes.
+     * @exception KErrInUse if fetch is ongoing
+     */
+    virtual void FetchL( MEmailFetchObserver& aObserver ) = 0;
+
+    /**
+     * Cancels fetch operation, observer is not called
+     */
+    virtual void CancelFetch() = 0;
+
+    /**
+     * Stores message content to a file
+     */
+    virtual void SaveToFileL( const TDesC& aPath ) = 0;
+
+    /**
+     * Typesafe multipart accessor for obtaining MEmailMultipart pointer
+     * to this object.
+     * @param content as multipart or NULL if content is not multipart
+     */
+    virtual MEmailMultipart* AsMultipartOrNull() const = 0;
+
+    /**
+     * Typesafe text content accessor for obtaining MEmailTextContent pointer
+     * to this object.
+     * @param content as text content or NULL if content is not text
+     */
+    virtual MEmailTextContent* AsTextContentOrNull() const = 0;
+
+    /**
+     * Typesafe attachment content accessor for obtaining MEmailAttachment pointer
+     * to this object.
+     * @param content as attachment content or NULL if content is not an attachment
+     */
+    virtual MEmailAttachment* AsAttachmentOrNull() const = 0;
+};
+
+/**
+* Convenience abstraction for manipulating plain or html text content. Use
+* CEmailInterfaceFactory::InterfaceL( KEmailIFUidTextContent ) to make new
+* instance of this interface.
+* @since S60 v5.0
+*/
+class MEmailTextContent : public MEmailMessageContent
+{
+public:
+    /**
+     * Text (content) type 
+     */
+    enum TTextType {
+        EPlainText, // text/plain
+        EHtmlText   // text/html
+    };
+
+    /**
+    * Tells if content has specified type of text.
+    */
+    virtual TTextType TextType() const = 0;
+
+    /**
+    * Sets (replaces) text to message content. Possible old content is
+    * deleted. Content type is set to "text/plain" or "text/html" based on
+    * specified text type.
+    * @param aPlainOrHtml sub-type of the text
+    * @param aText content of the message part
+    */
+    virtual void SetTextL(
+        const TTextType aPlainOrHtml,
+        const TDesC& aText ) = 0;
+};
+
+/**
+* Message part with multiple sub parts. If MEmailMessage::ContentL returns
+* content with type "multipart/*" (where '*' is a character sequence) it can
+* safely be casted to MEmailMultipart
+* @since S60 v5.0
+*/
+class MEmailMultipart : public MEmailMessageContent
+{
+public:
+    /**
+    * Returns number of child parts
+    */
+    virtual TInt PartCountL() = 0;
+
+    /**
+    * Returns a child part, ownership is transferred.
+    * @param aIndex part to return, leaves KErrArgument if out of bounds
+    */
+    virtual MEmailMessageContent* PartByIndexL( const TUint aIndex ) const = 0;
+
+    /**
+    * Deletes part by index.
+    * @param aIndex part to delete, leaves KErrArgument if out of bounds
+    */
+    virtual void DeletePartL( const TUint aIndex ) = 0;
+
+    /**
+    * Adds message part, ownership is transferred.
+    * @param aPart any object derived from MEmailMessageContent
+    * @param aPos position among child parts
+    */
+    virtual void AddPartL(
+        const MEmailMessageContent& aPart,
+        const TUint aPos ) = 0;
+};
+
+typedef RPointerArray<MEmailAttachment> REmailAttachmentArray;
+
+/**
+* Email attachment interface
+* Attachment is created with MEmailMessage::AddAttachmentL()
+* @since S60 v5.0
+*/
+class MEmailAttachment : public MEmailMessageContent
+{
+public:
+      /**
+      * Returns file handle of this attachment. If the attachment is
+      * not associated with a file, null file handle is returned.
+      */
+      virtual RFile FileL() const = 0;
+
+      /**
+      * Sets file name field
+      */
+      virtual void SetFileNameL( const TDesC& aFileName ) = 0;
+
+      /**
+      * Returns file name or null pointer descriptor if attachment
+      * is not associated with any file
+      */
+      virtual TPtrC FileNameL() const = 0;
+};
+
+} // namespace EmailInterface
+
+#endif // MEMAILCONTENT_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/memailfolder.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,107 @@
+/*
+* 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: Email message API
+*
+*/
+
+#ifndef _M_EMAILFOLDER
+#define _M_EMAILFOLDER
+
+#include <emailapidefs.h>
+#include <emailsorting.h>
+
+namespace EmailInterface {
+
+class MEmailFolder;
+class MMessageIterator;
+
+typedef  RPointerArray<MEmailFolder> RFolderArray;
+
+/**
+* folder types
+*/
+enum TFolderType
+    {
+    EInbox,
+    EOutbox,
+    EDrafts,
+    EDeleted,
+    ESent,
+    EOther
+    };
+
+/**
+* Email folder interface 
+* This is used for accessing folder information and included messages.
+* Operations affecting folder itself are not provided.
+*
+* Use case: for accessing messages in specific folder use MEmailMessageQuery
+* and set folder id with MEmailMessageQuery::SetFolderIdL()
+*
+* @since S60 v5.0
+*/
+class MEmailFolder : public MEmailInterface
+{
+public:
+    /**
+    * Returns folder id.
+    * @return folder type
+    */
+    virtual TFolderId FolderId() const = 0;
+    
+    /**
+    * Returns parent folder id.
+    * @return parent folder id
+    */
+    virtual TFolderId ParentFolderId() const = 0;
+    
+    /**
+    * Returns folder type.
+    * @return folder type
+    */
+    virtual TFolderType FolderType() const = 0;    
+
+    /**
+    * Returns folder name.
+    * @return folder name pointer descriptor
+    */
+    virtual TPtrC Name() const = 0;
+
+    /**
+    * Returns direct children of this folder, i.e. this is not recursive.
+    * @return number of subfolders or an error code
+    */    
+    virtual TInt GetSubfoldersL( 
+        RFolderArray& aSubfolders ) const = 0;
+
+    /**
+    * Returns message iterator for iterating messages in the folder
+    * @param aSortCriteria sort criteria
+    * @return message iterator
+    */
+    virtual EmailInterface::MMessageIterator* MessagesL( 
+        const RSortCriteriaArray& aCriteria ) = 0;
+    
+    /**
+    * Deletes messages in this folder
+    * @param aMessageIds messages to delete. This method is no-op if
+    * array is empty. It is expected that messages in the array are
+    * located in same folder or KErrArgument exception is raised.
+    */
+    virtual void DeleteMessagesL( const REmailMessageIdArray& aMessageIds ) = 0;
+};
+
+} // namespace EmailInterface
+
+#endif // _M_EMAILFOLDER
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/memailmailbox.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,159 @@
+/*
+* 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: Email message API
+*
+*/
+
+#ifndef MEMAILMAILBOX_H
+#define MEMAILMAILBOX_H
+
+#include <memailfolder.h>
+
+namespace EmailInterface {
+
+class MEmailAddress;
+class MEmailMessage;
+class MMailboxContentObserver;
+class MEmailMessageSearchAsync;
+class MMailboxSyncObserver;
+
+/**
+* Email mailbox interface.
+* MEmailMailbox cannot be instantiated with factory method. Use
+* MEmailClientApi::MailboxL to obtain a configured mailbox.
+* @since S60 v5.0
+*/
+class MEmailMailbox : public MEmailInterface
+{
+public:
+    /**
+    * Returns mailbox identifier
+    * @return mailbox id
+    */
+    virtual TMailboxId MailboxId() const = 0;
+
+    /**
+    * Returns own address of the mailbox. Role is set to ESender
+    * @return address, ownership not transferred
+    */
+    virtual MEmailAddress* AddressL() const = 0;
+
+    /**
+    * Returns mailbox name
+    * @return mailbox name
+    */
+    virtual TPtrC MailboxName() const = 0;
+
+    /** returns root level folders of this mailbox, to get subfolders of specific
+     * folder, use MEmailFolder::GetSubfolders
+     * @param aFolders pointer array of folders, ownership of folders is
+     * transferred
+     * @return number of folders in aFolders or Symbian OS error code
+     */
+    virtual TInt GetFoldersL( RFolderArray& aFolders ) const = 0;
+
+    /**
+    * Returns folder by folder id
+    * @param folder id
+    * @return pointer to folder, ownership is transferred
+    */
+    virtual MEmailFolder* FolderL( const TFolderId& aFolderId ) const = 0;
+
+    /**
+    * Returns folder by type
+    * @param type other than EOther because it is ambiguous
+    * @return pointer to folder, ownership is transferred
+    * @exception KErrNotFound if folder of requested type is not found
+    */
+    virtual MEmailFolder* FolderByTypeL(
+        const TFolderType aFolderType ) const = 0;
+
+    /**
+    * Returns existing message in this mailbox.
+    * @param aMessageId a message id returned by GetMessagesIdsL()
+    * @return new message object, ownership transferred.
+    * @exception
+    */
+    virtual MEmailMessage* MessageL( const TMessageId& aMessageId ) = 0;
+
+    /**
+     * Creates new message in 'drafts' folder. Ownership is transferred
+     * @return new draft message
+     */
+    virtual MEmailMessage* CreateDraftMessageL() const = 0;
+
+    /**
+     * Creates reply message. Ownership is transferred
+     * @param aMessageId original message
+     * @param aReplyToAll If ETrue, all recipients of the original message are
+     *        added to reply message.
+     * @return new draft message
+     */
+    virtual MEmailMessage* CreateReplyMessageL(
+        const TMessageId& aMessageId,
+        const TBool aReplyToAll = ETrue ) const = 0;
+
+    /**
+     * Creates forward message. Ownership is transferred
+     * @param aMessageId original message
+     * @return new draft message
+     */
+    virtual MEmailMessage* CreateForwardMessageL(
+        const TMessageId& aMessageId ) const = 0;
+
+    /**
+     * Starts synchronising this mailbox
+     * @param aObserver observer called back when sync is complete
+     */
+    virtual void SynchroniseL( MMailboxSyncObserver& aObserver ) = 0;
+
+    /**
+     * Cancels mailbox synchronisation.
+     */
+    virtual void CancelSynchronise() = 0;
+
+    /**
+    * Returns interface for searching messages from this mailbox. Ownership
+    * is transferred.
+    * @return message search interface pointer
+    */
+    virtual MEmailMessageSearchAsync* MessageSearchL() = 0;
+
+    /**
+     * Launches Email application and shows inbox.
+     * The method follows "fire and forget" pattern, returns immediately.
+     */
+    virtual void ShowInboxL() = 0;
+
+    /** Launches email editor and returns immediately.
+     * The method follows "fire and forget" pattern, returns immediately.
+     */
+    virtual void EditNewMessageL() = 0;
+    
+    /** Register mailbox observer 
+     * @param aObserver observer called back when changes in mailbox (new message,
+     * messages changes or messages deleted).
+     * */
+    virtual void RegisterObserverL( MMailboxContentObserver& aObserver ) = 0;
+        
+    /** 
+     * Unregister mailbox observe.r 
+     */
+    virtual void UnregisterObserver( MMailboxContentObserver& aObserver ) = 0;
+
+};
+
+} // namespace EmailInterface
+
+#endif // MEMAILMAILBOX_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/memailmessage.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,262 @@
+/*
+* 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: Email message API
+*
+*/
+
+#ifndef MEMAILMESSAGE_H
+#define MEMAILMESSAGE_H
+
+#include <emailapidefs.h>
+#include <memailaddress.h>
+#include <memailcontent.h>
+
+namespace EmailInterface {
+
+class MEmailMessageContent;
+class MEmailAttachment;
+
+/** message flags */  
+enum TMsgFlag
+    {
+    EFlag_Read = 1,                 // Message is read (or "seen") on the server
+    EFlag_Read_Locally = 2,         // Message is read on the client
+    EFlag_Low = 4,                  // Message has low priority
+    EFlag_Important = 8,            // Message has high priority
+    EFlag_FollowUpComplete = 16,    // The message follow-up is complete
+    EFlag_FollowUp = 32,            // Message is flagged (a flag is showing next to msg in Outlook)
+    EFlag_Attachments = 64,         // Message has attachments
+    EFlag_Multiple = 128,           // Message has more than one recipient
+    EFlag_CalendarMsg = 256,        // Message is a calendar message
+    EFlag_Answered = 512,           // The message was replied to
+    EFlag_Forwarded = 1024,         // The message was forwarded
+    EFlag_OnlyToMe = 2048,          // The message was sent only to this user
+    EFlag_RemoteDeleted = 4096,     // The message has been deleted on the server
+    EFlag_HasMsgSender = 8192,      // The message has one or more senders 
+    };
+/**
+ * MEmailMessage is email message abstraction
+ * @since S60 v5.0
+   @code
+     Create and send a message with attachment:
+ 
+     using namespace EmailInterface;
+     CEmailInterfaceFactory* factory = CEmailInterfaceFactory::NewL();
+     CleanupStack::PushL( factory );
+     MEmailClientApi* emailAPI = factory->InterfaceL( KEmailTypeClientAPI );
+     CleanupReleasePushL( *emailAPI );
+     RMailboxPtrArray mailboxes;
+     // Cleanup for array containing mailbox pointers, 
+     // calls MEmailMailbox::Release() on cleanup.
+     CleanupResetAndRelease<MEmailMailbox>::PushL( mailboxes );
+     if ( emailAPI->GetMailboxesL( mailboxes ) > 0 ) // at least one found
+         {
+         MEmailMailbox* mailbox = mailboxes[0];
+         MEmailMessage* message = mailbox->CreateDraftMessageL();
+         CleanupReleasePushL( *message );
+         message->SetPlainTextBodyL( _L("So say we all!") );
+         message->AddAttachmentL( _L( "BSG.png" ) ); 
+         message->SendL();
+         CleanupStack::PopAndDestroy(); // message
+         }    
+    CleanupStack::PopAndDestroy( 3 ); // mailboxes, emailAPI, factory
+  @endcode
+  *
+  */
+class MEmailMessage : public MEmailInterface
+{
+public:
+    /**
+     * Returns message id
+     * @return message id
+     */
+    virtual const TMessageId& MessageId() const = 0;
+ 
+    /** 
+     * Returns sender address, ownership is not transferred
+     * Setting role to MEmailAddress::EUndefined marks sender field "undefined"
+     */
+    virtual MEmailAddress* SenderAddressL() const = 0;        
+        
+    /**
+     * Returns reply-to address (NULL for newly created draft message).
+     * Ownership is not transferred. Setting role to MEmailAddress::EUndefined 
+     * marks reply-to field "undefined".
+     */    
+    virtual MEmailAddress* ReplyToAddressL() const = 0;
+    
+    /**
+     * Sets reply-to address, note that role of the address is ignored.
+     * Ownership is not transferred.
+     */
+    virtual void SetReplyToAddressL( const MEmailAddress& aSender ) = 0;       
+        
+    /**
+     * Returns recipients. Ownership is transferred.
+     * @param aRole, if EUndefined - returns to,cc and bcc recipients in that order
+     * @return number of recipients returned in array
+     * @exception returns KErrArgument if aRole is EReplyTo or ESender
+     */    
+    virtual TInt GetRecipientsL( const MEmailAddress::TRole aRole,
+        REmailAddressArray& aRecipients ) const = 0;
+    
+    /**
+     * Sets and replaces recipients of specific type.
+     * @param aRole to, cc or bcc, for other types leave KErrArgument
+     * @return recipient added to this message. Ownership is not transferred.
+     */
+    virtual void SetRecipientsL( const MEmailAddress::TRole aRole, REmailAddressArray& aRecipients ) = 0;    
+    
+    /** removes recipient from the message
+     * @param aRecipient that has been obtained by GetRecipients().
+     * Comparison of recipients and aRecipient is done based on 
+     * MEmailAddress::Address() and MEmailAddress::Role().
+     * @exception KErrNotFound if aRecipient doesn't match with existing 
+     * recipients.
+     */
+    virtual void RemoveRecipientL( const MEmailAddress& aRecipient ) = 0;
+    
+    /**
+     * Returns subject
+     * @return subject of the message
+     */
+    virtual TPtrC Subject() const = 0;
+
+    /**
+     * Sets subject
+     * @param subject of the message 
+     */
+    virtual void  SetSubjectL( const TPtrC& aSubject) = 0;    
+    
+    /**
+     * Returns date and time of the message.
+     * @return message date/time 
+     */
+    virtual TTime Date() const = 0;
+
+    /**
+     * Returns message flags
+     * @return message flags
+     */
+    virtual TInt Flags() const = 0;
+    
+    /**
+     * Sets a message flag
+     * @param flag to set
+     */
+    virtual void SetFlag( const TUint aFlag ) = 0;
+    
+    /**
+     * Resets a message flag to zero
+     * @param flag to reset
+     */
+    virtual void ResetFlag( const TUint aFlag ) = 0;
+
+// content
+    /**      
+     * Returns message body
+     * Returns pointer to message content, ownership not transferred.
+     * Actual type is MEmailTextContent, or MEmailMultipart (see memailcontent.h)
+     * @return content of the message or NULL if content has not been set
+     */    
+    virtual MEmailMessageContent* ContentL() const = 0;
+
+    /**
+     * Sets content to this message. First create content object, e.g.
+     * CEmailInterfaceFactory::InterfaceL( KEmailIFUidTextContent ), i.e. text/plain
+     * @param aContent content to set in the message, ownership is transferred.
+     * possible old content is destroyed if setting new content succeeds.
+     */    
+    virtual void SetContentL( const MEmailMessageContent* aContent ) = 0;
+    
+    /**
+     * Convenience method for setting plain text as message body.
+     * @param aPlainText text/plain content of message body. Old content
+     * is destroyed.
+     */
+    virtual void SetPlainTextBodyL( const TDesC& aPlainText ) = 0;
+
+    /**
+     * Adds attachment to message. This may affect previously set content, e.g.
+     * if SetContentL with MEmailTextContent argument was called, a new multipart
+     * content is created with MEmailTextContent and attachment as child parts.
+     * @param aFullpath path to file 
+     * @return created attachment, ownership is not transferred
+     */
+    virtual MEmailAttachment* AddAttachmentL( const TDesC& aFullPath ) = 0;
+        
+    /**
+     * Adds attachment to message. This may affect previously set content, e.g.
+     * if SetContentL with MEmailTextContent argument was called, a new multipart
+     * content is created with MEmailTextContent and attachment as child parts.
+     * @param file handle to file to be attached. Handle remains open.
+     * @return created attachment, ownership is not transferred
+     */
+    virtual MEmailAttachment* AddAttachmentL( RFile& aFile ) = 0;
+    
+    /**
+     * Returns attachments, ownership is transferred    
+     * @return number of attachments in aAttachments 
+     */
+    virtual TInt GetAttachmentsL( REmailAttachmentArray& aAttachments ) = 0;
+    
+    /**
+     * Remove an attachment, ownership is not transferred. 
+     * @param attachment object obtained with GetAttachmentsL
+     */
+    virtual void RemoveAttachmentL( const MEmailAttachment& aAttachment ) = 0;
+
+    /**
+     * Returns id of parent folder of the message
+     * @return parent folder id
+     */
+    virtual const TFolderId& ParentFolderId() const = 0;
+
+    /** 
+     * Saves changes done with any mutator to persistent store. 
+     */
+    virtual void SaveChangesL() = 0;
+
+    /** 
+     * Moves message to outbox, sending may not happen immediately but
+     * after next mailbox synchronization. Changes done to the message
+     * are first saved before sending as if SaveChangesL was called.
+     * For immediate sending use MEmailMailbox::SynchronizeL()
+     */
+    virtual void SendL() = 0;
+
+    /**
+     * Launches Email application and opens message in viewer
+     * The method follows "fire and forget" pattern, returns immediately.
+     */    
+    virtual void ShowMessageViewerL( ) = 0;
+
+    /** 
+     * Launches Email application and new reply message in editor. 
+     * The method follows "fire and forget" pattern, returns immediately.
+     * @param boolean indicating if reply-to message is sent to all recipients.
+     */
+    virtual void ReplyToMessageL( const TBool aReplyToAll = ETrue ) = 0;   
+
+    /** 
+     * Launches Email application and new forward message in editor
+     * The method follows "fire and forget" pattern, returns immediately.
+     */    
+    virtual void ForwardMessageL() = 0;
+
+};
+
+} // namespace EmailInterface
+
+#endif // MEMAILMESSAGE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/memailmessagesearch.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,133 @@
+/*
+* 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: ECom interface for Email Client API
+*
+*/
+
+#ifndef __MEMAILACTIONS
+#define __MEMAILACTIONS
+
+#include <e32cmn.h>
+#include <memailmessage.h>
+
+namespace EmailInterface {
+
+class MMessageIterator;
+class TEmailSortCriteria;
+
+/**
+* Observer interface for handling email search results.
+*/
+class MEmailSearchObserver
+{
+public:
+    /**
+     * Called when search has next message available.
+     * This callback is called several times until all results
+     * have been delivered.
+     *
+     * @param message found in search, ownership is transferred.
+     *          
+     */ 
+    virtual void HandleResultL( 
+        MEmailMessage* aMessage ) = 0;
+
+    /**
+     * Notifies that the search has completed and no more results are expected.
+     */
+    virtual void SearchCompletedL() = 0;
+};
+
+/**
+ * Search interface for messages. Results are provided asynchronoysly.
+ * By default all found mailboxes are included in search.
+ * @code
+   
+   MEmailMailbox* mailbox = NULL;
+   // obtain mailbox here... 
+   // ...and now get search interface
+   MEmailMessageSearchAsync* search = mailbox->MessageSearchL();
+   CleanupReleasePushL( *search );
+   TEmailSortCriteria criteria;
+   criteria.iAscending = ETrue;
+   criteria.iField = TEmailSortCriteria::EByDate;                 
+   search->SetSortCriteriaL( criteria );
+   search->StartSearchL( *this ); // this implements MEmailSearchObserver
+   search->Cancel(); // cancel search
+   CleanupStack::PopAndDestroy(); // search
+   
+   @endcode
+   
+ * @since S60 v5.0
+ */
+class MEmailMessageSearchAsync : public MEmailInterface
+{
+public:
+        
+    /**
+    * Sets sort order for search results.
+    * Leaves KErrNotReady if search is ongoing.
+    */
+    virtual void SetSortCriteriaL( const TEmailSortCriteria& aCriteria ) = 0;
+    
+    /**
+    * Adds a search key. Leaves KErrNotReady if search is ongoing.
+    */
+    virtual void AddSearchKeyL( const TDesC& aSearchKey ) = 0;
+                                                                  
+    /**
+    * Enables/disables search from remote email server.
+    * Leaves KErrNotReady if search is ongoing.
+    */
+    virtual void SetRemoteSearchL( TBool aRemote ) = 0;                                                                  
+    
+    /**
+    * Indicates whether remote search is enabled.
+    */
+    virtual TBool IsRemoteSearch() const = 0;
+    
+    /**
+     * Starts search, all methods affecting search attribures leave
+     * KErrNotReady while search is ongoing.
+     * @param aObserver called when results are available.
+     */     
+    virtual void StartSearchL( MEmailSearchObserver& aObserver ) = 0;
+
+    /**
+     * Cancels search.
+     */
+    virtual void Cancel() = 0;
+                                             
+    /** returns search status 
+      * @return search status:
+      *     < 0 : Search has failed
+      *     KRequestPending : search is ongoing. note that status may be
+      *         KRequestPending after HandleResultL callback because results 
+      *         may be given in chunks of results. Size of chunk depends on
+      *         implementation and may vary.
+      *     KErrNone : initial state, or search has finished
+      */
+    virtual TInt Status() const = 0;
+    
+    /**
+     * Resets all search attribures. Cancels search if ongoing. 
+     */
+    virtual void Reset() = 0;
+};
+
+} //EmailInterface
+
+#endif // __MEMAILACTIONS
+
+// End of file.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/mmailboxcontentobserver.h	Tue Jul 06 14:04:34 2010 +0300
@@ -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: Observer interface for mailbox events.
+*
+*/
+
+#ifndef MMAILBOXCONTENTOBSERVER_H
+#define MMAILBOXCONTENTOBSERVER_H
+
+#include <emailapidefs.h>
+
+namespace EmailInterface {
+
+class MMailboxContentObserver
+{
+public:
+    virtual void NewMessageEventL( const TMailboxId& aMailbox, const REmailMessageIdArray aNewMessages, const TFolderId& aParentFolderId ) = 0; 
+    
+    virtual void MessageChangedEventL( const TMailboxId& aMailbox, const REmailMessageIdArray aChangedMessages, const TFolderId& aParentFolderId ) = 0;
+    
+    virtual void MessageDeletedEventL( const TMailboxId& aMailbox, const REmailMessageIdArray aDeletedMessages, const TFolderId& aParentFolderId ) = 0;
+};
+
+} // namespace EmailInterface
+
+#endif // MMAILBOXCONTENTOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/mmailboxsyncobserver.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,33 @@
+/*
+* 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: Observer interface for mailbox synchronisation.
+*
+*/
+
+#ifndef MEMAILSYNCOBSERVER_H
+#define MEMAILSYNCOBSERVER_H
+
+#include <emailapidefs.h>
+
+namespace EmailInterface {
+
+class MMailboxSyncObserver
+{
+public:
+    virtual void MailboxSynchronisedL( TInt aResult ) = 0; 
+};
+
+} // namespace EmailInterface
+
+#endif // MEMAILSYNCOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_client_api/mmessageiterator.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* 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: Message iterator interface
+*
+*/
+
+#ifndef MMESSAGEITERATOR_H
+#define MMESSAGEITERATOR_H
+
+#include <emailapidefs.h>
+
+namespace EmailInterface {
+
+class MEmailMessage;
+
+/**
+ * Iterator for email messages. 
+ * @since S60 v5.0
+ */
+class MMessageIterator : public MEmailInterface
+{
+public:
+    /**
+    * Returns next message. When all messages are iterated, returns NULL
+    * @return next message. Ownership is not transferred.
+    */
+    virtual MEmailMessage* NextL() = 0;
+    
+    /**
+    * Returns previous message. When first message is reached, returns NULL
+    * @return previous message. Ownership not is transferred.
+    */
+    virtual MEmailMessage* PreviousL() = 0;
+    
+    /**
+    * Returns amount of messages accessible from the iterator.
+    * @return message count
+    */
+    virtual TUint Count() const = 0;
+    
+};
+
+} // EmailInterface
+
+#endif // MMESSAGEITERATOR_H
--- a/email_plat/email_plat.pro	Wed Jun 23 18:00:21 2010 +0300
+++ b/email_plat/email_plat.pro	Tue Jul 06 14:04:34 2010 +0300
@@ -19,6 +19,7 @@
 
 symbian*: { 
     include(email_services_api/email_services_api.pri)
-
+    include(nmail_settings_api/nmail_settings_api.pri)
     include(nmail_client_api/nmail_client_api.pri)
+    include(email_client_api/email_client_api.pri)
 }
--- a/email_plat/nmail_client_api/nmail_client_api.pri	Wed Jun 23 18:00:21 2010 +0300
+++ b/email_plat/nmail_client_api/nmail_client_api.pri	Tue Jul 06 14:04:34 2010 +0300
@@ -30,5 +30,6 @@
             "nmail_client_api/nmapimailboxlisting.h    APP_LAYER_PLATFORM_EXPORT_PATH(nmapimailboxlisting.h)" \
             "nmail_client_api/nmapimessagebody.h       APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagebody.h)" \
             "nmail_client_api/nmapimessageenvelope.h   APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessageenvelope.h)" \
-            "nmail_client_api/nmapimessagetask.h       APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagetask.h)"
+            "nmail_client_api/nmapimessagetask.h       APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagetask.h)" \
+            "nmail_client_api/nmapimessagemanager.h    APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagemanager.h)"
 }
--- a/email_plat/nmail_client_api/nmapiemailaddress.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/email_plat/nmail_client_api/nmapiemailaddress.h	Tue Jul 06 14:04:34 2010 +0300
@@ -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,8 +20,9 @@
 
 #include <QExplicitlySharedDataPointer>
 #include <nmapidef.h>
+
 /*!
-   Email addres
+   Email address
  */
 
 class QString;
@@ -41,7 +42,7 @@
     virtual ~NmApiEmailAddress();
 
     /*!
-       copying constructor for nmmessageenvelope
+       copying constructor for NmApiEmailAddress
      */
     NmApiEmailAddress(const NmApiEmailAddress &addr);
 
--- a/email_plat/nmail_client_api/nmapifolderlisting.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/email_plat/nmail_client_api/nmapifolderlisting.h	Tue Jul 06 14:04:34 2010 +0300
@@ -37,11 +37,11 @@
     Q_OBJECT
 public:
     /*!
-       Constructor of class. It set start values.
+       Constructor of class. 
      */
-    NmApiFolderListing(QObject *parent, const quint64 &nmMailboxId);
+    NmApiFolderListing(QObject *parent, const quint64 &mailboxId);
     /*!
-       Destructor of class. It release engine to be safe if manual releasing won't work.
+       Destructor of class. 
      */
     ~NmApiFolderListing();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/nmapimessagemanager.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,84 @@
+/*
+ * 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:
+ *     Email message related operations
+ */
+
+#ifndef NMAPIMESSAGEMANAGER_H_
+#define NMAPIMESSAGEMANAGER_H_
+
+#include <QObject>
+#include <QList>
+
+#include <nmapidef.h>
+
+struct NmApiMessage;
+class NmApiEmailMessage;
+
+namespace EmailClientApi {
+
+class NmApiFolder;
+class NmApiMessageManagerPrivate;
+
+class NMAPI_EXPORT NmApiMessageManager : public QObject
+{
+    Q_OBJECT
+	
+public:
+    NmApiMessageManager(quint64 mailboxId,QObject *parent = 0);
+
+    virtual ~NmApiMessageManager();
+
+public slots:
+    bool createDraftMessage(const QVariant *initData);
+    
+    bool createForwardMessage(const QVariant *initData);
+    
+    bool createReplyMessage(const QVariant *initData,bool replyAll);
+    
+    bool moveMessages(const QList<quint64> messageIds,
+		quint64 sourceFolderId,quint64 targetFolderId);
+    
+    bool copyMessages(const QList<quint64> messageIds,					
+					quint64 sourceFolder,
+					quint64 targetFolder);
+    
+    bool saveMessage(const ::NmApiMessage &message);
+    
+    bool deleteMessages(const QList<quint64> messageIds);
+    
+    bool fetch(const NmApiMessage &message);
+    
+    bool send(const NmApiMessage &message);
+    
+    bool createAttachment(NmApiEmailMessage &message,const QVariant &attachmenSpec);
+
+    bool removeAttachment(NmApiEmailMessage &message,quint64 attachmentId);
+    
+signals:
+	void messagesCopied(int result);
+
+	void messagesCreated(int result);
+
+	void messagesMoved(int result);
+
+	void messagesDeleted(int result);
+
+private:
+	NmApiMessageManagerPrivate *d;
+};
+
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_settings_api/nmail_settings_api.pri	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,24 @@
+#
+# 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:
+#
+#
+
+symbian*: { 
+    # Build.inf rules
+    BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+        "nmail_settings_api/nmapimailboxsettingsdata.h APP_LAYER_PLATFORM_EXPORT_PATH(nmapimailboxsettingsdata.h)" \
+	"nmail_settings_api/nmapimailboxsettings.h APP_LAYER_PLATFORM_EXPORT_PATH(nmapimailboxsettings.h)"
+    
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_settings_api/nmapimailboxsettings.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,55 @@
+/*
+ * 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 NMAPIMAILBOXSETTINGS_H_
+#define NMAPIMAILBOXSETTINGS_H_
+
+#include <QList>
+#include <QObject>
+
+#include <nmapidef.h>
+
+namespace EmailClientApi
+{
+
+class NmApiMailboxSettingsData;
+class NmApiMailboxSettingsPrivate;
+class NMAPI_EXPORT NmApiMailboxSettings : public QObject
+{
+    Q_OBJECT
+public:
+    NmApiMailboxSettings(QObject *parent = 0);
+    ~NmApiMailboxSettings();
+
+    bool listMailboxIds(QList<quint64> &idList);
+    bool loadSettings(quint64 mailboxId, NmApiMailboxSettingsData &data);
+    bool saveSettings(const NmApiMailboxSettingsData &data);
+    bool createMailbox(const QString &mailboxType, NmApiMailboxSettingsData &data);
+    bool deleteMailbox(quint64 mailboxId);
+    bool populateDefaultSettings(const QString &mailboxType, NmApiMailboxSettingsData &data);
+
+signals:
+    void mailboxDeleted(int result = 0);
+    
+protected:    
+    NmApiMailboxSettingsPrivate *d;
+ 
+};
+
+}
+
+#endif /* NMAPIMAILBOXSETTINGS_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_settings_api/nmapimailboxsettingsdata.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,129 @@
+/*
+ * 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 NMAPIMAILBOXSETTINGSDATA_H_
+#define NMAPIMAILBOXSETTINGSDATA_H_
+
+#include <QVariant>
+#include <nmapidef.h>
+
+namespace EmailClientApi
+{
+
+const QString NmApiMailboxTypeImap = "imap";
+const QString NmApiMailboxTypePop = "pop";
+
+const QString NmApiAuthNone = "none";
+const QString NmApiAuthSameAsIncoming = "SameAsIncoming";
+const QString NmApiAuthUserAuthentication = "UserAuthentication";
+
+const QString NmApiAutomatic = "automatic";
+const QString NmApiAlways = "always";
+const QString NmApiHomeOnly = "homeOnly";
+const QString NmApiOff = "off";
+
+const QString NmApiStartTls = "StartTls";
+const QString NmApiSSLTls = "SSLTls";
+const QString NmApiSecurityOff = NmApiOff;
+
+const QString NmApiKeepUpToDate = "Keep-Up-To-Date";
+const QString NmApiSaveEnergy = "Save-Energy";
+const QString NmApiFetchManually = "Manual-Fetch";
+const QString NmApiUserDefined = "User-Defined";
+
+enum NmApiWeekDays
+{
+    Mon = 0x01, Tue = 0x02, Wed = 0x04, Thu = 0x08, Fri = 0x10,
+    Sat = 0x20, Sun = 0x40
+};
+
+enum NmApiRefreshPeriods
+{
+    WhenMailboxOpens = 0, Every5minutes = 5, Every15minutes = 15,
+    EveryHour = 60, Every4Hours = 240
+};
+
+enum NmApiMailboxSettingKey
+{
+    IncomingLoginName = 0, // String
+    IncomingPassword, // String
+    MailboxName, // String
+    EmailAddress, // String
+    ReplyAddress, // String
+    EmailAlias, // String
+    MyName, // String    
+    DownloadPictures, // Integer: 0=Off, 1=On
+    MessageDivider, // Integer: 0=Off, 1=On
+    ReceptionActiveProfile, // String: Reception profile
+    ReceptionUserDefinedProfile, // Integer: 0=Disabled, 1=Enabled
+    ReceptionInboxSyncWindow, // Integer: 0=All messages
+    ReceptionGenericSyncWindowInMessages, // Integer: 0=All messages
+    ReceptionWeekDays, // Integer bitmask of weekdays
+    ReceptionDayStartTime, // Integer: 0-23
+    ReceptionDayEndTime, // Integer: 0-23
+    ReceptionRefreshPeriodDayTime, // Integer: 5,15,60,240,0="When open mailbox"
+    ReceptionRefreshPeriodOther, // Integer: 5,15,60,240,0="When open mailbox"
+    UserNameHidden, // Integer: 0=Off, 1=On
+    IncomingMailServer, // String
+    IncomingMailUsesAuthentication, // String    "none", "UserAuthentication"
+    IncomingMailSecurityType, // String  "StartTls", "SSLTls", "none"
+    OutgoingMailServer, // String
+    OutgoingMailUsesAuthentication, // String "none", "SameAsIncoming", "UserAuthentication"
+    OutgoingMailSecurityType, // String 	"StartTls", "SSLTls", "none"
+    IncomingPort, // Integer
+    OutgoingPort, // Integer
+    FolderPath, // String: Empty string means 'Default'
+    AlwaysOnlineState, // string "always", "homeOnly", "off"
+    EmailNotificationState, // string "automatic", "homeOnly", "off"
+    FirstEmnReceived, // Integer: 0=false,1=true
+    EmnReceivedNotSynced, // Integer: 0=false,1=true
+    AoLastSuccessfulUpdate, // QDateTime
+    AoLastUpdateFailed, // Integer: 0=false, 1=true
+    AoUpdateSuccessfulWithCurSettings, // Integer: 0=false, 1=true
+    IncomingSecureSockets, // Boolean
+    IncomingSSLWrapper, // Boolean
+    OutgoingLoginName, // String
+    OutgoingPassword, // String
+    UseOutgoingAuthentication, // Boolean
+    OutgoingSecureSockets, // Boolean
+    OutgoingSSLWrapper // Boolean
+};
+
+class NmApiMailboxSettingsDataPrivate;
+class NMAPI_EXPORT NmApiMailboxSettingsData
+{
+
+public:    
+    NmApiMailboxSettingsData();
+    ~NmApiMailboxSettingsData();
+
+    void setMailboxId(quint64 mailboxId);
+    quint64 mailboxId() const;
+    void setValue(int key, const QVariant &settingValue);
+    bool getValue(int key, QVariant &settingValue) const;
+    bool validateData() const;
+    void clearSettings();
+    QList<int> listSettings() const;
+
+protected:    
+    NmApiMailboxSettingsDataPrivate *d;
+
+};
+
+}//end namespace
+
+#endif /* NMAPIMAILBOXSETTINGSDATA_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/bwins/emailclientapiu.def	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	?ImplementationGroupProxy@@YAPBUTImplementationProxy@@AAH@Z @ 1 NONAME ; struct TImplementationProxy const * ImplementationGroupProxy(int &)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/data/emailclientapi.rss	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* 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:  Declares ECom registration information for email client api
+*     
+*
+*/
+
+#include <ecom/registryinfov2.rh>		//REGISTRY_INFO
+#include "emailclientapiimpl.hrh" 
+
+/** ECom version number to be used in Cmail related ECom registeration
+ *  resource files.
+ *  NOTE: Version number in ECom registeration resource file is saved as one
+ *  byte, so 255 is the maximum version number.
+ */
+#define KEmailEcomVersionNumber 7
+
+RESOURCE REGISTRY_INFO theInfo
+    {    
+    dll_uid = 0x20022D63;
+    resource_format_version = RESOURCE_FORMAT_VERSION_2;
+    interfaces =
+        {
+        INTERFACE_INFO
+            {
+            interface_uid = 0x20022D62;
+            implementations =
+                {
+                IMPLEMENTATION_INFO
+                    {
+                    implementation_uid = 0x20022D61;
+                    version_no = KEmailEcomVersionNumber;
+                    display_name = "email client api";
+                    default_data = "";
+    				opaque_data = "";
+    				rom_only=0;
+                    }
+                };
+            }
+        };
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/eabi/emailclientapiu.def	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,3 @@
+EXPORTS
+	_Z24ImplementationGroupProxyRi @ 1 NONAME
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/emailclientapi.pro	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,107 @@
+#
+# 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:
+#
+#
+
+TEMPLATE = lib
+TARGET = emailclientapi
+DEPENDPATH += . inc src
+INCLUDEPATH += . \
+			   ../../inc \
+			   ../emailframework/inc
+INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+HEADERS += inc/emailclientapiimpl.h \
+            inc/emailinterfacefactoryimpl.h \
+            inc/emailapiutils.h \
+            inc/emailmailbox.h \
+            inc/emailaddress.h \
+            inc/emailfolder.h \
+            inc/emailmessage.h \
+            inc/emailmailboxcache.h \
+            inc/messageiterator.h \
+            inc/emailcontent.h \
+            inc/emailmessagesearch.h \
+            inc/emailattachment.h \
+            inc/emailtextcontent.h \
+            inc/emailmultipart.h   
+
+SOURCES += src/emailclientapiimpl.cpp \
+            src/emailinterfacefactoryimpl.cpp \
+            src/implproxy.cpp \
+            src/emailapiutils.cpp \
+            src/emailmailbox.cpp \
+            src/emailaddress.cpp \
+            src/emailfolder.cpp \
+            src/emailmessage.cpp \
+            src/emailmailboxcache.cpp \
+            src/messageiterator.cpp \
+            src/emailcontent.cpp \
+            src/emailmessagesearch.cpp \
+            src/emailattachment.cpp \
+            src/emailtextcontent.cpp \
+            src/emailmultipart.cpp        
+        
+
+LIBS += -lbafl \
+        -lcone \
+        -leuser \
+        -lECom \
+        -lFSFWCommonLib \
+        -lFSMailFramework \
+        -lefsrv \
+        -lviewcli \
+        -lestor \
+        -lcentralrepository
+
+symbian*: {
+
+	INCLUDEPATH += /sf/mw/qtextensions/qthighway/inc
+	LIBS += -lxqservice 
+
+    TARGET.EPOCALLOWDLLDATA = 1
+    TARGET.CAPABILITY = CAP_ECOM_PLUGIN
+
+    TARGET.UID2 = 0x10009D8D
+    TARGET.UID3 = 0x20022D63
+
+    ecomPluginRegisterationFile = \
+    "SOURCEPATH data" \
+    "START RESOURCE emailclientapi.rss" \
+    "END" 
+
+    MMP_RULES += "SYSTEMINCLUDE /epoc32/include/ecom" 
+    MMP_RULES += ecomPluginRegisterationFile
+    MMP_RULES += "TARGETTYPE PLUGIN"
+
+    defBlock = \
+        "$${LITERAL_HASH}if defined(MARM)" \
+        "DEFFILE  eabi/emailclientapi.def" \
+        "$${LITERAL_HASH}else" \
+        "DEFFILE  bwins/emailclientapi.def" \
+        "$${LITERAL_HASH}endif"
+
+    MMP_RULES += defBlock
+    
+    BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
+    "rom/emailclientapi.iby CORE_APP_LAYER_IBY_EXPORT_PATH(emailclientapi.iby)"    
+    
+    # Prevents C2874W warnings
+    QMAKE_CXXFLAGS.ARMCC += --diag_suppress 2874
+}
+
+win32 {
+	DESTDIR = ../../../../bin
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailaddress.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,61 @@
+/*
+* 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 address implementation definition
+*
+*/
+
+#ifndef EMAILADDRESS_H
+#define EMAILADDRESS_H
+
+#include <memailaddress.h>
+#include "emailapiutils.h"
+
+using namespace EmailInterface;
+
+NONSHARABLE_CLASS( CEmailAddress ) : public CBase, public MEmailAddress
+    {
+public:
+    static CEmailAddress* NewL( const TRole aRole, const TDataOwner aOwner );
+    static CEmailAddress* NewLC( const TRole aRole, const TDataOwner aOwner );
+    
+    ~CEmailAddress();
+
+public: // from MEmailInterface
+    TEmailTypeId InterfaceId() const;
+    
+    void Release();
+
+public: // from MEmailAddress
+    void SetAddressL( const TDesC& aAddress );
+    TPtrC Address() const;
+    
+    void SetDisplayNameL( const TDesC& aDisplayName );
+    TPtrC DisplayName() const;
+    
+    TRole Role() const;
+    void SetRole( const TRole aRole );
+            
+private:        
+        CEmailAddress( const TRole aRole, const TDataOwner aOwner );
+        
+private:
+        RBuf iAddress;
+        RBuf iDisplayName;
+        TRole iRole;
+        TDataOwner iOwner;
+    };
+
+#endif // EMAILADDRESS_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailapiutils.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,157 @@
+/*
+* 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: This file implements utilities like CPluginData.
+*
+*/
+
+#ifndef EMAILAPIUTILS_H
+#define EMAILAPIUTILS_H
+
+#include <e32base.h>
+#include "cfsmailcommon.h"
+#include <emailapidefs.h>
+
+//using namespace EmailInterface;
+
+class CFSMailPlugin;
+
+enum TDataOwner
+    {
+    EClientOwns,
+    EAPIOwns
+    };
+
+
+/**
+* Helper container class for storing plugin pointer and implementation UID
+* @since S60 v5.2
+*/
+NONSHARABLE_CLASS( TPluginData )
+    {
+    public:
+    
+        inline TPluginData( TUid aUid ) : iPlugin( NULL ), iUid( TUid::Uid( aUid.iUid ) ) {}
+        
+        CFSMailPlugin* iPlugin;
+        
+        const TUid     iUid;
+    };
+    
+/**
+* Plugin data is a utility for protocol plugin creation and book 
+* keeping. Objects using the plugin should access it via this
+* class for optimised reference counting.
+*/
+NONSHARABLE_CLASS( CPluginData ) : public CBase
+{
+public:    
+    /**
+    * returns plugin instance or null if failed to instantiate.
+    * LoadResult() will return error code in instantiation
+    */
+    CFSMailPlugin* ClaimInstance();
+    
+    /**
+    * returns plugin instance or leaves if failed to instantiate.
+    */
+    CFSMailPlugin* ClaimInstanceL();
+
+    /**
+    *  Decreases access count of the plugin and deletes if reaches zero.
+    * Note! this should be called only aftre succesful ClaimInstance or 
+    * ClaimInstanceL.
+    */
+    void ReleaseInstance();
+    
+    /**
+    * Adds cleanup operation calling ReleaseInstance to cleanup stack
+    */                                                 
+    void ReleasePushL();
+    /**
+    * Cleanup operation for CleanupReleasePluginPushL
+    */
+    static void CleanupOperation( TAny* aAny );
+    
+    TUid Uid() const;
+    
+    TInt LoadResult() const;
+
+private: 
+    /* only CEmailClientApi owns instances of this, it should make sure that
+     * no duplicates exist, otherwise reference counting of plugins fail
+     * (this is not singleton class)
+     */
+    friend class CEmailClientApi;
+    friend class CEmailMailboxCache;
+    
+    CPluginData( TUid aUid );
+    ~CPluginData();
+
+private:    
+    // plugin pointer and uid
+    TPluginData iData;
+    
+    TInt iPluginLoadError;
+        
+    // >0 when iPlugin is instantiated
+    TUint          iRefCount;
+    
+    // EFalse if shared from Email Framework (CFSMailClient). If true,
+    // ReleaseInstance() doesn't delete plugin
+    TBool          iOwned;
+};
+
+/**
+* Constructs internal message id type from plugin data and mailbox/folder/message id 
+*/
+TFSMailMsgId FsMsgId( const CPluginData& aPluginData, const EmailInterface::TBaseId& aId );
+
+/**
+* Cleanup support for pointer arrays
+*/
+template<class T>
+class CleanupResetAndDestroy
+{
+public:
+    inline static void PushL( T& aItem );
+
+private:
+    inline static void ResetAndDestroy( TAny *aPtr );
+} ;
+
+template <class T>
+inline void CleanupResetAndDestroyPushL( T& aRef )
+    {
+    CleanupResetAndDestroy<T>::PushL( aRef );
+    }
+
+/**
+* Cleanup support for email interface objects.
+*/
+class CleanupReleasePush
+{
+public:
+    static void PushL( EmailInterface::MEmailInterface& aItem );
+
+private:
+    static void Release( TAny *aPtr );
+} ;
+
+
+#include "emailapiutils.inl"
+
+
+#endif // EMAILAPIUTILS_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailapiutils.inl	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* 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: This file implements class CEmailMailbox.
+*
+*/
+
+template<class T>
+inline void CleanupResetAndDestroy<T>::PushL( T& aItem ) 
+    { 
+    TCleanupItem item( &CleanupResetAndDestroy::ResetAndDestroy, &aItem );
+    CleanupStack::PushL( item );
+    }
+
+template<class T>
+inline void CleanupResetAndDestroy<T>::ResetAndDestroy( TAny *aPtr )
+    {
+    reinterpret_cast<T*>( aPtr )->ResetAndDestroy();
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailattachment.h	Tue Jul 06 14:04:34 2010 +0300
@@ -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: Definition of Email attachment.
+*
+*/
+
+
+#ifndef EMAILATTACHMENT_H
+#define EMAILATTACHMENT_H
+
+// INCLUDES
+#include <e32std.h>
+#include <e32base.h>
+
+#include "cfsmailclient.h"
+#include <memailcontent.h>
+#include "emailapiutils.h"
+
+using namespace EmailInterface;
+
+class CEmailMessageContent;
+// CLASS DECLARATION
+
+/**
+ *  CEmailAttachment
+ * 
+ */
+
+NONSHARABLE_CLASS(CEmailAttachment) : public CBase, public MEmailAttachment
+    {
+public:
+    // Constructors and destructor
+
+    /**
+     * Destructor.
+     */
+    ~CEmailAttachment();
+
+    /**
+     * Two-phased constructor.
+     */
+    static CEmailAttachment* NewL(
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,
+        CFSMailMessagePart *aAtt,
+        const TDataOwner aOwner );    
+
+    /**
+     * Two-phased constructor.
+     */
+    static CEmailAttachment* NewLC(
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,    
+        CFSMailMessagePart *aAtt,
+        const TDataOwner aOwner );    
+
+public: // from MEmailInterface
+    TEmailTypeId InterfaceId() const;
+    
+    void Release();
+
+public: // from MEmailAttachment
+    /**
+    * Returns file handle of this attachment. If the attachment is
+    * not associated with a file, null file handle is returned.
+    */
+    RFile FileL() const;
+
+    /**
+    * Sets file name field
+    */
+    void SetFileNameL( const TDesC& aFileName );
+
+    /**
+    * Returns file name or null pointer descriptor if attachment
+    * is not associated with any file
+    */
+    TPtrC FileNameL() const;
+    
+    
+public: // from MEmailMessageContent
+    
+    TMessageContentId Id() const;
+
+    TPtrC ContentType() const;
+
+    void SetContentType( const TDesC& aContentType );
+
+    TPtrC ContentId() const;
+
+    void SetContentId( const TDesC& aContentId );
+
+    TPtrC ContentDescription() const;
+
+    void SetContentDescription( const TDesC& aContentDescription );
+
+    TPtrC ContentDisposition() const;
+
+    void SetContentDisposition( const TDesC& aContentDisposition );
+
+    TPtrC ContentClass() const;
+
+    void SetContentClass( const TDesC& aContentClass );
+
+    TInt AvailableSize() const;
+
+    TInt TotalSize() const;
+
+    TPtrC ContentL() const;
+
+    void SetContentL( const TDesC& aContent );
+
+    void FetchL( MEmailFetchObserver& aObserver );
+
+    void CancelFetch();
+
+    void SaveToFileL( const TDesC& aPath );
+
+    MEmailMultipart* AsMultipartOrNull() const;
+    
+    MEmailTextContent* AsTextContentOrNull() const;
+
+    MEmailAttachment* AsAttachmentOrNull() const;
+    
+private:
+
+    /**
+     * Constructor for performing 1st stage construction
+     */
+    CEmailAttachment( const TDataOwner aOwner );
+
+    /**
+     * EPOC default constructor for performing 2nd stage construction
+     */
+    void ConstructL(
+            CPluginData& aPluginData,
+            const TMessageContentId& aMsgContentId );    
+
+    void ConstructL(
+            CPluginData& aPluginData,
+            const TMessageContentId& aMsgContentId,
+            CFSMailMessagePart *aPart);    
+    
+private:        
+    CEmailMessageContent*   iEmailMsgContent;
+    TDataOwner iOwner;
+    };
+
+#endif // EMAILATTACHMENT_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailclientapiimpl.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,232 @@
+/*
+* 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: Definition of Email API main interface.
+*
+*/
+
+#ifndef EMAILCLIENTAPIIMPL_H
+#define EMAILCLIENTAPIIMPL_H
+
+
+#include <implementationinformation.h> 
+#include "emailapiutils.h"
+#include "cfsmailcommon.h"
+#include "mfsmaileventobserver.h"    
+#include <memailclientapi.h>
+#include "emailclientpluginmanager.h"
+
+
+using namespace EmailInterface;
+
+class CFSMailBox;
+class MEmailEventObserver;
+class CVwsSessionWrapper;
+class CFSMailPlugin;
+class TFSMailMsgId;
+class CEmailMailboxCache;
+class CFSMailClient;
+
+/**
+*  "Framework" class including plugin management
+* @since S60 v5.2
+*/
+NONSHARABLE_CLASS( CEmailClientApi ) : public CBase, public MEmailClientApi
+{
+public:
+    /**
+    * Constructor
+    * @return
+    */
+    static CEmailClientApi* NewL();
+    
+    /**
+     *
+     */
+     CEmailClientApi();       
+
+public: // from MEmailInterface
+    TEmailTypeId InterfaceId() const;
+    
+    void Release();
+    
+public: // from MEmailClientApi
+
+    /** @see MEmailClientApi */   
+    MEmailMailbox* MailboxL( const TMailboxId& aId );
+   
+    /** @see MEmailClientApi */   
+    MEmailMailbox* MailboxL( const TPtrC& aAddress );
+           
+    /**
+    * Gets all mailboxes in pointer array. It is recommended to free other
+    * mailboxes besides needed one to optimise memory usage.
+    */    
+    TInt GetMailboxesL( RMailboxPtrArray& aMailboxes );
+    
+    /**
+    */
+    void LaunchEmailL( const TLaunchPolicy aPolicy );
+
+public: // new methods
+
+    /**
+     * Gets array of mailbox ids
+     * @param aMailboxes mailbox ids from all plugins
+     * @return number of mailboxes returned in aMailboxes
+     */
+    TInt GetMailboxIdsL( REmailMailboxIdArray& aMailboxes );
+        
+private:
+
+    /**
+     * Constructor
+     */
+    void ConstructL();
+    
+     /**
+     * Destructor
+     */
+    ~CEmailClientApi();
+
+    /**
+     * Push ECom implementation info to cleanup operation to cleanup stack
+     */
+    void CleanupImplInfoPushL( RPointerArray<CImplementationInformation>& aArray );
+    
+    /**
+     * Cleanup operation for ECom implementation info
+     */
+    static void CleanupImplInfo( TAny* aAny );
+   
+
+    // Group of methods for book keeping of loaded protocol plugins by this object.
+    // In certain situations it is preferable to have a plugin in memory
+    // instead of loading/unloading frequently.
+    
+    /** Increases plugin reference count if CEmailClientApi already doesn't
+     *  have active instance. When plugin is needed internally, this method
+     * should be accessor to a plugin. Counterpart is ReleasePlugin() when
+     * CEmailClientApi doesn't itself need plugin any more.
+     */
+    CFSMailPlugin* UsePlugin( CPluginData& aPluginData );
+    
+    /**
+    * For finding plugin data
+    */
+    TInt IndexOfLoadedPluginData( const TPluginData& aPluginData ) const;
+    
+    /**
+    * Used in comparing plugin data in array (part of find algorithm)
+    */    
+    static TBool PluginDataEquals( const TPluginData& a1, const TPluginData& a2 );
+    
+    /**
+    * This object doesn't need related protocol plugin
+    */
+    void ReleasePlugin( CPluginData& aPluginData );
+    
+    /**
+    * This object doesn't need any protocol plugin
+    */
+    void ReleaseAllPlugins();
+    
+    /**
+    * Return mailbox cache, creates it when called first time
+    */
+    CEmailMailboxCache& MailboxInfoCacheL();
+    
+    /**
+    * Caches mailbox ids and their mapping to related plugin data for quick
+    * lookup. When a mailbox with specific id is next time asked, related
+    * protocol plugin is already known.
+    */
+    void UpdateMailboxInfoCacheL();
+
+    /**
+    * Internal, used from UpdateMailboxInfoCacheL
+    */    
+    TBool CachePluginMailboxesL( 
+        CPluginData& aPluginData, 
+        CFSMailPlugin& aPlugin );
+    
+private:    
+    typedef RPointerArray<CPluginData> RPluginDataArray;
+    
+    /**
+    * Iterator for CPluginData elements in an array
+    */
+    class TPluginIterator
+    {
+    public:
+        // constructor
+        inline TPluginIterator( RPluginDataArray& aArray ) : 
+            iArray( aArray ), iIndex( 0 ) {}
+        
+        /**
+        * return next element
+        */
+        CPluginData* Next();
+    private:
+        // iterator array
+        RPluginDataArray& iArray;
+        // current iterator index
+        TInt iIndex;
+    };
+    
+private:
+    // plugin data array for all protocol plugins
+    RPluginDataArray    iPluginDataArray;
+
+    // singleton instance counter    
+    TInt iInstanceCounter;
+    
+    // book keeping of loaded plugins
+    RArray<TPluginData> iLoadedPluginsArray;
+       
+    // Mailbox ids are cached when first time listed. Related plugin uid
+    // is include in the cache.
+    CEmailMailboxCache* iMailboxCache;
+
+    CFSMailClient* iMailClient;
+    
+};
+
+/**
+* Email application launcher. 
+*/
+NONSHARABLE_CLASS( CEmailLauncher ) : public CBase
+{
+public:
+    static CEmailLauncher* NewL();
+    
+    ~CEmailLauncher();
+                                    
+    /**
+    *
+    */
+     void LaunchL( const TMailboxId& aMailboxId );
+private:
+    
+    CEmailLauncher();
+    
+    void ConstructL();
+    
+    // Owned window server session.
+    CVwsSessionWrapper* iViewSrvSession;
+};
+
+
+#endif // EMAILCLIENTAPIIMPL_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailclientapiimpl.hrh	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* 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: email client api internal definitions
+*
+*/
+#ifndef _EMAILCLIENTAPIIMPL_HRH
+#define _EMAILCLIENTAPIIMPL_HRH
+
+#define KEmailClientApiDllUid       0x20022D63
+#define KEmailClientApiImplUid      0x20022D61
+
+#endif // _EMAILCLIENTAPIIMPL_HRH
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailclientapiimpldefs.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,30 @@
+/*
+* 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 _EMAILCLIENTAPIIMPLDEFS_H
+#define _EMAILCLIENTAPIIMPLDEFS_H
+
+enum TEmailImplPanic {
+    EMailPanicPluginNotReleased,
+    EMailPanicSortMapIndexOutOfBounds
+};
+
+void Panic( TEmailImplPanic aPanic );
+
+#endif // _EMAILCLIENTAPIIMPLDEFS_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailclientpluginmanager.h	Tue Jul 06 14:04:34 2010 +0300
@@ -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: Definition for plugin manager interface
+*
+* Description: 
+*
+*/
+
+#ifndef MEMAILPLUGINMANAGER_H_
+#define MEMAILPLUGINMANAGER_H_
+
+#include "cfsmailcommon.h"
+
+class MEmailClientPluginManager
+    {
+public:
+    virtual CFSMailPlugin* GetPluginByUid(TUid aUid) = 0; 
+    };
+
+#endif // MEMAILPLUGINMANAGER_H_
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailcontent.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,129 @@
+/*
+* 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 content implementation definition
+*
+*/
+
+#ifndef EMAILCONTENT_H
+#define EMAILCONTENT_H
+
+#include <memailcontent.h>
+
+#include "cfsmailclient.h"
+#include "emailapiutils.h"
+
+using namespace EmailInterface;
+
+class CFSMailPlugin;
+class CFSMailRequestObserver;
+
+NONSHARABLE_CLASS( CEmailMessageContent ) : public CBase, 
+                                            public MEmailMessageContent
+{
+public:
+    static CEmailMessageContent* NewL( 
+            CPluginData& aPluginData,
+            const TMessageContentId& aMsgContentId,
+            CFSMailMessagePart* aPart);
+        
+    ~CEmailMessageContent();
+    
+public: // from MEmailInterface
+    TEmailTypeId InterfaceId() const;
+    
+    void Release();
+
+public: // from MEmailMessageContent
+    TMessageContentId Id() const;
+
+    TPtrC ContentType() const;
+
+    void SetContentType( const TDesC& aContentType );
+
+    TPtrC ContentId() const;
+
+    void SetContentId( const TDesC& aContentId );
+
+    TPtrC ContentDescription() const;
+
+    void SetContentDescription( const TDesC& aContentDescription );
+
+    TPtrC ContentDisposition() const;
+
+    void SetContentDisposition( const TDesC& aContentDisposition );
+
+    TPtrC ContentClass() const;
+
+    void SetContentClass( const TDesC& aContentClass );
+
+    TInt AvailableSize() const;
+
+    TInt TotalSize() const;
+
+    TPtrC ContentL() const;
+
+    void SetContentL( const TDesC& aContent );
+
+    void FetchL( MEmailFetchObserver& aObserver );
+
+    void CancelFetch();
+
+    void SaveToFileL( const TDesC& aPath );
+
+    MEmailMultipart* AsMultipartOrNull() const;
+    
+    MEmailTextContent* AsTextContentOrNull() const;
+
+    MEmailAttachment* AsAttachmentOrNull() const;
+    
+public:     
+    CFSMailMessagePart& Part();
+    void SetPart( CFSMailMessagePart *aPart );
+    
+    CPluginData& PluginData();
+        
+protected:
+    CEmailMessageContent( CPluginData& aPluginData, const TMessageContentId& aMsgContentId, CFSMailMessagePart* aPart );
+    
+private:
+    class CContentRequestObserver: public CBase, 
+                                   public MFSMailRequestObserver
+        {
+    public:
+        CContentRequestObserver( CEmailMessageContent &aParent);
+        
+        virtual void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
+        void SetObserverL( MEmailFetchObserver* aObserver );
+    private:
+        MEmailFetchObserver* iObserver;
+        CEmailMessageContent& iParent;
+        };
+
+private:
+    void ConstructL();
+
+private:
+    CPluginData&            iPluginData;
+    CFSMailPlugin*          iPlugin;
+    CFSMailMessagePart*     iPart;
+    TMessageContentId       iMsgContentId;
+    mutable HBufC*          iBuf;
+    mutable TUint           iUsed;
+    CContentRequestObserver *iFetchObserver;
+    TInt                    iRequestId;
+};
+
+#endif // EMAILCONTENT_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailfolder.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,103 @@
+/*
+* 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: CEmailMailbox.
+*
+*/
+
+#ifndef CEMAILFOLDER_H
+#define CEMAILFOLDER_H
+
+#include <emailapidefs.h>
+#include "cfsmailcommon.h"
+#include <memailfolder.h>
+#include "mfsmaileventobserver.h"
+
+using namespace EmailInterface;
+
+class CFSMailPlugin;
+class CPluginData;
+class CFSMailFolder;
+class EmailInterface::MMessageIterator;
+
+NONSHARABLE_CLASS( CEmailFolder ) : 
+    public CBase, 
+    public MEmailFolder
+{
+public:
+    
+    static CEmailFolder* NewLC( 
+        CPluginData& aPluginData,
+        const TFolderId& aFolderId,
+        CFSMailFolder *aFolder );
+    
+    static CEmailFolder* NewL( 
+        CPluginData& aPluginData,
+        const TFolderId& aFolderId,
+        CFSMailFolder *aFolder );
+
+    ~CEmailFolder();           
+
+public: // from MEmailInterface
+    TEmailTypeId InterfaceId() const;
+    
+    void Release();
+    
+public:    // from MEmailFolder
+    TFolderId FolderId() const;
+    
+    TFolderId ParentFolderId() const;
+    
+    TFolderType FolderType() const;    
+
+    TPtrC Name() const;
+
+    /**
+    * Returns direct childs of this folder, i.e. this is not recursive.
+    * @return number of subfolders or an error code
+    */    
+    TInt GetSubfoldersL( 
+        RFolderArray& aSubfolders ) const;
+
+    EmailInterface::MMessageIterator* MessagesL( 
+        const RSortCriteriaArray& aCriteria );
+    
+    void DeleteMessagesL( const REmailMessageIdArray& aMessageIds );
+    
+private: // constructors
+    CEmailFolder( CPluginData& aPluginData, const TFolderId& aFolderId, CFSMailFolder *aFolder );
+    
+    void ConstructL();
+
+private: // Internal methods
+    static void ToFsSortCriteriaL( 
+        const RSortCriteriaArray& aSortCriteria, 
+        RArray<TFSMailSortCriteria>& aFsCriteria );
+
+private:
+    CPluginData&    iPluginData;
+    
+    CFSMailPlugin*  iPlugin;
+
+    TFolderType     iFolderType;
+       
+    TFolderId       iFolderId;
+    
+    TFolderId       iParentId;
+    
+    CFSMailFolder   *iFolder;
+};
+    
+#endif // CEMAILFOLDER_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailinterfacefactoryimpl.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,69 @@
+/*
+* 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: Interface factory implementation class definition
+*
+*/
+
+#ifndef EMAILINTERFACEFACTORY_H
+#define EMAILINTERFACEFACTORY_H
+
+#include <emailinterfacefactory.h>
+
+using namespace EmailInterface;
+
+/**
+* Implements CEmailInterfaceFactory ECom interface
+*
+*/
+NONSHARABLE_CLASS( CEmailInterfaceFactoryImpl ) : public CEmailInterfaceFactory
+{
+public: 
+
+    /**
+    * Creates interface factory
+    * @return interface factory
+    */
+    static CEmailInterfaceFactoryImpl* NewL();
+    
+    // destructor
+    ~CEmailInterfaceFactoryImpl();
+    
+    /** @see CEmailInterfaceFactory::InterfaceL */
+    MEmailInterface* InterfaceL( const TInt aInterfaceId );
+    
+private:
+    enum TEmailUidAppendRemoveMode
+        {
+        EEmailUidModeAppend,
+        EEmailUidModeRemove,
+        };
+    
+    /**
+    * Registers/removes application UID to/from P&S so that the application
+    * can be shutdown during Email IAD update. Update may fail if any
+    * application is using some Email services during the update.
+    * Application UID is removed from the list in destructor.
+    * @param aMode Is the current process UID added or removed from the list
+    */
+    void AppendOrRemoveUidL( const TEmailUidAppendRemoveMode aMode );
+
+private:    
+    // c++ constructor and 2nd phase constructor
+    CEmailInterfaceFactoryImpl();
+    void ConstructL();
+};
+
+#endif // EMAILINTERFACEFACTORY_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailmailbox.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,181 @@
+/*
+* 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: This file implements class CEmailMailbox.
+*
+*/
+
+#ifndef EMAILMAILBOX_H
+#define EMAILMAILBOX_H
+
+#include "cfsmailcommon.h"
+#include <memailmailbox.h>
+#include "mfsmaileventobserver.h"
+#include "mfsmailrequestobserver.h"
+#include "mmailboxcontentobserver.h"
+
+using namespace EmailInterface;
+
+class CFSMailBox;
+class CFSMailAddress;
+class CFSMailPlugin;
+class CPluginData;
+class CEmailAddress;
+
+NONSHARABLE_CLASS( CEmailMailbox ) : 
+    public CBase, 
+    public MEmailMailbox
+{
+public:
+    
+    static CEmailMailbox* NewL( 
+        CPluginData& aPluginData,
+        const TMailboxId& aMailboxId );
+    
+    ~CEmailMailbox();           
+
+public: // from MEmailInterface
+    TEmailTypeId InterfaceId() const;
+    
+    void Release();
+    
+public:    // from MEmailMailbox
+    /**@see MEmailMailbox */
+    TMailboxId MailboxId() const;
+    
+    /**@see MEmailMailbox */
+    MEmailAddress* AddressL() const;
+    
+    /**@see MEmailMailbox */
+    TPtrC MailboxName() const;
+    
+    /**@see MEmailMailbox */
+    TInt GetFoldersL( RFolderArray& aFolders ) const;
+
+    /**@see MEmailMailbox */
+    MEmailFolder* FolderL( const TFolderId& aFolderId ) const;
+    
+    /**@see MEmailMailbox */
+    MEmailFolder* FolderByTypeL( 
+        const TFolderType aFolderType ) const;
+        
+    /**@see MEmailMailbox */
+    MEmailMessage* MessageL( const TMessageId& aMessageId );
+    
+    /**@see MEmailMailbox */
+    MEmailMessage* CreateDraftMessageL() const;
+    
+    /**@see MEmailMailbox */
+    MEmailMessage* CreateReplyMessageL( const TMessageId& aMessageId, const TBool aReplyToAll = ETrue ) const;
+    
+    /**@see MEmailMailbox */
+    MEmailMessage* CreateForwardMessageL( const TMessageId& aMessageId ) const;
+    
+    /**@see MEmailMailbox */
+    void SynchroniseL( MMailboxSyncObserver& aObserver );
+        
+    /**@see MEmailMailbox */
+    void CancelSynchronise();
+    
+    /**@see MEmailMailbox */
+    void RegisterObserverL( MMailboxContentObserver& aObserver );
+        
+    /**@see MEmailMailbox */
+    void UnregisterObserver( MMailboxContentObserver& aObserver );
+    
+    /**@see MEmailMailbox */
+    MEmailMessageSearchAsync* MessageSearchL();
+
+    /**@see MEmailMailbox */
+    void ShowInboxL();
+
+    /**@see MEmailMailbox */
+    void EditNewMessageL();
+    
+
+public: // new methods
+
+private:       
+    TFSMailMsgId FsMailboxId() const;
+    
+private: // constructors
+    CEmailMailbox( CPluginData& aPluginData, const TMailboxId& aPlugin );
+    
+    void ConstructL();
+
+private: // inner class for mailbox event handling
+    class TObserverEventMapper : public MFSMailEventObserver
+    {
+    public:
+        TObserverEventMapper( CFSMailPlugin* aPlugin, TUid aPluginUid, const TMailboxId& aMailboxId );
+        ~TObserverEventMapper();
+        void AddObserverL( MMailboxContentObserver& aObserver );
+        void RemoveObserver( MMailboxContentObserver& aObserver );
+    public: // from MFSMailEventObserver
+        virtual void EventL( TFSMailEvent aEvent, TFSMailMsgId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        typedef void ( CEmailMailbox::TObserverEventMapper::*TEventMapFunc)( TMailboxId, TAny*, TAny*, TAny* );
+    private: // mappers, so say we all!
+        void ConvertParamsL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, REmailMessageIdArray& aMessageIds, TFolderId& aFolderId );
+        void IgnoreEventL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        void NewMessageL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        void MessageChangedL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        void MessageDeletedL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        void MessageMoved( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        void MessageCopiedL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        void NewFolderL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        void FolderChangeL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        void FoldersDeletedL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        void FoldersMovedL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+        void ExceptionL( TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* aParam3 );
+    
+    private:                                                                                                                         
+        static TBool Equals( const MMailboxContentObserver& a1, const MMailboxContentObserver& a2 );
+    private:
+        CFSMailPlugin*  iPlugin;
+        TFSMailMsgId    iFsMailboxId;
+        RPointerArray<MMailboxContentObserver> iClientObservers;
+    };
+    class CEmailRequestObserver: public CBase,
+                                 public MFSMailRequestObserver                                 
+        {
+    public:
+        CEmailRequestObserver();
+        
+        void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
+        void SetObserverL( MMailboxSyncObserver* aObserver );
+    private:
+        MMailboxSyncObserver* iObserver;
+        };
+        
+private:        
+
+    CPluginData&    iPluginData;
+    
+    CFSMailPlugin*  iPlugin;
+
+    TMailboxId      iMailboxId;
+    
+    TObserverEventMapper* iEventMapper;
+
+    mutable CEmailAddress* iAddress;
+
+    CFSMailBox*     iFsMailbox;
+    
+    CEmailRequestObserver* iSyncObserver;    
+    
+    TInt iRequestId;
+};
+    
+#endif // EMAILMAILBOX_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailmailboxcache.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,138 @@
+/*
+* 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: Definition for mailbox cache
+*
+*/
+
+#ifndef EMAILMAILBOXCACHE_H
+#define EMAILMAILBOXCACHE_H
+
+#include <e32base.h> 
+#include <emailapidefs.h>
+
+using namespace EmailInterface;
+
+class CPluginData;
+
+
+/**
+* Cache associating mailbox with a protocol plugin. Improves performance by
+* removing need to load protocol plugins every time a mailbox needs to be
+* accessed (and keeping plugin loaded when it is not needed)
+* @since s60 v5.2
+*/
+NONSHARABLE_CLASS( CEmailMailboxCache ) : public CBase
+{
+public:
+    /**
+    * Cache entry to access plugin by mailbox id
+    */
+    class TCacheEntry
+    {
+    public:
+        inline TCacheEntry( 
+            CPluginData* aPluginData, 
+            TMailboxId aId ) : 
+            iPluginData( aPluginData ), 
+            iMailboxId( aId ) {}
+        CPluginData* iPluginData;
+        TMailboxId iMailboxId;
+    };
+    
+    /**
+    * Constructor
+    */
+    static CEmailMailboxCache* NewL();
+    
+    /** destructor */
+    ~CEmailMailboxCache();
+    
+    /**
+    * Clears cache and indicates that one or more AddMailboxL calls will 
+    * follow.
+    * Cleanup support invalidates cache if leave occurs before EndCachingPop()
+    * is called
+    */
+    void StartCachingPushL();
+    
+    /**
+    * Marks caching fully complete for all mailboxes (call when no more
+    * AddMailboxL will follow) and pops cleanup item.
+    */
+    void EndCachingPop();      
+    
+    /**
+    * Returns if mailboxes are cached
+    */
+    TBool IsCached() const;
+
+    /**
+    * Adds mailbox to cache.
+    * @param aPluginData mailbox associated with plugin(data)
+    * @param aMailboxId mailbox id
+    * @precondition: StartCaching must have been called. 
+    */
+    void AddMailboxL( CPluginData& aPluginData, const TMailboxId& aMailboxId );
+    
+    /**
+    * Returns plugin data by mailbox id
+    * @param aMailboxId 
+    * @return plugin data associated with specified mailbox
+    */
+    CPluginData* PluginDataL( const TMailboxId& aMailboxId ) const;
+
+    /**
+    * Returns plugin data by plugin id
+    * @param aPluginId 
+    * @return plugin data associated with specified plugin
+    */
+    CPluginData* PluginDataL( const TUid& aPluginId ) const;
+    
+    /**
+    * Gets all mailbox ids in all protocol plugins
+    */
+    void GetIdsL( REmailMailboxIdArray& aIdArray ) const;
+    
+private:    
+
+    TInt FindById( const TMailboxId& aMailboxId ) const;
+    TInt FindByPluginIdL( const TUid& aPluginId ) const;    
+    static TBool Equals( const TCacheEntry& a1, const  TCacheEntry& a2 );
+    static TBool PluginEquals( const TCacheEntry& a1, const  TCacheEntry& a2 );
+    
+    static void CleanupOp( TAny* aAny );
+    
+private:
+    
+    CEmailMailboxCache();
+    
+    void ConstructL();
+
+    enum TCacheState {
+        EEmpty,
+        ECaching,
+        EComplete
+    };
+private:
+    // empty, caching or caching complete
+    TCacheState iState;
+
+    // cached mailbox id with associated plugin data
+    RArray<TCacheEntry> iEntries;
+};
+
+
+#endif // EMAILMAILBOXCACHE_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailmessage.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,200 @@
+/*
+* 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 message implementation definition
+*
+*/
+
+#ifndef EMAILMESSAGE_H
+#define EMAILMESSAGE_H
+
+#include <memailmessage.h>
+#include "cfsmailcommon.h"
+#include "emailapiutils.h"
+#include "MFSMailRequestObserver.h"
+#include <QEventLoop>
+
+using namespace EmailInterface;
+
+class CFSMailMessagePart;
+class CFSMailMessage;
+class CFSMailAddress;
+class CFSMailPlugin;
+class CPluginData;
+class CEmailAddress;
+class CEmailAttachment;
+class CEmailTextContent;
+class CEmailMultipart;
+
+NONSHARABLE_CLASS( CEmailMessage ) : public CBase, public MEmailMessage, public MFSMailRequestObserver
+    {
+public:
+    /**
+    * Creates email message from plugin message
+    */
+    static CEmailMessage* NewL( CPluginData& aPluginData,
+                                CFSMailMessage* aFsMessage,
+                                const TDataOwner aOwner );
+
+    ~CEmailMessage();
+
+public: // from MEmailInterface
+    TEmailTypeId InterfaceId() const;
+    
+    void Release();
+    
+public: // from MEmailMessage
+    /**@see MEmailMessage */
+    const TMessageId& MessageId() const;
+    
+    /**@see MEmailMessage */
+    MEmailAddress* SenderAddressL() const;
+    
+    /**@see MEmailMessage */
+    MEmailAddress* ReplyToAddressL() const;
+    
+    /**@see MEmailMessage */
+    void SetReplyToAddressL( const MEmailAddress& aSender );
+    
+    /**@see MEmailMessage */
+    TInt GetRecipientsL( const MEmailAddress::TRole aRole,
+        REmailAddressArray& aRecipients ) const;            
+    
+    /**@see MEmailMessage */
+    void SetRecipientsL( const MEmailAddress::TRole aRole, REmailAddressArray& aRecipients );
+    
+    /**@see MEmailMessage */
+    void RemoveRecipientL( const MEmailAddress& aRecipient );
+    
+    /**@see MEmailMessage */
+    TPtrC Subject() const;
+
+    /**@see MEmailMessage */
+    void  SetSubjectL( const TPtrC& aSubject );    
+    
+    /**@see MEmailMessage */
+    TTime Date() const;
+
+    /**@see MEmailMessage */
+    TInt Flags() const;
+    
+    /**@see MEmailMessage */
+    void SetFlag( const TUint aFlag );
+    
+    /**@see MEmailMessage */
+    void ResetFlag( const TUint aFlag );
+
+    /**@see MEmailMessage */
+    MEmailMessageContent* ContentL() const;
+
+    /**@see MEmailMessage */
+    void SetContentL( const MEmailMessageContent* aContent );
+    
+    /**@see MEmailMessage */
+    void SetPlainTextBodyL( const TDesC& aPlainText );
+
+    /**@see MEmailMessage */
+    MEmailAttachment* AddAttachmentL( const TDesC& aFullPath );
+    
+    /**@see MEmailMessage */
+    MEmailAttachment* AddAttachmentL( RFile& aFile );
+    
+    /**@see MEmailMessage */
+    TInt GetAttachmentsL( REmailAttachmentArray& aAttachments );
+    
+    /**@see MEmailMessage */
+    void RemoveAttachmentL( const MEmailAttachment& aAttachment );
+
+    /**@see MEmailMessage */
+    const TFolderId& ParentFolderId() const;
+
+    /**@see MEmailMessage */
+    void SaveChangesL();
+
+    /**@see MEmailMessage */
+    void SendL();
+
+    /**@see MEmailMessage */
+    void ShowMessageViewerL();
+    
+    /**@see MEmailMessage */
+    void ReplyToMessageL( const TBool aReplyToAll = ETrue );
+    
+    /**@see MEmailMessage */
+    void ForwardMessageL();
+    
+protected: // From MFSMailRequestObserver
+    void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
+
+private:        
+
+    // Copies/moves flag values from iPluginMessage's flags to local flag member variable
+    void InitializeFlagValues();
+    
+    CEmailMessage( CPluginData& aPluginData, CFSMailMessage* aMessage, const TDataOwner aOwner );
+    
+    void ConstructL();
+							       
+    void ConvertAddressArrayL( const MEmailAddress::TRole aRole, 
+                               const RPointerArray<CFSMailAddress>& aSrc, 
+                               REmailAddressArray& aDst ) const; 
+    CEmailAddress* CreateAddressLC( const MEmailAddress::TRole aRole, CFSMailAddress& aFsAddress ) const;
+    TUint MapFlags( const TUint& aFlag );
+    
+    TMessageContentId MessageContentId( TEntryId aContentId ) const;
+        
+private:
+    CPluginData&    iPluginData;
+    
+    CFSMailPlugin*  iPlugin;
+
+    TMessageId      iMessageId;
+    
+    TMessageContentId   iMsgContentId;
+                                                                                  
+    mutable CEmailAddress*  iSender;
+    
+    mutable CEmailAddress*  iReplyTo;
+    
+    REmailAddressArray iRecipients;
+    
+    CFSMailMessage* iPluginMessage;
+    
+    TUint        iFlags;
+    
+    mutable CEmailTextContent *iTextContent;
+    mutable CEmailMultipart* iContent;
+    RPointerArray<CEmailAttachment> iAttachments;
+    TDataOwner iOwner;
+    QEventLoop iEventLoop;
+    TInt iError;
+
+    };
+//Class for compare email content type 
+class TContentType
+{
+public:
+    TContentType( const TDesC& aContentType );
+    // Returns ETrue iff the content type represented by this object 
+    // (after parameters have been removed) is equal to the given content type.
+    TBool Equals( const TDesC& aContentType );
+
+private:
+    // Content type (without parameters)
+    TPtrC iContentType;
+};
+
+
+#endif // EMAILMESSAGE_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailmessagesearch.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,170 @@
+/*
+* 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: Definition of Email message search API.
+*
+*/
+
+#ifndef EMAILMESSAGESEARCHASYNCIMPL_H_
+#define EMAILMESSAGESEARCHASYNCIMPL_H_
+
+#include <memailmessage.h>
+#include <memailmessagesearch.h>
+#include <emailsorting.h>
+
+#include "cfsmailclient.h"
+#include "mfsmailboxsearchobserver.h"
+#include "emailapiutils.h"
+
+using namespace EmailInterface;
+
+
+NONSHARABLE_CLASS( CEmailMessageSearchAsync) : 
+    public CBase, 
+    public MEmailMessageSearchAsync, 
+    public MFSMailBoxSearchObserver
+
+{
+public:
+    /**
+    * Constructor
+    * @return
+    */
+    static CEmailMessageSearchAsync* NewL(
+        CPluginData& aPluginData,
+        const TMailboxId& aMailboxId );
+    
+    /**
+     * Destructor
+     */
+    ~CEmailMessageSearchAsync();
+    
+public: // from MEmailInterface
+    TEmailTypeId InterfaceId() const;
+    
+    void Release();
+    
+
+public: // from MEmailMessageSearchAsync
+    /**
+    * Sets sort order for search results.
+    * Leaves KErrNotReady if search is ongoing.
+    */
+    void SetSortCriteriaL( const TEmailSortCriteria& aCriteria );
+    
+    /**
+    * Adds a search key. Leaves KErrNotReady if search is ongoing.
+    */
+    void AddSearchKeyL( const TDesC& aSearchKey );
+                                                                  
+    /**
+    * Enables/disables search from remote email server.
+    * Leaves KErrNotReady if search is ongoing.
+    */
+    void SetRemoteSearchL( TBool aRemote );                                                               
+    
+    /**
+    * Indicates whether remote search is enabled.
+    */
+    TBool IsRemoteSearch() const;
+    
+    /**
+     * Starts search, all methods affecting search attribures leave
+     * KErrNotReady while search is ongoing.
+     * @param aObserver called when results are available.
+     */     
+    void StartSearchL( MEmailSearchObserver& aObserver );
+
+    /**
+     * Cancels search.
+     */
+    void Cancel();
+                                             
+    /** returns search status 
+      * @return search status:
+      *     < 0 : Search has failed
+      *     KRequestPending : search is ongoing. note that status may be
+      *         KRequestPending after HandleResultL callback because results 
+      *         may be given in chunks of results. Size of chunk depends on
+      *         implementation and may vary.
+      *     KErrNone : initial state, or search has finished
+      */
+    TInt Status() const;
+    
+    /**
+     * Resets all search attribures. Cancels search if ongoing. 
+     */
+    void Reset();
+    
+public:  // From MFSMailBoxSearchObserver
+    /** 
+     * Notifies the email search API client that a match has been found
+     * 
+     * @param aMatchMessage contains a pointer to the matched message.
+     *         Ownership is transfered to the observer.
+     *
+     */
+     void MatchFoundL( CFSMailMessage* aMatchMessage );
+
+    /**
+     * Notifies the email search API client that the search has completed
+     *
+     */
+     void SearchCompletedL();
+
+//
+    /**
+    * Asks client if search engine should change search priority 
+  	*/
+    void ClientRequiredSearchPriority(TInt *apRequiredSearchPriority); 
+//
+
+    
+private:
+    /**
+     * Constructor
+     */
+    CEmailMessageSearchAsync(
+        CPluginData& aPluginData,
+        const TMailboxId& aMailboxId );
+
+    void ConstructL();
+    
+    /**
+     * Function leaves if search is going on. Otherwise it doesn't do anything.
+     */
+    inline void IsSearchGoingOnL() const; 
+
+private:
+    
+    CPluginData&    iPluginData;
+    
+    CFSMailPlugin*  iPlugin;
+
+    TMailboxId      iMailboxId;
+    
+    TFSMailSortCriteria iCriteria;
+        
+    RPointerArray<TDesC> iSearchStrings;    
+
+    MEmailSearchObserver* iObserver;
+    
+    mutable RSemaphore iGate;
+
+    TBool iRemote;
+};
+
+#endif // EMAILMESSAGESEARCHASYNCIMPL_H_
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailmultipart.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,123 @@
+/*
+* 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: Definition of Email text content.
+*
+*/
+
+
+#ifndef EMAILMULTIPART_H_
+#define EMAILMULTIPART_H_
+// INCLUDES
+#include "cfsmailclient.h"
+#include <memailcontent.h>
+#include "emailapiutils.h"
+
+using namespace EmailInterface;
+
+class CEmailMessageContent;
+
+
+// CLASS DECLARATION
+
+NONSHARABLE_CLASS( CEmailMultipart ) : public CBase,
+                                       public MEmailMultipart
+{
+public:
+    static CEmailMultipart* NewL( CPluginData& aPluginData, 
+            const TMessageContentId& aMsgContentId, 
+            CFSMailMessagePart* aPart,
+            const TDataOwner aOwner );
+    
+    ~CEmailMultipart();
+    
+public: // from MEmailInterface
+    TEmailTypeId InterfaceId() const;
+    
+    void Release();
+
+public: // from MEmailMessageContent
+    
+    TMessageContentId Id() const;
+
+    TPtrC ContentType() const;
+
+    void SetContentType( const TDesC& aContentType );
+
+    TPtrC ContentId() const;
+
+    void SetContentId( const TDesC& aContentId );
+
+    TPtrC ContentDescription() const;
+
+    void SetContentDescription( const TDesC& aContentDescription );
+
+    TPtrC ContentDisposition() const;
+
+    void SetContentDisposition( const TDesC& aContentDisposition );
+
+    TPtrC ContentClass() const;
+
+    void SetContentClass( const TDesC& aContentClass );
+
+    TInt AvailableSize() const;
+
+    TInt TotalSize() const;
+
+    TPtrC ContentL() const;
+
+    void SetContentL( const TDesC& aContent );
+
+    void FetchL( MEmailFetchObserver& aObserver );
+
+    void CancelFetch();
+
+    void SaveToFileL( const TDesC& aPath );
+
+    MEmailMultipart* AsMultipartOrNull() const;
+    
+    MEmailTextContent* AsTextContentOrNull() const;
+
+    MEmailAttachment* AsAttachmentOrNull() const;
+    
+public: // from MEmailMultipart
+    TInt PartCountL();
+
+    MEmailMessageContent* PartByIndexL( const TUint aIndex ) const;
+
+    void DeletePartL( const TUint aIndex );
+
+    void AddPartL(
+        const MEmailMessageContent& aPart,
+        const TUint aPos );
+    
+public: // for internal usage
+    void SetOwner( const TDataOwner aOwner );
+    
+    
+private:
+    CEmailMultipart( const TDataOwner aOwner );
+    
+    void ConstructL( CPluginData& aPluginData, const TMessageContentId& aMsgContentId, CFSMailMessagePart* aPart );
+    
+private: // Private data        
+    CEmailMessageContent* iEmailMsgContent;
+    RArray<TFSMailMsgId> iChildParts;
+    TUint iChildPartCount;
+    TDataOwner iOwner;
+};
+
+#endif // EMAILMULTIPART_H_
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/emailtextcontent.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,121 @@
+/*
+* 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: Definition of Email text content.
+*
+*/
+
+
+#ifndef EMAILTEXTCONTENT_H_
+#define EMAILTEXTCONTENT_H_
+
+// INCLUDES
+#include "cfsmailclient.h"
+#include <memailcontent.h>
+#include "emailapiutils.h"
+
+using namespace EmailInterface;
+
+class CEmailMessageContent;
+// CLASS DECLARATION
+
+/**
+ *  CEmailTextContent
+ * 
+ */
+NONSHARABLE_CLASS( CEmailTextContent ) : public CBase,
+                                         public MEmailTextContent
+{   
+public:
+    static CEmailTextContent* NewL( CPluginData& aPluginData, 
+            const TMessageContentId& aMsgContentId, 
+            CFSMailMessagePart* aPart,
+            const TDataOwner aOwner );
+    
+    ~CEmailTextContent();
+    
+public: // from MEmailInterface
+    TEmailTypeId InterfaceId() const;
+    
+    void Release();
+
+public: // from MEmailTextContent
+    TTextType TextType() const;
+
+    void SetTextL(
+            const TTextType aPlainOrHtml,
+            const TDesC& aText );
+    
+public: // from MEmailMessageContent
+    
+    TMessageContentId Id() const;
+
+    TPtrC ContentType() const;
+
+    void SetContentType( const TDesC& aContentType );
+
+    TPtrC ContentId() const;
+
+    void SetContentId( const TDesC& aContentId );
+
+    TPtrC ContentDescription() const;
+
+    void SetContentDescription( const TDesC& aContentDescription );
+
+    TPtrC ContentDisposition() const;
+
+    void SetContentDisposition( const TDesC& aContentDisposition );
+
+    TPtrC ContentClass() const;
+
+    void SetContentClass( const TDesC& aContentClass );
+
+    TInt AvailableSize() const;
+
+    TInt TotalSize() const;
+
+    TPtrC ContentL() const;
+
+    void SetContentL( const TDesC& aContent );
+
+    void FetchL( MEmailFetchObserver& aObserver );
+
+    void CancelFetch();
+
+    void SaveToFileL( const TDesC& aPath );
+
+    MEmailMultipart* AsMultipartOrNull() const;
+    
+    MEmailTextContent* AsTextContentOrNull() const;
+
+    MEmailAttachment* AsAttachmentOrNull() const;
+    
+public: // for internal usage
+    void SetOwner( const TDataOwner aOwner );
+
+    
+private:
+    CEmailTextContent( const TDataOwner aOwner );
+    
+    void ConstructL( CPluginData& aPluginData, const TMessageContentId& aMsgContentId, CFSMailMessagePart* aPart);
+    
+private:        
+    TTextType               iTextType;
+    CEmailMessageContent*   iEmailMsgContent;
+    TDataOwner              iOwner;
+};
+
+#endif // EMAILTEXTCONTENT_H_
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/inc/messageiterator.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,135 @@
+/*
+* 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: Email message iterator
+*
+*/
+
+#ifndef CMESSAGEITERATOR_H
+#define CMESSAGEITERATOR_H
+                                                                             
+#include <mmessageiterator.h>                                                                             
+#include "emailapidefs.h"
+#include "cfsmailcommon.h"
+
+using namespace EmailInterface;
+
+class MFSMailIterator;
+class CPluginData;
+class CFSMailMessage;
+class CEmailMessage;
+/**
+ * Iterator for email messages
+ * @since S60 v5.2
+ */
+NONSHARABLE_CLASS( CMessageIterator ) : public CBase, public MMessageIterator
+{
+public:
+    /**
+    * Constructor
+    * @param aIterator
+    * @param aPluginData
+    * @return new iterator
+    */
+    static CMessageIterator* NewL( MFSMailIterator* aIterator,
+                                   CPluginData& aPluginData,
+                                   TUint aCount );
+    
+    ~CMessageIterator();
+
+private:
+    CMessageIterator( MFSMailIterator* aIterator, CPluginData& aPluginData, TUint aCount );
+    
+    void ConstructL();
+    
+public: // from MEmailInterface              
+
+    TEmailTypeId InterfaceId() const;
+
+    void Release();
+    
+public: // from MMessageIterator
+
+    /** @see MMessageIterator */
+    MEmailMessage* NextL();
+    
+    /** @see MMessageIterator 
+     (not implemented) */
+    
+    MEmailMessage* PreviousL();
+    
+    TUint Count() const;
+        
+
+private:   
+    // Reads next chunk of messages from protocol plugin
+    TBool ReadNextChunkL();
+    TBool ReadPreviousChunkL();
+    MEmailMessage* ReadFromChunkL();
+    void CleanCache();    
+    void AddToCacheL( CFSMailMessage* aFsMsg );    
+private: // data
+    
+    /**
+    * Iterator internal states. "Consuming" in state names mean getting and 
+    * returning next message from the iterator.
+    */
+    enum TState {
+        // No messages available in iterator, read them from protocl plugin.
+        // NextL returns a message from chunk (or NULL if folder is empty)
+        // This is initial state.
+        EReadNextMessageChunk,
+        EReadPreviousMessageChunk,
+        
+        // Message(s) are available (retrieved from plugin). No remaining 
+        // messages excepted from the plugin. NextL returns a message from chunk.
+        EConsumeFromChunk,
+        
+        // Message(s) are available in chunk and more in protocol plugin.
+        EConsumeFromChunkWithMoreChunksToFollow,
+        
+        // Iterator is iterated throuh and NextL would return NULL.
+        EIteratorConsumed
+    };
+
+    // plugin iterator, owned
+    MFSMailIterator* iIterator;
+    
+    // reference to plugin data
+    CPluginData&    iPluginData;
+
+    CFSMailPlugin*  iPlugin;
+    
+    // message id used for reading messages from plugin
+    TFSMailMsgId    iStartMsgId;
+    
+    // Internal state  
+    TState           iState;
+    
+    // pointer array of messages read from protocol plugin (aka message chunk)
+    RPointerArray<CFSMailMessage> iFsMessageArray;
+    RPointerArray<CEmailMessage> iMessageArray;
+    
+    TUint iCount;
+    
+    TInt iCursor;
+    
+    TFSMailMsgId iFirstMsgId;
+    
+    TBool iHasMoreNextItems;
+    TBool iHasMorePrevItems;
+};
+
+#endif // CMESSAGEITERATOR_H
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/rom/emailclientapi.iby	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,22 @@
+/*
+* 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:  (ROM) Image description file for emailclientapi
+*
+*/
+#include <data_caging_paths_for_iby.hrh>
+#ifdef FF_EMAIL_FRAMEWORK
+
+ECOM_PLUGIN( emailclientapi.dll, emailclientapi.rsc )
+
+#endif
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailaddress.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,129 @@
+/*
+* 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: This file implements class CEmailAddress.
+*
+*/
+
+#include "emailaddress.h"
+#include "cfsmailclient.h"
+#include "emailclientapi.hrh"
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailAddress* CEmailAddress::NewL( const TRole aRole, const TDataOwner aOwner )
+    {
+    CEmailAddress* self = new ( ELeave ) CEmailAddress( aRole, aOwner );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailAddress* CEmailAddress::NewLC( const TRole aRole, const TDataOwner aOwner )
+    {
+    CEmailAddress* self = CEmailAddress::NewL( aRole, aOwner );
+    CleanupStack::PushL( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailAddress::~CEmailAddress()
+    {
+    iAddress.Close();
+    iDisplayName.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailAddress::CEmailAddress( const TRole aRole, const TDataOwner aOwner ) :
+    iRole( aRole ), 
+    iOwner( aOwner )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TEmailTypeId CEmailAddress::InterfaceId() const
+    {
+    return KEmailIFUidAddress;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailAddress::Release()
+    {
+    if ( iOwner == EClientOwns )
+        {
+        delete this;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailAddress::SetAddressL( const TDesC& aAddress )
+    {
+    iAddress.Close();
+    iAddress.CreateL( aAddress );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailAddress::Address() const
+    {    
+    return iAddress;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailAddress::SetDisplayNameL( const TDesC& aDisplayName )
+    {
+    iDisplayName.Close();
+    iDisplayName.CreateL( aDisplayName );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailAddress::DisplayName() const
+    {
+    return iDisplayName;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailAddress::TRole CEmailAddress::Role() const
+    {
+    return iRole;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailAddress::SetRole( const TRole aRole )
+    {
+    iRole = aRole;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailapiutils.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,144 @@
+/*
+* 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: This file implements class CEmailApiUtils.
+*
+*/
+
+#include <e32std.h>
+#include "cfsmailplugin.h"
+#include "emailapidefs.h"
+#include "emailclientapiimpldefs.h"
+#include "emailapiutils.h"
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CPluginData::CPluginData( TUid aUid ) :
+    iData( aUid ),
+    iPluginLoadError( KErrNotReady )
+    { 
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CPluginData::~CPluginData()
+    {
+    // panic if a user of plugin has not called ReleaseInstance after ClaimInstance
+    __ASSERT_ALWAYS( iOwned || !iRefCount, Panic( EMailPanicPluginNotReleased ) );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CFSMailPlugin* CPluginData::ClaimInstance()
+    {
+    if ( !iData.iPlugin )
+        {
+        TRAP( iPluginLoadError, iData.iPlugin = CFSMailPlugin::NewL( iData.iUid ) );
+        }
+    if ( !iPluginLoadError )
+        {
+        iRefCount++;
+        }
+    return iData.iPlugin;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CFSMailPlugin* CPluginData::ClaimInstanceL()
+    {
+    ClaimInstance();
+    User::LeaveIfError( iPluginLoadError );
+    return iData.iPlugin;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CPluginData::ReleaseInstance()
+    {
+    if ( iData.iPlugin )
+        {
+        iRefCount--;
+        if ( !iRefCount )
+            {
+            delete iData.iPlugin;
+            iData.iPlugin = NULL;
+            }
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CPluginData::ReleasePushL()
+    {
+    TCleanupItem item( &CPluginData::CleanupOperation, this );
+    CleanupStack::PushL( item );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CPluginData::CleanupOperation( TAny* aAny )
+    {
+    CPluginData* pdata = reinterpret_cast<CPluginData*>( aAny );
+    pdata->ReleaseInstance();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TUid CPluginData::Uid() const
+    {
+    return iData.iUid;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TInt CPluginData::LoadResult() const
+    {
+    return iPluginLoadError;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TFSMailMsgId FsMsgId( const CPluginData& aPluginData, const EmailInterface::TBaseId& aId )
+    {
+    TFSMailMsgId id( aPluginData.Uid(), aId.iId );
+    return id;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CleanupReleasePush::PushL( EmailInterface::MEmailInterface& aItem )
+    {
+    TCleanupItem item( &CleanupReleasePush::Release, &aItem );
+    CleanupStack::PushL( item );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CleanupReleasePush::Release( TAny *aPtr )
+    {
+    reinterpret_cast<EmailInterface::MEmailInterface*>( aPtr )->Release();
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailattachment.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,292 @@
+/*
+* 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: This file implements class CEmailAttachment.
+*
+*/
+
+#include "emailattachment.h"
+#include "emailcontent.h"
+#include "emailclientapi.hrh"
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------/
+CEmailAttachment::CEmailAttachment( const TDataOwner aOwner ) : iOwner( aOwner )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+CEmailAttachment::~CEmailAttachment()
+    {
+    delete iEmailMsgContent;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+CEmailAttachment* CEmailAttachment::NewLC(
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,
+        CFSMailMessagePart *aAtt,
+        const TDataOwner aOwner )
+    {    
+    CEmailAttachment* self = new (ELeave) CEmailAttachment( aOwner );
+    CleanupStack::PushL( self );
+    self->ConstructL( aPluginData, aMsgContentId, aAtt );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+CEmailAttachment* CEmailAttachment::NewL(
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,
+        CFSMailMessagePart *aAtt,
+        const TDataOwner aOwner )
+    {
+    CEmailAttachment* self = CEmailAttachment::NewLC( aPluginData, aMsgContentId, aAtt, aOwner );
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::ConstructL(
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,
+        CFSMailMessagePart *aAtt)
+    {
+    iEmailMsgContent = CEmailMessageContent::NewL( aPluginData, aMsgContentId, aAtt );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TInt CEmailAttachment::AvailableSize() const
+{
+    return iEmailMsgContent->AvailableSize();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::CancelFetch()
+{
+    iEmailMsgContent->CancelFetch();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TPtrC CEmailAttachment::ContentL() const
+{
+    User::Leave(KErrNotSupported);
+    return iEmailMsgContent->ContentL();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TPtrC CEmailAttachment::ContentClass() const
+{
+    return iEmailMsgContent->ContentClass();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TPtrC CEmailAttachment::ContentDescription() const
+{
+    return iEmailMsgContent->ContentDescription();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TPtrC CEmailAttachment::ContentDisposition() const
+{
+    return iEmailMsgContent->ContentDisposition();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TPtrC CEmailAttachment::ContentId() const
+{
+    return iEmailMsgContent->ContentId();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TPtrC CEmailAttachment::ContentType() const
+{
+    return iEmailMsgContent->ContentType();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::FetchL( MEmailFetchObserver & aObserver )
+{
+    iEmailMsgContent->FetchL( aObserver );
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TMessageContentId CEmailAttachment::Id() const
+{
+    return iEmailMsgContent->Id();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TEmailTypeId CEmailAttachment::InterfaceId() const
+    {
+    return KEmailIFUidAttachment;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::Release()
+    {
+    if ( iOwner == EClientOwns )
+        {    
+        delete this;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::SaveToFileL( const TDesC& aPath )
+{
+    iEmailMsgContent->SaveToFileL( aPath );
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::SetContentClass( const TDesC& aContentClass )
+{
+    iEmailMsgContent->SetContentClass( aContentClass );
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::SetContentDescription( const TDesC& aContentDescription )
+{
+    iEmailMsgContent->SetContentDescription(aContentDescription);
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::SetContentDisposition( const TDesC& aContentDisposition )
+{
+    iEmailMsgContent->SetContentDisposition( aContentDisposition );
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::SetContentId( const TDesC &aContentId )
+{
+    iEmailMsgContent->SetContentId( aContentId );
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::SetContentL( const TDesC &aContent )
+{
+    iEmailMsgContent->SetContentL( aContent );
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailAttachment::SetContentType( const TDesC &aContentType )
+{
+    iEmailMsgContent->SetContentType( aContentType );
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TInt CEmailAttachment::TotalSize() const
+{
+    return iEmailMsgContent->TotalSize();
+}
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailMultipart* CEmailAttachment::AsMultipartOrNull() const
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailTextContent* CEmailAttachment::AsTextContentOrNull() const
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailAttachment* CEmailAttachment::AsAttachmentOrNull() const
+    {
+    const MEmailAttachment* ptr = this;
+    return const_cast<MEmailAttachment *>( ptr );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+RFile CEmailAttachment::FileL() const
+    {
+    return iEmailMsgContent->Part().GetContentFileL();
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------/
+void CEmailAttachment::SetFileNameL( const TDesC& aFileName )
+    {
+    iEmailMsgContent->Part().SetAttachmentNameL( aFileName );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TPtrC CEmailAttachment::FileNameL() const
+    {
+    return iEmailMsgContent->Part().AttachmentNameL();
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailclientapiimpl.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,425 @@
+/*
+* 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: This file implements class CEmailClientApi.
+*
+*/
+
+
+
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <viewclipartner.h>
+#include <vwsdefpartner.h>
+#else
+#include <viewcli.h>
+#include <vwsdef.h>
+#endif // SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <centralrepository.h>
+#include "emailclientapiimpl.h"
+#include "emailapiutils.h"
+#include "emailmailbox.h"
+#include <memailaddress.h>
+#include "cfsmailplugin.h"
+#include "cfsmailclient.h"
+#include "emailclientapiimpldefs.h"
+#include "emailmailboxcache.h"
+#include "emailclientapi.hrh"
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+MEmailMailbox* CEmailClientApi::MailboxL( const TMailboxId& aId )
+    {
+    UpdateMailboxInfoCacheL();
+    CPluginData* pluginData = MailboxInfoCacheL().PluginDataL( aId );
+    MEmailMailbox* mailbox = NULL;
+    if ( pluginData )
+        {
+        mailbox = CEmailMailbox::NewL( *pluginData, aId );
+        }
+    return mailbox;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailMailbox* CEmailClientApi::MailboxL( const TPtrC& aAddress )
+    {
+    MEmailMailbox* mailbox = NULL;
+    REmailMailboxIdArray mailboxes;
+    CleanupClosePushL( mailboxes );
+    TInt count( GetMailboxIdsL( mailboxes ) );
+    while ( count-- )
+        {
+        const TMailboxId mailboxId = mailboxes[count];
+        MEmailMailbox* refMailbox = MailboxL( mailboxId );
+        if ( refMailbox )
+            {
+            TPtrC address( refMailbox->AddressL()->Address() );
+            if ( !address.Compare( aAddress ) )
+                {
+                mailbox = refMailbox; // addresses match
+                count = 0;
+                }
+            else
+                {
+                refMailbox->Release();
+                }
+            }
+        }
+    CleanupStack::PopAndDestroy( &mailboxes );
+    // find mailbox or leave KErrNotFound
+    if ( !mailbox )
+        {
+        User::Leave( KErrNotFound );
+        }
+    return mailbox;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailClientApi::GetMailboxIdsL( 
+    REmailMailboxIdArray& aMailboxes )
+    {
+    UpdateMailboxInfoCacheL();
+
+    aMailboxes.Reset();
+    CEmailMailboxCache& mbcache = MailboxInfoCacheL();
+    mbcache.GetIdsL( aMailboxes ); 
+
+    const TInt mailboxesFound( aMailboxes.Count() );
+    return mailboxesFound;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailClientApi::GetMailboxesL( RMailboxPtrArray& aMailboxes )
+    {
+    REmailMailboxIdArray mailboxIdArray;
+    CleanupClosePushL( mailboxIdArray );
+
+    // GetMailboxIdsL loads plugin and keeps loaded if it contains at
+    // least one mailbox
+    TInt count = GetMailboxIdsL( mailboxIdArray );
+    while ( count-- )
+        {
+        // mailbox creation increases plugin ref count by one
+        MEmailMailbox* mailbox = MailboxL( mailboxIdArray[count] );
+        CleanupReleasePushL( *mailbox );
+        aMailboxes.AppendL( mailbox );
+        CleanupStack::Pop( mailbox );
+        }
+    // Created mailboxes still hold plugin references so we can decrease 
+    // ref count.
+    ReleaseAllPlugins(); 
+    
+    CleanupStack::PopAndDestroy( &mailboxIdArray );
+    return aMailboxes.Count();
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailClientApi::LaunchEmailL( const TLaunchPolicy /*aPolicy*/ )
+    {
+    User::Leave(KErrNotSupported);
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CPluginData* CEmailClientApi::TPluginIterator::Next()
+    {
+    CPluginData* item = NULL;
+    if ( iIndex < iArray.Count() )
+        {
+        item = iArray[ iIndex++ ];
+        }
+    return item;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailClientApi* CEmailClientApi::NewL()
+    {
+    CEmailClientApi* instance = static_cast<CEmailClientApi*>( Dll::Tls() );
+
+    if ( !instance )
+        {
+        instance = new ( ELeave ) CEmailClientApi();
+        CleanupStack::PushL( instance );
+        instance->ConstructL();
+        User::LeaveIfError( Dll::SetTls( instance ) );
+        CleanupStack::Pop( instance );
+        }
+
+    instance->iInstanceCounter++;
+
+    return instance;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailClientApi::~CEmailClientApi()
+    {
+    // ensure this doesn't held plugin references
+    ReleaseAllPlugins();
+
+    // ResetAndDestroy doesn't work because ~CPluginData is private
+    TInt count( iPluginDataArray.Count() );
+    while ( count-- )
+        {
+        delete iPluginDataArray[count];
+        }
+    iPluginDataArray.Close();
+    iLoadedPluginsArray.Close();
+    delete iMailboxCache;
+
+    Dll::FreeTls();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailClientApi::CEmailClientApi() : iInstanceCounter( 0 )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailClientApi::CleanupImplInfoPushL( RPointerArray<CImplementationInformation>& aArray )
+    {
+    TCleanupItem item( &CEmailClientApi::CleanupImplInfo, &aArray );
+    CleanupStack::PushL( item );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailClientApi::CleanupImplInfo( TAny* aAny )
+    {
+    RPointerArray<CImplementationInformation>* array = 
+        reinterpret_cast<RPointerArray<CImplementationInformation>*>( aAny );
+    array->ResetAndDestroy();
+    }
+ 
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailClientApi::ConstructL()
+    {
+    RPointerArray<CImplementationInformation> implInfoArray;
+    REComSession::ListImplementationsL( KFSMailPluginInterface, implInfoArray );
+    CleanupImplInfoPushL( implInfoArray );
+    TInt err = KErrNone;
+    TInt count( implInfoArray.Count() );
+    // add implementation UIDs to plugin info array, no instantiation at this
+    // phase
+    while ( count-- )
+        {
+        const CImplementationInformation* info = implInfoArray[count];
+        CPluginData* pluginData = new ( ELeave ) CPluginData( info->ImplementationUid() );
+        err = iPluginDataArray.Append( pluginData );
+        if ( err != KErrNone )
+            {
+            // failed to append, give up
+            delete pluginData;
+            count = 0;
+            }
+        }
+    iMailClient =  CFSMailClient::NewL();
+    CleanupStack::PopAndDestroy( &implInfoArray );
+    User::LeaveIfError( err );    
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TEmailTypeId CEmailClientApi::InterfaceId() const
+    {
+    return KEmailClientApiInterface;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailClientApi::Release()
+    {
+    if( this->iInstanceCounter == 1 )
+        {
+        delete this;
+        }
+    else
+        {
+        this->iInstanceCounter--;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Returns plugin instance from plugin data. If we already have "claimed"
+// instance once, prevent increment of reference count 
+// -----------------------------------------------------------------------------
+CFSMailPlugin* CEmailClientApi::UsePlugin( CPluginData& aPluginData )
+    {
+    // use 'data' as search key for IndexOfLoadedPluginData()
+    TPluginData data( aPluginData.Uid() );
+    TPluginData* pluginDataPtr = &data;
+    // check if we have plugin already "in use".
+    const TInt index( IndexOfLoadedPluginData( data ) );
+    if ( index == KErrNotFound )
+        { // we don't have plugin instance so take it and add to loaded plugins
+        data.iPlugin = aPluginData.ClaimInstance();
+        if ( data.iPlugin && iLoadedPluginsArray.Append( data ) != KErrNone )
+            {                
+            aPluginData.ReleaseInstance(); // failed to append, don't proceed..
+            data.iPlugin = NULL;           // but return null
+            }          
+        }
+    else
+        {
+        // already in use, obtain plugin pointer from the array
+        pluginDataPtr = &iLoadedPluginsArray[index];
+        }
+    return pluginDataPtr->iPlugin;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailClientApi::ReleasePlugin( CPluginData& aPluginData )
+    {
+    // release plugin but only if it is not already claimed
+    TPluginData data( aPluginData.Uid() );
+    const TInt index( IndexOfLoadedPluginData( data ) );
+     if ( index != KErrNotFound )
+        {
+        aPluginData.ReleaseInstance();
+        iLoadedPluginsArray.Remove( index );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailClientApi::ReleaseAllPlugins()
+    {
+    for ( TInt i = 0; i < iPluginDataArray.Count(); i++ )
+        {
+        CPluginData* pdata = iPluginDataArray[i];
+        ReleasePlugin( *pdata );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailMailboxCache& CEmailClientApi::MailboxInfoCacheL()
+    {
+    if ( !iMailboxCache)
+        {
+        iMailboxCache = CEmailMailboxCache::NewL();
+        }
+    return *iMailboxCache;
+    }
+
+// -----------------------------------------------------------------------------
+// Lists all mailboxes in protocol plugins and adds them to cache. Plugins may 
+// not be loaded so loading is done. The plugin is kept in memory if it contains
+// at least one mailbox to avoid loading again later as typical use case is 
+// creation of a mailbox object => the plugin is again needed 
+//( see ::GetMailboxesL which calls ReleaseAllPlugins()
+// -----------------------------------------------------------------------------
+void CEmailClientApi::UpdateMailboxInfoCacheL()
+    {
+    CEmailMailboxCache& mbcache = MailboxInfoCacheL();
+    if ( !mbcache.IsCached() )
+        {
+        // cache update needed
+        mbcache.StartCachingPushL();
+        TPluginIterator iter( iPluginDataArray );
+        CPluginData* pluginData = iter.Next();
+        while ( pluginData )
+            {
+            TBool containsMailbox( EFalse );
+            // loads plugin if needed
+            CFSMailPlugin* plugin = UsePlugin( *pluginData );
+            if ( plugin )
+                {
+                // if one plugin fails, it should not block other plugins
+                // ==> trap it             
+                
+                TRAPD( err, containsMailbox = CachePluginMailboxesL(
+                    *pluginData, 
+                    *plugin ) );
+                if ( !containsMailbox || err )
+                    {
+                    // plugins with no mailboxes (or failed to cache) is
+                    // released (unloaded) to optimize RAM usage.
+                    ReleasePlugin( *pluginData );
+                    }            
+                }
+            else if ( pluginData->iPluginLoadError == KErrNoMemory )
+                {
+                // don't continue if OOM
+                User::Leave( KErrNoMemory );
+                }
+            pluginData = iter.Next();
+            }
+        mbcache.EndCachingPop();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TBool CEmailClientApi::CachePluginMailboxesL( CPluginData& aPluginData, CFSMailPlugin& aPlugin )
+    {
+    TBool containsMailbox( EFalse );
+    RArray<TFSMailMsgId> pluginMailboxes;
+    CleanupClosePushL( pluginMailboxes );
+    aPlugin.ListMailBoxesL( pluginMailboxes );
+    TInt mailboxCount = pluginMailboxes.Count();
+    while ( mailboxCount-- )
+        {
+        const TFSMailMsgId& mailboxId = pluginMailboxes[mailboxCount];
+        TMailboxId id( mailboxId.Id() );
+        MailboxInfoCacheL().AddMailboxL( aPluginData, id );
+        containsMailbox = ETrue;
+        }
+    CleanupStack::PopAndDestroy( &pluginMailboxes );
+    return containsMailbox;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailClientApi::IndexOfLoadedPluginData( const TPluginData& aPluginData ) const
+    {
+    TIdentityRelation<TPluginData> relation( CEmailClientApi::PluginDataEquals );
+    return iLoadedPluginsArray.Find( aPluginData, relation );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TBool CEmailClientApi::PluginDataEquals( const TPluginData& a1, const TPluginData& a2 )
+    {
+    return ( a1.iUid == a2.iUid );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailcontent.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,412 @@
+/*
+* 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: This file implements class CEmailContent.
+*
+*/
+
+#include <apmstd.h>
+
+#include "emailcontent.h"
+#include "cfsmailclient.h"
+#include "emailclientapi.hrh"
+#include "emailapiutils.h"
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CEmailMessageContent* CEmailMessageContent::NewL( 
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,
+        CFSMailMessagePart* aPart )    
+    {
+
+    CEmailMessageContent* self = new ( ELeave ) 
+        CEmailMessageContent( aPluginData, aMsgContentId, aPart );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CFSMailMessagePart& CEmailMessageContent::Part()
+    {
+    return *iPart;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::SetPart( CFSMailMessagePart* aPart )
+    {
+    iPart = aPart;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CPluginData& CEmailMessageContent::PluginData()
+    {
+    return iPluginData;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::ConstructL()
+    {
+    iPlugin = iPluginData.ClaimInstanceL();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CEmailMessageContent::~CEmailMessageContent()
+    {
+    iPluginData.ReleaseInstance();
+    delete iPart;
+    delete iBuf;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CEmailMessageContent::CEmailMessageContent(
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,
+        CFSMailMessagePart* aPart):
+        iPluginData( aPluginData ), 
+        iPart( aPart ), 
+        iMsgContentId( aMsgContentId ), 
+        iBuf( NULL ), 
+        iUsed( 0 )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TEmailTypeId CEmailMessageContent::InterfaceId() const
+    {
+    return KEmailIFUidMessageContent;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::Release()
+    {
+    delete this;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TMessageContentId CEmailMessageContent::Id() const
+    {
+    return iMsgContentId;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TPtrC CEmailMessageContent::ContentType() const
+    {
+    if (iPart)
+        {
+        return iPart->GetContentType();
+        } 
+    else
+        {
+        return TPtrC(0,0);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::SetContentType( const TDesC& aContentType )
+    {
+    if (iPart)
+        iPart->SetContentType( aContentType );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TPtrC CEmailMessageContent::ContentId() const
+    {
+    if (iPart)
+        {
+        return iPart->ContentID();
+        }
+    else
+        {
+        return TPtrC(0,0);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::SetContentId( const TDesC& aContentId )
+    {
+    if (iPart)
+        TRAP_IGNORE( iPart->SetContentIDL( aContentId ) );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TPtrC CEmailMessageContent::ContentDescription() const
+    {
+    if (iPart)
+        {
+        return iPart->ContentDescription();
+        }
+    else
+        {
+        return TPtrC(0,0);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::SetContentDescription( 
+    const TDesC& aContentDescription )
+    {
+    if (iPart)
+        iPart->SetContentDescription( aContentDescription );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TPtrC CEmailMessageContent::ContentDisposition() const
+    {
+    if (iPart)
+        {
+        return iPart->ContentDisposition();
+        }
+    else
+        {
+        return TPtrC(0,0);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::SetContentDisposition( 
+    const TDesC& aContentDisposition )
+    {
+    if (iPart)
+        iPart->SetContentDisposition( aContentDisposition );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TPtrC CEmailMessageContent::ContentClass() const
+    {
+    if (iPart)
+        {
+        return iPart->GetContentClass();
+        }
+    else
+        {
+        return TPtrC(0,0);
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::SetContentClass( const TDesC& aContentClass )
+    {
+    if (iPart)
+        iPart->SetContentClass( aContentClass );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TInt CEmailMessageContent::AvailableSize() const
+    {
+    if (iPart)
+        {
+        return iPart->FetchedContentSize();
+        }
+    else
+        {
+        return 0;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TInt CEmailMessageContent::TotalSize() const
+    {
+    if (iPart)
+        {
+        return iPart->ContentSize();
+        }
+    else
+        {
+        return 0;
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TPtrC CEmailMessageContent::ContentL() const
+    {
+    TInt size = AvailableSize();
+    TPtr16 ptr( 0, size );
+    if ( size != 0 )
+        {
+        if ( !iBuf )
+            {
+            iBuf = HBufC::NewL( size );
+            }
+        
+        if ( size > ptr.MaxLength() )
+            {
+            iBuf = iBuf->ReAlloc( size );
+            }
+        ptr.Set( iBuf->Des() );
+        iPart->GetContentToBufferL( ptr, iUsed );
+        iUsed += size;
+        }
+    return ptr;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::SetContentL( const TDesC& aContent )
+    {
+    User::LeaveIfNull( iPart );
+    iPart->SetContentSize( aContent.Length() );
+    iPart->SetFetchedContentSize( aContent.Length() );
+    iPlugin->SetContentL( aContent, 
+            FsMsgId( iPluginData, iMsgContentId.iMessageId.iFolderId.iMailboxId ),
+            FsMsgId( iPluginData, iMsgContentId.iMessageId.iFolderId ),
+            FsMsgId( iPluginData, iMsgContentId.iMessageId ),
+            FsMsgId( iPluginData, iMsgContentId ) );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::FetchL( MEmailFetchObserver&  aObserver )
+    {
+    User::LeaveIfNull( iPart );
+    const TFSMailMsgId fsId = FsMsgId(iPluginData, iMsgContentId);
+    if ( !iFetchObserver )
+        {
+        iFetchObserver = new ( ELeave ) CContentRequestObserver( *this );
+        }
+    iFetchObserver->SetObserverL( &aObserver );
+    iRequestId = iPart->FetchMessagePartL( fsId, *iFetchObserver, TUint( 0 ) );
+
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::CancelFetch()
+    {
+    TRAP_IGNORE( iPlugin->CancelL( iRequestId ) );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::SaveToFileL( const TDesC& aPath )
+    {
+    iPlugin->CopyMessagePartFileL(
+        FsMsgId( iPluginData, iMsgContentId.iMessageId.iFolderId.iMailboxId ),
+        FsMsgId( iPluginData, iMsgContentId.iMessageId.iFolderId ),
+        FsMsgId( iPluginData, iMsgContentId.iMessageId ),
+        FsMsgId( iPluginData, iMsgContentId ),
+        aPath );
+    }
+
+/* Dummy implementations, not ever called */
+MEmailMultipart* CEmailMessageContent::AsMultipartOrNull() const 
+    {
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+MEmailTextContent* CEmailMessageContent::AsTextContentOrNull() const
+    {
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+MEmailAttachment* CEmailMessageContent::AsAttachmentOrNull() const
+    {
+    return NULL;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CEmailMessageContent::CContentRequestObserver::CContentRequestObserver( 
+    CEmailMessageContent& aParent ) : iObserver( NULL ), iParent( aParent )
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::CContentRequestObserver::RequestResponseL( 
+    TFSProgress aEvent, TInt /* aRequestId */ )
+    {
+    if ( aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete )
+        {
+        delete iParent.iPart;
+        iParent.iPart = NULL;
+        CFSMailMessagePart *part = iParent.iPlugin->MessagePartL( 
+            FsMsgId( iParent.iPluginData, iParent.iMsgContentId.iMessageId.iFolderId.iMailboxId ),
+            FsMsgId( iParent.iPluginData, iParent.iMsgContentId.iMessageId.iFolderId ),
+            FsMsgId( iParent.iPluginData, iParent.iMsgContentId.iMessageId ),
+            FsMsgId( iParent.iPluginData, iParent.iMsgContentId ) );
+        iParent.SetPart( part );
+
+        if ( iObserver ) 
+            iObserver->DataFetchedL( aEvent.iError );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMessageContent::CContentRequestObserver::SetObserverL( MEmailFetchObserver* aObserver )
+    {
+    iObserver = aObserver;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailfolder.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,278 @@
+/*
+* 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: This file implements class CEmailFolder.
+*
+*/
+
+#include "emailfolder.h"
+#include "emailmailbox.h"
+#include "emailapiutils.h"
+#include "messageiterator.h"
+#include "emailsorting.h"
+#include "cfsmailfolder.h"
+#include "cfsmailplugin.h"
+#include "emailclientapi.hrh"
+#include "emailclientapiimpldefs.h"
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailFolder* CEmailFolder::NewLC( 
+    CPluginData& aPluginData,
+    const TFolderId& aFolderId,  
+    CFSMailFolder *aFolder )
+    {
+    CEmailFolder* self = new ( ELeave ) 
+        CEmailFolder( aPluginData, aFolderId, aFolder );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailFolder* CEmailFolder::NewL( 
+    CPluginData& aPluginData,
+    const TFolderId& aFolderId,  
+    CFSMailFolder *aFolder )
+    {
+    CEmailFolder* self = CEmailFolder::NewLC( aPluginData, aFolderId, aFolder);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailFolder::CEmailFolder( 
+    CPluginData& aPluginData, 
+    const TFolderId& aFolderId,
+    CFSMailFolder* aFolder) : 
+    iPluginData( aPluginData ), 
+    iFolderType( EOther ), 
+    iFolderId( aFolderId ),
+    iFolder( aFolder )
+    {
+    }
+   
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailFolder::ConstructL()
+    {
+    iPlugin = iPluginData.ClaimInstance();
+    
+    User::LeaveIfNull( iFolder );
+    
+    const TFSFolderType fsType = iFolder->GetFolderType();
+    switch ( fsType )
+        {
+        case EFSInbox:
+            iFolderType = EInbox;
+            break;
+        case EFSOutbox:
+            iFolderType = EOutbox;
+            break;
+        case EFSDraftsFolder:
+            iFolderType = EDrafts;
+            break;
+        case EFSSentFolder:
+            iFolderType = ESent;
+            break;
+        case EFSDeleted:
+            iFolderType = EDeleted;
+            break;
+        case EFSOther:
+        default:
+            iFolderType = EOther;
+            break;
+        }
+    iParentId = TFolderId( 
+        iFolder->GetParentFolderId().Id(), 
+        iFolderId.iMailboxId );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailFolder::~CEmailFolder()
+    {
+    iPluginData.ReleaseInstance();
+    delete iFolder;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TEmailTypeId CEmailFolder::InterfaceId() const
+    {
+    return KEmailIFUidFolder;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailFolder::Release()
+    {
+    delete this;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TFolderId CEmailFolder::FolderId() const
+    {
+    return iFolderId;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TFolderId CEmailFolder::ParentFolderId() const
+    {
+    return iParentId;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TFolderType CEmailFolder::FolderType() const
+    {
+    return iFolderType;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailFolder::Name() const
+    {
+    if ( !iFolder )
+        return KNullDesC();
+    return TPtrC ( iFolder->GetFolderName() );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailFolder::GetSubfoldersL( RFolderArray& aSubfolders ) const
+    {
+    User::LeaveIfNull( iFolder );
+
+    RPointerArray<CFSMailFolder> folders;
+    CleanupResetAndDestroy<RPointerArray<CFSMailFolder> >::PushL( folders );
+
+    iFolder->GetSubFoldersL( folders );
+    
+    TInt res( folders.Count() );
+    
+    for ( TInt i = 0; i < res; i++ )
+        {
+        const CFSMailFolder* fsfolder = folders[i];
+        const TEntryId id = fsfolder->GetFolderId().Id();
+        const TFolderId folderId( id, iFolderId.iMailboxId.iId );
+        MEmailFolder* folder = CEmailFolder::NewL( iPluginData, folderId, folders[i] );
+        aSubfolders.AppendL( folder );
+        }
+    CleanupStack::Pop( &folders );
+    folders.Close();
+    return res;
+    }
+
+// -----------------------------------------------------------------------------
+//  CEmailFolder::MessagesL
+// -----------------------------------------------------------------------------
+MMessageIterator* CEmailFolder::MessagesL(
+        const RSortCriteriaArray& aCriteria )
+    {
+    RArray<TFSMailSortCriteria> sortCriterias;
+    CleanupClosePushL( sortCriterias );
+    CEmailFolder::ToFsSortCriteriaL( aCriteria, sortCriterias );
+
+    MFSMailIterator* fsIter = iFolder->ListMessagesL( EFSMsgDataEnvelope, sortCriterias );
+    TUint count = iFolder->GetMessageCount();
+
+    CleanupStack::PopAndDestroy( &sortCriterias );
+    CMessageIterator* iter = CMessageIterator::NewL( 
+        fsIter, iPluginData, count );
+
+    return iter;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailFolder::DeleteMessagesL( const REmailMessageIdArray& aMessageIds )
+    {
+    RArray<TFSMailMsgId> fsArray;
+    CleanupClosePushL( fsArray );
+    const TInt count( aMessageIds.Count() );
+    for ( TInt i = 0; i < count; i++ )
+        {
+        TMessageId msgId = aMessageIds[i];
+        if ( iFolderId != msgId.iFolderId )
+            {
+            // not all messages in the same folder, plugin API doesn't accept this.
+            User::Leave( KErrArgument );
+            }
+        fsArray.AppendL( FsMsgId( iPluginData, msgId ) );
+        }
+    iPlugin->DeleteMessagesByUidL( 
+            FsMsgId( iPluginData, iFolderId.iMailboxId ), 
+            FsMsgId( iPluginData, iFolderId ), 
+            fsArray );
+    CleanupStack::PopAndDestroy( &fsArray );
+    }
+
+// -----------------------------------------------------------------------------
+// Maps email api sort criteria to sort criteria type that protocol plugin
+// accepts.
+// -----------------------------------------------------------------------------
+void CEmailFolder::ToFsSortCriteriaL( 
+    const RSortCriteriaArray& aSortCriteria, 
+    RArray<TFSMailSortCriteria>& aFsCriteria )
+    {
+    const TFSMailSortField fieldValues[] = {
+        EFSMailDontCare,        
+        EFSMailSortByDate,      
+        EFSMailSortBySender,    
+        EFSMailSortByRecipient, 
+        EFSMailSortBySubject,   
+        EFSMailSortByPriority,  
+        EFSMailSortByFlagStatus,
+        EFSMailSortByUnread,    
+        EFSMailSortBySize,      
+        EFSMailSortByAttachment };
+
+    for ( TInt i=0; i < aSortCriteria.Count(); i++ )
+        {
+        const TEmailSortCriteria& criteria  = aSortCriteria[i];
+        __ASSERT_ALWAYS( criteria.iField < sizeof( fieldValues ) / sizeof (fieldValues [i] ),
+            Panic( EMailPanicSortMapIndexOutOfBounds ) );
+        TFSMailSortCriteria fsCriteria;
+        fsCriteria.iField = fieldValues[ criteria.iField ];
+        if ( criteria.iAscending )
+            {
+            fsCriteria.iOrder = EFSMailAscending;
+            }
+        else
+            {
+            fsCriteria.iOrder = EFSMailDescending;
+            }
+        aFsCriteria.AppendL( fsCriteria );
+        }
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailinterfacefactoryimpl.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,216 @@
+/*
+* 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: This file implements class CEmailInterfaceFactoryImpl.
+*
+*/
+
+#include <e32property.h>                // RProperty
+#include <s32mem.h>                     // RDesRead/WriteStream
+
+#include "emailinterfacefactoryimpl.h"
+#include "emailcontent.h"
+#include "cfsmailclient.h"
+#include "emailclientapiimpldefs.h"
+#include "emailclientapiimpl.h"
+#include "emailaddress.h"
+#include "emailmessagesearch.h"
+#include "emailshutdownconst.h"
+
+_LIT( KEmailImplPanic, "Email client API" );
+const TInt KEmailUidExtraBuffer = 2 * KEmailPlatformApiUidItemSize;
+
+// ---------------------------------------------------------------------------
+// Email client API panic wrapper
+// ---------------------------------------------------------------------------
+void Panic( TEmailImplPanic aPanic )
+    {
+    User::Panic( KEmailImplPanic(), aPanic );
+    }
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CEmailInterfaceFactoryImpl::NewL
+// ---------------------------------------------------------------------------
+CEmailInterfaceFactoryImpl* CEmailInterfaceFactoryImpl::NewL()
+    {
+    CEmailInterfaceFactoryImpl* self = new (ELeave) CEmailInterfaceFactoryImpl();
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+// CEmailInterfaceFactoryImpl::~CEmailInterfaceFactoryImpl
+// ---------------------------------------------------------------------------
+CEmailInterfaceFactoryImpl::~CEmailInterfaceFactoryImpl()
+    {
+    TRAP_IGNORE( AppendOrRemoveUidL( EEmailUidModeRemove ) );
+    }
+
+// ---------------------------------------------------------------------------
+// CEmailInterfaceFactoryImpl::CEmailInterfaceFactoryImpl
+// ---------------------------------------------------------------------------
+CEmailInterfaceFactoryImpl::CEmailInterfaceFactoryImpl() : 
+    CEmailInterfaceFactory()
+    {
+    }
+
+// ---------------------------------------------------------------------------
+// CEmailInterfaceFactoryImpl::ConstructL
+// ---------------------------------------------------------------------------
+void CEmailInterfaceFactoryImpl::ConstructL()
+    {
+	// This leaves if related P&S keys are not defined by EmailServerMonitor,
+	// so EmailServerMonitor need to be started before using client API.
+	// TRAP_IGNORE should be removed after EmailServerMonitor is added to
+	// starter list.
+    TRAP_IGNORE( AppendOrRemoveUidL( EEmailUidModeAppend ) );
+    }
+
+// ---------------------------------------------------------------------------
+// CEmailInterfaceFactoryImpl::InterfaceL
+// ---------------------------------------------------------------------------
+MEmailInterface* CEmailInterfaceFactoryImpl::InterfaceL( const TInt aInterfaceId )
+    {
+    MEmailInterface* interface = NULL;
+    switch ( aInterfaceId )
+        {
+        case KEmailClientApiInterface:
+            interface = CEmailClientApi::NewL();
+            break;
+        case KEmailIFUidAddress:
+            interface = CEmailAddress::NewL( MEmailAddress::EUndefined, EClientOwns );
+            break;
+        case KEmailIFUidTextContent:
+        default:
+            break;
+        }
+    if ( !interface )
+        {
+        User::Leave( KErrNotSupported );
+        }
+    return interface;
+    }
+
+// ---------------------------------------------------------------------------
+// CEmailInterfaceFactoryImpl::AppendOrRemoveUidL
+// ---------------------------------------------------------------------------
+void CEmailInterfaceFactoryImpl::AppendOrRemoveUidL(
+        const TEmailUidAppendRemoveMode aMode )
+    {
+    // Read buffer length
+    TInt bufLength( 0 );
+    User::LeaveIfError( RProperty::Get( KEmailShutdownPsCategory,
+                                        EEmailPsKeyPlatformApiAppsToCloseLength,
+                                        bufLength ) );
+
+    // Allocate buffer for reading and then read the list of UIDs from P&S.
+    // Adding some extra buffer just in case the size key and actual list
+    // are out of sync. This shouldn't happen, but you never know.
+    HBufC8* readBuf = HBufC8::NewLC( bufLength + KEmailUidExtraBuffer );
+    TPtr8 readPtr = readBuf->Des();
+    
+    User::LeaveIfError( RProperty::Get( KEmailShutdownPsCategory,
+                                        EEmailPsKeyPlatformApiAppsToClose,
+                                        readPtr ) );
+    
+    // For writing get the size of the original buffer + room for our own UID
+    // if needed
+    TInt writeBufSize = readPtr.Length();
+    if( aMode == EEmailUidModeAppend )
+        {
+        writeBufSize += KEmailPlatformApiUidItemSize;
+        }
+    
+    HBufC8* writeBuf = HBufC8::NewLC( writeBufSize );
+    TPtr8 writePtr = writeBuf->Des();
+
+    // Read and write streams used to read/write the UIDs from/to descriptors
+    RDesReadStream readStream( readPtr );
+    CleanupClosePushL( readStream );
+
+    RDesWriteStream writeStream( writePtr );
+    CleanupClosePushL( writeStream );
+
+    // Get our own process UID
+    RProcess ownProcess;
+    TUid ownUid = ownProcess.SecureId();
+    ownProcess.Close();
+
+    TInt itemsCount = readPtr.Length() / KEmailPlatformApiUidItemSize;
+
+    TBool ownUidFound = EFalse;
+    TInt writeLength = 0;
+    for ( TInt ii = 0;ii < itemsCount; ++ii )
+        {
+        // Read next UID from the stream
+        TUid item = TUid::Uid( readStream.ReadInt32L() );
+        
+        // We can skip our own UID. If we are removing, then we don't want
+        // our UID to be written. If we are adding, we don't need to set
+        // the new values as our UID already exists in the list.
+        if( item == ownUid )
+            {
+            ownUidFound = ETrue;
+            if( aMode == EEmailUidModeAppend )
+                {
+                // Our own UID is already in the list, so no need to update
+                // the list. Hence we can quit here.
+                break;
+                }
+            }
+        else
+            {
+            writeStream.WriteInt32L( item.iUid );
+            writeLength += KEmailPlatformApiUidItemSize;
+            }
+        }
+
+    // If we are appending our UID and it wasn't found from the list,
+    // write it to the stream
+    if( aMode == EEmailUidModeAppend && !ownUidFound )
+        {
+        writeStream.WriteInt32L( ownUid.iUid );
+        writeLength += KEmailPlatformApiUidItemSize;
+        }
+
+    // Set correct length for the write ptr buffer as it might not be
+    // updated correctly by the write stream
+    writePtr.SetLength( writeLength );
+
+    // Set new values to P&S only if something has changed, so either:
+    // 1) We are appending our UID and it didn't exist before
+    // 2) We are removing our UID and it did exist before
+    if( ( aMode == EEmailUidModeAppend && !ownUidFound ) ||
+        ( aMode == EEmailUidModeRemove && ownUidFound ) )
+        {
+        // Write first the UID list as it is more probable to fail, writing
+        // plain integer value shouldn't fail in any case. This way these
+        // values stay in sync also in case of error, as the list length
+        // gets updated only if the list itself is updated succesfully.
+        User::LeaveIfError( RProperty::Set( KEmailShutdownPsCategory,
+                        EEmailPsKeyPlatformApiAppsToClose,
+                        writePtr ) );
+
+        User::LeaveIfError( RProperty::Set( KEmailShutdownPsCategory,
+                        EEmailPsKeyPlatformApiAppsToCloseLength,
+                        writeLength ) );
+        }
+
+    CleanupStack::PopAndDestroy( 4, readBuf );
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailmailbox.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,662 @@
+/*
+* 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: This file implements class CEmailMailbox.
+*
+*/
+
+#include <e32cmn.h>
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <viewclipartner.h>
+#include <vwsdefpartner.h>
+#else
+#include <viewcli.h>
+#include <vwsdef.h>
+#endif // SYMBIAN_ENABLE_SPLIT_HEADERS
+
+#include <mmailboxsyncobserver.h>
+#include "emailmailbox.h"
+#include "emailapiutils.h"
+#include "emailaddress.h"
+#include "emailfolder.h"
+#include "emailmessage.h"
+#include "emailmessagesearch.h"
+#include "cfsmailclient.h"
+#include "emailclientapiimpl.h"
+#include "cfsmailplugin.h"
+#include "cfsmailbox.h"
+#include "cfsmailfolder.h"
+#include "emailclientapi.hrh"
+
+#include <XQServiceRequest.h>
+#include "email_services_api.h"
+
+// Constants
+
+#include <QStringList>
+
+_LIT( KNewLine, "\n" );
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+CEmailMailbox* CEmailMailbox::NewL(
+    CPluginData& aPluginData,
+    const TMailboxId& aMailboxId )
+    {
+    CEmailMailbox* self = new ( ELeave ) CEmailMailbox( aPluginData, aMailboxId );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+CEmailMailbox::CEmailMailbox(
+    CPluginData& aPluginData,
+    const TMailboxId& aMailboxId )
+    : iPluginData( aPluginData ),
+    iMailboxId( aMailboxId.iId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::ConstructL()
+    {
+    iPlugin = iPluginData.ClaimInstanceL();
+    iEventMapper = new ( ELeave ) TObserverEventMapper(
+        iPlugin, iPluginData.Uid(), iMailboxId );
+    iFsMailbox = iPlugin->GetMailBoxByUidL( FsMailboxId() );
+    iSyncObserver = new ( ELeave ) CEmailMailbox::CEmailRequestObserver();
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+CEmailMailbox::~CEmailMailbox()
+    {
+    delete iFsMailbox;
+    delete iEventMapper;
+    delete iAddress;
+    iPluginData.ReleaseInstance();
+    delete iSyncObserver;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TEmailTypeId CEmailMailbox::InterfaceId() const
+    {
+    return KEmailIFUidMailbox;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::Release()
+    {
+    delete this;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TMailboxId CEmailMailbox::MailboxId() const
+    {
+    return iMailboxId;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailAddress* CEmailMailbox::AddressL() const
+    {
+    if ( !iAddress )
+        {
+        iAddress = CEmailAddress::NewL(
+            MEmailAddress::ESender, EAPIOwns );
+        iAddress->SetDisplayNameL( iFsMailbox->GetName() );
+        iAddress->SetAddressL( iFsMailbox->OwnMailAddress().GetEmailAddress() );
+        }
+    return iAddress;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TPtrC CEmailMailbox::MailboxName() const
+    {
+    return iFsMailbox->GetName();
+    }
+
+// -----------------------------------------------------------------------------
+// Constructs and returns type mailbox id of internal data type TFSMailMsgId
+// -----------------------------------------------------------------------------
+TFSMailMsgId CEmailMailbox::FsMailboxId() const
+    {
+    return FsMsgId( iPluginData, iMailboxId );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TInt CEmailMailbox::GetFoldersL( RFolderArray& aFolders ) const
+    {
+    TFSMailMsgId rootId = TFSMailMsgId();
+    RPointerArray<CFSMailFolder> folders;
+    CleanupResetAndDestroyPushL( folders );
+    iPlugin->ListFoldersL( FsMailboxId(), rootId, folders );
+    TInt res( folders.Count() );
+    for ( TInt i = 0; i < res; i++ )
+        {
+        const CFSMailFolder* fsfolder = folders[i];
+        const TEntryId id = fsfolder->GetFolderId().Id();
+        const TFolderId folderId( id, iMailboxId );
+        CEmailFolder* folder = CEmailFolder::NewLC( iPluginData, folderId, folders[i] );
+        aFolders.AppendL( folder );
+        CleanupStack::Pop( folder );
+        }
+    CleanupStack::Pop( &folders );
+    folders.Close(); // close but don't delete folders because they are
+                     // owned by CEmailFolder
+    return res;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailFolder* CEmailMailbox::FolderL( const TFolderId& aFolderId ) const
+    {
+    CFSMailFolder* fsFolder = iPlugin->GetFolderByUidL(
+            FsMsgId( iPluginData, iMailboxId ),
+            FsMsgId( iPluginData, aFolderId ) );
+    CleanupStack::PushL( fsFolder );
+
+    CEmailFolder* folder = CEmailFolder::NewL( iPluginData,
+                aFolderId, fsFolder );
+    CleanupStack::Pop( fsFolder );
+
+    return folder;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailFolder* CEmailMailbox::FolderByTypeL(
+    const TFolderType aFolderType ) const
+    {
+    TFSMailMsgId fsFolderId;
+
+    switch ( aFolderType )
+        {
+        case EInbox:
+            fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSInbox );
+            break;
+        case EOutbox:
+            fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSOutbox );
+            break;
+        case EDrafts:
+            fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSDraftsFolder );
+            break;
+        case EDeleted:
+            fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSDeleted );
+            break;
+        case ESent:
+            fsFolderId = iPlugin->GetStandardFolderIdL( FsMailboxId(), EFSSentFolder );
+            break;
+        case EOther:
+        default:
+            User::Leave( KErrNotFound );
+            break;
+        }
+
+    const TFolderId folderId( fsFolderId.Id(), iMailboxId );
+
+    CFSMailFolder* fsFolder = iPlugin->GetFolderByUidL(
+            FsMsgId( iPluginData, iMailboxId ),
+            fsFolderId );
+    CleanupStack::PushL( fsFolder );
+
+    CEmailFolder* folder = CEmailFolder::NewL( iPluginData,
+            folderId,
+            fsFolder );
+
+    CleanupStack::Pop( fsFolder );
+
+    return folder;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailMessage* CEmailMailbox::MessageL( const TMessageId& aMessageId )
+    {
+    CFSMailMessage *fsMessage = iPlugin->GetMessageByUidL(
+            FsMsgId( iPluginData, aMessageId.iFolderId.iMailboxId ),
+            FsMsgId( iPluginData, aMessageId.iFolderId ),
+            FsMsgId( iPluginData, aMessageId ),
+            EFSMsgDataEnvelope );
+
+    CleanupStack::PushL( fsMessage );
+    CEmailMessage* message = CEmailMessage::NewL( iPluginData, fsMessage, EClientOwns );
+    CleanupStack::Pop( fsMessage );
+
+    return message;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailMessage* CEmailMailbox::CreateDraftMessageL() const
+    {
+    CFSMailMessage* fsMessage = iFsMailbox->CreateMessageToSend();
+    User::LeaveIfNull( fsMessage );
+    CleanupStack::PushL( fsMessage );
+    MEmailMessage* message = CEmailMessage::NewL( iPluginData, fsMessage, EClientOwns );
+    CleanupStack::Pop( fsMessage );
+
+    return message;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailMessage* CEmailMailbox::CreateReplyMessageL( 
+        const TMessageId& aMessageId, const TBool aReplyToAll ) const
+    {
+    CFSMailMessage* fsMessage = iFsMailbox->CreateReplyMessage( 
+        FsMsgId( iPluginData, aMessageId ), aReplyToAll );
+    User::LeaveIfNull( fsMessage );
+    CleanupStack::PushL( fsMessage );
+    MEmailMessage* message = CEmailMessage::NewL( iPluginData, fsMessage, EClientOwns );
+    CleanupStack::Pop( fsMessage );
+
+    return message;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailMessage* CEmailMailbox::CreateForwardMessageL( const TMessageId& aMessageId ) const
+    {
+    CFSMailMessage* fsMessage = iFsMailbox->CreateForwardMessage(
+        FsMsgId( iPluginData, aMessageId ), KNewLine() );
+    User::LeaveIfNull( fsMessage );
+    CleanupStack::PushL( fsMessage );
+    MEmailMessage* message = CEmailMessage::NewL( iPluginData, fsMessage, EClientOwns );
+    CleanupStack::Pop( fsMessage );
+
+    return message;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::SynchroniseL( MMailboxSyncObserver& aObserver )
+    {
+    iSyncObserver->SetObserverL( &aObserver );
+    iRequestId = iFsMailbox->RefreshNowL( *iSyncObserver );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::CancelSynchronise()
+    {
+    iFsMailbox->CancelSearch();
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::RegisterObserverL( MMailboxContentObserver& aObserver )
+    {
+    iEventMapper->AddObserverL( aObserver );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::UnregisterObserver( MMailboxContentObserver& aObserver )
+    {
+    iEventMapper->RemoveObserver( aObserver );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+MEmailMessageSearchAsync* CEmailMailbox::MessageSearchL()
+    {
+    MEmailMessageSearchAsync* searchAPI = 
+        CEmailMessageSearchAsync::NewL( iPluginData, iMailboxId );
+    return searchAPI;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::ShowInboxL()
+    {
+    User::Leave( KErrNotSupported );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::EditNewMessageL()
+    {
+    bool syncronous;
+
+    XQServiceRequest request( emailInterfaceNameSend,
+                             emailOperationSendMail,
+                             syncronous );
+
+    QVariant returnValue;
+    if ( !request.send( returnValue ) )
+        User::Leave( KErrGeneral );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+CEmailMailbox::TObserverEventMapper::TObserverEventMapper(
+    CFSMailPlugin* aPlugin,
+    TUid aPluginUid, const TMailboxId& aMailboxId )
+     : iPlugin( aPlugin ),
+       iFsMailboxId( aPluginUid.iUid, aMailboxId.iId )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+CEmailMailbox::TObserverEventMapper::~TObserverEventMapper()
+    {
+    iClientObservers.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// Adds mailbox observer and subscribes to plugin mailbox events if there
+// were no previous observers.
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::AddObserverL( 
+        MMailboxContentObserver& aObserver )
+    {
+    TIdentityRelation<MMailboxContentObserver> relation( 
+        &CEmailMailbox::TObserverEventMapper::Equals );
+    if ( iClientObservers.Find( &aObserver, relation ) == KErrNotFound )
+        {
+        const TInt count( iClientObservers.Count() );
+        if  ( !count )
+            {
+            iPlugin->SubscribeMailboxEventsL( iFsMailboxId, *this );
+            }
+        iClientObservers.AppendL( &aObserver );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Removes an observer and removes event subscription if the observer was
+// last in observer array.
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::RemoveObserver( 
+        MMailboxContentObserver& aObserver )
+    {
+    TIdentityRelation<MMailboxContentObserver> relation( 
+        &CEmailMailbox::TObserverEventMapper::Equals );
+    const TInt index( iClientObservers.Find( &aObserver, relation ) );
+    if ( index != KErrNotFound )
+        {
+        iClientObservers.Remove( index );
+        const TInt count( iClientObservers.Count() );
+        if  ( !count )
+            {
+            iPlugin->UnsubscribeMailboxEvents( iFsMailboxId, *this );
+            }
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// Maps protocol a plugin event to client event
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::EventL(
+    TFSMailEvent aEvent,
+    TFSMailMsgId aMailbox,
+    TAny* aParam1,
+    TAny* aParam2,
+    TAny* aParam3 )
+    {
+    const TEventMapFunc KMailboxEventHandlers[] = {
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::IgnoreEventL,
+    &CEmailMailbox::TObserverEventMapper::NewMessageL,
+    &CEmailMailbox::TObserverEventMapper::MessageChangedL,
+    &CEmailMailbox::TObserverEventMapper::MessageDeletedL,
+    &CEmailMailbox::TObserverEventMapper::MessageMoved,
+    &CEmailMailbox::TObserverEventMapper::MessageCopiedL,
+    &CEmailMailbox::TObserverEventMapper::NewFolderL,
+    &CEmailMailbox::TObserverEventMapper::FolderChangeL,
+    &CEmailMailbox::TObserverEventMapper::FoldersDeletedL,
+    &CEmailMailbox::TObserverEventMapper::FoldersMovedL,
+    &CEmailMailbox::TObserverEventMapper::ExceptionL
+    };
+
+    TMailboxId id( aMailbox.Id() );
+    // boundary check
+    const TInt index( aEvent );
+    if ( index < sizeof( KMailboxEventHandlers ) / sizeof( KMailboxEventHandlers[ index ] ) )
+        {
+        // call event handler function
+        TEventMapFunc method = KMailboxEventHandlers[ index ];
+        (this->*method)(id, aParam1,aParam2,aParam3 );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::ConvertParamsL( 
+        TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, 
+        REmailMessageIdArray& aMessageIds, TFolderId& aFolderId )
+    {
+    RArray<TFSMailMsgId>* newEntries( static_cast< RArray<TFSMailMsgId>* >( aParam1 ) );
+    CleanupClosePushL( *newEntries );
+    TFSMailMsgId* parentFolder = static_cast<TFSMailMsgId*>( aParam2 );
+    aFolderId = TFolderId( parentFolder->Id(), aMailbox );
+
+    for ( TInt j = 0; j < newEntries->Count(); j++ ) 
+        {
+        TFSMailMsgId fsId(( *newEntries )[j] );
+        TMessageId messageId( fsId.Id(), aFolderId.iId, aMailbox );
+        aMessageIds.Append( messageId );
+        }
+
+    CleanupStack::PopAndDestroy( newEntries );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::IgnoreEventL(
+    TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::NewMessageL(
+    TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* /*aParam3*/ )
+    {
+    REmailMessageIdArray messageIds;
+    TFolderId folderId;
+    ConvertParamsL( aMailbox, aParam1, aParam2, messageIds, folderId );
+    CleanupClosePushL( messageIds );
+
+    for ( TInt i = 0; i < iClientObservers.Count(); i++ )
+        {
+        MMailboxContentObserver* observer = iClientObservers[i];
+        if (observer)
+            observer->NewMessageEventL( aMailbox, messageIds, folderId );
+        }
+    
+    CleanupStack::PopAndDestroy( &messageIds );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::MessageChangedL(
+    TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* /*aParam3*/ )
+    {
+    REmailMessageIdArray messageIds;
+    TFolderId folderId;
+    ConvertParamsL( aMailbox, aParam1, aParam2, messageIds, folderId );
+    CleanupClosePushL( messageIds );
+
+    for ( TInt i = 0; i < iClientObservers.Count(); i++ )
+        {
+        MMailboxContentObserver* observer = iClientObservers[i];
+        if (observer)
+            observer->MessageChangedEventL( aMailbox, messageIds, folderId );
+        }
+    CleanupStack::PopAndDestroy( &messageIds );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::MessageDeletedL(
+    TMailboxId aMailbox, TAny* aParam1, TAny* aParam2, TAny* /*aParam3*/ )
+    {
+    REmailMessageIdArray messageIds;    
+    TFolderId folderId;
+    ConvertParamsL( aMailbox, aParam1, aParam2, messageIds, folderId );
+    CleanupClosePushL( messageIds );
+
+    for ( TInt i = 0; i < iClientObservers.Count(); i++ )
+        {
+        MMailboxContentObserver* observer = iClientObservers[i];
+        if (observer)
+            observer->MessageDeletedEventL( aMailbox, messageIds, folderId );
+        }
+    
+    CleanupStack::PopAndDestroy( &messageIds );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::MessageMoved(
+    TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::MessageCopiedL(
+    TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::NewFolderL(
+    TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::FolderChangeL(
+    TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::FoldersDeletedL(
+    TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::FoldersMovedL(
+    TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::TObserverEventMapper::ExceptionL(
+    TMailboxId /*aMailbox*/, TAny* /*aParam1*/, TAny* /*aParam2*/, TAny* /*aParam3*/ )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TBool CEmailMailbox::TObserverEventMapper::Equals( 
+        const MMailboxContentObserver& a1, const MMailboxContentObserver& a2 )
+    {
+    return ( &a1 == &a2 );
+    }
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+CEmailMailbox::CEmailRequestObserver::CEmailRequestObserver() : iObserver( NULL )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::CEmailRequestObserver::RequestResponseL( 
+        TFSProgress aEvent, TInt /* aRequestId */ )
+    {
+    if ( iObserver && aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete )
+        {
+        iObserver->MailboxSynchronisedL(aEvent.iError);
+        }
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMailbox::CEmailRequestObserver::SetObserverL( MMailboxSyncObserver* aObserver )
+    {
+    iObserver = aObserver;
+    }
+
+// End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailmailboxcache.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,194 @@
+/*
+* 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: This file implements class CEmailMailboxCache.
+*
+*/
+
+#include "emailmailboxcache.h"
+#include "emailapiutils.h"
+
+static const TInt KCacheGranularity = 2;
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CEmailMailboxCache* CEmailMailboxCache::NewL()
+    {
+    CEmailMailboxCache* cache = new ( ELeave ) CEmailMailboxCache();
+    return cache;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CEmailMailboxCache::~CEmailMailboxCache()
+    {
+    iEntries.Close();
+    }
+
+// ---------------------------------------------------------------------------
+// Start of cache transaction with clenanup support
+// ---------------------------------------------------------------------------
+void CEmailMailboxCache::StartCachingPushL()
+    {
+    TCleanupItem item( &CEmailMailboxCache::CleanupOp, this );
+    CleanupStack::PushL( item );
+    iState = ECaching;
+    iEntries.Reset();
+    }
+
+// ---------------------------------------------------------------------------
+//  End of cache transaction
+// ---------------------------------------------------------------------------
+void CEmailMailboxCache::EndCachingPop()
+    {
+    iState = EComplete;
+    CleanupStack::Pop();
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TBool CEmailMailboxCache::IsCached() const
+    {
+    return iState == EComplete;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMailboxCache::AddMailboxL( 
+    CPluginData& aPluginData, 
+    const TMailboxId& aMailboxId )
+    {
+    if ( iState != ECaching )
+        {
+        User::Leave( KErrNotReady );
+        }
+    if ( FindById( aMailboxId ) == KErrNotFound )
+        {
+        TCacheEntry entry( &aPluginData, aMailboxId );
+        iEntries.AppendL( entry );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CPluginData* CEmailMailboxCache::PluginDataL( const TMailboxId& aMailboxId ) const
+    {
+    CPluginData* pdata = NULL;
+    const TInt index( FindById( aMailboxId ) );
+    if ( index != KErrNotFound )
+        {
+        const TCacheEntry& entry = iEntries[ index ];
+        pdata = entry.iPluginData;
+        }
+    return pdata;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CPluginData* CEmailMailboxCache::PluginDataL( const TUid& aPluginId ) const
+    {
+    CPluginData* pdata = NULL;
+    const TInt index( FindByPluginIdL( aPluginId ) );
+    if ( index != KErrNotFound )
+        {
+        const TCacheEntry& entry = iEntries[ index ];
+        pdata = entry.iPluginData;
+        }
+    return pdata;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+void CEmailMailboxCache::GetIdsL( REmailMailboxIdArray& aIdArray ) const
+    {
+    if ( iState != EComplete )
+        {
+        // cache not up to date
+        User::Leave( KErrNotReady );
+        }
+    for ( TInt i=0; i < iEntries.Count(); i++ )
+        {
+        TMailboxId id = iEntries[i].iMailboxId;
+        aIdArray.AppendL( id );
+        }
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TInt CEmailMailboxCache::FindById( const TMailboxId& aMailboxId ) const
+    {
+    TIdentityRelation<TCacheEntry> rel( CEmailMailboxCache::Equals );
+
+    // don't care about plugin data because this is seach key only and
+    // mailbox id is used for search
+    TCacheEntry entry( NULL, aMailboxId );
+    return iEntries.Find( entry, rel );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TInt CEmailMailboxCache::FindByPluginIdL( const TUid& aPluginId ) const
+    {
+    TIdentityRelation<TCacheEntry> rel( CEmailMailboxCache::PluginEquals );
+    CPluginData* key = new ( ELeave ) CPluginData( aPluginId );
+    TCacheEntry entry( key, TMailboxId() );
+    TInt index = iEntries.Find( entry, rel ); 
+    delete key;
+    return index;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TBool CEmailMailboxCache::Equals( const TCacheEntry& a1, const TCacheEntry& a2 )
+    {
+    return ( a1.iMailboxId == a2.iMailboxId );
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+TBool CEmailMailboxCache::PluginEquals( const TCacheEntry& a1, const TCacheEntry& a2 )
+    {
+    return ( a1.iPluginData->Uid() == a2.iPluginData->Uid() );
+    }
+
+// ---------------------------------------------------------------------------
+// Cleanup 
+// ---------------------------------------------------------------------------
+void CEmailMailboxCache::CleanupOp( TAny* aAny )
+    {
+    CEmailMailboxCache* cache = reinterpret_cast<CEmailMailboxCache*>( aAny );
+    cache->iEntries.Reset();
+    cache->iState = EEmpty;
+    }
+
+// ---------------------------------------------------------------------------
+// 
+// ---------------------------------------------------------------------------
+CEmailMailboxCache::CEmailMailboxCache() : 
+    iState( EEmpty ), 
+    iEntries( KCacheGranularity )
+    {
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailmessage.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,912 @@
+/*
+* 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: This file implements class CEmailMessage.
+*
+*/
+
+#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
+#include <viewclipartner.h>
+#include <vwsdefpartner.h>
+#else
+#include <viewcli.h>
+#include <vwsdef.h>
+#endif // SYMBIAN_ENABLE_SPLIT_HEADERS
+
+#include "emailmessage.h"
+#include "emailaddress.h"
+#include "emailapiutils.h"
+#include "emailclientapi.hrh"
+#include "emailapiutils.h"
+#include "emailinterfacefactoryimpl.h"
+#include "emailcontent.h"
+#include "emailtextcontent.h"
+#include "emailmultipart.h"
+#include "emailattachment.h"
+#include "cfsmailplugin.h"
+#include "cfsmailclient.h"
+
+#include <XQServiceRequest.h>
+#include "email_services_api.h"
+
+const TInt KSendMessageRequestId = 100;
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailMessage* CEmailMessage::NewL( CPluginData& aPluginData,
+                                    CFSMailMessage* aFsMessage,
+                                    const TDataOwner aOwner )
+    {
+    CEmailMessage* message = new ( ELeave ) CEmailMessage( aPluginData, aFsMessage, aOwner );
+    CleanupStack::PushL( message );
+    message->ConstructL();
+    CleanupStack::Pop( message );
+    return message;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailMessage::CEmailMessage(
+        CPluginData& aPluginData,
+        CFSMailMessage *aFsMessage,
+        const TDataOwner aOwner)
+        : iPluginData( aPluginData ), iPluginMessage( aFsMessage ), iOwner( aOwner )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::ConstructL()
+    {
+    User::LeaveIfNull( iPluginMessage );
+    iPlugin = iPluginData.ClaimInstanceL();
+    if ( iPluginMessage )
+        {
+        iMessageId = TMessageId( 
+            iPluginMessage->GetMessageId().Id(),
+            iPluginMessage->GetFolderId().Id(), 
+            iPluginMessage->GetMailBoxId().Id() );
+
+        // Copy the message flags
+        InitializeFlagValues();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailMessage::~CEmailMessage()
+    {
+    delete iPluginMessage;
+    delete iSender;
+    delete iReplyTo;
+    delete iTextContent;
+    delete iContent;
+    iPluginData.ReleaseInstance();
+    iAttachments.ResetAndDestroy();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TEmailTypeId CEmailMessage::InterfaceId() const
+    {
+    return KEmailIFUidMessage;
+    }
+    
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::Release()
+    {
+    if ( iOwner == EClientOwns )
+        {
+        delete this;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+const TMessageId& CEmailMessage::MessageId() const
+    {
+    return iMessageId;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailAddress* CEmailMessage::SenderAddressL() const
+    {
+    User::LeaveIfNull( iPluginMessage );
+
+    CFSMailAddress* fsAddress = iPluginMessage->GetSender();
+    if ( fsAddress )
+        {
+        if ( !iSender )
+            {
+            iSender = CEmailAddress::NewL( MEmailAddress::ESender, EAPIOwns );
+            }
+        iSender->SetAddressL(fsAddress->GetEmailAddress());
+        iSender->SetDisplayNameL(fsAddress->GetDisplayName());
+        }
+    else
+        {
+        // Sender address not defined. Delete client object as well
+        delete iSender;
+        iSender = NULL;
+        }
+    return iSender;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailAddress* CEmailMessage::ReplyToAddressL() const
+    {
+    User::LeaveIfNull( iPluginMessage );
+
+    const CFSMailAddress& fsAddress = iPluginMessage->GetReplyToAddress();
+    if ( &fsAddress )
+        {
+        if ( !iReplyTo )
+            {
+            iReplyTo = CEmailAddress::NewL( MEmailAddress::EReplyTo, EAPIOwns );
+            }
+        iReplyTo->SetAddressL( fsAddress.GetEmailAddress() );
+        iReplyTo->SetDisplayNameL( fsAddress.GetDisplayName() );
+        }
+    else
+        {
+        delete iReplyTo;
+        iReplyTo = NULL;
+        }
+    return iReplyTo;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::SetReplyToAddressL( const MEmailAddress& aSender )
+    {
+    User::LeaveIfNull( iPluginMessage );
+    
+    CFSMailAddress *fsAddress = CFSMailAddress::NewLC();
+    if ( !iReplyTo )
+        {
+        iReplyTo = CEmailAddress::NewL( MEmailAddress::EReplyTo, EAPIOwns );
+        }
+    fsAddress->SetDisplayName( aSender.DisplayName() );
+    fsAddress->SetEmailAddress( aSender.Address() );
+    iPluginMessage->SetReplyToAddress( fsAddress );
+    iReplyTo->SetAddressL( fsAddress->GetEmailAddress() );
+    iReplyTo->SetDisplayNameL( fsAddress->GetDisplayName() );
+    CleanupStack::Pop();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailMessage::GetRecipientsL( const MEmailAddress::TRole aRole,
+        REmailAddressArray& aRecipients ) const
+    {
+    if( aRole == MEmailAddress::EReplyTo ||
+        aRole == MEmailAddress::ESender )
+        {
+        User::Leave( KErrArgument );
+        }
+    else 
+        {
+        User::LeaveIfNull( iPluginMessage );
+        
+        if( aRole == MEmailAddress::ETo || 
+            aRole == MEmailAddress::EUndefined )
+            {
+            const RPointerArray<CFSMailAddress>& toRecipients =
+                iPluginMessage->GetToRecipients();
+            ConvertAddressArrayL( 
+                    MEmailAddress::ETo, 
+                    toRecipients, aRecipients );
+            }
+        if( aRole == MEmailAddress::ECc || 
+            aRole == MEmailAddress::EUndefined )
+            {
+            const RPointerArray<CFSMailAddress>& ccRecipients =
+                iPluginMessage->GetCCRecipients();
+            ConvertAddressArrayL( 
+                    MEmailAddress::ECc, 
+                    ccRecipients, aRecipients );
+            }
+        if( aRole == MEmailAddress::EBcc || 
+            aRole == MEmailAddress::EUndefined )
+            {
+            const RPointerArray<CFSMailAddress>& bccRecipients =
+                iPluginMessage->GetBCCRecipients();
+            ConvertAddressArrayL( 
+                    MEmailAddress::EBcc, 
+                    bccRecipients, aRecipients );
+            }
+        }
+    return aRecipients.Count();
+    }
+    
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::SetRecipientsL( const MEmailAddress::TRole aRole,
+        REmailAddressArray& aRecipients )
+    {
+    TInt count( aRecipients.Count() );
+
+    for( TInt i=0;i<count;i++ )
+        {
+        const MEmailAddress* address = aRecipients[i];
+        CFSMailAddress* fsAddress = CFSMailAddress::NewLC();
+        fsAddress->SetEmailAddress( address->Address() );
+        fsAddress->SetDisplayName( address->DisplayName() );
+        
+        User::LeaveIfNull( iPluginMessage );
+        
+        if( aRole == MEmailAddress::ETo )
+            {
+            iPluginMessage->AppendToRecipient( fsAddress );
+            }
+        else if( aRole == MEmailAddress::ECc )
+            {
+            iPluginMessage->AppendCCRecipient( fsAddress );
+            }
+        else if( aRole == MEmailAddress::EBcc )
+            {
+            iPluginMessage->AppendBCCRecipient( fsAddress );
+            }
+        else
+            {
+            User::Leave( KErrArgument );
+            }
+        CleanupStack::Pop( fsAddress );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::RemoveRecipientL( const MEmailAddress& /*aRecipient*/ )
+    {
+    User::Leave( KErrNotSupported );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailMessage::Subject() const
+    {
+    if ( !iPluginMessage )
+        return KNullDesC();
+    return iPluginMessage->GetSubject();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void  CEmailMessage::SetSubjectL( const TPtrC& aSubject )
+    {
+    User::LeaveIfNull( iPluginMessage );
+    iPluginMessage->SetSubject( aSubject );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TTime CEmailMessage::Date() const
+    {
+    TTime time;
+
+    if ( iPluginMessage ) {
+        time = iPluginMessage->GetDate();
+    }
+
+    return time;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailMessage::Flags() const
+    {
+    return iFlags;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::SetFlag( const TUint aFlag )
+    {
+    iFlags |= aFlag;
+    TUint flag = MapFlags( aFlag );
+    if ( iPluginMessage )
+        iPluginMessage->SetFlag( flag );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::ResetFlag( const TUint aFlag )
+    {
+    iFlags &= ~aFlag;
+    TUint flag = MapFlags( aFlag );
+    if ( iPluginMessage )
+        iPluginMessage->ResetFlag( flag );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::InitializeFlagValues()
+    {
+    if ( !iPluginMessage )
+        return;
+    // 1st reset member value, then start copying different flags
+    iFlags = 0;
+    
+    // EFlag_Read
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Read ) )
+        {
+        iFlags |= EFlag_Read;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Read;
+        }
+    //    EFlag_Read_Locally
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Read_Locally ) )
+        {
+        iFlags |= EFlag_Read_Locally;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Read_Locally;
+        }    
+    // EFlag_Low
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Low ) )
+        {
+        iFlags |= EFlag_Low;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Low;
+        }
+    // EFlag_Important
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Important ) )
+        {
+        iFlags |= EFlag_Important;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Important;
+        }
+    // EFlag_FollowUpComplete
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_FollowUpComplete ) )
+        {
+        iFlags |= EFlag_FollowUpComplete;
+        }
+    else
+        {
+        iFlags &= ~EFlag_FollowUpComplete;
+        }
+    // EFlag_FollowUp
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_FollowUp ) )
+        {
+        iFlags |= EFlag_FollowUp;
+        }
+    else
+        {
+        iFlags &= ~EFlag_FollowUp;
+        }
+    // EFlag_Attachments
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Attachments ) )
+        {
+        iFlags |= EFlag_Attachments;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Attachments;
+        }
+    // EFlag_Multiple
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Multiple ) )
+        {
+        iFlags |= EFlag_Multiple;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Multiple;
+        }
+    // EFlag_CalendarMsg
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_CalendarMsg ) )
+        {
+        iFlags |= EFlag_CalendarMsg;
+        }
+    else
+        {
+        iFlags &= ~EFlag_CalendarMsg;
+        }
+    // EFlag_Answered
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Answered ) )
+        {
+        iFlags |= EFlag_Answered;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Answered;
+        }
+    // EFlag_Forwarded
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_Forwarded ) )
+        {
+        iFlags |= EFlag_Forwarded;
+        }
+    else
+        {
+        iFlags &= ~EFlag_Forwarded;
+        }
+    // EFlag_OnlyToMe
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_OnlyToMe ) )
+        {
+        iFlags |= EFlag_OnlyToMe;
+        }
+    else
+        {
+        iFlags &= ~EFlag_OnlyToMe;
+        }
+    // EFlag_RemoteDeleted
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_RemoteDeleted ) )
+        {
+        iFlags |= EFlag_RemoteDeleted;
+        }
+    else
+        {
+        iFlags &= ~EFlag_RemoteDeleted;
+        }
+    // EFlag_HasMsgSender 
+    if ( iPluginMessage->IsFlagSet( EFSMsgFlag_HasMsgSender ) )
+        {
+        iFlags |= EFlag_HasMsgSender;
+        }
+    else
+        {
+        iFlags &= ~EFlag_HasMsgSender;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailMessageContent* CEmailMessage::ContentL() const
+    {
+    if ( iTextContent )
+        {
+        return iTextContent;
+        }
+    if ( iContent )
+        {
+        return iContent;
+        }
+
+    User::LeaveIfNull( iPluginMessage );
+    
+    RPointerArray<CFSMailMessagePart> parts;
+    CleanupResetAndDestroyPushL( parts );
+    iPluginMessage->ChildPartsL( parts );
+    TInt count( parts.Count() );
+    if( count == 0 )
+        {
+        /* No content, return NULL */
+        CleanupStack::PopAndDestroy( &parts ); // in case heap allocated but not used
+        return NULL;
+        }
+    CFSMailMessagePart* part = parts[0];
+    TContentType contentType( part->GetContentType() );
+    TMessageContentId msgContentId = TMessageContentId(
+                        part->GetPartId().Id(),
+                        iMessageId.iId,
+                        iMessageId.iFolderId.iId,
+                        iMessageId.iFolderId.iMailboxId );
+
+    if ( contentType.Equals( KFSMailContentTypeTextPlain ) ||
+        contentType.Equals( KFSMailContentTypeTextHtml ) )
+        {                                
+        iTextContent = CEmailTextContent::NewL(iPluginData, msgContentId, part, EAPIOwns );
+        parts[0] = NULL; // ownership of part transferred
+        }
+    else if ( contentType.Equals( KFSMailContentTypeMultipartMixed ) ||
+              contentType.Equals( KFSMailContentTypeMultipartAlternative ) ||
+              contentType.Equals( KFSMailContentTypeMultipartDigest ) ||
+              contentType.Equals( KFSMailContentTypeMultipartRelated ) ||
+              contentType.Equals( KFSMailContentTypeMultipartParallel ) )
+        {
+        iContent = CEmailMultipart::NewL(iPluginData, msgContentId, part, EAPIOwns);
+        parts[0] = NULL; // ownership of part transferred
+        }
+
+    CleanupStack::PopAndDestroy( &parts ); // parts
+
+    if (iTextContent)
+        {
+        return iTextContent;
+        }
+    return iContent;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::SetContentL( const MEmailMessageContent*  aContent )
+    {
+    User::LeaveIfNull( aContent );
+    MEmailTextContent* textContent = aContent->AsTextContentOrNull();
+    if ( textContent )
+        {
+        if ( iTextContent )
+            {
+            delete iTextContent; // Destroy old content
+            }
+        iTextContent = dynamic_cast<CEmailTextContent*>( textContent );
+        if ( iTextContent )
+            {
+            iTextContent->SetOwner( EAPIOwns );
+            }
+        return;
+        }
+    MEmailMultipart* mPart = aContent->AsMultipartOrNull();
+    if ( mPart )
+        {
+        if ( iContent )
+            {
+            delete iContent;
+            }
+        iContent = dynamic_cast<CEmailMultipart*>( mPart );
+        if ( iContent )
+            {
+            iContent->SetOwner( EAPIOwns );
+            }
+        }    
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::SetPlainTextBodyL( const TDesC& aPlainText )
+    {
+    if ( iTextContent )
+        {
+        iTextContent->SetTextL( MEmailTextContent::EPlainText, aPlainText );
+        return;
+        }
+
+    User::LeaveIfNull( iPluginMessage );
+
+    CFSMailMessagePart* msgTextPart = iPluginMessage->PlainTextBodyPartL();
+    
+    if( !msgTextPart )
+        {
+        msgTextPart = iPluginMessage->NewChildPartL( TFSMailMsgId(), KFSMailContentTypeTextPlain );
+        }
+    CleanupStack::PushL( msgTextPart );
+
+    TMessageContentId msgContentId = MessageContentId( msgTextPart->GetPartId().Id() );
+
+    msgTextPart->SetContentType( KFSMailContentTypeTextPlain );
+    iTextContent = CEmailTextContent::NewL( iPluginData, msgContentId, msgTextPart, EAPIOwns );
+    if (iTextContent)
+        {
+        iTextContent->SetTextL( MEmailTextContent::EPlainText, aPlainText );
+        }
+    CleanupStack::Pop( msgTextPart );
+
+    return;
+
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailAttachment* CEmailMessage::AddAttachmentL( const TDesC& aFullPath )
+    {
+    User::LeaveIfNull( iPluginMessage );
+
+    CFSMailMessagePart* part = iPluginMessage->AddNewAttachmentL( aFullPath, TFSMailMsgId() );
+    CleanupStack::PushL( part );    
+    CEmailAttachment* att = CEmailAttachment::NewLC( iPluginData, iMsgContentId, part, EAPIOwns );
+    iAttachments.AppendL( att );
+    CleanupStack::Pop( 2, part );
+
+    return att;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailAttachment* CEmailMessage::AddAttachmentL( RFile& aFile )
+    {
+    User::LeaveIfNull( iPluginMessage );
+    TBufC8 <1> mime;
+    CFSMailMessagePart* part = iPluginMessage->AddNewAttachmentL( aFile, mime );
+    CleanupStack::PushL( part );
+    CEmailAttachment* att = CEmailAttachment::NewLC( iPluginData, iMsgContentId, part, EAPIOwns );
+    iAttachments.AppendL( att );
+
+    CleanupStack::Pop( 2, part );
+
+    return att;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailMessage::GetAttachmentsL( REmailAttachmentArray& aAttachments )
+    {
+    User::LeaveIfNull( iPluginMessage );
+
+    RPointerArray<CFSMailMessagePart> attachments;
+    CleanupResetAndDestroyPushL( attachments );
+    iPluginMessage->AttachmentListL( attachments );
+    const TInt count( attachments.Count() );
+    for (TInt i = 0; i < count; i++)
+        {
+        TMessageContentId msgContentId = MessageContentId( attachments[i]->GetPartId().Id() );
+
+        CEmailAttachment* att = CEmailAttachment::NewL( 
+            iPluginData, msgContentId, attachments[i], EClientOwns );
+
+        aAttachments.AppendL( att );
+        }
+    CleanupStack::Pop( &attachments );
+    return count;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::RemoveAttachmentL( const MEmailAttachment& /*aAttachment*/ )
+    {
+    User::Leave( KErrNotSupported );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+const TFolderId& CEmailMessage::ParentFolderId() const
+    {
+    return iMessageId.iFolderId;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::SaveChangesL()
+    {
+    User::LeaveIfNull( iPluginMessage );
+    
+    TFSMailMsgId mailboxId( 
+            FsMsgId( iPluginData, iMessageId.iFolderId.iMailboxId ) );
+    
+    iPlugin->StoreMessageL( mailboxId, *iPluginMessage );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::SendL()
+    {
+    User::LeaveIfNull( iPluginMessage );
+    
+    if ( iEventLoop.isRunning() )
+        User::Leave( KErrInUse );
+    
+    SaveChangesL();
+    iError = KErrNone;
+    iPlugin->SendMessageL( *iPluginMessage, *this, KSendMessageRequestId );
+    iEventLoop.exec();
+
+    User::LeaveIfError( iError );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::RequestResponseL( TFSProgress aEvent, TInt aRequestId )
+    {
+    iError = aEvent.iError;
+
+    if ( aRequestId == KSendMessageRequestId &&
+            aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete )
+        iEventLoop.quit();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessage::ConvertAddressArrayL(
+        const MEmailAddress::TRole aRole,
+        const RPointerArray<CFSMailAddress>& aSrc,
+        REmailAddressArray& aDst ) const
+    {
+    for ( TInt i=0; i<aSrc.Count(); i++ )
+        {
+        CEmailAddress* recipient = CreateAddressLC( aRole, *aSrc[i] );
+        aDst.AppendL( recipient );
+        CleanupStack::Pop( recipient );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+CEmailAddress* CEmailMessage::CreateAddressLC(
+        const MEmailAddress::TRole aRole, 
+        CFSMailAddress& aFsAddress ) const
+    {
+    CEmailAddress* address = CEmailAddress::NewLC( aRole, EClientOwns );
+    TDesC& temp1 = aFsAddress.GetEmailAddress();
+    if ( &temp1 )
+        {
+        address->SetAddressL( temp1 );
+        }
+    TDesC& temp2 = aFsAddress.GetDisplayName();
+    if ( &temp2 )
+        {
+        address->SetDisplayNameL( temp2 );
+        }   
+    return address;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TUint CEmailMessage::MapFlags( const TUint& aFlag )
+    {
+    TUint flag = 0;
+    switch( aFlag )
+        {
+        case EFlag_Read:
+            flag = EFSMsgFlag_Read;
+            break;
+        case EFlag_Read_Locally:
+            flag = EFSMsgFlag_Read_Locally;
+            break;
+        case EFlag_Low:
+            flag = EFSMsgFlag_Low;
+            break;
+        case EFlag_Important:
+            flag = EFSMsgFlag_Important;
+            break;
+        case EFlag_FollowUpComplete:
+            flag = EFSMsgFlag_FollowUpComplete;
+            break;
+        case EFlag_FollowUp:
+            flag = EFSMsgFlag_FollowUp;
+            break;
+        case EFlag_Attachments:
+            flag = EFSMsgFlag_Attachments;
+            break;
+        case EFlag_Multiple:
+            flag = EFSMsgFlag_Multiple;
+            break;
+        case EFlag_CalendarMsg:
+            flag = EFSMsgFlag_CalendarMsg;
+            break;
+        case EFlag_Answered:
+            flag = EFSMsgFlag_Answered;
+            break;
+        case EFlag_Forwarded:
+            flag = EFSMsgFlag_Forwarded;
+            break;
+        case EFlag_OnlyToMe:
+            flag = EFSMsgFlag_OnlyToMe;
+            break;
+        case EFlag_RemoteDeleted:
+            flag = EFSMsgFlag_RemoteDeleted;
+            break;
+        case EFlag_HasMsgSender:
+            flag = EFSMsgFlag_HasMsgSender;
+            break;
+        default:
+            break;
+        }
+    return flag;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMessage::ShowMessageViewerL()
+    {   
+    bool syncronous;
+
+    XQServiceRequest request(
+       emailInterfaceNameMessage,
+       emailOperationViewMessage,
+       syncronous );
+
+    TFSMailMsgId mailboxId = FsMsgId( iPluginData, iMessageId.iFolderId.iMailboxId );
+    TFSMailMsgId folderId = FsMsgId( iPluginData, iMessageId.iFolderId );
+    TFSMailMsgId messageId = FsMsgId( iPluginData, iMessageId );
+
+    QList<QVariant> list;
+    list.append( mailboxId.Id() );
+    list.append( folderId.Id() );
+    list.append( messageId.Id() );
+    request.setArguments( list );
+
+    QVariant returnValue;
+    if ( !request.send( returnValue ) )
+        User::Leave( KErrGeneral );
+    }
+
+// -----------------------------------------------------------------------------
+// Launches Email application and new reply message in editor. 
+// The method follows "fire and forget" pattern, returns immediately.
+// -----------------------------------------------------------------------------
+void CEmailMessage::ReplyToMessageL( const TBool /*aReplyToAll*/ )
+    {
+    User::Leave( KErrNotSupported );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+void CEmailMessage::ForwardMessageL()
+    {
+    User::Leave( KErrNotSupported );
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TMessageContentId CEmailMessage::MessageContentId( TEntryId aContentId ) const
+    {
+    TMessageContentId msgContentId = TMessageContentId( 
+                    aContentId,
+                    iMessageId.iId,
+                    iMessageId.iFolderId.iId,
+                    iMessageId.iFolderId.iMailboxId );
+    return msgContentId;
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TContentType::TContentType( const TDesC& aContentType ) : iContentType( aContentType )
+    {
+    _LIT( KSeparator, ";" );
+    TInt end = aContentType.Find( KSeparator );
+    if ( end != KErrNotFound )
+        {
+        iContentType.Set( aContentType.Left( end ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+//
+// -----------------------------------------------------------------------------
+TBool TContentType::Equals( const TDesC& aContentType )
+    {
+    TBool ret = iContentType.CompareF( aContentType );
+    if ( ret == 0  )
+        return ETrue;
+    else
+        return EFalse;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailmessagesearch.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,362 @@
+/*
+* 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: This file implements class CEmailMessageSearchAsync
+*
+*/
+
+#include <emailclientapi.hrh>
+#include "emailmessagesearch.h"
+#include "emailmessage.h"
+
+/**
+ * Global semaphore name. Semaphore blocks parallel service access.
+ */
+_LIT( KGlobalSemaphoreToPreventParallelCall, "12mymessaging.nokia.com34" );
+
+// ======== MEMBER FUNCTIONS ========
+
+// ---------------------------------------------------------------------------
+// CEmailMessageSearchAsync::NewL
+// ---------------------------------------------------------------------------
+CEmailMessageSearchAsync* CEmailMessageSearchAsync::NewL(
+    CPluginData& aPluginData,
+    const TMailboxId& aMailboxId )
+    {
+    CEmailMessageSearchAsync* self = 
+        new ( ELeave ) CEmailMessageSearchAsync( aPluginData, aMailboxId );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ---------------------------------------------------------------------------
+//
+// ---------------------------------------------------------------------------
+void CEmailMessageSearchAsync::ConstructL()
+    {
+    iPlugin = iPluginData.ClaimInstanceL();
+    // Open existing semaphore, or create a new one
+    if ( KErrNone != iGate.OpenGlobal( KGlobalSemaphoreToPreventParallelCall, EOwnerProcess ) )
+        {
+        User::LeaveIfError( 
+            iGate.CreateGlobal( KGlobalSemaphoreToPreventParallelCall, 1, EOwnerProcess ) );
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailMessageSearchAsync::CEmailMessageSearchAsync(    
+    CPluginData& aPluginData,
+    const TMailboxId& aMailboxId )
+    : iPluginData( aPluginData ), iMailboxId( aMailboxId.iId ),
+    iCriteria(), iObserver( NULL ), iRemote( EFalse )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailMessageSearchAsync::~CEmailMessageSearchAsync()
+    {
+    iSearchStrings.Close();
+    iPluginData.ReleaseInstance();
+    iGate.Close();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TEmailTypeId CEmailMessageSearchAsync::InterfaceId() const
+    {
+    return KEmailIFUidSearch;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMessageSearchAsync::Release()
+    {
+    if (KErrNone != iGate.Wait(1))
+        {
+        this->Cancel();
+        }
+    delete this;
+    }
+
+// -----------------------------------------------------------------------------
+// Sets sort order for search results.
+// Leaves KErrNotReady if search is ongoing.
+// -----------------------------------------------------------------------------
+void CEmailMessageSearchAsync::SetSortCriteriaL( const TEmailSortCriteria& aCriteria )
+    {
+    IsSearchGoingOnL();
+
+    switch (aCriteria.iField)
+        {
+        case TEmailSortCriteria::EDontCare:
+            iCriteria.iField = EFSMailDontCare;
+            break;
+
+        case TEmailSortCriteria::EByDate:
+            iCriteria.iField = EFSMailSortByDate;
+            break;
+
+        case TEmailSortCriteria::EBySender:
+            iCriteria.iField = EFSMailSortBySender;
+            break;
+
+        case TEmailSortCriteria::EByRecipient:
+            iCriteria.iField = EFSMailSortByRecipient;
+            break;
+
+        case TEmailSortCriteria::EBySubject:
+            iCriteria.iField = EFSMailSortBySubject;
+            break;
+
+        case TEmailSortCriteria::EByPriority:
+            iCriteria.iField = EFSMailSortByPriority;
+            break;
+
+        case TEmailSortCriteria::EByFlagStatus:
+            iCriteria.iField = EFSMailSortByFlagStatus;
+            break;
+
+        case TEmailSortCriteria::EByUnread:
+            iCriteria.iField = EFSMailSortByUnread;
+            break;
+
+        case TEmailSortCriteria::EBySize:
+            iCriteria.iField = EFSMailSortBySize;
+            break;
+
+        case TEmailSortCriteria::EByAttachment:
+            iCriteria.iField = EFSMailSortByAttachment;
+            break;
+
+        default:
+            User::Leave( KErrNotSupported );
+            break;
+
+        }
+    if (aCriteria.iAscending)
+        {
+        iCriteria.iOrder = EFSMailAscending;
+        }
+    else
+        {
+        iCriteria.iOrder = EFSMailDescending;
+        }
+    // Release gate
+    iGate.Signal();
+    }
+
+// -----------------------------------------------------------------------------
+// Adds a search key. Leaves KErrNotReady if search is ongoing.
+// -----------------------------------------------------------------------------
+void CEmailMessageSearchAsync::AddSearchKeyL( const TDesC& aSearchKey ) 
+    {
+    IsSearchGoingOnL();
+
+    iSearchStrings.AppendL(&aSearchKey);
+    // Release gate
+    iGate.Signal();
+    }
+
+/// -----------------------------------------------------------------------------
+// Enables/disables search from remote email server.
+// Leaves KErrNotReady if search is ongoing.
+// -----------------------------------------------------------------------------
+void CEmailMessageSearchAsync::SetRemoteSearchL( TBool aRemote )  
+    {    
+    IsSearchGoingOnL();
+
+    iRemote = aRemote;
+    // Release gate
+    iGate.Signal();
+    // Currently plugins do not support this function
+    User::Leave( KErrNotSupported );    
+    }
+
+// -----------------------------------------------------------------------------
+// Indicates whether remote search is enabled.
+// -----------------------------------------------------------------------------
+TBool CEmailMessageSearchAsync::IsRemoteSearch() const
+    {
+    // Currently plugins do not support this function
+    return EFalse; 
+    }
+
+// -----------------------------------------------------------------------------
+// Starts search, all methods affecting search attribures leave
+// KErrNotReady while search is ongoing.
+// @param aObserver called when results are available.
+//     
+void CEmailMessageSearchAsync::StartSearchL( MEmailSearchObserver& aObserver )
+    {
+    IsSearchGoingOnL();
+
+    iObserver = &aObserver;
+    const TFSMailMsgId fsMailboxId( iPluginData.Uid(), iMailboxId.iId );
+    RArray <TFSMailMsgId> folderIds;
+
+    /** Search API */
+
+    /**
+     * Asyncronous call for starting search for given string. Only one search can be
+     * performed at a time.
+     *
+     *
+     * This function will search for message's containing the given search string.
+     * The search will be performed on the all message fields: To, Cc, Bcc, subject, body.
+     * The search client will be notified of each found message,
+     * and upon completion of the search.  Only one search can be performed at a time.  
+     *  
+     * To change the sort order in the search result, use the same search string in the
+     * but change the aSortCriteria parameter.  The store "caches" the search
+     * results generated by the same search string.
+     *    
+     * The function will leave with KErrInUse if a search is already in progress.
+     *
+     * /note Only works if the store is in an authenticated state,
+     *  otherwise this function leaves with KErrNotReady
+     * 
+     * @paran aMailBoxId id of the mailbox where messages are to be searched
+     * @param aFolderIds list of folders where messages are to be searched
+     *        global or folder specific search depends on the size of array is 0 or not.
+     * @param aSearchStrings text strings that will be searched from different message fields.
+     * @param aSortCriteria sort criteria for the results
+     * @param aSearchObserver client observer that will be notified about search status.
+     *
+     */
+    iPlugin->SearchL( fsMailboxId,
+        folderIds,
+        iSearchStrings,
+        iCriteria,
+        *this );
+    // Gate is kept closed as search is asynchronous. Gate will be reopen after search is completed, i.e.
+    // CEmailMessageSearchAsync::SearchCompleted.
+    }
+
+// -----------------------------------------------------------------------------
+// Cancels search.
+// -----------------------------------------------------------------------------
+void CEmailMessageSearchAsync::Cancel()
+    {
+    if (KErrNone != iGate.Wait(1))
+        {
+        
+        /**
+         * Cancels current search. Does nothing if there is not any search.
+         * The search client will not be called back after this function is called.
+         *
+         */
+        const TFSMailMsgId fsMailboxId( iPluginData.Uid(), iMailboxId.iId );
+        iPlugin->CancelSearch( fsMailboxId );
+        }
+    else
+        {
+        // Release gate
+        iGate.Signal();
+        }
+    }
+
+// -----------------------------------------------------------------------------
+//  * @return search status:
+//  *     < 0 : Search has failed
+//  *     KRequestPending : search is ongoing. note that status may be
+//  *         KRequestPending after HandleResultL callback because results 
+//  *         may be given in chunks of results. Size of chunk depends on
+//  *         implementation and may vary.
+//  *     KErrNone : initial state, or search has finished
+// -----------------------------------------------------------------------------
+TInt CEmailMessageSearchAsync::Status() const
+    {
+    if (KErrNone != iGate.Wait(1))
+        {
+        // Search is going on
+        return KRequestPending;
+        }
+    else
+        {
+        // Release gate
+        iGate.Signal();       
+        }
+
+    return KErrNone; 
+    }
+
+// -----------------------------------------------------------------------------
+// Resets all search attribures. Cancels search if ongoing. 
+// -----------------------------------------------------------------------------
+void CEmailMessageSearchAsync::Reset()
+    {
+    if ( KErrNone != iGate.Wait( 1 ) )
+        {
+        this->Cancel();
+        }
+    
+    iCriteria = TFSMailSortCriteria();
+    iSearchStrings.Reset();
+    
+    // Release gate
+    iGate.Signal();
+    
+    };
+
+// -----------------------------------------------------------------------------
+// Notifies the email search API client that a match has been found
+// 
+// @param aMatchMessage contains a pointer to the matched message.
+//         Ownership is transfered to the observer.
+// -----------------------------------------------------------------------------
+void CEmailMessageSearchAsync::MatchFoundL( CFSMailMessage* aMatchMessage )
+{
+    User::LeaveIfNull( iObserver );
+    CEmailMessage *result = CEmailMessage::NewL(iPluginData, aMatchMessage, EClientOwns );
+    iObserver->HandleResultL( result );
+}
+
+// -----------------------------------------------------------------------------
+// Notifies the email search API client that the search has completed
+// -----------------------------------------------------------------------------
+ void CEmailMessageSearchAsync::SearchCompletedL()
+{
+    User::LeaveIfNull( iObserver );
+    iObserver->SearchCompletedL();
+    // Search is now complete, release gate.
+    iGate.Signal();
+}
+
+// -----------------------------------------------------------------------------
+// Asks client if search engine should change search priority 
+// -----------------------------------------------------------------------------
+void CEmailMessageSearchAsync::ClientRequiredSearchPriority(TInt* /*apRequiredSearchPriority*/)
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// Function leaves if search is going on. Otherwise it doesn't do anything.
+// -----------------------------------------------------------------------------
+void CEmailMessageSearchAsync::IsSearchGoingOnL() const
+    {
+    if ( KErrNone != iGate.Wait( 1 ) )
+        {
+        // Leave now, search is going on
+        User::Leave( KErrNotReady );
+        }
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailmultipart.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,378 @@
+/*
+* 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: This file implements class CEmailAttachment.
+*
+*/
+
+#include "emailcontent.h"
+#include "emailtextcontent.h"
+#include "emailattachment.h"
+#include "emailmultipart.h"
+#include "emailmessage.h"
+#include "emailclientapi.hrh"
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailMultipart* CEmailMultipart::NewL( 
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,
+        CFSMailMessagePart* aPart,
+        const TDataOwner aOwner ) 
+    {
+    CEmailMultipart* self = new ( ELeave ) CEmailMultipart( aOwner );
+    CleanupStack::PushL( self );
+    self->ConstructL( aPluginData, aMsgContentId, aPart );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::ConstructL(
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,
+        CFSMailMessagePart* aPart )
+    {
+    iEmailMsgContent = CEmailMessageContent::NewL( aPluginData, aMsgContentId, aPart );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailMultipart::~CEmailMultipart()
+    {
+    delete iEmailMsgContent;
+    iChildParts.Reset();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailMultipart::CEmailMultipart( const TDataOwner aOwner ) : iOwner( aOwner )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailMultipart::PartCountL()
+    {
+    iChildParts.Reset();
+    RPointerArray<CFSMailMessagePart> childParts;
+    CleanupResetAndDestroyPushL( childParts );
+    iEmailMsgContent->Part().ChildPartsL( childParts );
+    iChildPartCount = childParts.Count();
+
+    for ( TInt i = 0; i < iChildPartCount; i++ )
+        {
+        TFSMailMsgId id = childParts[i]->GetPartId();
+        iChildParts.AppendL( id );
+        }
+    CleanupStack::PopAndDestroy( &childParts );
+    return iChildPartCount;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailMessageContent* CEmailMultipart::PartByIndexL( const TUint aIndex ) const
+    {
+    if ( aIndex >= iChildPartCount )
+        {
+        User::Leave( KErrArgument );
+        }
+    MEmailMessageContent* content = NULL;
+    TFSMailMsgId partId = iChildParts[aIndex];
+    CFSMailMessagePart* copy = iEmailMsgContent->Part().ChildPartL( partId );
+    if ( !copy )
+        return content;
+
+    TContentType contentType( copy->GetContentType() );
+    TMessageContentId msgContentId = TMessageContentId( 
+            copy->GetPartId().Id(),
+            Id().iMessageId.iId,
+            Id().iMessageId.iFolderId.iId,
+            Id().iMessageId.iFolderId.iMailboxId );
+
+    if ( contentType.Equals( KFSMailContentTypeTextPlain ) || 
+         contentType.Equals( KFSMailContentTypeTextHtml ) )
+        {
+        content = CEmailTextContent::NewL( 
+            iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns );
+        }
+    else if ( contentType.Equals( KFSMailContentTypeMultipartMixed ) ||
+              contentType.Equals( KFSMailContentTypeMultipartAlternative ) ||
+              contentType.Equals( KFSMailContentTypeMultipartDigest ) ||
+              contentType.Equals( KFSMailContentTypeMultipartRelated ) ||
+              contentType.Equals( KFSMailContentTypeMultipartParallel ) )
+        {
+        content = CEmailMultipart::NewL( 
+            iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns );
+        }
+    else 
+        {
+        content = CEmailAttachment::NewL( 
+            iEmailMsgContent->PluginData(), msgContentId, copy, EClientOwns );
+        } 
+    return content;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::DeletePartL( const TUint aIndex )
+    {
+    if ( aIndex >= iChildPartCount )
+        {
+        User::Leave( KErrArgument );
+        }
+    
+    TFSMailMsgId partId = iChildParts[aIndex];
+    iEmailMsgContent->Part().RemoveChildPartL( partId );
+    iChildParts.Remove( aIndex );
+    iChildPartCount--;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::AddPartL(
+        const MEmailMessageContent& aPart,
+        const TUint aPos )
+    {
+    if ( aPos > iChildPartCount )
+        {
+        User::Leave( KErrArgument );
+        }
+
+    TFSMailMsgId insertBefore = TFSMailMsgId();
+    if ( aPos <  iChildPartCount )
+        {
+        insertBefore = iChildParts[aPos];
+        }
+    const TDesC& contentType = aPart.ContentType();
+
+    CFSMailMessagePart* newPart = 
+        iEmailMsgContent->Part().NewChildPartL( insertBefore, contentType );
+    CleanupStack::PushL( newPart );
+    TFSMailMsgId newPartId = newPart->GetPartId(); 
+    iChildParts.InsertL( newPartId, aPos );
+    iChildPartCount = iChildParts.Count();
+    CleanupStack::Pop( newPart );
+    
+
+
+    return;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TEmailTypeId CEmailMultipart::InterfaceId() const
+    {
+    return KEmailIFUidMultipart;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::Release()
+    {
+    if ( iOwner == EClientOwns )
+        {
+        delete this;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TMessageContentId CEmailMultipart::Id() const
+    {
+    return iEmailMsgContent->Id(); 
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailMultipart::ContentType() const
+    {
+    return iEmailMsgContent->ContentType();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::SetContentType( const TDesC& aContentType )
+    {
+    iEmailMsgContent->SetContentType( aContentType );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailMultipart::ContentId() const
+    {
+    return iEmailMsgContent->ContentId();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::SetContentId( const TDesC& aContentId )
+    {
+    iEmailMsgContent->SetContentId( aContentId );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailMultipart::ContentDescription() const
+    {
+    return iEmailMsgContent->ContentDescription();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::SetContentDescription( const TDesC& aContentDescription )
+    {
+    iEmailMsgContent->SetContentDescription( aContentDescription );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailMultipart::ContentDisposition() const
+    {
+    return iEmailMsgContent->ContentDisposition();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::SetContentDisposition( const TDesC& aContentDisposition )
+    {
+    iEmailMsgContent->SetContentDisposition( aContentDisposition );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailMultipart::ContentClass() const
+    {
+    return iEmailMsgContent->ContentClass();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::SetContentClass( const TDesC& aContentClass )
+    {
+    iEmailMsgContent->SetContentClass( aContentClass );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailMultipart::AvailableSize() const
+    {
+    return iEmailMsgContent->AvailableSize();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailMultipart::TotalSize() const
+    {
+    return iEmailMsgContent->TotalSize();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailMultipart::ContentL() const
+    {
+    User::Leave(KErrNotSupported);
+    return iEmailMsgContent->ContentL();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::SetContentL( const TDesC& aContent )
+    {
+    iEmailMsgContent->SetContentL( aContent );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::FetchL( MEmailFetchObserver& aObserver )
+    {
+    iEmailMsgContent->FetchL( aObserver );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::CancelFetch()
+    {
+    iEmailMsgContent->CancelFetch();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::SaveToFileL( const TDesC& aPath )
+    {
+    iEmailMsgContent->SaveToFileL( aPath );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailMultipart* CEmailMultipart::AsMultipartOrNull() const
+    {
+    const MEmailMultipart* ptr = this;
+    return const_cast<MEmailMultipart*>( ptr );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailTextContent* CEmailMultipart::AsTextContentOrNull() const
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailAttachment* CEmailMultipart::AsAttachmentOrNull() const
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailMultipart::SetOwner( const TDataOwner aOwner )
+    {
+    iOwner = aOwner;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/emailtextcontent.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,298 @@
+/*
+* 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: This file implements class CEmailAttachment.
+*
+*/
+
+#include "emailcontent.h"
+#include "emailtextcontent.h"
+#include "emailmessage.h"
+#include "emailclientapi.hrh"
+
+// CEmailTextContent
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailTextContent* CEmailTextContent::NewL( 
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,
+        CFSMailMessagePart* aPart,
+        const TDataOwner aOwner ) 
+    {
+    CEmailTextContent* self = new ( ELeave ) CEmailTextContent( aOwner );
+    CleanupStack::PushL( self );
+    self->ConstructL( aPluginData, aMsgContentId, aPart );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::ConstructL(
+        CPluginData& aPluginData,
+        const TMessageContentId& aMsgContentId,
+        CFSMailMessagePart* aPart )
+    {
+    iEmailMsgContent = CEmailMessageContent::NewL( aPluginData, aMsgContentId, aPart );
+    TContentType contentType( aPart->GetContentType() );
+    if ( contentType.Equals( KFSMailContentTypeTextHtml ) )
+        {
+        iTextType = EHtmlText;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailTextContent::~CEmailTextContent()
+    {
+    delete iEmailMsgContent;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CEmailTextContent::CEmailTextContent( TDataOwner aOwner ) : 
+    iTextType( EPlainText ), 
+    iOwner( aOwner )
+    {
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TEmailTypeId CEmailTextContent::InterfaceId() const
+    {
+    return KEmailIFUidTextContent;
+    }
+    
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::Release()
+    {
+    if ( iOwner == EClientOwns )
+        {
+        delete this;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailTextContent::TTextType CEmailTextContent::TextType() const
+    {
+    return iTextType;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::SetTextL(
+            const TTextType aPlainOrHtml,
+            const TDesC& aText )
+    {    
+    iTextType = aPlainOrHtml;
+
+    if( aPlainOrHtml == EPlainText )
+        {
+        SetContentType( KContentTypeTextPlain );
+        }
+    else if( aPlainOrHtml == EHtmlText )
+        {
+        SetContentType( KContentTypeTextHtml );
+        }
+    SetContentL( aText );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TMessageContentId CEmailTextContent::Id() const
+    {
+    return iEmailMsgContent->Id(); 
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailTextContent::ContentType() const
+    {
+    return iEmailMsgContent->ContentType();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::SetContentType( const TDesC& aContentType )
+    {
+    iEmailMsgContent->SetContentType( aContentType );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailTextContent::ContentId() const
+    {
+    return iEmailMsgContent->ContentId();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::SetContentId( const TDesC& aContentId )
+    {
+    iEmailMsgContent->SetContentId( aContentId );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailTextContent::ContentDescription() const
+    {
+    return iEmailMsgContent->ContentDescription();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::SetContentDescription( const TDesC& aContentDescription )
+    {
+    iEmailMsgContent->SetContentDescription( aContentDescription );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailTextContent::ContentDisposition() const
+    {
+    return iEmailMsgContent->ContentDisposition();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::SetContentDisposition( const TDesC& aContentDisposition )
+    {
+    iEmailMsgContent->SetContentDisposition( aContentDisposition );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailTextContent::ContentClass() const
+    {
+    return iEmailMsgContent->ContentClass();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::SetContentClass( const TDesC& aContentClass )
+    {
+    iEmailMsgContent->SetContentClass( aContentClass );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailTextContent::AvailableSize() const
+    {
+    return iEmailMsgContent->AvailableSize();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TInt CEmailTextContent::TotalSize() const
+    {
+    return iEmailMsgContent->TotalSize();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TPtrC CEmailTextContent::ContentL() const
+    {
+    return iEmailMsgContent->ContentL();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::SetContentL( const TDesC& aContent )
+    {
+    iEmailMsgContent->SetContentL( aContent );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::FetchL( MEmailFetchObserver& aObserver )
+    {
+    iEmailMsgContent->FetchL( aObserver );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::CancelFetch()
+    {
+    iEmailMsgContent->CancelFetch();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::SaveToFileL( const TDesC& aPath )
+    {
+    iEmailMsgContent->SaveToFileL( aPath );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailMultipart* CEmailTextContent::AsMultipartOrNull() const
+    {    
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailTextContent* CEmailTextContent::AsTextContentOrNull() const
+    {
+    const MEmailTextContent* ptr = this;
+    return const_cast<MEmailTextContent *>(ptr);
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailAttachment* CEmailTextContent::AsAttachmentOrNull() const
+    {
+    return NULL;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CEmailTextContent::SetOwner( const TDataOwner aOwner )
+    {
+    iOwner = aOwner;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/implproxy.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* 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:  ECom impementation proxy for Email client API
+*
+*/
+
+#include "emailclientapiimpl.hrh"
+#include "emailclientapiimpl.h"
+#include "emailinterfacefactoryimpl.h"
+#include <implementationproxy.h>	//TImplementationProxy
+
+// -----------------------------------------------------------------------------
+// Defines the pairing required by the ECOM framework to correctly identify the
+// instantiation method pointer for client's request.
+// -----------------------------------------------------------------------------
+const TImplementationProxy ImplementationTable[] =
+    {
+    IMPLEMENTATION_PROXY_ENTRY(
+            KEmailClientApiImplUid,
+            CEmailInterfaceFactoryImpl::NewL )
+    };
+
+// -----------------------------------------------------------------------------
+// Returns the TImplementationProxy for email client api implementation
+// -----------------------------------------------------------------------------
+EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
+    {
+    aTableCount = sizeof( ImplementationTable ) / sizeof( TImplementationProxy );
+
+    return ImplementationTable;
+    }
+
+// End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/emailclientapi/src/messageiterator.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,319 @@
+/*
+* 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: This file implements class CMessageIterator.
+*
+*/
+
+#include "emailmessage.h"
+#include "messageiterator.h"
+#include "emailapiutils.h"
+#include "cfsmailplugin.h"
+#include "emailapiutils.h"
+#include "emailclientapi.hrh"
+#include "mfsmailiterator.h"
+
+// number of messages in chunk to retrive from protocol plugin. Actual chunk
+// size is one less because last element is used for reference to next chunk
+// retrieval. See ReadNextChunkL() for details.
+const TInt KMessageChunkSize = 5;
+
+const TInt KUndefined = -1;
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CMessageIterator* CMessageIterator::NewL( 
+    MFSMailIterator* aIterator,
+    CPluginData& aPluginData,
+    TUint aCount )
+    {
+    CMessageIterator* iter = new ( ELeave ) 
+        CMessageIterator( aIterator, aPluginData, aCount );
+    return iter;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CMessageIterator::~CMessageIterator()
+    {
+    iPluginData.ReleaseInstance();
+    TInt count = iMessageArray.Count();
+    iMessageArray.ResetAndDestroy();
+    for ( TInt i = count; i < iFsMessageArray.Count(); i++ )
+        {
+        delete iFsMessageArray[i];
+        }
+    iFsMessageArray.Reset();
+    delete iIterator;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TEmailTypeId CMessageIterator::InterfaceId() const
+    {
+    return KEmailIFUidMessageIterator;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CMessageIterator::Release()
+    {
+    delete this;
+    }
+
+// -----------------------------------------------------------------------------
+// Returns next message
+// Messages are retrieved from protocol plugin in chunks of x messages and
+// when NextL has be called for x times, next chunk is retrieved. This
+// is trade-off between RAM consumption and speed.
+// -----------------------------------------------------------------------------
+MEmailMessage* CMessageIterator::NextL()
+    {
+    if ( iCursor == KUndefined )
+        {
+        // Buffer empty, read the first chunk
+        if ( !ReadNextChunkL() )
+            {
+            // No messages found, 
+            // Reset the cursor and return NULL
+            iCursor = KUndefined;
+            iStartMsgId = TFSMailMsgId();
+            return NULL;
+            }
+        // Items found, return the first item in the buffer
+        iCursor = 0;
+        }
+    else
+        {
+        // Iterate to the next item
+        iCursor++;
+        }
+    return ReadFromChunkL();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailMessage* CMessageIterator::PreviousL()
+    {
+    if ( iCursor == KUndefined )
+        {
+        iStartMsgId = TFSMailMsgId();
+        // Buffer empty, client should first call NextL
+        return NULL;
+        }
+    // Iterate to the previous item
+    iCursor--;
+    return ReadFromChunkL();
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TBool CMessageIterator::ReadNextChunkL()
+    {
+    User::LeaveIfNull( iIterator );
+    
+    TBool chunkFound = EFalse;
+
+    // Delete previous items if exist
+    CleanCache();
+    iHasMoreNextItems = iIterator->NextL(
+            iStartMsgId,
+            KMessageChunkSize,
+            iFsMessageArray );
+    if ( iFsMessageArray.Count() > 0 )
+        {
+        chunkFound = ETrue;
+        // Set the cursor to the first item 
+        iCursor = 0;
+        iHasMorePrevItems = ETrue;
+        }
+    return chunkFound;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TBool CMessageIterator::ReadPreviousChunkL()
+    {
+    User::LeaveIfNull( iIterator );
+
+    TBool chunkFound = EFalse;
+
+    // Delete previous items if exist
+    CleanCache();
+    RPointerArray<CFSMailMessage> tmp;
+    iHasMorePrevItems = iIterator->PreviousL(
+            iStartMsgId,
+            KMessageChunkSize, 
+            tmp );
+    TInt count = tmp.Count();
+    if ( count > 0 )
+        {
+        // It seems that items have been found
+        // Set the cursor to the end of array
+        iCursor = count - 1;
+        iHasMoreNextItems = ETrue;
+        chunkFound = ETrue;
+        // Revise the order of the buffer.
+        // Create complete cache, so it is easier to iterate, 
+        // as now we have to start from the end of cache
+        for ( TInt i = count; i > 0; i-- )
+            {
+            CFSMailMessage* msg = tmp[i-1];
+            iFsMessageArray.AppendL( msg );
+            AddToCacheL( msg );
+            }
+        }
+
+    return chunkFound;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+MEmailMessage* CMessageIterator::ReadFromChunkL()
+    {
+    if ( iCursor >= KMessageChunkSize )
+        {
+        if ( iHasMoreNextItems )
+            {
+            iStartMsgId = iFsMessageArray[iCursor-1]->GetMessageId();
+            if ( !ReadNextChunkL() )
+                {
+                // No more items found, 
+                // set the cursor to the previous item,
+                // and return NULL.
+                iCursor--;
+                return NULL;
+                }
+            }
+        else
+            {
+            // No more items found, 
+            // set the cursor to the previous item,
+            // and return NULL.
+            iCursor--;
+            return NULL;
+            }
+        }
+    else if ( iCursor < 0 )
+        {
+        iStartMsgId = iFsMessageArray[0]->GetMessageId();
+        if ( iHasMorePrevItems )
+            {
+            if ( !ReadPreviousChunkL() )
+                {
+                // Buffer is empty now, client should call nextL,
+                // and start reading from the start of the buffer
+                iCursor = KUndefined;
+                return NULL;
+                }
+            }
+        else
+            {
+            // Buffer is empty now, client should call nextL,
+            // and start reading from the start of the buffer
+            iCursor = KUndefined;   
+            return NULL;
+            }
+        }
+
+    if ( iCursor < iFsMessageArray.Count() )
+        {
+        /* There are items to read in the cache */
+        if ( iCursor >= iMessageArray.Count() )
+            {
+            AddToCacheL( iFsMessageArray[iCursor] );
+            }
+        return iMessageArray[iCursor];
+        }
+    else
+        {
+        // No more items found,
+        // set the cursor to the previous item,
+        // and return NULL.
+        iCursor--;
+        return NULL;
+        }
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CMessageIterator::AddToCacheL( CFSMailMessage* aFsMsg )
+    {
+    CEmailMessage* message = CEmailMessage::NewL( iPluginData, aFsMsg, EAPIOwns );
+    iMessageArray.AppendL( message );
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CMessageIterator::CleanCache()
+    {
+    // This is strange loop indeed
+    // Both arrays has items that are deleted, iMessageArray has objects that point to iFsMessageArray
+    // Index in both arrays goes syncronously
+    // To prevent double destruction, first delete iMessageArray onjects and then the rest of the iFsMessageArray
+    TInt count = iMessageArray.Count();
+    iMessageArray.ResetAndDestroy();
+    for ( TInt i = count; i < iFsMessageArray.Count(); i++ )
+        {
+        iFsMessageArray.Remove( count );
+        }
+    iFsMessageArray.Reset();    
+    }
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+TUint CMessageIterator::Count() const
+    {
+    return iCount;
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+void CMessageIterator::ConstructL()
+    {
+    iPlugin = iPluginData.ClaimInstanceL();
+    
+    }
+
+// -----------------------------------------------------------------------------
+// 
+// -----------------------------------------------------------------------------
+CMessageIterator::CMessageIterator( 
+    MFSMailIterator* aIterator,
+    CPluginData& aPluginData,
+    TUint aCount ) :
+    iIterator( aIterator ),
+    iPluginData( aPluginData ),
+    iStartMsgId( TFSMailMsgId() ),
+    iState( EReadNextMessageChunk ),
+    iFsMessageArray( KMessageChunkSize ),
+    iCount( aCount ),
+    iCursor ( KUndefined ),
+    iFirstMsgId( TFSMailMsgId() ),
+    iHasMoreNextItems( ETrue ),
+    iHasMorePrevItems( ETrue )
+    {
+    }
+
+// End of file
--- a/emailservices/emailcommon/inc/CFSMailCommon.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailcommon/inc/CFSMailCommon.h	Tue Jul 06 14:04:34 2010 +0300
@@ -52,6 +52,7 @@
     EFSMsgFlag_OnlyToMe = 2048,          // The message was sent only to this user
     EFSMsgFlag_RemoteDeleted = 4096,     // The message has been deleted on the server
     EFSMsgFlag_HasMsgSender = 8192,      // The message has one or more senders 
+	// <qmail> Not using EFSMsgFlag_BodyTruncated </qmail>
     };
 
 /** email list sorting options */  
--- a/emailservices/emailcommon/inc/CFSMailMessageBase.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailcommon/inc/CFSMailMessageBase.h	Tue Jul 06 14:04:34 2010 +0300
@@ -299,6 +299,7 @@
      CFSMailMessageBase();
 
 // <qmail>
+     // iMessageId removed
     /**
      * ConstructL
      */
--- a/emailservices/emailcommon/inc/CFSMailRequestHandler.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailcommon/inc/CFSMailRequestHandler.h	Tue Jul 06 14:04:34 2010 +0300
@@ -81,7 +81,7 @@
     /**
      * destructor.
      */
-      ~CFSMailRequestHandler();
+     virtual ~CFSMailRequestHandler();
 
     /**
      * two based constructor
--- a/emailservices/emailcommon/src/CFSMailBox.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailcommon/src/CFSMailBox.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -77,7 +77,7 @@
 EXPORT_C CFSMailBox::~CFSMailBox()
 {
     NM_FUNCTION;
-    
+    // <qmail> Not using KMailboxExtMrCalInfo </qmail>
     iFolders.ResetAndDestroy();
 }
 
@@ -456,11 +456,7 @@
     
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
-        // <qmail> Not activated yet.
-        //UpdateMrusL( aMessage.GetToRecipients(),
-        //         aMessage.GetCCRecipients(),
-        //       aMessage.GetBCCRecipients() );
-        // </qmail>
+        // <qmail> Removed UpdateMrusL. </qmail>
         plugin->SendMessageL( aMessage );
         }
 	}
@@ -481,11 +477,7 @@
 
     if ( plugin )
         {
-        // <qmail> Not activated yet.
-        //UpdateMrusL( aMessage.GetToRecipients(),
-        //         aMessage.GetCCRecipients(),
-        //       aMessage.GetBCCRecipients() );
-        // </qmail>
+        // <qmail> Removed UpdateMrusL. </qmail>
 
         // init asynchronous request
         request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(),
@@ -555,6 +547,11 @@
 EXPORT_C TDesC& CFSMailBox::GetBrandingIdL( )
 {
     NM_FUNCTION;
+	if ( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
+        {
+        TDesC& result = plugin->GetBrandingIdL( GetId() );
+        return result;
+        }
     
     return BrandingId();
 }
@@ -585,6 +582,7 @@
     NM_FUNCTION;
     
     TFSPendingRequest request;
+    request.iRequestId = 0;
     if( CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid( GetId() ) )
         {
         // init asynchronous request
@@ -650,7 +648,7 @@
         
         // remove outbox, drafts folder from folder list
         RArray<TFSMailMsgId> folderIds;
-        folderIds.Reset();
+        CleanupClosePushL( folderIds );  
         for(TInt i=0;i<iFolders.Count();i++)
         {
             TFSMailMsgId id = iFolders[i]->GetFolderId();
@@ -662,7 +660,7 @@
         
         // start search
         plugin->SearchL( GetId(), folderIds, aSearchStrings, aSortCriteria, aSearchObserver );
-        folderIds.Reset();
+        CleanupStack::PopAndDestroy( &folderIds );
         }
     }
 
@@ -1067,9 +1065,11 @@
 EXPORT_C void CFSMailBox::ReleaseExtension( CEmailExtension* aExtension )
     {
     NM_FUNCTION;
+	// <qmail> Not using KMailboxExtMrCalInfo
     
     // no specialized behaviour, call base class
     CExtendableEmail::ReleaseExtension( aExtension );
+	// </qmail>
     }
     
 // -----------------------------------------------------------------------------
@@ -1094,6 +1094,7 @@
             }
         }    
     else if ( aInterfaceUid == KEmailMailboxStateExtensionUid )
+		// <qmail> Not using KEmailSettingExtensionUid or KEmailConnectionStatusQueryExtensionUid </qmail>
         {
         if ( !extension )
             {
--- a/emailservices/emailcommon/src/CFSMailMessagePart.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailcommon/src/CFSMailMessagePart.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -529,16 +529,19 @@
 	if(plugin != NULL)
 		{
 		RPointerArray<CFSMailMessagePart> parts;
-		RArray<TFSMailMsgId> partIds;
-    	plugin->ChildPartsL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),parts);
+        CleanupResetAndDestroyPushL( parts );
+        plugin->ChildPartsL(GetMailBoxId(),GetFolderId(),GetMessageId(),GetPartId(),parts);
+        RArray<TFSMailMsgId> partIds;
+        CleanupClosePushL( partIds );
+        partIds.ReserveL( 1 + parts.Count() );
 		for(TInt i=0;i<parts.Count();i++)
 			{
-			partIds.Append(parts[i]->GetMessageId());
+			partIds.AppendL( parts[i]->GetMessageId() );
 			}
-        partIds.Append(GetPartId());
+        partIds.AppendL( GetPartId() );
 		plugin->RemovePartContentL(GetMailBoxId(), GetFolderId(), GetMessageId(), partIds);
-        parts.ResetAndDestroy();
-		partIds.Reset();
+        CleanupStack::PopAndDestroy( &partIds );
+        CleanupStack::PopAndDestroy( &parts );
 		}
 	}
 
@@ -559,12 +562,12 @@
         {
         // get attachment list
         RPointerArray<CFSMailMessagePart> attachments;
-        attachments.Reset();
+        CleanupResetAndDestroyPushL( attachments );
         DoAttachmentListL(attachments);
 
         // copy attachment part ids
         RArray<TFSMailMsgId> ids;
-        ids.Reset();
+        CleanupClosePushL( ids ); 
         for(TInt i=0;i<attachments.Count();i++)
             {
             ids.Append(attachments[i]->GetPartId());
@@ -577,8 +580,8 @@
             }
         
         // clean tables
-        attachments.ResetAndDestroy();
-        ids.Reset();
+        CleanupStack::PopAndDestroy( &ids );
+        CleanupStack::PopAndDestroy( &attachments );
         }
     }
 
--- a/emailservices/emaildebug/inc/emailtrace.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emaildebug/inc/emailtrace.h	Tue Jul 06 14:04:34 2010 +0300
@@ -18,47 +18,43 @@
 #ifndef EMAILTRACE_H
 #define EMAILTRACE_H
 
-#include <e32debug.h>
-#include <qdebug.h>
-#include <qfile.h>
-
-/*
- * The NM_TRACING_SYSTEM macro can be used to enable and disable the tracing
- * system in debug mode. The tracing system can be disabled in a specific
- * source file by defining the macro "NM_TRACING_SYSTEM 0" before this file
- * is included.
- */
-#ifndef NM_TRACING_SYSTEM
-#define NM_TRACING_SYSTEM 1
-#endif
+#include <QCoreApplication>
+#include <QDebug>
+#include <QFile>
+#include <QThread>
 
 /*
  * The macros NM_COMMENT_TRACES, NM_ERROR_TRACES, and NM_FUNCTION_TRACES
  * control which debug messages are printed. The trace logging is controlled
- * with the NM_LOG_TO_FILE macro, whereas the NM_LOG_FILE macro defines which
- * file is to be used in logging. The print_trace() helper function implements
- * printing. If NM_LOG_TO_FILE is zero or the NM_LOG_FILE cannot be opened,
- * the messages are printed to qDebug().
+ * with the NM_LOG_TO_FILE macro, whereas the NM_LOG_DIRECTORY macro defines
+ * which directory is to be used to store the log files. The print_trace()
+ * helper function implements printing. Log files are named according to
+ * process and thread IDs. If NM_LOG_TO_FILE is zero or a log file cannot be
+ * opened, the messages are printed to qDebug(). The DSC2STR() function can
+ * be used to convert Symbian descriptors to QString objects.
  */
-#if NM_TRACING_SYSTEM && (defined(DEBUG) || defined(_DEBUG))
+#if defined(DEBUG) || defined(_DEBUG)
 
-#define NM_COMMENT_TRACES  1
-#define NM_ERROR_TRACES    1
-#define NM_FUNCTION_TRACES 1
+#define NM_COMMENT_TRACES  0
+#define NM_ERROR_TRACES    0
+#define NM_FUNCTION_TRACES 0
 
 #if NM_COMMENT_TRACES || NM_ERROR_TRACES || NM_FUNCTION_TRACES
 
-#define NM_LOG_TO_FILE 0
-#define NM_LOG_FILE    "c:/data/logs/nmail_trace.log"
+#define NM_LOG_TO_FILE   1
+#define NM_LOG_DIRECTORY "c:/data/logs/"
 
 inline void print_trace(const QString& msg)
 {
-    static QFile file(NM_LOG_FILE);
+    static QFile file(NM_LOG_DIRECTORY+
+                      QString("nmail_p%1_t%2.log").
+                      arg(QCoreApplication::applicationPid()).
+                      arg(QThread::currentThreadId()));
     if (NM_LOG_TO_FILE && !file.isOpen()) {
         file.open(QIODevice::Append | QIODevice::Text);
     }
     if (file.isWritable()) {
-        QDebug(&file).nospace() << "[Nmail] " << msg << '\n';
+        QDebug(&file).nospace() << msg << '\n';
     } else {
         qDebug().nospace() << "[Nmail] " << msg;
     }
@@ -66,6 +62,16 @@
 
 #endif
 
+inline QString DSC2STR(const TDesC& dsc)
+{
+    return QString::fromRawData(reinterpret_cast<const QChar*>(dsc.Ptr()),
+                                dsc.Length());
+}
+
+#else
+
+#define DSC2STR(dsc)
+
 #endif /* DEBUG */
 
 /*
@@ -142,7 +148,7 @@
 #define ERROR_3(err,msg,arg1,arg2,arg3)\
 do {\
     QString __msg;\
-    __msg.sprintf(msg,arg1,srg2,arg3);\
+    __msg.sprintf(msg,arg1,arg2,arg3);\
     NM_ERROR(err,__msg);\
 } while(0)
 #define ERROR_GEN(msg) ERROR(KErrGeneral,msg)
@@ -162,10 +168,12 @@
 
 /*
  * The macro NM_FUNCTION, when used inside a function body, enables tracing
- * for a function. ENTER and RETURN messages are printed when entering into
+ * for a function. If used, it should be placed on the first line of the
+ * function body. ENTER and RETURN messages are printed when entering into
  * and returning from a function, respectively. In case of an exception,
- * UNWIND (for stack unwinding) is printed. The FUNC_LOG macro is provided
- * for legacy compatibility. It is deprecated and should not be used.
+ * UNWIND (for stack unwinding) is printed instead of RETURN. The FUNC_LOG
+ * macro is provided for legacy compatibility. It is deprecated and should
+ * not be used.
  */
 #if NM_FUNCTION_TRACES
 
--- a/emailservices/emailframework/src/CFSMailClient.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailframework/src/CFSMailClient.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -188,7 +188,7 @@
 {
     NM_FUNCTION;
     
-	CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aFolderId);
+	CFSMailPlugin* plugin = iFWImplementation->GetPluginManager().GetPluginByUid(aMailBoxId);
 	if(plugin)
 	{
 		plugin->DeleteMessagesByUidL(aMailBoxId,aFolderId,aMessages);
--- a/emailservices/emailstore/base_plugin/inc/BasePlugin.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailstore/base_plugin/inc/BasePlugin.h	Tue Jul 06 14:04:34 2010 +0300
@@ -50,6 +50,7 @@
 class CMailboxInfo;
 class CSearchHandler;
 class HMailIterator;
+class CDelayedOp;
 class CDelayedOpsManager;
 class MDelayedOpsManager;
 
@@ -85,6 +86,7 @@
     friend class CDelayedMessageStorerOp;
 	// <qmail>
     friend class CDelayedAddNewOrRemoveChildPartOp;
+    friend class CDelayedOp;
 	// </qmail>
 	protected:
     struct TOngoingFetchInfo;
@@ -830,7 +832,8 @@
         //does not actually own the observers.
         RPointerArray<MFSMailEventObserver> iObservers;
         //async fetch reqs.
-        RPointerArray<CFetchRequester> iReqs;
+        RPointerArray<CFetchRequester> iReqs;       
+        RPointerArray<CDelayedOp> iDelayedOpReqs;
 
         TCacheLine iCacheLine;
 
--- a/emailservices/emailstore/base_plugin/inc/baseplugindelayedops.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailstore/base_plugin/inc/baseplugindelayedops.h	Tue Jul 06 14:04:34 2010 +0300
@@ -108,6 +108,10 @@
     MDelayedOpsManager* iManager;   //not owned
     CBasePlugin* iPlugin;           //not owned
     
+public:
+    TInt iRequestId;
+    MFSMailRequestObserver* iOperationObserver;
+    
     __LOG_DECLARATION
     };
 
--- a/emailservices/emailstore/base_plugin/inc/baseplugindelayedopsprivate.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailstore/base_plugin/inc/baseplugindelayedopsprivate.h	Tue Jul 06 14:04:34 2010 +0300
@@ -231,8 +231,6 @@
     TFSMailMsgId iMailBox;
     RPointerArray<CFSMailMessage> iMessages;
     RPointerArray<CFSMailMessagePart> iMessageParts;
-    MFSMailRequestObserver& iOperationObserver;
-    TInt iRequestId;
     TInt iType;
     // Data buffer for async operations
     HBufC8* iDataBuffer;
@@ -273,8 +271,6 @@
 private:
     CBasePlugin& iBasePlugin;
     TFSMailMsgId iMailBox;
-    MFSMailRequestObserver& iOperationObserver;
-    TInt iRequestId;
 
     __LOG_DECLARATION
     };
@@ -342,8 +338,6 @@
     TFSMailMsgId iPartId;
     HBufC* iContentType;
     HBufC* iFilePath;
-    MFSMailRequestObserver& iOperationObserver;
-    TInt iRequestId;
     TInt iActionType;
     __LOG_DECLARATION
     };
--- a/emailservices/emailstore/base_plugin/src/BasePlugin.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailstore/base_plugin/src/BasePlugin.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -130,7 +130,12 @@
 
     iReqs.ResetAndDestroy();
     iReqs.Close();
-    
+
+    // Note that all the ops in iDelayedOpReqs array (if any) have already been
+    // deleted in the destructor of CDelayedOpsManager class.
+    iDelayedOpReqs.Reset();
+    iDelayedOpReqs.Close();
+
     ResetCache();
 
     __LOG_DESTRUCT
@@ -800,6 +805,7 @@
      CDelayedMessageToSendOp* delayedOp = CDelayedMessageToSendOp::NewLC(
     *this,aMailBoxId,aOperationObserver,aRequestId);
     iDelayedOpsManager->EnqueueOpL( delayedOp );
+    iDelayedOpReqs.AppendL(delayedOp);
     CleanupStack::Pop( delayedOp );      
     }
  // </qmail> 
--- a/emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailstore/base_plugin/src/baseplugindelayedops.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -72,6 +72,16 @@
     
     //self-destroy.
     iManager->DequeueOp( *this );
+    
+    //Remove this from iDelayedOpReqs as well.
+    for ( TInt i = 0; i < iPlugin->iDelayedOpReqs.Count(); i++ )
+        {
+        if ( iPlugin->iDelayedOpReqs[i] == this )
+            {
+            iPlugin->iDelayedOpReqs.Remove( i );
+            break;
+            }
+        }
     delete this;
     }
     
@@ -613,10 +623,12 @@
     MFSMailRequestObserver& aOperationObserver,
     const TInt aRequestId)
     : iMailBox( aMailBox ), 
-      iOperationObserver( aOperationObserver ),
-      iRequestId( aRequestId ),
       iType(EHeaders)
     {
+    
+    CDelayedOp::iOperationObserver = &aOperationObserver ;
+    CDelayedOp::iRequestId =  aRequestId ;
+       
     for(TInt i=0; i < messages.Count(); i++)
         {
         iMessages.Append(messages[i]);
@@ -630,10 +642,12 @@
     RPointerArray<CFSMailMessagePart>& aMessageParts,
     MFSMailRequestObserver& aOperationObserver,
     const TInt aRequestId)
-    :iOperationObserver( aOperationObserver ),
-    iRequestId( aRequestId ),
-    iType(EParts)
+    :iType(EParts)
     {
+    
+    CDelayedOp::iOperationObserver = &aOperationObserver ;
+    CDelayedOp::iRequestId =  aRequestId ;
+    
     for(TInt i=0; i < aMessageParts.Count(); i++)
         {
         iMessageParts.Append(aMessageParts[i]);
@@ -704,8 +718,12 @@
         progress.iError = KErrNone;
         progress.iProgressStatus = TFSProgress::EFSStatus_RequestComplete;
         }
-
-    iOperationObserver.RequestResponseL( progress, iRequestId );
+		
+		if(iOperationObserver)
+			{
+				iOperationObserver->RequestResponseL( progress, iRequestId );
+			}
+    
     
     __LOG_EXIT;
     }
@@ -714,35 +732,39 @@
 /**
  * 
  */
-void CDelayedMessageStorerOp::StorePartL(
-        CFSMailMessagePart* aPart)
+void CDelayedMessageStorerOp::StorePartL(CFSMailMessagePart* aPart)
     {
     User::LeaveIfNull(aPart);
-    
+
     // Text buffer for html text content
     HBufC* data16 = aPart->GetLocalTextContentLC();
 
-    TPtrC8 ptr8(reinterpret_cast<const TUint8*>( data16->Ptr() ),
-            data16->Size() );
-    
+    // Convert from 16 to 8 bit data -
+    HBufC8* dataBuffer = HBufC8::NewLC((data16->Length() * 2) + 1);
+    TPtr8 ptr8(dataBuffer->Des());
+    CnvUtfConverter::ConvertFromUnicodeToUtf8(ptr8, *data16);
+
     //get msgstore part
-    CMailboxInfo& mailBox = GetPlugin().GetMailboxInfoL( aPart->GetMailBoxId().Id() );
-    
+    CMailboxInfo& mailBox = GetPlugin().GetMailboxInfoL(
+            aPart->GetMailBoxId().Id());
+
     CMsgStoreMessage* msg = mailBox().FetchMessageL(
-            aPart->GetMessageId().Id(), KMsgStoreInvalidId );
-    CleanupStack::PushL( msg );
-    
-    CMsgStoreMessagePart* part= msg->ChildPartL( aPart->GetPartId().Id(), ETrue );
-    
-    CleanupStack::PopAndDestroy( msg );
-    CleanupStack::PushL( part );
+            aPart->GetMessageId().Id(), KMsgStoreInvalidId);
+    CleanupStack::PushL(msg);
+
+    CMsgStoreMessagePart* part = msg->ChildPartL(aPart->GetPartId().Id(),
+            ETrue);
+
+    CleanupStack::PopAndDestroy(msg);
+    CleanupStack::PushL(part);
 
     //replace content
     part->ReplaceContentL(ptr8);
-    
-    CleanupStack::PopAndDestroy( part );
-    CleanupStack::PopAndDestroy( data16 );
-       
+
+    CleanupStack::PopAndDestroy(part);
+    CleanupStack::PopAndDestroy(dataBuffer);
+    CleanupStack::PopAndDestroy(data16);
+
     }
 
 
@@ -794,10 +816,11 @@
     MFSMailRequestObserver& aOperationObserver,
     const TInt aRequestId)
     : iBasePlugin(aPlugin), 
-      iMailBox( aMailBox ), 
-      iOperationObserver( aOperationObserver ),
-      iRequestId( aRequestId )
+      iMailBox( aMailBox )
     {
+    
+    CDelayedOp::iOperationObserver = &aOperationObserver ;
+    CDelayedOp::iRequestId =  aRequestId ;
 
     }
 
@@ -821,7 +844,10 @@
         progress.iProgressStatus = TFSProgress::EFSStatus_RequestComplete;
         }
 
-    iOperationObserver.RequestResponseL( progress, iRequestId );
+		if(iOperationObserver)
+			{
+				iOperationObserver->RequestResponseL( progress, iRequestId );
+			}
     
     __LOG_EXIT;
     }
@@ -885,10 +911,10 @@
     iParentFolderId( aParentFolderId ),
     iMessageId( aMessageId ),
     iParentPartId( aParentPartId ),
-    iOperationObserver( aOperationObserver ),
-    iRequestId( aRequestId ),
     iActionType( AddNewChild)
     {
+    CDelayedOp::iOperationObserver = &aOperationObserver ;
+    CDelayedOp::iRequestId =  aRequestId ;
     }
 
 /**
@@ -907,10 +933,10 @@
     iMessageId( aMessageId ),
     iParentPartId( aParentPartId ),
     iPartId( aPartId ),
-    iOperationObserver( aOperationObserver ),
-    iRequestId( aRequestId ),
     iActionType( RemoveChild)
     {
+    CDelayedOp::iOperationObserver = &aOperationObserver ;
+    CDelayedOp::iRequestId =  aRequestId ;
     }
 
 /**
@@ -978,7 +1004,10 @@
         progress.iProgressStatus = TFSProgress::EFSStatus_RequestComplete;
         }
 		
-    iOperationObserver.RequestResponseL( progress, iRequestId );
+		if(iOperationObserver)
+			{
+				iOperationObserver->RequestResponseL( progress, iRequestId );
+			}
     
     __LOG_EXIT;
     }
--- a/emailservices/emailstore/base_plugin/src/basepluginmisc.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailstore/base_plugin/src/basepluginmisc.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -384,6 +384,23 @@
     		break;
     		}
     	}
+    count = iDelayedOpReqs.Count();
+    for ( TInt i = 0; i < count; i++ )
+        {
+        if ( iDelayedOpReqs[i]->iRequestId == aRequestId )
+            {
+            CDelayedOp* request = iDelayedOpReqs[i];
+            TFSProgress progress = TFSProgress();
+            progress.iProgressStatus = TFSProgress::EFSStatus_RequestCancelled;
+            progress.iCounter = progress.iMaxCount = 1;
+            progress.iError = KErrNone;
+            request->iOperationObserver->RequestResponseL( progress, aRequestId );
+            iDelayedOpsManager->DequeueOp(*request);
+            iDelayedOpReqs.Remove( i );
+            delete request;
+            break;
+            }
+        }
     }
 
 
--- a/emailservices/emailstore/message_store/client/inc/MsgStoreObserverHandler.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailstore/message_store/client/inc/MsgStoreObserverHandler.h	Tue Jul 06 14:04:34 2010 +0300
@@ -84,6 +84,7 @@
 		RArray<MMsgStoreObserver*>                       iObservers;
 		RArray<TMailBoxObserverInfo>                     iMailBoxObservers;
 		TBuf8<sizeof(TMsgStoreEvent)*KEventBufferLength> iEventBuffer;
+		TBool                                            iObjectDeleted;
 		
 		__LOG_DECLARATION
 	
--- a/emailservices/emailstore/message_store/client/src/MsgStoreObserverHandler.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/emailstore/message_store/client/src/MsgStoreObserverHandler.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -45,6 +45,8 @@
 	iSession( aSession )
 	{
 	__LOG_CONSTRUCT( "MsgClient", "CMsgStoreObserverHandler" )
+	//initialize variable to false.
+    iObjectDeleted = EFalse;
 	} // end constructor
 
 // ==========================================================================
@@ -57,6 +59,10 @@
 	iMailBoxObservers.Close();
 	iObservers.Close();
 		
+	//object is being deleted. Mark variable as true to cover case where delete
+	//has come while RunL was running and "AccountEventNotify" was called and
+	//has not completed.
+	iObjectDeleted = ETrue;
 	__LOG_DESTRUCT
 	} // end destructor
 
@@ -233,9 +239,15 @@
     	    eventPtr++;
             }
             
-    	// Get the next event(s).    	
-    	iSession.GetEvents( iStatus, iEventBuffer );
-    	SetActive();
+        //check that "this" object was not deleted by client during "AccountEventNotify".
+        //If object has been deleted there is no need to get session events and activate itself.
+        if ( !iObjectDeleted )
+            {
+            // Get the next event(s).       
+            iSession.GetEvents(iStatus, iEventBuffer);
+            SetActive();
+            }
+    	
 	    }
     else
     	{
--- a/emailservices/nmailagent/inc/nmmailagent.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmailagent/inc/nmmailagent.h	Tue Jul 06 14:04:34 2010 +0300
@@ -26,7 +26,8 @@
 class NmDataPluginInterface;
 class HbIndicator;
 class XQSystemToneService;
-
+class XQSettingsManager;
+class XQSettingsKey;
 
 class NmMailboxInfo
 {
@@ -86,6 +87,8 @@
 
     void indicatorActivated(const QString &type, const QVariantMap &data);
 
+    void valueChanged(const XQSettingsKey& key, const QVariant& value);
+
 private:
 
     void initMailboxStatus();
@@ -146,6 +149,8 @@
     bool mAlertToneAllowed;
     int mLastOutboxCount;
     bool mUnreadIndicatorActive;
+    XQSettingsManager *mSettingManager;
+    int mSilenceMode;
 };
 
 
--- a/emailservices/nmailagent/nmailagent.pro	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmailagent/nmailagent.pro	Tue Jul 06 14:04:34 2010 +0300
@@ -51,13 +51,14 @@
                              "conf/2002C326.txt                  /epoc32/release/winscw/urel/z/private/10202BE9/2002C326.txt" \
                              "conf/2002C326.txt                  /epoc32/data/z/private/10202BE9/2002C326.txt"
 
+    RSS_RULES += "hidden = KAppIsHidden;"
 
     TARGET.EPOCHEAPSIZE = 0x1000 0x100000 // MAX 1MB
 
     LIBS += -ldomaincli
     LIBS += -lxqservice
     LIBS += -lxqsettingsmanager
-    #LIBS += -lxqsystemtoneservice
+    LIBS += -lxqsystemtoneservice
     LIBS += -lhwrmvibraclient
 
     TARGET.UID2 = 0x100039CE
--- a/emailservices/nmailagent/src/nmmailagent.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmailagent/src/nmmailagent.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -26,15 +26,34 @@
 #include <xqsettingsmanager.h>
 #include <xqcentralrepositoryutils.h>
 #include <xqsystemtoneservice.h>
+#include <xqsettingskey.h>
+#include <ProfileEngineInternalCRKeys.h>
 
 // CONSTS
 const int NmAgentIndicatorNotSet = -1;
 const int NmAgentAlertToneTimer = 60000; // 60s
 const int NmAgentDefaultVibraDuration = 1000; // 1 second
-static const quint32 NmRepositoryId = 0x2002C326; 
+static const quint32 NmRepositoryId = 0x2002C326;
 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";
+const XQCentralRepositorySettingsKey NmSilenceModeKey(KCRUidProfileEngine.iUid, KProEngSilenceMode);
+const int NmSilenceModeOn = 1;
+
+/*!
+    Helper method for finding out if XQSettingsKey and XQCentralRepositorySettingsKey points to
+    same key.
+
+    @param settingKey XQSettingsKey
+    @param cenrepSettingKey XQCentralRepositorySettingsKey
+    @return <code>true</code> if target, uid and key matches otherwise returns <code>false</code>
+*/
+bool keysEqual(const XQSettingsKey& settingKey, const XQCentralRepositorySettingsKey& cenrepSettingKey)
+{
+    return ((settingKey.target() == cenrepSettingKey.target()) &&
+            (settingKey.uid() == cenrepSettingKey.uid()) &&
+            (settingKey.key() == cenrepSettingKey.key()));
+}
 
 
 /*!
@@ -68,7 +87,9 @@
  mVibra(NULL),
  mAlertToneAllowed(true),
  mLastOutboxCount(0),
- mUnreadIndicatorActive(false)
+ mUnreadIndicatorActive(false),
+ mSettingManager(NULL),
+ mSilenceMode(NmSilenceModeOn)  // by default silent mode is on
 {
     NM_FUNCTION;
 }
@@ -99,8 +120,34 @@
         return false;
     }
 
-    //mSystemTone = new XQSystemToneService();
-    
+    // Check status of silent mode.
+    delete mSettingManager;
+    mSettingManager = NULL;
+    mSettingManager = new XQSettingsManager();
+    QVariant silenceMode = mSettingManager->readItemValue(NmSilenceModeKey,
+        XQSettingsManager::TypeInt);
+    mSilenceMode = silenceMode.toInt();
+
+    // Start monitoring silence mode key.
+    bool monitoring(mSettingManager->startMonitoring(NmSilenceModeKey, XQSettingsManager::TypeInt));
+    monitoring &= connect(mSettingManager,
+                          SIGNAL(valueChanged(const XQSettingsKey&, const QVariant&)),
+                          this,
+                          SLOT(valueChanged(const XQSettingsKey&, const QVariant&)),
+                          Qt::UniqueConnection);
+
+    // If silence mode monitoring can't be started, then change silence mode on to be sure
+    // that no tone is played if silence mode is turned on at somepoint.
+    if (!monitoring) {
+        mSilenceMode = NmSilenceModeOn;
+    }
+
+    delete mSystemTone;
+    mSystemTone = NULL;
+    mSystemTone = new XQSystemToneService();
+
+    delete mIndicator;
+    mIndicator = NULL;
     mIndicator = new HbIndicator();
     connect(mIndicator,SIGNAL(userActivated(const QString &, const QVariantMap&)),
         this, SLOT(indicatorActivated(const QString&, const QVariantMap&)));
@@ -131,6 +178,8 @@
     }
 
     // Construct the vibra interface instance.
+    delete mVibra;
+    mVibra = NULL;
     TRAP_IGNORE(mVibra = CHWRMVibra::NewL());
 
     // load all current mailboxes
@@ -144,11 +193,13 @@
     NM_FUNCTION;
 
     delete mVibra;
-    //delete mSystemTone;
-
+    delete mSystemTone;
+    if (mSettingManager) {
+        mSettingManager->stopMonitoring(NmSilenceModeKey);
+        delete mSettingManager;
+    }
     qDeleteAll(mMailboxes);
 
-    //delete mSystemTone;
     NmDataPluginFactory::releaseInstance(mPluginFactory);
 }
 
@@ -297,6 +348,8 @@
 */
 int NmMailAgent::getTotalUnreadCount() const
 {
+    NM_FUNCTION;
+
     int unreads = 0;
     foreach (const NmMailboxInfo *mailbox, mMailboxes) {
         if (mailbox->mActive && mailbox->mInboxActive) {
@@ -312,6 +365,8 @@
 */
 bool NmMailAgent::updateUnreadIndicator()
 {
+    NM_FUNCTION;
+
     int unreads = getTotalUnreadCount();
     return updateUnreadIndicator(unreads>0);
 }
@@ -332,10 +387,10 @@
     bool changed = false;
     if (mailboxInfo->mActive != active ||
         refreshAlways) {
-        
+
 		// store the new state to permanent storage
         storeMailboxActive(mailboxId, active);
-        
+
         mailboxInfo->mActive = active;
         changed = true;
         if (active) {
@@ -404,8 +459,8 @@
 bool NmMailAgent::updateUnreadIndicator(bool active)
 {
     NM_FUNCTION;
+
     bool activated = false;
-
     if (active != mUnreadIndicatorActive) {
         if (active) {
             mIndicator->activate(NmUnreadIndicatorName);
@@ -428,17 +483,20 @@
 {
     NM_FUNCTION;
 
+    bool ok(false);
     XQApplicationManager appManager;
     XQAiwRequest *request = appManager.create(
         XQI_EMAIL_INBOX_VIEW, XQOP_EMAIL_INBOX_VIEW, false);
-    
-    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->lastError()));
-    delete request;
+    // Instance might be NULL if the service is not available.
+    if (request) {
+        QList<QVariant> list;
+        list.append(QVariant(mailboxId));
+        request->setArguments(list);
+
+        ok = request->send();
+        NM_COMMENT(QString("Launch ok=%1 error=%2").arg(ok).arg(request->lastError()));
+        delete request;
+    }
     return ok;
 }
 
@@ -479,7 +537,7 @@
         case NmMailboxCreated:
             foreach (NmId mailboxId, mailboxIds) {
                 getMailboxInfo(mailboxId); // create a new mailbox if needed
-                
+
                 // make sure the mailbox activity data is reseted
                 deleteStoredMailboxActivity(mailboxId);
             }
@@ -511,7 +569,7 @@
             foreach (NmId mailboxId, mailboxIds) {
                 // Will hide also the indicator
                 removeMailboxInfo(mailboxId);
-                
+
                 // make sure the mailbox activity data is deleted
                 deleteStoredMailboxActivity(mailboxId);
             }
@@ -528,6 +586,8 @@
 */
 NmMailboxInfo *NmMailAgent::getMailboxByType(const QString &type)
 {
+    NM_FUNCTION;
+
     foreach (NmMailboxInfo *mailbox, mMailboxes) {
         // mailbox is shown in indicators
         if (mailbox->mIndicatorIndex >= 0 && mailbox->mActive) {
@@ -551,7 +611,7 @@
 {
     NM_FUNCTION;
     Q_UNUSED(data);
-    
+
     // map the indicator type to mailbox
     NmMailboxInfo *info = getMailboxByType(type);
     if (info) {
@@ -565,6 +625,22 @@
 }
 
 /*!
+    Called when cenrep key value has been changed.
+    - only silence mode key handled
+
+    @param key changed key
+    @param value value for a key.
+*/
+void NmMailAgent::valueChanged(const XQSettingsKey& key, const QVariant& value)
+{
+    NM_FUNCTION;
+
+    if(keysEqual(key, NmSilenceModeKey)) {
+        mSilenceMode = value.toInt();
+    }
+}
+
+/*!
     Received from NmFrameworkAdapter messageEvent signal
     \sa NmFrameworkAdapter
 */
@@ -575,6 +651,7 @@
             const NmId& mailboxId)
 {
     NM_FUNCTION;
+
     NM_COMMENT(QString("NmMailAgent::handleMessageEvent(): event=%1, id=%2").
         arg(event).arg(mailboxId.id()));
 
@@ -583,45 +660,44 @@
 
     switch (event) {
         case NmMessageCreated: {
+            // Check the new messages to make the indicator appear earlier
             NmMailboxInfo *mailboxInfo = getMailboxInfo(mailboxId);
+            
+            // Inbox folder ID may be still unknown
+            if (mailboxInfo->mInboxFolderId.id() == 0) {
+                NmDataPluginInterface *plugin =
+                    mPluginFactory->interfaceInstance(mailboxId);
 
-            // Check the new messages to make the indicator appear earlier
-            if (mailboxInfo->mSyncState == Synchronizing) {
-                
-                // Inbox folder ID may be still unknown
-                if (mailboxInfo->mInboxFolderId.id()==0) {
-                    NmDataPluginInterface *plugin = mPluginFactory->interfaceInstance(mailboxId);
-                    if (plugin) {
-                        mailboxInfo->mInboxFolderId =
-                            plugin->getStandardFolderId(mailboxId, NmFolderInbox);
-                    }
+                if (plugin) {
+                    mailboxInfo->mInboxFolderId =
+                        plugin->getStandardFolderId(mailboxId, NmFolderInbox);
                 }
-                
-                if (folderId == mailboxInfo->mInboxFolderId) {
-                    foreach (NmId messageId, messageIds) {
-                        bool messageUnread = false;
+            }
+
+            if (folderId == mailboxInfo->mInboxFolderId) {
+                foreach (NmId messageId, messageIds) {
+                    bool messageUnread = false;
 
-                        // Check the message if we can either play a tone or if the "@" is 
-                        // not visible at the moment
-                        if (mAlertToneAllowed || !mUnreadIndicatorActive) {
-                            if (getMessageUnreadInfo(folderId, messageId, mailboxId, messageUnread)) {
-                                if (messageUnread) {
-                                    mailboxInfo->mUnreadMailIdList.append(messageId);
-                                    mailboxInfo->mInboxActive = true;
-                                    updateMailboxState(mailboxId, true, false);
+                    // Check the message if we can either play a tone or if the "@" is
+                    // not visible at the moment
+                    if (mAlertToneAllowed || !mUnreadIndicatorActive) {
+                        if (getMessageUnreadInfo(folderId, messageId, mailboxId, messageUnread)) {
+                            if (messageUnread) {
+                                mailboxInfo->mUnreadMailIdList.append(messageId);
+                                mailboxInfo->mInboxActive = true;
+                                updateMailboxState(mailboxId, true, false);
 
-                                    // make the "@" appear immediatelly
-                                    updateUnreadIndicator(true);
+                                // make the "@" appear immediatelly
+                                updateUnreadIndicator(true);
 
-                                    // Play the tone as well
-                                    playAlertTone();
-                                }
+                                // Play the tone as well
+                                playAlertTone();
                             }
                         }
                     }
                 }
             }
-            
+
             if (folderId==mailboxInfo->mInboxFolderId) {
                 mailboxInfo->mInboxCreatedMessages += messageIds.count();
             }
@@ -635,7 +711,7 @@
                 // Always activate the indicator
                 activate = true;
                 updateNeeded = true;
-                
+
                 mailboxInfo->mOutboxMails += messageIds.count();
 				updateSendIndicator();
             }
@@ -681,13 +757,21 @@
                 // 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 and inbox is still active
-					if (mailboxInfo->mInboxActive &&
+					updateNeeded = true;
+
+	                // Keep it active if there is unread mails and inbox is still active
+ 				    if (mailboxInfo->mInboxActive &&
 					    mailboxInfo->mUnreadMailIdList.count() > 0) {
 					    activate = true;
-                    }
-                    updateNeeded = true;
-                }
+	                }
+				}
+				else {
+	                // Also update the indicator status if it is already shown
+    	            if (mailboxInfo->mActive) {
+						activate = true;
+            	        updateNeeded = true;
+					}
+				}
 				updateSendIndicator();
             }
             break;
@@ -910,16 +994,20 @@
 bool NmMailAgent::playAlertTone()
 {
     NM_FUNCTION;
-	bool played = false;
+	bool played(false);
 
     if (mAlertToneAllowed) {
-        //mSystemTone->playTone(XQSystemToneService::EmailAlertTone);
-        
+        // Play tone only if system tone service is available and
+        // phone is not in silence mode.
+        if (mSystemTone && !mSilenceMode) {
+            mSystemTone->playTone(XQSystemToneService::EmailAlertTone);
+        }
+
         // Execute the vibra effect.
         if (mVibra) {
             TRAP_IGNORE(mVibra->StartVibraL(NmAgentDefaultVibraDuration));
         }
-        
+
         // play alert only once per minute
         mAlertToneAllowed = false;
         QTimer::singleShot(NmAgentAlertToneTimer, this, SLOT(enableAlertTone()));
@@ -944,6 +1032,8 @@
 */
 void NmMailAgent::updateSendIndicator()
 {
+    NM_FUNCTION;
+
     // Get number of mails in outboxes
     int outboxMails = 0;
     foreach (NmMailboxInfo *mailboxInfo, mMailboxes) {
@@ -970,36 +1060,41 @@
 */
 void NmMailAgent::storeMailboxActive(const NmId &mailboxId, bool active)
 {
-    XQCentralRepositorySettingsKey key(NmRepositoryId, mailboxId.id());
-    XQSettingsManager mgr;
-    XQCentralRepositoryUtils utils(mgr);
-    
-    if (active) {
-        // when mailbox is active, key can be deleted
-        utils.deleteKey(key);
-    }
-    else {
-        utils.createKey(key,(int)active);
+    NM_FUNCTION;
+
+    if (mSettingManager) {
+        XQCentralRepositorySettingsKey key(NmRepositoryId, mailboxId.id());
+        XQCentralRepositoryUtils utils(*mSettingManager);
+
+        if (active) {
+            // when mailbox is active, key can be deleted
+            utils.deleteKey(key);
+        }
+        else {
+            utils.createKey(key,(int)active);
+        }
     }
 }
 
 /*!
-    Get the mailbox activity state. 
+    Get the mailbox activity state.
     \param mailboxId id of the mailbox
     \return true if the mailbox is active or no information was stored earlier
 */
 bool NmMailAgent::isMailboxActive(const NmId &mailboxId)
 {
-    XQCentralRepositorySettingsKey key(NmRepositoryId, mailboxId.id());
-    XQSettingsManager mgr;
-    QVariant value = mgr.readItemValue(key,XQSettingsManager::TypeInt);
-    if (!value.isValid()) {
-        // no valid value found, key missing?
-        NM_COMMENT("NmMailAgent::isMailboxActive - value not valid");
-        return true;
+    NM_FUNCTION;
+
+    bool mailboxActive(true);
+    if (mSettingManager) {
+        XQCentralRepositorySettingsKey key(NmRepositoryId, mailboxId.id());
+        QVariant value = mSettingManager->readItemValue(key, XQSettingsManager::TypeInt);
+        if (value.isValid()) {
+            NM_COMMENT(QString("NmMailAgent::isMailboxActive - value=%1").arg(value.toInt()));
+            mailboxActive = value.toInt();
+        }
     }
-    NM_COMMENT(QString("NmMailAgent::isMailboxActive - value=%1").arg(value.toInt()));
-    return value.toInt();
+    return mailboxActive;
 }
 
 /*!
@@ -1008,9 +1103,10 @@
 */
 void NmMailAgent::deleteStoredMailboxActivity(const NmId &mailboxId)
 {
+    NM_FUNCTION;
+
     // deactivation delete the key too
     storeMailboxActive(mailboxId,false);
 }
 
 // End of file
-
--- a/emailservices/nmclientapi/bwins/nmailclientapiu.def	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/bwins/nmailclientapiu.def	Tue Jul 06 14:04:34 2010 +0300
@@ -187,4 +187,59 @@
 	?setParentFolderId@NmApiFolder@EmailClientApi@@QAEX_K@Z @ 186 NONAME ; void EmailClientApi::NmApiFolder::setParentFolderId(unsigned long long)
 	?start@NmApiFolderListing@EmailClientApi@@UAE_NXZ @ 187 NONAME ; bool EmailClientApi::NmApiFolderListing::start(void)
 	?cancel@NmApiFolderListing@EmailClientApi@@UAEXXZ @ 188 NONAME ; void EmailClientApi::NmApiFolderListing::cancel(void)
+	?metaObject@NmApiMessageManager@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 189 NONAME ; struct QMetaObject const * EmailClientApi::NmApiMessageManager::metaObject(void) const
+	?tr@NmApiMessageManager@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 190 NONAME ; class QString EmailClientApi::NmApiMessageManager::tr(char const *, char const *, int)
+	?createReplyMessage@NmApiMessageManager@EmailClientApi@@QAE_NPBVQVariant@@_N@Z @ 191 NONAME ; bool EmailClientApi::NmApiMessageManager::createReplyMessage(class QVariant const *, bool)
+	?saveMessage@NmApiMessageManager@EmailClientApi@@QAE_NABUNmApiMessage@@@Z @ 192 NONAME ; bool EmailClientApi::NmApiMessageManager::saveMessage(struct NmApiMessage const &)
+	?messagesCopied@NmApiMessageManager@EmailClientApi@@IAEXH@Z @ 193 NONAME ; void EmailClientApi::NmApiMessageManager::messagesCopied(int)
+	??_ENmApiMessageManager@EmailClientApi@@UAE@I@Z @ 194 NONAME ; EmailClientApi::NmApiMessageManager::~NmApiMessageManager(unsigned int)
+	?tr@NmApiMailboxSettings@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 195 NONAME ; class QString EmailClientApi::NmApiMailboxSettings::tr(char const *, char const *, int)
+	?loadSettings@NmApiMailboxSettings@EmailClientApi@@QAE_N_KAAVNmApiMailboxSettingsData@2@@Z @ 196 NONAME ; bool EmailClientApi::NmApiMailboxSettings::loadSettings(unsigned long long, class EmailClientApi::NmApiMailboxSettingsData &)
+	?removeAttachment@NmApiMessageManager@EmailClientApi@@QAE_NAAVNmApiEmailMessage@@_K@Z @ 197 NONAME ; bool EmailClientApi::NmApiMessageManager::removeAttachment(class NmApiEmailMessage &, unsigned long long)
+	?copyMessages@NmApiMessageManager@EmailClientApi@@QAE_NV?$QList@_K@@_K1@Z @ 198 NONAME ; bool EmailClientApi::NmApiMessageManager::copyMessages(class QList<unsigned long long>, unsigned long long, unsigned long long)
+	??1NmApiMessageManager@EmailClientApi@@UAE@XZ @ 199 NONAME ; EmailClientApi::NmApiMessageManager::~NmApiMessageManager(void)
+	?tr@NmApiMessageManager@EmailClientApi@@SA?AVQString@@PBD0@Z @ 200 NONAME ; class QString EmailClientApi::NmApiMessageManager::tr(char const *, char const *)
+	?listSettings@NmApiMailboxSettingsData@EmailClientApi@@QBE?AV?$QList@H@@XZ @ 201 NONAME ; class QList<int> EmailClientApi::NmApiMailboxSettingsData::listSettings(void) const
+	?trUtf8@NmApiMessageManager@EmailClientApi@@SA?AVQString@@PBD0@Z @ 202 NONAME ; class QString EmailClientApi::NmApiMessageManager::trUtf8(char const *, char const *)
+	?mailboxDeleted@NmApiMailboxSettings@EmailClientApi@@IAEXH@Z @ 203 NONAME ; void EmailClientApi::NmApiMailboxSettings::mailboxDeleted(int)
+	?staticMetaObject@NmApiMailboxSettings@EmailClientApi@@2UQMetaObject@@B @ 204 NONAME ; struct QMetaObject const EmailClientApi::NmApiMailboxSettings::staticMetaObject
+	?messagesDeleted@NmApiMessageManager@EmailClientApi@@IAEXH@Z @ 205 NONAME ; void EmailClientApi::NmApiMessageManager::messagesDeleted(int)
+	??0NmApiMailboxSettingsData@EmailClientApi@@QAE@XZ @ 206 NONAME ; EmailClientApi::NmApiMailboxSettingsData::NmApiMailboxSettingsData(void)
+	?trUtf8@NmApiMessageManager@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 207 NONAME ; class QString EmailClientApi::NmApiMessageManager::trUtf8(char const *, char const *, int)
+	?metaObject@NmApiMailboxSettings@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 208 NONAME ; struct QMetaObject const * EmailClientApi::NmApiMailboxSettings::metaObject(void) const
+	?messagesMoved@NmApiMessageManager@EmailClientApi@@IAEXH@Z @ 209 NONAME ; void EmailClientApi::NmApiMessageManager::messagesMoved(int)
+	?saveSettings@NmApiMailboxSettings@EmailClientApi@@QAE_NABVNmApiMailboxSettingsData@2@@Z @ 210 NONAME ; bool EmailClientApi::NmApiMailboxSettings::saveSettings(class EmailClientApi::NmApiMailboxSettingsData const &)
+	?fetch@NmApiMessageManager@EmailClientApi@@QAE_NABUNmApiMessage@@@Z @ 211 NONAME ; bool EmailClientApi::NmApiMessageManager::fetch(struct NmApiMessage const &)
+	?createMailbox@NmApiMailboxSettings@EmailClientApi@@QAE_NABVQString@@AAVNmApiMailboxSettingsData@2@@Z @ 212 NONAME ; bool EmailClientApi::NmApiMailboxSettings::createMailbox(class QString const &, class EmailClientApi::NmApiMailboxSettingsData &)
+	?qt_metacast@NmApiMessageManager@EmailClientApi@@UAEPAXPBD@Z @ 213 NONAME ; void * EmailClientApi::NmApiMessageManager::qt_metacast(char const *)
+	??0NmApiMessageManager@EmailClientApi@@QAE@_KPAVQObject@@@Z @ 214 NONAME ; EmailClientApi::NmApiMessageManager::NmApiMessageManager(unsigned long long, class QObject *)
+	?getValue@NmApiMailboxSettingsData@EmailClientApi@@QBE_NHAAVQVariant@@@Z @ 215 NONAME ; bool EmailClientApi::NmApiMailboxSettingsData::getValue(int, class QVariant &) const
+	?tr@NmApiMailboxSettings@EmailClientApi@@SA?AVQString@@PBD0@Z @ 216 NONAME ; class QString EmailClientApi::NmApiMailboxSettings::tr(char const *, char const *)
+	?moveMessages@NmApiMessageManager@EmailClientApi@@QAE_NV?$QList@_K@@_K1@Z @ 217 NONAME ; bool EmailClientApi::NmApiMessageManager::moveMessages(class QList<unsigned long long>, unsigned long long, unsigned long long)
+	??1NmApiMailboxSettingsData@EmailClientApi@@QAE@XZ @ 218 NONAME ; EmailClientApi::NmApiMailboxSettingsData::~NmApiMailboxSettingsData(void)
+	?validateData@NmApiMailboxSettingsData@EmailClientApi@@QBE_NXZ @ 219 NONAME ; bool EmailClientApi::NmApiMailboxSettingsData::validateData(void) const
+	?trUtf8@NmApiMailboxSettings@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 220 NONAME ; class QString EmailClientApi::NmApiMailboxSettings::trUtf8(char const *, char const *, int)
+	?createForwardMessage@NmApiMessageManager@EmailClientApi@@QAE_NPBVQVariant@@@Z @ 221 NONAME ; bool EmailClientApi::NmApiMessageManager::createForwardMessage(class QVariant const *)
+	?listMailboxIds@NmApiMailboxSettings@EmailClientApi@@QAE_NAAV?$QList@_K@@@Z @ 222 NONAME ; bool EmailClientApi::NmApiMailboxSettings::listMailboxIds(class QList<unsigned long long> &)
+	??_ENmApiMailboxSettings@EmailClientApi@@UAE@I@Z @ 223 NONAME ; EmailClientApi::NmApiMailboxSettings::~NmApiMailboxSettings(unsigned int)
+	?getStaticMetaObject@NmApiMailboxSettings@EmailClientApi@@SAABUQMetaObject@@XZ @ 224 NONAME ; struct QMetaObject const & EmailClientApi::NmApiMailboxSettings::getStaticMetaObject(void)
+	?deleteMessages@NmApiMessageManager@EmailClientApi@@QAE_NV?$QList@_K@@@Z @ 225 NONAME ; bool EmailClientApi::NmApiMessageManager::deleteMessages(class QList<unsigned long long>)
+	?createDraftMessage@NmApiMessageManager@EmailClientApi@@QAE_NPBVQVariant@@@Z @ 226 NONAME ; bool EmailClientApi::NmApiMessageManager::createDraftMessage(class QVariant const *)
+	??0NmApiMailboxSettings@EmailClientApi@@QAE@PAVQObject@@@Z @ 227 NONAME ; EmailClientApi::NmApiMailboxSettings::NmApiMailboxSettings(class QObject *)
+	?qt_metacast@NmApiMailboxSettings@EmailClientApi@@UAEPAXPBD@Z @ 228 NONAME ; void * EmailClientApi::NmApiMailboxSettings::qt_metacast(char const *)
+	?qt_metacall@NmApiMessageManager@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 229 NONAME ; int EmailClientApi::NmApiMessageManager::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??1NmApiMailboxSettings@EmailClientApi@@UAE@XZ @ 230 NONAME ; EmailClientApi::NmApiMailboxSettings::~NmApiMailboxSettings(void)
+	?deleteMailbox@NmApiMailboxSettings@EmailClientApi@@QAE_N_K@Z @ 231 NONAME ; bool EmailClientApi::NmApiMailboxSettings::deleteMailbox(unsigned long long)
+	?send@NmApiMessageManager@EmailClientApi@@QAE_NABUNmApiMessage@@@Z @ 232 NONAME ; bool EmailClientApi::NmApiMessageManager::send(struct NmApiMessage const &)
+	?trUtf8@NmApiMailboxSettings@EmailClientApi@@SA?AVQString@@PBD0@Z @ 233 NONAME ; class QString EmailClientApi::NmApiMailboxSettings::trUtf8(char const *, char const *)
+	?createAttachment@NmApiMessageManager@EmailClientApi@@QAE_NAAVNmApiEmailMessage@@ABVQVariant@@@Z @ 234 NONAME ; bool EmailClientApi::NmApiMessageManager::createAttachment(class NmApiEmailMessage &, class QVariant const &)
+	?messagesCreated@NmApiMessageManager@EmailClientApi@@IAEXH@Z @ 235 NONAME ; void EmailClientApi::NmApiMessageManager::messagesCreated(int)
+	?setMailboxId@NmApiMailboxSettingsData@EmailClientApi@@QAEX_K@Z @ 236 NONAME ; void EmailClientApi::NmApiMailboxSettingsData::setMailboxId(unsigned long long)
+	?populateDefaultSettings@NmApiMailboxSettings@EmailClientApi@@QAE_NABVQString@@AAVNmApiMailboxSettingsData@2@@Z @ 237 NONAME ; bool EmailClientApi::NmApiMailboxSettings::populateDefaultSettings(class QString const &, class EmailClientApi::NmApiMailboxSettingsData &)
+	?clearSettings@NmApiMailboxSettingsData@EmailClientApi@@QAEXXZ @ 238 NONAME ; void EmailClientApi::NmApiMailboxSettingsData::clearSettings(void)
+	?setValue@NmApiMailboxSettingsData@EmailClientApi@@QAEXHABVQVariant@@@Z @ 239 NONAME ; void EmailClientApi::NmApiMailboxSettingsData::setValue(int, class QVariant const &)
+	?mailboxId@NmApiMailboxSettingsData@EmailClientApi@@QBE_KXZ @ 240 NONAME ; unsigned long long EmailClientApi::NmApiMailboxSettingsData::mailboxId(void) const
+	?getStaticMetaObject@NmApiMessageManager@EmailClientApi@@SAABUQMetaObject@@XZ @ 241 NONAME ; struct QMetaObject const & EmailClientApi::NmApiMessageManager::getStaticMetaObject(void)
+	?staticMetaObject@NmApiMessageManager@EmailClientApi@@2UQMetaObject@@B @ 242 NONAME ; struct QMetaObject const EmailClientApi::NmApiMessageManager::staticMetaObject
+	?qt_metacall@NmApiMailboxSettings@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 243 NONAME ; int EmailClientApi::NmApiMailboxSettings::qt_metacall(enum QMetaObject::Call, int, void * *)
 
--- a/emailservices/nmclientapi/eabi/nmailclientapiu.def	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/eabi/nmailclientapiu.def	Tue Jul 06 14:04:34 2010 +0300
@@ -211,4 +211,61 @@
 	_ZTVN14EmailClientApi19NmApiMailboxListingE @ 210 NONAME
 	_ZTVN14EmailClientApi20NmApiEnvelopeListingE @ 211 NONAME
 	_ZTVN14EmailClientApi20NmApiMessageEnvelopeE @ 212 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager11qt_metacallEN11QMetaObject4CallEiPPv @ 213 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager11qt_metacastEPKc @ 214 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager11saveMessageERK12NmApiMessage @ 215 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager12copyMessagesE5QListIyEyy @ 216 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager12moveMessagesE5QListIyEyy @ 217 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager13messagesMovedEi @ 218 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager14deleteMessagesE5QListIyE @ 219 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager14messagesCopiedEi @ 220 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager15messagesCreatedEi @ 221 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager15messagesDeletedEi @ 222 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager16createAttachmentER17NmApiEmailMessageRK8QVariant @ 223 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager16removeAttachmentER17NmApiEmailMessagey @ 224 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager16staticMetaObjectE @ 225 NONAME DATA 16
+	_ZN14EmailClientApi19NmApiMessageManager18createDraftMessageEPK8QVariant @ 226 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager18createReplyMessageEPK8QVariantb @ 227 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager19getStaticMetaObjectEv @ 228 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager20createForwardMessageEPK8QVariant @ 229 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager4sendERK12NmApiMessage @ 230 NONAME
+	_ZN14EmailClientApi19NmApiMessageManager5fetchERK12NmApiMessage @ 231 NONAME
+	_ZN14EmailClientApi19NmApiMessageManagerC1EyP7QObject @ 232 NONAME
+	_ZN14EmailClientApi19NmApiMessageManagerC2EyP7QObject @ 233 NONAME
+	_ZN14EmailClientApi19NmApiMessageManagerD0Ev @ 234 NONAME
+	_ZN14EmailClientApi19NmApiMessageManagerD1Ev @ 235 NONAME
+	_ZN14EmailClientApi19NmApiMessageManagerD2Ev @ 236 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings11qt_metacallEN11QMetaObject4CallEiPPv @ 237 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings11qt_metacastEPKc @ 238 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings12loadSettingsEyRNS_24NmApiMailboxSettingsDataE @ 239 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings12saveSettingsERKNS_24NmApiMailboxSettingsDataE @ 240 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings13createMailboxERK7QStringRNS_24NmApiMailboxSettingsDataE @ 241 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings13deleteMailboxEy @ 242 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings14listMailboxIdsER5QListIyE @ 243 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings14mailboxDeletedEi @ 244 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings16staticMetaObjectE @ 245 NONAME DATA 16
+	_ZN14EmailClientApi20NmApiMailboxSettings19getStaticMetaObjectEv @ 246 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings23populateDefaultSettingsERK7QStringRNS_24NmApiMailboxSettingsDataE @ 247 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettingsC1EP7QObject @ 248 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettingsC2EP7QObject @ 249 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettingsD0Ev @ 250 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettingsD1Ev @ 251 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettingsD2Ev @ 252 NONAME
+	_ZN14EmailClientApi24NmApiMailboxSettingsData12setMailboxIdEy @ 253 NONAME
+	_ZN14EmailClientApi24NmApiMailboxSettingsData13clearSettingsEv @ 254 NONAME
+	_ZN14EmailClientApi24NmApiMailboxSettingsData8setValueEiRK8QVariant @ 255 NONAME
+	_ZN14EmailClientApi24NmApiMailboxSettingsDataC1Ev @ 256 NONAME
+	_ZN14EmailClientApi24NmApiMailboxSettingsDataC2Ev @ 257 NONAME
+	_ZN14EmailClientApi24NmApiMailboxSettingsDataD1Ev @ 258 NONAME
+	_ZN14EmailClientApi24NmApiMailboxSettingsDataD2Ev @ 259 NONAME
+	_ZNK14EmailClientApi19NmApiMessageManager10metaObjectEv @ 260 NONAME
+	_ZNK14EmailClientApi20NmApiMailboxSettings10metaObjectEv @ 261 NONAME
+	_ZNK14EmailClientApi24NmApiMailboxSettingsData12listSettingsEv @ 262 NONAME
+	_ZNK14EmailClientApi24NmApiMailboxSettingsData12validateDataEv @ 263 NONAME
+	_ZNK14EmailClientApi24NmApiMailboxSettingsData8getValueEiR8QVariant @ 264 NONAME
+	_ZNK14EmailClientApi24NmApiMailboxSettingsData9mailboxIdEv @ 265 NONAME
+	_ZTIN14EmailClientApi19NmApiMessageManagerE @ 266 NONAME
+	_ZTIN14EmailClientApi20NmApiMailboxSettingsE @ 267 NONAME
+	_ZTVN14EmailClientApi19NmApiMessageManagerE @ 268 NONAME
+	_ZTVN14EmailClientApi20NmApiMailboxSettingsE @ 269 NONAME
 
--- a/emailservices/nmclientapi/inc/nmapicommonheader.h	Wed Jun 23 18:00:21 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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 NMAPICOMMONHEADER_H
-#define NMAPICOMMONHEADER_H
-
-#include <nmapiemailaddress.h>
-#include <nmapimessagebody.h>
-#include <nmapidef.h>
-#include <nmapimailbox.h>
-#include <nmapifolder.h>
-#include <nmapimessageenvelope.h>
-
-#endif /* NMAPICOMMONHEADER_H */
--- a/emailservices/nmclientapi/inc/nmapienvelopelisting_p.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapienvelopelisting_p.h	Tue Jul 06 14:04:34 2010 +0300
@@ -29,20 +29,21 @@
 
 class NmApiEnvelopeListingPrivate : public QObject
 {
+    Q_OBJECT
+    
 public:
-
-    NmApiEnvelopeListingPrivate(QObject *parent = 0);
+    NmApiEnvelopeListingPrivate(const quint64 folderId, const quint64 mailboxId, QObject *parent = 0);
     virtual ~NmApiEnvelopeListingPrivate();
+    bool envelopes(QList<EmailClientApi::NmApiMessageEnvelope> &envelopes);
+    qint32 listEnvelopes();
+    bool isRunning() const;
+    void cancel();
 
-    bool initializeEngine();
-    void releaseEngine();
-    qint32 grabEnvelopes();
-
+private:
+    quint64 mFolderId;
+    quint64 mMailboxId;
     bool mIsRunning;
-    quint64 folderId;
-    quint64 mailboxId;
     NmApiEngine *mEngine;
-
     QList<EmailClientApi::NmApiMessageEnvelope> mEnvelopes;
 };
 }
--- a/emailservices/nmclientapi/inc/nmapieventnotifier_p.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapieventnotifier_p.h	Tue Jul 06 14:04:34 2010 +0300
@@ -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"
@@ -18,6 +18,7 @@
 #ifndef NMAPIEVENTNOTIFIERPRIVATE_H
 #define NMAPIEVENTNOTIFIERPRIVATE_H
 
+#include <QObject>
 #include "nmapiprivateclasses.h"
 #include <nmapicommon.h>
 
@@ -34,18 +35,22 @@
     NmApiEventNotifierPrivate(QObject *parent = 0);
     virtual ~NmApiEventNotifierPrivate();
 
-    bool initializeEngine();
-    void releaseEngine();
     void cancel();
-
+    bool isRunning() const;
+    bool start();
+    void stop();
+    void events(QList<NmApiMessage> &events);
 public slots:
     void emailStoreEvent(const NmApiMessage &events);
 
-public:
+signals:
+    void timedOut();
+
+private:
     QTimer *mEmitSignals;
     NmApiEngine *mEngine;
+    bool mIsRunning;
     QList<NmApiMessage> mBufferOfEvents;
-    bool mIsRunning;
 };
 
 }
--- a/emailservices/nmclientapi/inc/nmapifolder_p.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapifolder_p.h	Tue Jul 06 14:04:34 2010 +0300
@@ -15,8 +15,8 @@
  *
  */
 
-#ifndef NMAPIMAILBOX_P_H
-#define NMAPIMAILBOX_P_H
+#ifndef NMAPIFOLDER_P_H
+#define NMAPIFOLDER_P_H
 
 #include <nmapicommon.h>
 
@@ -45,4 +45,4 @@
 
 }
 
-#endif /* NMAPIMAILBOX_P_H_ */
+#endif /* NMAPIFOLDER_P_H */
--- a/emailservices/nmclientapi/inc/nmapifolderlisting_p.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapifolderlisting_p.h	Tue Jul 06 14:04:34 2010 +0300
@@ -17,6 +17,8 @@
 #ifndef NMAPIFOLDERLISTINGPRIVATE_H
 #define NMAPIFOLDERLISTINGPRIVATE_H
 
+#include <QObject>
+
 class NmApiEngine;
 
 namespace EmailClientApi
@@ -26,19 +28,21 @@
 
 class NmApiFolderListingPrivate : public QObject
 {
+    Q_OBJECT
+    
 public:
 
-    NmApiFolderListingPrivate(QObject *parent = 0);
+    NmApiFolderListingPrivate(quint64 mailboxId, QObject *parent = 0);
     virtual ~NmApiFolderListingPrivate();
-
-    bool initializeEngine();
-    void releaseEngine();
-    qint32 grabFolders();
-
-    QList<EmailClientApi::NmApiFolder> mFolders;//!<List of folders \sa getFolder \sa QSharedData \sa EmailClientApi::NmApiFolder
-    NmApiEngine *mEngine;//!<Pointer to engine instance \sa NmUiEngine
-    bool mIsRunning;//!<Keep info if folder listing is running \sa isRunning
-    quint64 mMailboxId;//!<Keep info about mailbox id for foler
+    qint32 listFolders();
+    bool folders(QList<EmailClientApi::NmApiFolder> &folders);
+    void cancel();
+    bool isRunning() const;
+private:
+	  quint64 mMailboxId;
+    NmApiEngine *mEngine;
+    bool mIsRunning;
+    QList<EmailClientApi::NmApiFolder> mFolders;
 };
 }
 #endif /* NMAPIFOLDERLISTINGPRIVATE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapiheaders.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,102 @@
+/*
+* 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 NMAPIHEADERS_H
+#define NMAPIHEADERS_H
+
+// Qt
+#include <QObject>
+#include <QVariant>
+#include <QString>
+#include <QHash>
+#include <QList>
+#include <QPluginLoader>
+#include <QDir>
+#include <QApplication>
+#include <QLocale>
+#include <QList>
+#include <QTimer>
+#include <QDateTime>
+#include <QExplicitlySharedDataPointer>
+#include <QSharedData>
+
+#include <imapset.h>
+#include <pop3set.h>
+#include <iapprefs.h>
+#include <cemailaccounts.h>
+
+
+#include <SMTPSET.H>
+
+#include <xqconversions.h>
+
+#include <nmdataplugininterface.h>
+
+#include <nmmailbox.h>
+#include <nmmessage.h>
+#include <nmfolder.h>
+#include <nmmessagepart.h>
+#include <nmcommon.h>
+
+#include <nmoperation.h>
+
+#include <emailtrace.h>
+
+
+
+// nmail_settings_api
+#include <nmapimailboxsettings.h>
+#include <nmapimailboxsettingsdata.h>
+
+// nmail_client_api
+#include <nmapicommon.h>
+#include <nmapidef.h>
+#include <nmapiemailaddress.h>
+#include <nmapiemailservice.h>
+#include <nmapienvelopelisting.h>
+#include <nmapieventnotifier.h>
+#include <nmapifolder.h>
+#include <nmapifolderlisting.h>
+#include <nmapimailbox.h>
+#include <nmapimailboxlisting.h>
+#include <nmapimessagebody.h>
+#include <nmapimessageenvelope.h>
+#include <nmapimessagetask.h>
+#include <nmapimessagemanager.h>
+
+
+// own headers
+#include "nmapidatapluginfactory.h"
+#include "nmapiemailaddress_p.h"
+#include "nmapiengine.h"
+#include "nmapienvelopelisting_p.h"
+#include "nmapieventnotifier_p.h"
+#include "nmapifolder_p.h"
+#include "nmapifolderlisting_p.h"
+#include "nmapimailbox_p.h"
+#include "nmapimailboxlisting_p.h"
+#include "nmapimailboxsettings_p.h"
+#include "nmapimailboxsettingsdata_p.h"
+#include "nmapimessagebody_p.h"
+#include "nmapimessageenvelope_p.h"
+#include "nmapimessagemanager_p.h"
+#include "nmapipopimapsettingsmanager.h"
+#include "nmapiprivateclasses.h"
+#include "nmapitypesconverter.h"
+
+
+#endif // NMAPIHEADERS_H
--- a/emailservices/nmclientapi/inc/nmapimailbox_p.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapimailbox_p.h	Tue Jul 06 14:04:34 2010 +0300
@@ -18,8 +18,7 @@
 #ifndef NMAPIMAILBOX_P_H
 #define NMAPIMAILBOX_P_H
 
-#include <nmapicommon.h>
-
+#include <QSharedData>
 
 namespace EmailClientApi
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapimailboxsettings_p.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,61 @@
+/*
+ * 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 NMAPIMAILBOXSETTINGS_P_H_
+#define NMAPIMAILBOXSETTINGS_P_H_
+
+#include <QObject>
+#include <qpointer.h>
+#include <nmapimailboxsettings.h>
+#include <nmoperation.h>
+
+class NmApiDataPluginFactory;
+class NmOperation;
+
+namespace EmailClientApi
+{
+class NmApiMailboxSettingsData;
+
+class NmApiMailboxSettingsPrivate : public QObject
+{
+    Q_OBJECT
+public:
+    NmApiMailboxSettingsPrivate(QObject *parent = 0);
+    ~NmApiMailboxSettingsPrivate();
+
+    bool listMailboxIds(QList<quint64> &idList);
+    bool loadSettings(quint64 mailboxId, NmApiMailboxSettingsData &data);
+    bool saveSettings(const NmApiMailboxSettingsData &data);
+    bool createMailbox(const QString &mailboxType, NmApiMailboxSettingsData &data);
+    bool deleteMailbox(quint64 mailboxId);
+    bool populateDefaultSettings(const QString &mailboxType, NmApiMailboxSettingsData &data);
+
+signals:
+    void mailboxDeleted(int result = 0);
+    
+private:
+    void createPopImapMailbox(const QString &type, NmApiMailboxSettingsData &data);
+
+    
+private:
+    NmApiDataPluginFactory *mFactory;
+    QPointer<NmOperation> mDeleteMailboxOperation; // not owned
+};
+
+}
+
+#endif /* NMAPIMAILBOXSETTINGS_P_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapimailboxsettingsdata_p.h	Tue Jul 06 14:04:34 2010 +0300
@@ -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 _NMAPI_MAILBOX_SETTINGS_DATA_PRIVATE_
+#define _NMAPI_MAILBOX_SETTINGS_DATA_PRIVATE_
+
+#include <QObject>
+#include <QScopedPointer>
+#include <QHash>
+
+namespace EmailClientApi
+{
+class NmApiMailboxSettingsDataPrivate
+{
+public:
+    NmApiMailboxSettingsDataPrivate();
+    virtual ~NmApiMailboxSettingsDataPrivate();
+    void setMailboxId(quint64 mailboxId);
+    quint64 mailboxId() const;
+    void setValue(int key, const QVariant &settingValue);
+    bool getValue(int key, QVariant &settingValue) const;
+    bool validateData() const;
+    QList<int> listSettings() const;
+	void clearSettings();
+    
+private:
+    bool validateString(int key, QVariant& val, bool& validated) const;
+    bool validateStringValue(int key, QString& val) const;
+    bool validateStringGeneral(int key, QString& val, bool& handled) const;
+    bool validateEmailAddress(int key, QString& val, bool& handled) const;
+    bool validateUsesAuthentication(int key, QString& val, bool& handled) const;
+    bool validateSecurityType(int key, QString& val, bool& handled) const;
+    bool validateAOLState(int key, QString& val, bool& handled) const;
+    bool validateInteger(int key, QVariant& val, bool& validated) const;
+    bool validateIntVal(int key, int val) const;
+    bool validateIntGeneral(int key, int val, bool& handled) const;
+    bool validateOnOffValue(int key, int val, bool& handled) const;
+    bool validateWeekdayMask(int key, int val, bool& handled) const;
+    bool validateHoursInDay(int key, int val, bool& handled) const;
+    bool validateBool(int key, QVariant& val, bool& validated) const;
+    bool validateDateTime(int key, QVariant& val, bool& validated) const;
+
+private:
+    quint64 mId;
+    QScopedPointer<QHash<int, QVariant> > mSettings;
+
+};
+}//end namespace
+
+#endif //_NMAPI_MAILBOX_SETTINGS_DATA_PRIVATE_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapimessagemanager_p.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,82 @@
+/*
+ * 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:
+ *     Email message related operations
+ */
+
+#ifndef NMAPIMESSAGEMANAGER_P_H_
+#define NMAPIMESSAGEMANAGER_P_H_
+
+#include <QObject>
+#include <nmapimessagemanager.h>
+#include <nmapifolder.h>
+#include <NmApiDataPluginFactory.h>
+#include <nmcommon.h>
+#include <nmapifolder.h>
+#include <nmapiprivateclasses.h>
+
+
+class NmApiEmailMessage;
+
+namespace EmailClientApi
+{
+
+class NmApiMessageManagerPrivate : public QObject
+{
+ Q_OBJECT  
+public:
+    NmApiMessageManagerPrivate(quint64 mailboxId,QObject *parent = 0);
+    virtual ~NmApiMessageManagerPrivate();
+    
+private:
+    enum EState {
+        EIdle = 0,
+        ECopyPending,
+        EMovePending,
+        EDeletePending        
+    };
+    
+public slots: 
+    bool moveMessages(const QList<quint64> messageIds,
+                    quint64 sourceFolderId,
+                    quint64 targetFolderId);
+
+    bool copyMessages(const QList<quint64> messageIds, 
+                   quint64 sourceFolder,
+                   quint64 targetFolder);
+    
+	void messageEventHandler(NmMessageEvent event,
+								const NmId &folder,
+								const QList<NmId> &messages,
+								const NmId &mailBox);
+								
+signals:
+	void messagesCopied(int result);
+	void messagesCreated(int result);
+	void messagesMoved(int result);
+	void messagesDeleted(int result);
+
+
+private:    
+    NmApiMessageManagerPrivate::EState mState;
+    QList<quint64> mMessages;
+    NmId mTarget;
+    NmId mMailboxId; 
+    NmApiDataPluginFactory *mFactory;
+    QObject *mPlugin;
+};
+
+}
+
+#endif /*NMAPIMESSAGEMANAGER_P_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapipopimapsettingsmanager.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,39 @@
+/*
+* 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 NMAPIPOPIMAPSETTINGSMANAGER_H
+#define NMAPIPOPIMAPSETTINGSMANAGER_H
+
+#include <nmapimailboxsettingsdata.h>
+
+namespace EmailClientApi {
+
+class NmApiPopImapSettingsManager 
+{
+public:       
+    NmApiPopImapSettingsManager();
+    virtual ~NmApiPopImapSettingsManager();
+    bool populateDefaults(const QString &mailboxType, NmApiMailboxSettingsData &data);
+
+private:
+    void populateImapDefs(NmApiMailboxSettingsData &data);
+    void populatePopDefs(NmApiMailboxSettingsData &data);
+    
+};
+}//namespace
+
+#endif // NMAPIPOPIMAPSETTINGSMANAGER_H
--- a/emailservices/nmclientapi/inc/nmapiprivateheaders.h	Wed Jun 23 18:00:21 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +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 NMAPIPRIVATEHEADERS_H
-#define NMAPIPRIVATEHEADERS_H
-
-#include "nmmailbox.h"
-#include "nmmessage.h"
-#include "nmfolder.h"
-#include "nmmessagepart.h"
-
-#endif // NMAPIPRIVATEHEADERS_H
--- a/emailservices/nmclientapi/nmclientapi.pro	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/nmclientapi.pro	Tue Jul 06 14:04:34 2010 +0300
@@ -26,78 +26,80 @@
 
 INCLUDEPATH +=  inc \
                 ../../email_plat/nmail_client_api \
-                ../../inc 
+                ../../email_plat/nmail_settings_api \
+                ../../inc
                 
-DEPENDPATH += src \
-              inc \
-              ../../email_plat/nmail_client_api \
-              ../../inc 
+DEPENDPATH +=  ../../email_plat/nmail_client_api \
+                ../../email_plat/nmail_settings_api \
+
 
 MOC_DIR = tmp
 
+# public headers 
+HEADERS += nmapicommon.h \
+           nmapidef.h \
+           nmapiemailaddress.h \
+           nmapiemailservice.h \
+           nmapienvelopelisting.h \
+           nmapieventnotifier.h \
+           nmapifolder.h \
+           nmapifolderlisting.h \
+           nmapimailbox.h \
+           nmapimailboxlisting.h \
+           nmapimessagebody.h \
+           nmapimessageenvelope.h \
+           nmapimessagetask.h \
+           nmapimessagemanager.h \
+           nmapimailboxsettings.h
 
-#headers  and sources outside api
-HEADERS   += nmapiprivateheaders.h \
-             nmapitypesconverter.h \ 
-             nmapiprivateclasses.h \
-             nmdataplugininterface.h \
-             nmapidatapluginfactory.h \
-             nmapiengine.h \
-             nmmessagepart.h  \
-             nmapicommon.h
-             
-#headers  and sources from api             
-SOURCES   += nmapitypesconverter.cpp \
-             nmapidatapluginfactory.cpp \
-             nmapiemailservice.cpp \
-             nmapiengine.cpp 
+# private headers 
+HEADERS += inc/nmapidatapluginfactory.h \
+           inc/nmapiemailaddress_p.h \
+           inc/nmapiengine.h \
+           inc/nmapienvelopelisting_p.h \
+           inc/nmapieventnotifier_p.h \
+           inc/nmapifolder_p.h \
+           inc/nmapifolderlisting_p.h \
+           inc/nmapimailbox_p.h \
+           inc/nmapimailboxlisting_p.h \
+           inc/nmapimailboxsettings_p.h \
+           inc/nmapimailboxsettingsdata_p.h \
+           inc/nmapimessagebody_p.h \
+           inc/nmapimessageenvelope_p.h \
+           inc/nmapimessagemanager_p.h \
+           inc/nmapipopimapsettingsmanager.h \
+           inc/nmapiprivateclasses.h \
+           inc/nmapitypesconverter.h \
+           inc/nmapiheaders.h 
+                        
+SOURCES += src/nmapidatapluginfactory.cpp \
+           src/nmapiemailaddress.cpp \
+           src/nmapiemailservice.cpp \
+           src/nmapiengine.cpp \
+           src/nmapienvelopelisting_p.cpp \
+           src/nmapienvelopelisting.cpp \ 
+           src/nmapieventnotifier_p.cpp \
+           src/nmapieventnotifier.cpp \
+           src/nmapifolder.cpp \
+           src/nmapifolderlisting_p.cpp \
+           src/nmapifolderlisting.cpp \
+           src/nmapimailbox.cpp \
+           src/nmapimailboxlisting_p.cpp \
+           src/nmapimailboxlisting.cpp \
+           src/nmapimessagetask.cpp \
+           src/nmapimailboxsettingsdata_p.cpp \
+           src/nmapimailboxsettingsdata.cpp \
+           src/nmapimailboxsettings_p.cpp \
+           src/nmapimailboxsettings.cpp \
+           src/nmapimessagebody.cpp \
+           src/nmapimessageenvelope.cpp \
+           src/nmapipopimapsettingsmanager.cpp \
+	         src/nmapimessagemanager_p.cpp \
+			     src/nmapimessagemanager.cpp \
+           src/nmapitypesconverter.cpp 
 
 
 
-HEADERS   += nmapicommonheader.h \
-             nmapiemailservice.h \
-             nmapimessagetask.h \
-             nmapimailboxlisting_p.h \
-             nmapimailboxlisting.h \
-             nmapifolderlisting_p.h \
-             nmapifolderlisting.h \
-             nmapienvelopelisting_p.h \
-             nmapienvelopelisting.h \
-	     nmapiemailaddress_p.h \
-	     nmapiemailaddress.h \
-	     nmapieventnotifier_p.h \
-	     nmapieventnotifier.h \
-	     nmapifolder_p.h \
-	     nmapifolder.h \
-	     nmapimailbox_p.h \
-	     nmapimailbox.h \
-	     nmapimessagebody_p.h \
-	     nmapimessagebody.h \
-	     nmapimessageenvelope_p.h \
-	     nmapimessageenvelope.h
-			 
-LIBS += -leuser
-LIBS += -llibc			
-
-
-SOURCES   += nmapimessagetask.cpp \
-	     nmapimailboxlisting_p.cpp \
-             nmapimailboxlisting.cpp \
-             nmapifolderlisting_p.cpp \
-             nmapifolderlisting.cpp \
-             nmapienvelopelisting_p.cpp \
-             nmapienvelopelisting.cpp \ 
-	     nmapiemailaddress.cpp \
-	     nmapieventnotifier_p.cpp \
-	     nmapieventnotifier.cpp \
-	     nmapifolder.cpp \
-	     nmapimailbox.cpp \
-	     nmapimessagebody.cpp \
-	     nmapimessageenvelope.cpp
-
-
-             
-             
 
 symbian*: { 
     TARGET.EPOCALLOWDLLDATA = 1
@@ -107,8 +109,13 @@
     TARGET.UID3 = 0x2002C366
     
     INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
 	
-	 LIBS += -lnmailbase
+	 LIBS += -lnmailbase \
+	 -limcm \
+	 -lxqsettingsmanager \
+	 -lxqutils \
+	 -lnmailuiengine
 				   
     defBlock = \      
       "$${LITERAL_HASH}if defined(MARM)" \
@@ -125,10 +132,3 @@
 
 }
 
-win32 {
-   DESTDIR = ../../bin
-   OBJECTS_DIR = tmp 
-}
-
-
-
--- a/emailservices/nmclientapi/src/nmapidatapluginfactory.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapidatapluginfactory.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,25 +15,9 @@
  *
  */
 
-#include "emailtrace.h"
-
-#include "nmdataplugininterface.h"
-#include "nmapidatapluginfactory.h"
+#include "nmapiheaders.h"
 
-// Qt
-#include <QPluginLoader>
-#include <QDir>
-#include <QApplication>
-#include <QLocale>
-#include <QObject>
 
-// nmailbase
-#include "nmcommon.h"
-#include "nmmailbox.h"
-#include "nmmessageenvelope.h"
-#include "nmmessage.h"
-#include "nmmessagepart.h"
-#include "nmfolder.h"
 
 /*!
  \class NmApiDataPluginFactory
--- a/emailservices/nmclientapi/src/nmapiemailaddress.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapiemailaddress.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,10 +15,8 @@
  *
  */
 
-#include "emailtrace.h"
+#include "nmapiheaders.h"
 
-#include <nmapiemailaddress.h>
-#include "nmapiemailaddress_p.h"
 
 namespace EmailClientApi
 {
--- a/emailservices/nmclientapi/src/nmapiemailservice.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapiemailservice.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,13 +15,8 @@
  *
  */
 
-#include "emailtrace.h"
+#include "nmapiheaders.h"
 
-#include <nmapiemailservice.h>
-#include "nmapiengine.h"
-
-#include <nmapimailbox.h>
-#include <nmapimessageenvelope.h>
 
 namespace EmailClientApi
 {
--- a/emailservices/nmclientapi/src/nmapiengine.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapiengine.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,19 +15,8 @@
  *
  */
 
-#include "emailtrace.h"
-
-#include <nmapicommonheader.h>
+#include "nmapiheaders.h"
 
-#include "nmapitypesconverter.h"
-#include "nmdataplugininterface.h"
-#include "nmapidatapluginfactory.h"
-#include "nmapiengine.h"
-
-/*!
-    from nmailbase
-*/
-#include "nmapiprivateheaders.h"
 
 NmApiEngine *NmApiEngine::mInstance = NULL;
 quint32 NmApiEngine::mReferenceCount = 0;
--- a/emailservices/nmclientapi/src/nmapienvelopelisting.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapienvelopelisting.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -14,17 +14,8 @@
  * Description:
  *
  */
-
-#include "emailtrace.h"
-
-#include <nmapienvelopelisting.h>
-#include "nmapienvelopelisting_p.h"
-
-#include <nmapicommonheader.h>
-
-#include "nmapiengine.h"
-
-
+ 
+#include "nmapiheaders.h"
 
 namespace EmailClientApi
 {
@@ -38,30 +29,20 @@
     NmApiMessageTask(parent)
 {
     NM_FUNCTION;
-    
-    mListingPrivate = new NmApiEnvelopeListingPrivate(this);
-    mListingPrivate->mailboxId = mailboxId;
-    mListingPrivate->folderId = folderId;
-    mListingPrivate->mIsRunning = false;
+    mListingPrivate = new NmApiEnvelopeListingPrivate(folderId, mailboxId, this);
 }
 
 /*!
-   Destructor of class. It release engine to be safe if manual releasing won't work.
+   Destructor of class. 
  */
 NmApiEnvelopeListing::~NmApiEnvelopeListing()
 {
     NM_FUNCTION;
-    
-    if (mListingPrivate->mIsRunning) {
-        mListingPrivate->releaseEngine();
-    }
 }
 
 /*!
-   \brief Starts gathering envelopes list.
-   
-   In first turn it will get whole folderlist. 
-   If start works, it do nothing.
+   \brief Fetches envelope list. Emits envelopesListed signal when ready.
+   Results can be fetched with getEnvelopes.
    
    To asynchronous operation ce be used \sa QTimer::singleShot on this method.
    Example:
@@ -73,77 +54,37 @@
 bool NmApiEnvelopeListing::start()
 {
     NM_FUNCTION;
-    
-    bool result = false;
 
-    if (mListingPrivate->mIsRunning) {
-        result = true;
-    }
-    else {
-
-        bool started = mListingPrivate->initializeEngine();
-        if (!started) {
-            QMetaObject::invokeMethod(this, "envelopesListed", Qt::QueuedConnection, Q_ARG(qint32,
-                (qint32) EnvelopeListingFailed));
-            result = false;
-        }
-        else {
-            qint32 envelopesCount = mListingPrivate->grabEnvelopes();
-
-            mListingPrivate->mIsRunning = true;
-            QMetaObject::invokeMethod(this, "envelopesListed", Qt::QueuedConnection, Q_ARG(qint32,
+    qint32 envelopesCount = mListingPrivate->listEnvelopes();
+    QMetaObject::invokeMethod(this, "envelopesListed", Qt::QueuedConnection, Q_ARG(qint32,
                 envelopesCount));
-            result = true;
-        }
-    }
-    return result;
+    return true;
 }
 
 /*!
    \brief Stop gathering envelope list.
-   
-   In first it change state of listing.
-   Then it release engine.
-   On end it clears list of envelopes and emits \sa NmApiMessageTask::canceled() signal.
+
+   Clears list of envelopes and emits \sa NmApiMessageTask::canceled() signal.
  */
 void NmApiEnvelopeListing::cancel()
 {
     NM_FUNCTION;
-    
-    if (mListingPrivate->mIsRunning) {
-        mListingPrivate->mIsRunning = false;
-        mListingPrivate->releaseEngine();
-        mListingPrivate->mEnvelopes.clear();
+    mListingPrivate->cancel();
+    emit canceled();
 
-        emit canceled();
-    }
 }
 
 /*! 
    \brief Returns results after envelopesListed signal is received.
    
     Caller gets ownership of envelopes. Returns true if results were available.
-    Before calling cancel and start should be called,
-    because after second calling it return empty list.
-    It also at start clear inputlist of NmMessageEnvelope.
+    Before calling start should be called, otherwise will return empty list.
+    It also clears inputlist of NmMessageEnvelope.
  */
 bool NmApiEnvelopeListing::getEnvelopes(QList<EmailClientApi::NmApiMessageEnvelope> &envelopes)
 {
     NM_FUNCTION;
-    
-    envelopes.clear();
-
-    bool result = false;
-
-    if (!mListingPrivate->mIsRunning) {
-        result = false;
-    }
-    else {
-        envelopes = mListingPrivate->mEnvelopes;
-        mListingPrivate->mEnvelopes.clear();
-        result = true;
-    }
-    return result;
+    return mListingPrivate->envelopes(envelopes);
 }
 
 /*!
@@ -152,8 +93,7 @@
 bool NmApiEnvelopeListing::isRunning() const
 {
     NM_FUNCTION;
-    
-    return mListingPrivate->mIsRunning;
+    return mListingPrivate->isRunning();
 }
 
 }
--- a/emailservices/nmclientapi/src/nmapienvelopelisting_p.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapienvelopelisting_p.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,77 +15,76 @@
  *
  */
 
-#include "emailtrace.h"
-
-#include "nmapiengine.h"
-#include "nmapienvelopelisting_p.h"
-
-#include <nmapimailbox.h>
-#include <nmapimessageenvelope.h>
+#include "nmapiheaders.h"
 
 
 
 namespace EmailClientApi
 {
-NmApiEnvelopeListingPrivate::NmApiEnvelopeListingPrivate(QObject *parent) :
-    QObject(parent), mEngine(NULL)
+NmApiEnvelopeListingPrivate::NmApiEnvelopeListingPrivate(const quint64 folderId, const quint64 mailboxId, QObject *parent)
+:QObject(parent),
+mFolderId(folderId), 
+mMailboxId(mailboxId), 
+mIsRunning(false),
+mEngine(NULL)
 {
     NM_FUNCTION;
+    mEngine = NmApiEngine::instance();
+    Q_CHECK_PTR(mEngine);
 }
 
 NmApiEnvelopeListingPrivate::~NmApiEnvelopeListingPrivate()
 {
     NM_FUNCTION;
-    
-    releaseEngine();
+    NmApiEngine::releaseInstance(mEngine);
 }
 
-/*!
-   \brief It initialize engine for email operations. 
+/*! 
+   \brief Fills envelopes to the input parameter.
    
-   When use initializeEngine need to remember release it.
-   It return value if initialization go good.
-   \sa releaseEngine 
+    Caller gets ownership of envelopes. Returns true if results were available.
  */
-bool NmApiEnvelopeListingPrivate::initializeEngine()
+bool NmApiEnvelopeListingPrivate::envelopes(QList<EmailClientApi::NmApiMessageEnvelope> &envelopes)
 {
     NM_FUNCTION;
-    
-    mEngine = NmApiEngine::instance();
-    return mEngine ? true : false;
+    bool ret(mIsRunning);
+    envelopes.clear();
+    while (!mEnvelopes.isEmpty()) {
+        envelopes << mEnvelopes.takeFirst();
+    }
+    mIsRunning = false;
+    return ret;
 }
 
 /*!
-   \brief It release engine for email operations.
+   \brief It fetches envelopes from engine. 
+   
+   Because it uses NmApiMessageEnvelope with sharedData we don't need care about release memory.
    
-   \sa initializeEngine
+   \return Count of envelopes 
  */
-void NmApiEnvelopeListingPrivate::releaseEngine()
+qint32 NmApiEnvelopeListingPrivate::listEnvelopes()
 {
     NM_FUNCTION;
-    
-    NmApiEngine::releaseInstance(mEngine);
+    mIsRunning = true;
+    mEnvelopes.clear();
+    mEngine->listEnvelopes(mMailboxId, mFolderId, mEnvelopes);
+    return mEnvelopes.count();
 }
-
 /*!
-   \brief It grab envelopes from engine. 
-   
-   When it start grabing, it release all old.
-   Because it uses NmApiMessageEnvelope with sharedData we don't need care about release memory.
-   
-   \return Count of envelopes or "-1" if there is no engine initialised
+   \brief Return info if listing is running
  */
-qint32 NmApiEnvelopeListingPrivate::grabEnvelopes()
+bool NmApiEnvelopeListingPrivate::isRunning() const
 {
-    NM_FUNCTION;
-    
-    if(!mEngine){
-        return -1;
-    }
-    
+    return mIsRunning;
+}
+/*!
+   \brief Clears list of envelopes.
+ */
+void NmApiEnvelopeListingPrivate::cancel() 
+{
+    mIsRunning = false;
     mEnvelopes.clear();
-    mEngine->listEnvelopes(mailboxId, folderId, mEnvelopes);
-    return mEnvelopes.count();
 }
 }
 
--- a/emailservices/nmclientapi/src/nmapieventnotifier.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapieventnotifier.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -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"
@@ -15,35 +15,22 @@
  *
  */
 
-#include "emailtrace.h"
+#include "nmapiheaders.h"
 
-#include <QList>
-#include <QVariant>
-#include <QString>
-#include <QTimer>
 
-#include "nmapiengine.h"
-#include <nmapieventnotifier.h>
-#include "nmapieventnotifier_p.h"
-
-const quint32 IntervalEmitingSignals = 10000;
 
 namespace EmailClientApi
 {
 /*!
    Constructor
  */
-NmApiEventNotifier::NmApiEventNotifier(QObject *parent) :
-    NmApiMessageTask(parent)
-
+NmApiEventNotifier::NmApiEventNotifier(QObject *parent) 
+:NmApiMessageTask(parent)
 {
     NM_FUNCTION;
     
-    //set timer
     mNmApiEventNotifierPrivate = new NmApiEventNotifierPrivate(this);
-    mNmApiEventNotifierPrivate->mEmitSignals = new QTimer(this);
-    mNmApiEventNotifierPrivate->mEmitSignals->setInterval(IntervalEmitingSignals);
-    connect(mNmApiEventNotifierPrivate->mEmitSignals, SIGNAL(timeout()), this, SLOT(
+    connect(mNmApiEventNotifierPrivate, SIGNAL(timedOut()), this, SLOT(
         sendEventsFromBuffer()), Qt::QueuedConnection);
 
 }
@@ -54,9 +41,8 @@
 NmApiEventNotifier::~NmApiEventNotifier()
 {
     NM_FUNCTION;
-    
-    if (mNmApiEventNotifierPrivate->mIsRunning) {
-        mNmApiEventNotifierPrivate->releaseEngine();
+    if (mNmApiEventNotifierPrivate) {
+        mNmApiEventNotifierPrivate->stop();
     }
 }
 
@@ -69,39 +55,14 @@
 {
     NM_FUNCTION;
     
-    bool result = false;
-
-    if (mNmApiEventNotifierPrivate->mIsRunning) {
-        result = true;
-    }
-    else {
-        if (!mNmApiEventNotifierPrivate->initializeEngine()) {
-            mNmApiEventNotifierPrivate->mIsRunning = false;
-            result = false;
-        }
-        else {
-            qRegisterMetaType<QList<quint64> > ("QList<quint64>");
-            qRegisterMetaType<NmApiMessage> ("NmApiMessage");
-
-            connect(mNmApiEventNotifierPrivate->mEngine, SIGNAL(emailStoreEvent(NmApiMessage)), mNmApiEventNotifierPrivate,
-                SLOT(emailStoreEvent(NmApiMessage)), Qt::QueuedConnection);
-            
-            // initiate event listening
-            mNmApiEventNotifierPrivate->mEngine->startCollectingEvents();
-            
-            mNmApiEventNotifierPrivate->mEmitSignals->start();
-            mNmApiEventNotifierPrivate->mIsRunning = true;
-            result = true;
-        }
-    }
-    return result;
+    return mNmApiEventNotifierPrivate->start();
 }
 
 /*!
    Cancels monitoring.
    
    In user responsibility is to cancel monitoring.
-   On end it clear buffer events and emits \sa NmApiMessageTask::canceled() signal.
+   On end it clears buffer events and emits \sa NmApiMessageTask::canceled() signal.
  */
 void NmApiEventNotifier::cancel()
 {
@@ -118,14 +79,13 @@
 {
     NM_FUNCTION;
     
-    return mNmApiEventNotifierPrivate->mIsRunning;
+    return mNmApiEventNotifierPrivate->isRunning();
 }
 
 /*!
-   It check each object in buffer and emit signal with it.
-   
-   After end of work of this function buffer is empty.
-   It is called by timeout signal from timer.
+   Checks each object in buffer and emits corresponding signal.
+   Uses scheduled transmission. Can be called also directly to force the 
+   signal sending.
  */
 void NmApiEventNotifier::sendEventsFromBuffer()
 {
@@ -134,53 +94,41 @@
     qRegisterMetaType<EmailClientApi::NmApiMailboxEvent> ("EmailClientApi::NmApiMailboxEvent");
     qRegisterMetaType<EmailClientApi::NmApiMessageEvent> ("EmailClientApi::NmApiMessageEvent");
     
-    NmApiMessage events;
-    while (!mNmApiEventNotifierPrivate->mBufferOfEvents.isEmpty()) {
-        events = mNmApiEventNotifierPrivate->mBufferOfEvents.takeFirst();
-        switch (events.objectType) {
+    QList<NmApiMessage> events;
+    mNmApiEventNotifierPrivate->events(events);
+    while (!events.isEmpty()) {
+        NmApiMessage event = events.takeFirst();
+        switch (event.objectType) {
             case EMailbox:
-                switch (events.action) {
-                    case ENew:
-                        emit mailboxEvent(MailboxCreated, events.objectIds);
-                        break;
-                    case EChange:
-
-                        break;
-                    case EDeleted:
-                        emit mailboxEvent(MailboxDeleted, events.objectIds);
-                        break;
-                    default:
-                        break;
-                }
-                break;
-            case EFolder:
-                switch (events.action) {
-                    case ENew:
-
-                        break;
-                    case EChange:
-
-                        break;
-                    case EDeleted:
-
-                        break;
+                switch (event.action) {
+                    case ENew: {
+                        emit mailboxEvent(MailboxCreated, event.objectIds);
+                    } 
+                    break;
+                    case EDeleted: {
+                        emit mailboxEvent(MailboxDeleted, event.objectIds);
+                    }
+                    break;
                     default:
                         break;
                 }
                 break;
             case EMessage:
-                switch (events.action) {
-                    case ENew:
-                        emit messageEvent(MessageCreated, events.mailboxId, events.folderId,
-                            events.objectIds);
+                switch (event.action) {
+                    case ENew: {
+                        emit messageEvent(MessageCreated, event.mailboxId, event.folderId,
+                            event.objectIds);
+                        }
                         break;
-                    case EChange:
-                        emit messageEvent(MessageChanged, events.mailboxId, events.folderId,
-                            events.objectIds);
+                    case EChange: {
+                        emit messageEvent(MessageChanged, event.mailboxId, event.folderId,
+                            event.objectIds);
+                        }
                         break;
-                    case EDeleted:
-                        emit messageEvent(MessageDeleted, events.mailboxId, events.folderId,
-                            events.objectIds);
+                    case EDeleted: {
+                        emit messageEvent(MessageDeleted, event.mailboxId, event.folderId,
+                            event.objectIds);
+                        }
                         break;
                     default:
                         break;
@@ -190,6 +138,7 @@
                 break;
         }
     }
+    events.clear();
 }
 
 } //End of EmailClientApi
--- a/emailservices/nmclientapi/src/nmapieventnotifier_p.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapieventnotifier_p.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -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"
@@ -15,15 +15,12 @@
  *
  */
 
-#include "emailtrace.h"
-
-#include "nmapiengine.h"
-#include "nmapieventnotifier_p.h"
-
-#include <QTimer>
+#include "nmapiheaders.h"
 
 namespace EmailClientApi
 {
+const quint32 IntervalEmitingSignals = 10000;
+
 /*!
    Constructor
  */
@@ -31,6 +28,11 @@
     QObject(parent), mEmitSignals(NULL), mEngine(NULL), mIsRunning(false)
 {
     NM_FUNCTION;
+    mEmitSignals = new QTimer(this);
+    mEmitSignals->setInterval(IntervalEmitingSignals);
+    connect(mEmitSignals, SIGNAL(timeout()), this, SIGNAL(
+        timedOut()));
+    mEngine = NmApiEngine::instance();
 }
 
 /*!
@@ -39,41 +41,65 @@
 NmApiEventNotifierPrivate::~NmApiEventNotifierPrivate()
 {
     NM_FUNCTION;
+    mEmitSignals->stop();
+    NmApiEngine::releaseInstance(mEngine);
 }
 
 /*!
-   \brief It initialize engine for email operations. 
+   Returns true if the 
+ */
+bool NmApiEventNotifierPrivate::isRunning() const
+{
+    return mIsRunning;
+}
+
+/*!
+   Start monitoring email events
    
-   When use initializeEngine need to remember release it.
-   It return value if initialization go good.
-   \sa releaseEngine 
-   \return Return true if engine works.
+   \return Value tells about monitoring system running
  */
-bool NmApiEventNotifierPrivate::initializeEngine()
+bool NmApiEventNotifierPrivate::start()
 {
     NM_FUNCTION;
     
-    if (!mEngine) {
-        mEngine = NmApiEngine::instance();
+    bool result(false);
+
+    if (mIsRunning) {
+        result = true;
     }
+    else {
+        qRegisterMetaType<QList<quint64> > ("QList<quint64>");
+        qRegisterMetaType<NmApiMessage> ("NmApiMessage");
 
-    return mEngine ? true : false;
+        connect(mEngine, SIGNAL(emailStoreEvent(NmApiMessage)), this,
+                SLOT(emailStoreEvent(NmApiMessage)));
+            
+        mEngine->startCollectingEvents();
+            
+        mEmitSignals->start();
+        mIsRunning = true;
+        result = true;
+    }
+    return result;
+}
+/*!
+   \brief Stop listening events.
+ */
+void NmApiEventNotifierPrivate::stop()
+{
+    mIsRunning = false;
+    mEmitSignals->stop();
+    disconnect(mEngine, SIGNAL(emailStoreEvent(NmApiMessage)), this,
+            SLOT(emailStoreEvent(NmApiMessage)));
 }
 
 /*!
-   \brief It release engine for email operations.
-   
-   \sa initializeEngine
+    Returns event buffer, after function call the buffer is empty
  */
-void NmApiEventNotifierPrivate::releaseEngine()
+void NmApiEventNotifierPrivate::events(QList<NmApiMessage> &events)
 {
-    NM_FUNCTION;
-    
-    if (mIsRunning) {
-        cancel();
-    }
-    else {
-        NmApiEngine::releaseInstance(mEngine);
+    while (!mBufferOfEvents.isEmpty()) {
+        events << mBufferOfEvents.takeFirst();
     }
 }
 
@@ -87,7 +113,6 @@
 void NmApiEventNotifierPrivate::emailStoreEvent(const NmApiMessage &events)
 {
     NM_FUNCTION;
-    
     mBufferOfEvents << events;
 }
 
@@ -102,12 +127,8 @@
     mIsRunning = false;
     mEmitSignals->stop();
 
-    if (mEngine) {
-        disconnect(mEngine, SIGNAL(emailStoreEvent(NmApiMessage)), this,
+    disconnect(mEngine, SIGNAL(emailStoreEvent(NmApiMessage)), this,
             SLOT(emailStoreEvent(NmApiMessage)));
-    }
-
-    releaseEngine();
 
     mBufferOfEvents.clear();
 }
--- a/emailservices/nmclientapi/src/nmapifolder.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapifolder.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -14,11 +14,9 @@
  * Description: 
  *
  */
-
-#include "emailtrace.h"
+ 
+#include "nmapiheaders.h"
 
-#include <nmapifolder.h>
-#include "nmapifolder_p.h"
 
 namespace EmailClientApi
 {
--- a/emailservices/nmclientapi/src/nmapifolderlisting.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapifolderlisting.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,13 +15,8 @@
  *
  */
 
-#include "emailtrace.h"
+#include "nmapiheaders.h"
 
-#include <nmapifolderlisting.h>
-#include "nmapifolderlisting_p.h"
-
-#include <nmapimailbox.h>
-#include <nmapifolder.h>
 
 namespace EmailClientApi
 {
@@ -33,14 +28,11 @@
 /*!
    Constructor of class. It set start values.
  */
-NmApiFolderListing::NmApiFolderListing(QObject *parent, const quint64 &nmMailboxId) :
+NmApiFolderListing::NmApiFolderListing(QObject *parent, const quint64 &mailboxId) :
     NmApiMessageTask(parent)
 {
     NM_FUNCTION;
-    
-    mFolderListing = new NmApiFolderListingPrivate(this);
-    mFolderListing->mIsRunning = false;
-    mFolderListing->mMailboxId = nmMailboxId;
+    mFolderListing = new NmApiFolderListingPrivate(mailboxId, this);
 }
 
 /*!
@@ -49,10 +41,6 @@
 NmApiFolderListing::~NmApiFolderListing()
 {
     NM_FUNCTION;
-    
-    if (mFolderListing->mIsRunning) {
-        mFolderListing->releaseEngine();
-    }
 }
 
 /*! 
@@ -65,14 +53,7 @@
 bool NmApiFolderListing::getFolders(QList<EmailClientApi::NmApiFolder> &folders)
 {
     NM_FUNCTION;
-    
-    folders.clear();
-    if (!mFolderListing->mIsRunning || mFolderListing->mFolders.isEmpty()) {
-        return false;
-    }
-    folders = mFolderListing->mFolders;
-    mFolderListing->mFolders.clear();
-    return true;
+    return mFolderListing->folders(folders);
 }
 
 /*!
@@ -91,20 +72,7 @@
 bool NmApiFolderListing::start()
 {
     NM_FUNCTION;
-    
-    if (mFolderListing->mIsRunning) {
-        return true;
-    }
-
-    if (!mFolderListing->initializeEngine()) {
-        QMetaObject::invokeMethod(this, "foldersListed", Qt::QueuedConnection, Q_ARG(qint32,
-            (qint32) FolderListingFailed));
-        return false;
-    }
-
-    qint32 folderCount = mFolderListing->grabFolders();
-
-    mFolderListing->mIsRunning = true;
+    qint32 folderCount = mFolderListing->listFolders();
     QMetaObject::invokeMethod(this, "foldersListed", Qt::QueuedConnection,
         Q_ARG(qint32, folderCount));
 
@@ -122,14 +90,7 @@
 {
     NM_FUNCTION;
     
-    if (!mFolderListing->mIsRunning) {
-        return;
-    }
-
-    mFolderListing->mIsRunning = false;
-    mFolderListing->releaseEngine();
-    mFolderListing->mFolders.clear();
-
+    mFolderListing->cancel(); 
     emit canceled();
 }
 
@@ -139,10 +100,9 @@
 bool NmApiFolderListing::isRunning() const
 {
     NM_FUNCTION;
-    
-    return mFolderListing->mIsRunning;
+    return mFolderListing->isRunning();
 }
 
 }
 
-#include "moc_nmapifolderlisting.cpp"
+
--- a/emailservices/nmclientapi/src/nmapifolderlisting_p.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapifolderlisting_p.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,12 +15,8 @@
  *
  */
 
-#include "emailtrace.h"
+#include "nmapiheaders.h"
 
-#include "nmapiengine.h"
-#include "nmapifolderlisting_p.h"
-
-#include <nmapifolder.h>
 
 namespace EmailClientApi
 {
@@ -28,10 +24,15 @@
 /*!
    Constructor form NmApiFolderListingPrivate
  */
-NmApiFolderListingPrivate::NmApiFolderListingPrivate(QObject *parent) :
-    QObject(parent), mEngine(NULL)
+NmApiFolderListingPrivate::NmApiFolderListingPrivate(quint64 mailboxId, QObject *parent) 
+:QObject(parent), 
+mMailboxId(mailboxId),
+mEngine(NULL),
+mIsRunning(false)
 {
     NM_FUNCTION;
+    mEngine = NmApiEngine::instance();
+    Q_CHECK_PTR(mEngine);
 }
 
 /*!
@@ -40,60 +41,59 @@
 NmApiFolderListingPrivate::~NmApiFolderListingPrivate()
 {
     NM_FUNCTION;
-    
-    releaseEngine();
-}
-
-/*!
-   \brief It initialize engine for email operations. 
-   
-   When use initializeEngine need to remember release it.
-   It return value if initialization go good.
-   \sa releaseEngine 
- */
-bool NmApiFolderListingPrivate::initializeEngine()
-{
-    NM_FUNCTION;
-    
-    if (!mEngine) {
-        mEngine = NmApiEngine::instance();
-    }
-
-    return mEngine ? true : false;
-}
-
-/*!
-   \brief It release engine for email operations.
-   
-   \sa initializeEngine
- */
-void NmApiFolderListingPrivate::releaseEngine()
-{
-    NM_FUNCTION;
-    
     NmApiEngine::releaseInstance(mEngine);
 }
 
 /*!
-   \brief It grab folders from engine. 
+   \brief Fetch folders from engine. 
    
-   When it start grabing, it release all old.
    Because it uses NmFolder with sharedData we don't need care about release memory.
    
-   \return Count of folders or "-1" if there is no engine initialised
+   \return Count of folders
  */
-qint32 NmApiFolderListingPrivate::grabFolders()
+qint32 NmApiFolderListingPrivate::listFolders()
 {
     NM_FUNCTION;
-    
-    if (!mEngine) {
-        return -1;
-    }
-    
+    mIsRunning = true;
     mFolders.clear();
     mEngine->listFolders(mMailboxId, mFolders);
     return mFolders.count();
 }
 
+/*! 
+   \brief Returns results after listFolders is called.
+   
+    Caller gets ownership of messages. Returns true if results were available.
+    It clears list of folders after be called.
+    It also at start clear inputlist of NmFolder.
+ */
+bool NmApiFolderListingPrivate::folders(QList<EmailClientApi::NmApiFolder> &folders)
+{
+    NM_FUNCTION;
+    bool ret(mIsRunning);
+    folders.clear();
+    while (!mFolders.isEmpty()) {
+        folders << mFolders.takeFirst();
+    }
+    mIsRunning = false;
+    return ret;
 }
 
+/*!
+   \brief Return info if listing is running
+ */
+bool NmApiFolderListingPrivate::isRunning() const
+{
+    NM_FUNCTION;
+    return mIsRunning;
+}
+/*!
+   \brief Clears list of folders.
+ */
+void NmApiFolderListingPrivate::cancel() 
+{
+    mIsRunning = false;
+    mFolders.clear();
+}
+}
+
--- a/emailservices/nmclientapi/src/nmapimailbox.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimailbox.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,12 +15,7 @@
  *
  */
 
-#include "emailtrace.h"
-
-#include <nmapimailbox.h>
-#include "nmapimailbox_p.h"
-
-#include <QString>
+#include "nmapiheaders.h"
 
 namespace EmailClientApi
 {
--- a/emailservices/nmclientapi/src/nmapimailboxlisting.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimailboxlisting.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,16 +15,7 @@
  *
  */
 
-#include "emailtrace.h"
-
-#include <nmapimailboxlisting.h>
-
-#include <QObject>
-
-#include <nmapimailbox.h>
-#include "nmapiengine.h"
-#include "nmapimailboxlisting_p.h"
-
+#include "nmapiheaders.h"
 
 namespace EmailClientApi
 {
@@ -169,4 +160,3 @@
 
 }
 
-#include "moc_nmapimailboxlisting.cpp"
--- a/emailservices/nmclientapi/src/nmapimailboxlisting_p.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimailboxlisting_p.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,12 +15,8 @@
  *
  */
 
-#include "emailtrace.h"
+#include "nmapiheaders.h"
 
-#include "nmapiengine.h"
-#include "nmapimailboxlisting_p.h"
-
-#include <nmapimailbox.h>
 
 namespace EmailClientApi
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/src/nmapimailboxsettings.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,95 @@
+/*
+ * 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 "nmapiheaders.h"
+
+
+namespace EmailClientApi {
+
+
+NmApiMailboxSettings::NmApiMailboxSettings(QObject *parent)
+   :QObject(parent)
+{
+   d = new NmApiMailboxSettingsPrivate(this); 
+   connect(d, SIGNAL(mailboxDeleted(int)),this,SIGNAL(mailboxDeleted(int)));
+}
+
+NmApiMailboxSettings::~NmApiMailboxSettings()
+{
+    delete d;
+}
+
+/*!
+ \fn listMailboxIds
+ \param idList - QList consists of ids as quint64.
+ \return true is successful, otherwise return false
+
+ Lists ids of mailboxes
+ */
+bool NmApiMailboxSettings::listMailboxIds(QList<quint64> &idList)
+{
+    return d->listMailboxIds(idList);
+}
+
+bool NmApiMailboxSettings::loadSettings(quint64 mailboxId, NmApiMailboxSettingsData &data)
+{
+	return d->loadSettings(mailboxId, data);
+}
+
+bool NmApiMailboxSettings::saveSettings(const NmApiMailboxSettingsData &data)
+{
+	return d->saveSettings(data);
+}
+
+/*!
+ \fn createMailbox
+ \param mailboxType - mailbox type as QString
+ \param data - mailbox settings data
+
+ Creates a mailbox
+ */
+bool NmApiMailboxSettings::createMailbox(const QString &mailboxType, NmApiMailboxSettingsData &data)
+{
+    return d->createMailbox(mailboxType, data);
+}
+
+/*!
+ \fn deleteMailbox
+ \param mailboxId - mailbox id.
+ \return quint64 - the mailbox id.
+ 
+ Deletes mailbox with specific id.
+ */
+bool NmApiMailboxSettings::deleteMailbox(quint64 mailboxId)
+{
+    return d->deleteMailbox(mailboxId);
+}
+
+/*!
+ \fn populateDefaultSettings
+ \param mailboxType - mailbox type as QString
+ \param data - mailbox settings data, on return contains dafault settings for mailbox protocol
+ \return true if default settings are set, otherwise false
+ 
+ Populates NmApiMailboxSettingsData with protocol specific settings data.
+ */
+bool NmApiMailboxSettings::populateDefaultSettings(const QString &mailboxType, NmApiMailboxSettingsData &data)
+{
+    return d->populateDefaultSettings(mailboxType, data);
+}
+
+}//end namespace
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/src/nmapimailboxsettings_p.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,139 @@
+/*
+ * 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 "nmapiheaders.h"
+
+
+namespace EmailClientApi
+{
+NmApiMailboxSettingsPrivate::NmApiMailboxSettingsPrivate(QObject *parent) : 
+    QObject(parent), 
+    mFactory(NULL),
+    mDeleteMailboxOperation(NULL)
+{
+    NM_FUNCTION;
+    mFactory = NmApiDataPluginFactory::instance();
+    Q_CHECK_PTR(mFactory);
+}
+
+NmApiMailboxSettingsPrivate::~NmApiMailboxSettingsPrivate()
+{
+    NM_FUNCTION;
+    NmApiDataPluginFactory::releaseInstance(mFactory);
+    if(mDeleteMailboxOperation && mDeleteMailboxOperation->isRunning()) {
+        mDeleteMailboxOperation->cancelOperation();        
+    }
+}
+
+bool NmApiMailboxSettingsPrivate::listMailboxIds(QList<quint64> &idList)
+{
+    NM_FUNCTION; 
+    QList<NmId> mailboxIds;
+    bool ret = false;
+    idList.clear();
+    
+    NmDataPluginInterface *instance = mFactory->interfaceInstance();
+    if (instance) {
+        if (instance->listMailboxIds(mailboxIds) == KErrNone) {
+            
+            foreach (NmId boxId, mailboxIds) {
+                        idList.append(boxId.id());
+                    }
+            
+            ret = true;   
+            }
+        } 
+     
+    return ret;
+}
+
+bool NmApiMailboxSettingsPrivate::loadSettings(quint64 mailboxId, NmApiMailboxSettingsData &data)
+{
+    NM_FUNCTION;
+    Q_UNUSED(mailboxId);
+    Q_UNUSED(data);
+    return false;
+}
+
+bool NmApiMailboxSettingsPrivate::saveSettings(const NmApiMailboxSettingsData &data)
+{
+    NM_FUNCTION;
+    Q_UNUSED(data);
+    return false;
+}
+
+bool NmApiMailboxSettingsPrivate::createMailbox(
+    const QString &mailboxType,
+    NmApiMailboxSettingsData &data)
+{
+    NM_FUNCTION;
+    Q_UNUSED(mailboxType);
+    Q_UNUSED(data);
+    bool ret = false;
+    
+    /*QT_TRY {
+        if (mailboxType==NmApiMailboxTypePop || mailboxType==NmApiMailboxTypeImap) {
+            QScopedPointer<NmApiPopImapSettingsManager> popImapManager(new NmApiPopImapSettingsManager());  
+            popImapManager->createMailbox(mailboxType, data);
+            ret = true;
+        }
+        else {
+            ret = false;
+        }
+        //TODO store cenrep stuff here
+    }
+    QT_CATCH(...){
+        ret = false;
+    }*/
+    
+    return ret;
+}
+
+bool NmApiMailboxSettingsPrivate::deleteMailbox(quint64 mailboxId)
+{
+    NM_FUNCTION;
+    bool ret = false;
+    NmDataPluginInterface *instance = mFactory->interfaceInstance();
+    if (instance) {
+        if (mDeleteMailboxOperation && mDeleteMailboxOperation->isRunning()) {
+            mDeleteMailboxOperation->cancelOperation();
+        }
+        mDeleteMailboxOperation = instance->deleteMailboxById(NmId(mailboxId));
+        
+        if (mDeleteMailboxOperation) {
+            ret = true;
+            connect(mDeleteMailboxOperation, 
+                    SIGNAL(operationCompleted(int)), 
+                    this, 
+                    SIGNAL(mailboxDeleted(int)));
+        }
+    }
+    return ret;
+}
+
+bool NmApiMailboxSettingsPrivate::populateDefaultSettings(
+    const QString &mailboxType, NmApiMailboxSettingsData &data) 
+{
+    NM_FUNCTION;
+    Q_UNUSED(mailboxType);
+    Q_UNUSED(data);
+    /*QScopedPointer<NmApiPopImapSettingsManager> popImapManager(new NmApiPopImapSettingsManager());  
+    return popImapManager->populateDefaults(mailboxType, data);*/
+    return true;
+}
+
+}// namespace
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/src/nmapimailboxsettingsdata.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,114 @@
+/*
+ * 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 "nmapiheaders.h"
+
+
+namespace EmailClientApi
+{
+
+NmApiMailboxSettingsData::NmApiMailboxSettingsData()
+{
+    d = new NmApiMailboxSettingsDataPrivate();
+    Q_CHECK_PTR(d);
+}
+
+NmApiMailboxSettingsData::~NmApiMailboxSettingsData()
+{
+    delete d;
+}
+
+/*!
+ \fn setMailboxId 
+ \param mailboxId - valid mailbox id as quint64.
+ 
+ Sets the mailbox id               
+ */
+void NmApiMailboxSettingsData::setMailboxId(quint64 mailboxId)
+{
+    d->setMailboxId(mailboxId);
+}
+
+/*!
+ \fn mailboxId
+ \return quint64 - the mailbox id.
+ 
+ Gets the mailbox id.              
+ */
+quint64 NmApiMailboxSettingsData::mailboxId() const
+{
+    return d->mailboxId();
+}
+
+/*!
+ \fn setValue 
+ \param key - setting data to be set.
+ \param settingValue - Value to be set as QVariant.
+ 
+ Sets individual setting value.        
+ */
+void NmApiMailboxSettingsData::setValue(int key, const QVariant &settingValue)
+{
+    d->setValue(key, settingValue);
+}
+
+/*!
+ \fn getValue
+ \param key - setting data to get.
+ \param settingValue - On return holds as QVariant.
+ \return true if successfull, false otherwise.
+ 
+ Get individual setting value.        
+ */
+bool NmApiMailboxSettingsData::getValue(int key, QVariant &settingValue) const
+{
+    return d->getValue(key, settingValue);
+}
+
+/*!
+ \fn validateData
+ \return boolean - true, everything validated OK, false otherwise
+ 
+ Validates data in this container. 
+ */
+bool NmApiMailboxSettingsData::validateData() const
+{
+    return d->validateData();
+}
+
+/*!
+ \fn listSettings
+ \return QList<int> - ,on return contains use key values for settingsdata
+ 
+ Validates data in this container. 
+ */
+QList<int> NmApiMailboxSettingsData::listSettings() const
+{
+	return d->listSettings();
+}
+
+/*!
+ \fn clearSettings 
+ 
+ Resets data in this container.
+ */
+void NmApiMailboxSettingsData::clearSettings()
+{
+	d->clearSettings();
+}
+
+}//end namespace
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/src/nmapimailboxsettingsdata_p.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,757 @@
+/*
+ * 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 "nmapiheaders.h"
+
+
+
+
+namespace EmailClientApi
+{
+
+NmApiMailboxSettingsDataPrivate::NmApiMailboxSettingsDataPrivate() :
+    mId(0), mSettings(new QHash<int, QVariant>())
+{
+    NM_FUNCTION;
+    Q_CHECK_PTR( mSettings );
+}
+
+NmApiMailboxSettingsDataPrivate::~NmApiMailboxSettingsDataPrivate()
+{
+    NM_FUNCTION;
+}
+
+/*!
+ \fn setMailboxId 
+ \param mailboxId - valid mailbox id as quint64.
+ 
+ Sets the mailbox id               
+ */
+void NmApiMailboxSettingsDataPrivate::setMailboxId(quint64 mailboxId)
+{
+    NM_FUNCTION;
+    mId = mailboxId;
+}
+
+/*!
+ \fn mailboxId
+ \return quint64 - the mailbox id.
+ 
+ Gets the mailbox id.              
+ */
+quint64 NmApiMailboxSettingsDataPrivate::mailboxId() const
+{
+    NM_FUNCTION;
+    return mId;
+}
+
+/*!
+ \fn setValue 
+ \param key - setting data to be set.
+ \param settingValue - Value to be set as QVariant.
+
+ Sets individual setting value.        
+ */
+void NmApiMailboxSettingsDataPrivate::setValue(int key, const QVariant &settingValue)
+{
+    NM_FUNCTION;
+    (*mSettings)[key] = settingValue;
+}
+
+/*!
+ \fn getValue
+ \param key - setting data to get.
+ \param settingValue - On return holds as QVariant.
+ \return true if succesfull, false otherwise.
+ 
+ Get individual setting value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::getValue(int key, QVariant &settingValue) const
+{
+    NM_FUNCTION;
+    if (mSettings->contains(key)) {
+        settingValue = (*mSettings)[key];
+        return true;
+    }
+    return false;
+}
+
+/*!
+ \fn validateString
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param validated - if this key was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual string type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateString(int key, QVariant& val, bool& validated) const
+{
+    NM_FUNCTION;
+    bool ret = true;
+    switch (key) {     
+     case OutgoingPassword:
+     case IncomingPassword:     
+     case FolderPath: 
+     case IncomingLoginName:
+     case MailboxName:
+     case MyName:
+     case ReceptionActiveProfile:
+     case IncomingMailServer:
+     case OutgoingMailServer:
+     case OutgoingLoginName:
+     case EmailAddress:
+     case ReplyAddress:
+     case EmailAlias:               
+     case IncomingMailUsesAuthentication:
+     case OutgoingMailUsesAuthentication:
+     case IncomingMailSecurityType:
+     case OutgoingMailSecurityType:
+     case EmailNotificationState:         
+     case AlwaysOnlineState:{
+         validated=true;
+         if (val.type() != QVariant::String) {
+             ret = false;
+             break;
+         }
+
+         QString sz = val.toString();                   
+         ret = validateStringValue(key, sz);
+         break;
+     }
+         
+     default: {
+         validated = false;
+         ret = false;
+         break;
+         }
+    }    
+    return ret;
+}
+
+/*!
+ \fn validateStringValue
+ \param key - setting data to validate.
+ \param val - value to validate. 
+ \return true if valid value, false otherwise.
+ 
+ validates individual string type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateStringValue(int key, QString& val) const
+{
+    NM_FUNCTION;
+    int ret = true;
+    bool valid = true, validated = false;
+    
+    valid = validateStringGeneral(key ,val, validated);
+    if (validated && !valid) {
+            ret = false;
+    }
+    
+    if( !validated ) {
+        valid = validateEmailAddress(key ,val, validated);
+        if (validated && !valid) {
+            ret = false;
+        }
+    }
+    
+    if( !validated ) {
+        valid = validateUsesAuthentication(key ,val, validated);
+        if (validated && !valid) {
+            ret = false;
+        }
+    }
+    
+    if( !validated ) {
+        valid = validateSecurityType(key ,val, validated);
+        if (validated && !valid) {
+            ret = false;
+        }
+    }
+    
+    if( !validated ) {
+        valid = validateAOLState(key ,val, validated);
+        if (validated && !valid) {
+            ret = false;
+        }
+    }        
+    return ret;
+}
+
+/*!
+ \fn validateStringGeneral
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param handled - true if method value was handled by method.
+ \return true if valid value, false otherwise.
+ 
+ validates individual string type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateStringGeneral(int key, QString& /*val*/, bool& handled) const
+{
+    NM_FUNCTION;
+    int ret = true;
+    switch (key) {     
+         case OutgoingPassword:
+         case IncomingPassword:     
+         case FolderPath:
+         case IncomingLoginName:
+         case MailboxName:
+         case MyName:
+         case ReceptionActiveProfile:
+         case IncomingMailServer:
+         case OutgoingMailServer:
+         case OutgoingLoginName: {
+             // Allready validated that values are string, 
+             // otherwise method is not called
+             handled = true;         
+             break;
+         }
+         default: {
+             handled = false;
+             ret = false;
+             break;
+         }    
+    } 
+    return ret;
+}
+         
+/*!
+ \fn validateEmailAddress
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param handled - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual string type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateEmailAddress(int key, QString& val, bool& handled) const
+{
+    NM_FUNCTION;
+    int ret = true;
+    switch (key) {        
+        case EmailAddress:
+        case ReplyAddress: {
+            handled = true;
+            if (val.size() == 0) {             
+                 ret = false;
+                 break;
+            }
+            if (!(val.contains("@"))) {
+               ret = false;
+            }
+            break;
+        }
+        case EmailAlias:  {
+            handled = true;            
+            break;
+        }
+        default: {
+            handled = false;
+            ret = false;
+            break;
+        }
+    }
+    return ret;
+}
+     
+/*!
+ \fn validateUsesAuthentication
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param handled - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual string type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateUsesAuthentication(int key, QString& val, bool& handled) const
+{ 
+    NM_FUNCTION;
+    int ret = true;
+    switch (key) { 
+        case IncomingMailUsesAuthentication:
+        case OutgoingMailUsesAuthentication: {
+            handled = true;
+            if (val.size() == 0) {
+                ret = false;
+                break;
+            }
+            if (!(val.contains("none") ||
+              val.contains("UserAuthentication") ||
+                  (key == OutgoingMailUsesAuthentication &&
+                   val.contains("SameAsIncoming")) )) {
+                ret = false;
+            }
+            break;
+        }
+        default: {
+            handled = false;
+            ret = false;
+            break;
+        }
+    }
+    return ret;
+}
+        
+/*!
+ \fn validateSecurityType
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param validated - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual string type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateSecurityType(int key, QString& val, bool& handled) const
+{ 
+    NM_FUNCTION;
+    int ret = true;
+    switch (key) {
+         case IncomingMailSecurityType:
+         case OutgoingMailSecurityType: {
+            handled = true;
+            if (val.size() == 0) {
+                ret = false;
+                break;
+            }
+            if (!(val.contains("StartTls") || 
+                  val.contains("SSLTls") || 
+                  val.contains("none"))) {
+                ret = false;
+            }
+            break;
+         }
+         default: {
+             handled = false;
+             ret = false;
+             break;
+         }
+     }
+     return ret;
+}
+
+/*!
+ \fn validateAOLState
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param validated - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual string type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateAOLState(int key, QString& val, bool& handled) const
+{ 
+    NM_FUNCTION;
+    int ret = true;
+    switch (key) {
+        case EmailNotificationState:         
+        case AlwaysOnlineState:{
+         handled = true;
+         if (val.size() == 0) {
+              ret = false;
+              break;
+          }
+          if (!( (val.contains("always") && key == AlwaysOnlineState) || 
+                 (val.contains("automatic") && key == EmailNotificationState) || 
+                  val.contains("homeOnly") || 
+                  val.contains("off"))) {
+              ret = false;
+          }
+          break;
+        }
+        default: {
+            handled = false;
+            ret = false;
+            break;
+        }
+    }
+    return ret;
+}
+
+/*!
+ \fn validateInteger
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param validated - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual integer type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateInteger(int key, QVariant& val, bool& validated) const
+{
+    NM_FUNCTION;
+    bool ret = true;
+    switch (key) { 
+        case DownloadPictures:
+        case MessageDivider:
+        case UserNameHidden:
+        case FirstEmnReceived:
+        case EmnReceivedNotSynced:
+        case AoLastUpdateFailed:
+        case AoUpdateSuccessfulWithCurSettings:
+        case ReceptionUserDefinedProfile:
+        case ReceptionInboxSyncWindow:
+        case ReceptionGenericSyncWindowInMessages:
+        case IncomingPort:
+        case OutgoingPort:
+        case ReceptionWeekDays:
+        case ReceptionDayStartTime:
+        case ReceptionDayEndTime:
+        case ReceptionRefreshPeriodDayTime:
+        case ReceptionRefreshPeriodOther: {
+            validated = true;
+            if (!(val.type() == QVariant::Int ||
+                  val.type() == QVariant::UInt ||
+                  val.type() == QVariant::LongLong  ||
+                  val.type() == QVariant::ULongLong ||
+                  val.type() == QVariant::Double)) {
+                ret = false;
+                break;
+            }            
+            int ival = val.toInt();
+            ret = validateIntVal(key,ival);
+            break;
+        }
+        default: {
+            validated = false;
+            ret = false;
+            break;
+        }
+     }
+     return ret;
+}
+
+/*!
+ \fn validateIntVal
+ \param key - setting data to validate.
+ \param val - value to validate. 
+ \return true if valid value, false otherwise.
+ 
+ validates individual integer type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateIntVal(int key, int val) const
+{
+    NM_FUNCTION;
+    int ret = true;
+    bool valid = true, validated = false;
+
+    valid = validateIntGeneral(key ,val, validated);
+    if (validated && !valid) {
+           ret = false;
+    }
+    
+    if( !validated ) {
+       valid = validateOnOffValue(key ,val, validated);
+       if (validated && !valid) {
+           ret = false;
+       }
+    }
+    
+    if( !validated ) {
+       valid = validateWeekdayMask(key ,val, validated);
+       if (validated && !valid) {
+           ret = false;
+       }
+    }
+    
+    if( !validated ) {
+       valid = validateHoursInDay(key ,val, validated);
+       if (validated && !valid) {
+           ret = false;
+       }
+    }
+    return ret;
+}
+
+/*!
+ \fn validateOnOffValue
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param validated - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual integer type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateOnOffValue(int key, int val, bool& handled) const
+{
+    NM_FUNCTION;
+    bool ret = true;
+    switch (key) {   
+        // Integer: 0=Off, 1=On    
+        case DownloadPictures:
+        case MessageDivider:
+        case UserNameHidden:
+        
+        // Integer: 0=false,1=true
+        case FirstEmnReceived:
+        case EmnReceivedNotSynced:
+        case AoLastUpdateFailed:
+        case AoUpdateSuccessfulWithCurSettings:
+        
+        // Integer: 0=Disabled, 1=Enabled
+        case ReceptionUserDefinedProfile: {
+            handled = true;
+            if (!(0 <= val && val <= 1)) {
+                ret = false;
+            }
+            break;
+        }
+        default: {
+            handled = false;
+            ret = false;
+            break;
+        }
+    }
+    return ret;
+}
+
+/*!
+ \fn validateIntGeneral
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param validated - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual integer type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateIntGeneral(int key, int /*val*/, bool& handled) const
+{ 
+    NM_FUNCTION;
+    bool ret = true;
+    switch (key) {         
+        // Integer: 5,15,60,240,0="When open mailbox"
+        case ReceptionRefreshPeriodDayTime:
+        case ReceptionRefreshPeriodOther:
+            
+        // Integer: 0=All messages
+        case ReceptionInboxSyncWindow:
+        case ReceptionGenericSyncWindowInMessages:
+            
+        // Integer
+        case IncomingPort:
+        case OutgoingPort: {
+            // Allready valid thate these are integers
+            handled = true;
+            break;
+        }
+        default: {
+            handled = false;
+            ret = false;
+            break;
+        }
+    }
+    return ret;
+}
+
+/*!
+ \fn validateWeekDayMask
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param validated - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual integer type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateWeekdayMask(int key, int val, bool& handled) const
+{
+    NM_FUNCTION;
+    bool ret = true;
+    switch (key) {
+        // Integer bitmask of weekdays: 0x01=Mon,0x02=Tue,0x04=Wed,0x08=Thu,0x10=Fri,0x20=Sat,0x40=Sun
+        case ReceptionWeekDays: {
+            handled = true;
+            int wkdmask = Mon | Tue | Wed | Thu | Fri | Sat | Sun;
+            if ((val & wkdmask) != val) {
+                ret = false;
+            }
+            break;
+        }
+        default: {
+            handled = false;
+            ret = false;
+            break;
+        }
+    }
+    return ret;
+}
+
+/*!
+ \fn validateHoursInDay
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param validated - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual integer type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateHoursInDay(int key, int val, bool& handled) const
+{ 
+    NM_FUNCTION;
+    bool ret = true;
+    switch (key) {
+        // Integer: 0-23
+        case ReceptionDayStartTime:
+        case ReceptionDayEndTime: {
+            handled = true;
+            if (!(0 <= val && val <= 23)) { 
+                ret = false;
+            }
+            break;
+        }
+        default: {
+            handled = false;
+            ret = false;
+            break;
+        }
+    }
+    return ret;
+}
+
+/*!
+ \fn validateBool
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param validated - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual bool type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateBool(int key, QVariant& val, bool& validated) const
+{
+    NM_FUNCTION;
+    bool ret = true;
+    switch (key) {    
+        
+        // Boolean
+        case IncomingSecureSockets:
+        case IncomingSSLWrapper:
+        case UseOutgoingAuthentication:
+        case OutgoingSecureSockets:
+        case OutgoingSSLWrapper: {
+            validated = true;
+            if (val.type() != QVariant::Bool)
+                ret = false;
+            break;
+        }
+        default: {
+            validated = false;
+            ret = false;
+            break;
+        }
+    }
+    return ret;
+}
+
+/*!
+ \fn validateDateTime
+ \param key - setting data to validate.
+ \param val - value to validate.
+ \param validated - true if value was validated by the method
+ \return true if valid value, false otherwise.
+ 
+ validates individual QDateTime type value.        
+ */
+bool NmApiMailboxSettingsDataPrivate::validateDateTime(int key, QVariant& val, bool& validated) const
+{
+    NM_FUNCTION;
+    switch(key) {
+        case AoLastSuccessfulUpdate: {
+            if (val.type() != QVariant::DateTime) {
+                validated = true;
+                return false;
+            }
+            return true;
+        }
+        default: {
+            validated = false;
+            return false;
+        }
+    }
+}
+
+/*!
+ \fn validateData
+ \return boolean - true, everything validated OK, false otherwise
+ 
+ Validates data in this container. 
+ */   
+bool NmApiMailboxSettingsDataPrivate::validateData() const
+{
+    NM_FUNCTION;
+    QHash<int, QVariant>::const_iterator i = mSettings->constBegin();
+    while (i != mSettings->constEnd()) {
+        
+        bool validated = false;
+        bool valid = false;        
+        
+        int key = i.key();
+        QVariant val = i.value();
+        
+        ++i;
+        
+        valid = validateString(key ,val, validated);
+        if (validated) {
+            if (!valid){
+                return valid;
+            }
+            continue;
+        }
+        
+        valid = validateInteger(key ,val, validated);
+        if (validated) {
+            if (!valid){
+                return valid;
+            }
+            continue;
+        }
+         
+        valid = validateBool(key ,val, validated);
+        if (validated) {
+            if (!valid){
+                return valid;
+            }
+            continue;
+        } 
+         
+        valid = validateDateTime(key ,val, validated);
+        if (validated) {
+            if (!valid){
+                return valid;
+            }
+            continue;
+        }
+     }
+     return true;
+}
+
+QList<int> NmApiMailboxSettingsDataPrivate::listSettings() const
+{
+    NM_FUNCTION;
+    return mSettings->keys();
+}
+
+/*!
+ \fn clearSettings 
+ 
+ Resets data in this container. 
+ */
+void NmApiMailboxSettingsDataPrivate::clearSettings()
+{
+	mSettings->clear();
+}
+
+}//end namespace
--- a/emailservices/nmclientapi/src/nmapimessagebody.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessagebody.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -14,11 +14,9 @@
  * Description: 
  *
  */
-
-#include "emailtrace.h"
+ 
+#include "nmapiheaders.h"
 
-#include <nmapimessagebody.h>
-#include "nmapimessagebody_p.h"
 
 namespace EmailClientApi
 {
--- a/emailservices/nmclientapi/src/nmapimessageenvelope.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessageenvelope.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,16 +15,9 @@
  *
  */
 
-#include "emailtrace.h"
-
-#include <QString>
-#include <QDateTime>
+#include "nmapiheaders.h"
 
-#include <nmapimessageenvelope.h>
-#include "nmapimessageenvelope_p.h"
 
-#include <nmapiemailaddress.h>
-#include <nmapimessagebody.h>
 
 namespace EmailClientApi
 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/src/nmapimessagemanager.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,165 @@
+/*
+ * 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:
+ *     Email message related operations
+ */
+ 
+#include "nmapiheaders.h"
+
+
+/*!
+    \class NmApiMessageManager
+    \brief A class for performing various operations on messages.
+ */
+ 
+ 
+namespace EmailClientApi
+{
+
+ NmApiMessageManager::NmApiMessageManager(quint64 mailboxId,QObject *parent)
+	:QObject(parent)
+{
+	d = new NmApiMessageManagerPrivate(mailboxId,this);	
+	connect(d, SIGNAL(messagesCopied(int)),this,SIGNAL(messagesCopied(int)));
+	connect(d, SIGNAL(messagesCreated(int)),this,SIGNAL(messagesCreated(int)));
+	connect(d, SIGNAL(messagesMoved(int)),this,SIGNAL(messagesMoved(int)));
+	connect(d, SIGNAL(messagesDeleted(int)),this,SIGNAL(messagesDeleted(int)));	
+}
+
+NmApiMessageManager::~NmApiMessageManager()
+{
+	delete d;
+}
+   
+
+    // creates a new email message
+    // signaled with draftMessageCreated(NmApiMessage *message,int result) 
+    //    * ownership transferred
+bool NmApiMessageManager::createDraftMessage(const QVariant *initData)
+{
+    NM_FUNCTION;
+    Q_UNUSED(initData);
+	return false;
+}
+    
+    // creates fw message
+    // signaled with forwardMessageCreated(NmApiMessage *message,int result) 
+    //    * ownership transferred
+ bool NmApiMessageManager::createForwardMessage(const QVariant *initData)
+ {
+    NM_FUNCTION;
+    Q_UNUSED(initData);
+	return false;
+ }
+    
+    // creates reply message
+    // signaled with replyMessageCreated(NmApiMessage *message,int result) 
+    //    * ownership transferred
+bool NmApiMessageManager::createReplyMessage(const QVariant *initData,
+													bool replyAll)
+{
+    NM_FUNCTION;
+    Q_UNUSED(initData);
+    Q_UNUSED(replyAll);
+	return false;
+}
+ 
+/*!
+ \fn moveMessages 
+ \param messageIds Id list of source messages.
+ \param sourceFolderId Id of the source folder.
+ \param targetFolderId Id of the target folder.
+ \return true if operation was successfully started.
+ 
+ Starts async move operation for given messages.  
+ Completion signalled with messagesMoved(int result).
+ */
+bool NmApiMessageManager::moveMessages(const QList<quint64> messageIds,
+									quint64 sourceFolderId,
+									quint64 targetFolderId)
+{    
+	return d->moveMessages(messageIds,sourceFolderId,targetFolderId);
+}
+
+/*!
+ \fn copyMessages 
+ \param messageIds Id list of source messages.
+ \param sourceFolder Id of the source folder.
+ \param targetFolder Id of the target folder.
+ \return true if operation was successfully started.
+ 
+ Starts async copy operation for given messages.  
+ Completion signalled with messagesCopied(int result).
+ */
+bool NmApiMessageManager::copyMessages(const QList<quint64> messageIds,								
+									quint64 sourceFolder,
+									quint64 targetFolder)
+{
+	return d->copyMessages(messageIds, sourceFolder, targetFolder);
+}
+    
+// signaled with messageSaved(quint64 messageId, int result)
+bool NmApiMessageManager::saveMessage(const NmApiMessage &message)
+{
+    Q_UNUSED(message);
+	return false;
+}
+    
+// deletes message
+// signaled with messagesDeleted(int result)
+bool NmApiMessageManager::deleteMessages(const QList<quint64> messageIds)
+{
+    Q_UNUSED(messageIds);
+	return false;
+}
+    
+    // starts fetching rest of message body from server
+    // signaled with messageFetched(quint64 messageId, int result)
+bool NmApiMessageManager::fetch(const NmApiMessage &message)
+{
+    Q_UNUSED(message);
+	return false;
+}
+    
+    // moves message to outbox. Actual sending time may be immediate or scheduled
+    // signaled with messageSent(quint64 messageId, int result)
+bool NmApiMessageManager::send(const NmApiMessage &message)
+{
+    Q_UNUSED(message);
+	return false;
+}
+
+// creates new attachment for a message. Currently attachment can be specified as file name (attachmentSpec is QString)
+// signaled with attachmentCreated(quint64 attachemntId)
+//  * 
+bool NmApiMessageManager::createAttachment(NmApiEmailMessage &message,
+										const QVariant &attachmenSpec)
+{
+    Q_UNUSED(message);
+    Q_UNUSED(attachmenSpec);
+    return false;
+}
+                                                      
+// removes attachment from a message
+// signaled with attachmentRemoved(int result)
+bool NmApiMessageManager::removeAttachment(NmApiEmailMessage &message,
+quint64 /*attachmentId*/)
+{    
+    Q_UNUSED(message);
+    return false;
+}
+ 
+} // namespace EmailClientApi
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/src/nmapimessagemanager_p.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,165 @@
+/*
+ * 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:
+ *     Email message related operations
+ */
+ 
+#include "nmapiheaders.h"
+
+
+namespace EmailClientApi
+{
+
+NmApiMessageManagerPrivate::NmApiMessageManagerPrivate(quint64 mailboxId,QObject *parent)
+: QObject(parent),
+  mState(NmApiMessageManagerPrivate::EIdle), mMailboxId(mailboxId)
+{
+    NM_FUNCTION;	
+	
+    mFactory = NmApiDataPluginFactory::instance();
+    mPlugin = mFactory->plugin();    
+    if(mPlugin) {
+        connect(mPlugin,
+                SIGNAL(messageEvent(NmMessageEvent,
+                                    const NmId&,
+                                    const QList<NmId>&,
+                                    const NmId&)),
+                this,
+                SLOT(messageEventHandler(NmMessageEvent,
+                                    const NmId&,
+                                    const QList<NmId>&,
+                                    const NmId&)));
+    }				
+    NmDataPluginInterface *interface = mFactory->interfaceInstance();
+    interface->subscribeMailboxEvents(mailboxId);
+	
+}
+
+NmApiMessageManagerPrivate::~NmApiMessageManagerPrivate()
+{
+    NM_FUNCTION;
+    NmDataPluginInterface *interface = mFactory->interfaceInstance();
+    interface->unsubscribeMailboxEvents(mMailboxId);
+    NmApiDataPluginFactory::releaseInstance(mFactory);
+}
+    
+/*!
+ \fn moveMessages 
+ \param messageIds Id list of source messages.
+ \param sourceFolderId Id of the source folder.
+ \param targetFolderId Id of the target folder.
+ \return true if operation was successfully started.
+ 
+ Starts async move operation for given messages.  
+ Completion signalled with messagesMoved(int result).
+ */
+bool NmApiMessageManagerPrivate::moveMessages(const QList<quint64> messageIds,
+											quint64 sourceFolder,
+											quint64 targetFolder)
+{
+    NM_FUNCTION;
+    Q_UNUSED(messageIds);
+    Q_UNUSED(sourceFolder);
+    Q_UNUSED(targetFolder);
+    return false;
+}
+    
+/*!
+ \fn copyMessages 
+ \param messageIds Id list of source messages.
+ \param sourceFolder Id of the source folder.
+ \param targetFolder Id of the target folder.
+ \return true if operation was successfully started.
+ 
+ Starts async copy operation for given messages.  
+ Completion signalled with messagesCopied(int result).
+ */
+bool NmApiMessageManagerPrivate::copyMessages(const QList<quint64> messageIds,
+                                            const quint64 sourceFolder,
+											const quint64 targetFolder)
+{
+    NM_FUNCTION;
+    bool ret = false;
+    NmId targetFolderNmId(targetFolder);
+	NmId sourceFolderNmId(sourceFolder);
+	mTarget = targetFolderNmId;
+	mMessages = messageIds;
+	
+	NmDataPluginInterface *interface = mFactory->interfaceInstance();
+	
+    if (interface) {
+        mState = NmApiMessageManagerPrivate::ECopyPending;
+        if (interface->copyMessages(mMailboxId,
+                                  messageIds,
+                                  sourceFolderNmId,
+                                  targetFolderNmId)==0) {			
+            ret = true;
+        }        
+    }
+	mState = NmApiMessageManagerPrivate::EIdle;
+	return ret;
+}
+  
+/*!
+ \fn messageEventHandler 
+ \param event Event type.
+ \param folder Folder id.
+ \param messages Id list of messages involved.
+ \param mailBox Id of mailbox.
+  
+ Handler for plugin originated messageEvent.
+ */
+void NmApiMessageManagerPrivate::messageEventHandler(NmMessageEvent event,
+												const NmId &folder,
+												const QList<NmId> &messages,
+												const NmId &mailBox)
+{	
+	if(mMailboxId == mailBox &&
+	   mTarget == folder) {	
+        switch(event)
+        {
+            case NmMessageCreated: {
+                if (mState==NmApiMessageManagerPrivate::ECopyPending) {
+                    if(messages.count()==mMessages.count()) {
+                        emit messagesCopied(0);
+                    }
+                    else {
+                        emit messagesCopied(-1);
+                    }
+                }
+                break;			
+            }
+            
+            case NmMessageChanged: {
+                break;		
+            }
+            
+            case NmMessageDeleted: {            
+                break;
+            }
+                
+            case NmMessageFound: {
+                break;
+            }
+            
+            default: {
+                break;
+            }
+        }
+        mState = NmApiMessageManagerPrivate::EIdle;
+	}
+}
+} //namespace
+
+
--- a/emailservices/nmclientapi/src/nmapimessagetask.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessagetask.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,9 +15,9 @@
  *
  */
 
-#include "emailtrace.h"
+#include "nmapiheaders.h"
 
-#include <nmapimessagetask.h>
+
 
 /*!
    Constructor for NmApiMessageTask
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/src/nmapipopimapsettingsmanager.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,126 @@
+/*
+* 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 "nmapiheaders.h"
+
+
+
+
+static const int DefaultPopPort = 110;
+static const int DefaultImapPort = 993;
+
+using namespace EmailClientApi;
+    
+NmApiPopImapSettingsManager::NmApiPopImapSettingsManager()
+{    
+}
+
+NmApiPopImapSettingsManager::~NmApiPopImapSettingsManager()
+{   
+}
+
+bool NmApiPopImapSettingsManager::populateDefaults(const QString &mailboxType, NmApiMailboxSettingsData &data)
+{
+    bool ret = false;
+    
+    QT_TRY {
+        if (mailboxType==NmApiMailboxTypePop) {
+            populatePopDefs(data);
+            ret = true;
+        }
+        else if (mailboxType==NmApiMailboxTypeImap) {
+            populateImapDefs(data);
+            ret = true;
+        }
+        else {
+            ret = false;
+        }
+    }
+    QT_CATCH(...){
+        ret = false;
+    }
+    
+    return ret;
+}
+
+void NmApiPopImapSettingsManager::populateImapDefs(NmApiMailboxSettingsData &data)
+{
+    QScopedPointer<CImImap4Settings> imapSettings(new CImImap4Settings());
+    
+    QScopedPointer<CImIAPPreferences> iapPref;
+    QT_TRAP_THROWING(iapPref.reset(CImIAPPreferences::NewLC());
+            CleanupStack::Pop(iapPref.data()));  
+        
+    QScopedPointer<CEmailAccounts> mailAccounts;
+    QT_TRAP_THROWING(mailAccounts.reset(CEmailAccounts::NewL()));
+        
+    QT_TRAP_THROWING( mailAccounts->PopulateDefaultImapSettingsL(*imapSettings,*iapPref));
+    
+    data.setValue(IncomingLoginName, 
+                           XQConversions::s60Desc8ToQString(imapSettings->LoginName()));
+
+    data.setValue(IncomingPassword, 
+                           XQConversions::s60Desc8ToQString(imapSettings->Password()));
+       
+    data.setValue(IncomingMailServer, 
+                           XQConversions::s60DescToQString(imapSettings->ServerAddress()));
+         
+   if (imapSettings->Port()) {
+       data.setValue(IncomingPort, imapSettings->Port());
+       }
+   else {
+       data.setValue(IncomingPort, DefaultImapPort);
+   }
+   
+   data.setValue(OutgoingSecureSockets, imapSettings->SecureSockets());
+   data.setValue(OutgoingSSLWrapper, imapSettings->SSLWrapper());  
+}
+
+void NmApiPopImapSettingsManager::populatePopDefs(NmApiMailboxSettingsData &data)
+{
+    QScopedPointer<CImPop3Settings> popSettings(new CImPop3Settings());
+   
+    QScopedPointer<CImIAPPreferences> iapPref;
+    QT_TRAP_THROWING(iapPref.reset(CImIAPPreferences::NewLC());
+        CleanupStack::Pop(iapPref.data()));
+ 
+    QScopedPointer<CEmailAccounts> mailAccounts;
+    QT_TRAP_THROWING(mailAccounts.reset(CEmailAccounts::NewL()));
+    
+    QT_TRAP_THROWING( mailAccounts->PopulateDefaultPopSettingsL(*popSettings,*iapPref));
+    
+    data.setValue(IncomingLoginName, 
+                        XQConversions::s60Desc8ToQString(popSettings->LoginName()));
+   
+    data.setValue(IncomingPassword, 
+                        XQConversions::s60Desc8ToQString(popSettings->Password()));
+     
+    data.setValue(IncomingMailServer, 
+                        XQConversions::s60DescToQString(popSettings->ServerAddress()));
+    
+    if (popSettings->Port()) {
+        data.setValue(IncomingPort, popSettings->Port());
+        }
+    else {
+        data.setValue(IncomingPort, DefaultPopPort);
+    }
+    
+    data.setValue(OutgoingSecureSockets, popSettings->SecureSockets());
+    data.setValue(OutgoingSSLWrapper, popSettings->SSLWrapper());
+}
+
+
--- a/emailservices/nmclientapi/src/nmapitypesconverter.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapitypesconverter.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,13 +15,7 @@
  *
  */
 
-#include "emailtrace.h"
-
-#include "nmapitypesconverter.h"
-
-#include <nmapicommonheader.h>
-
-#include <nmapiprivateheaders.h>
+#include "nmapiheaders.h"
 
 /*!
    converts nmmailbox to client api NmApiMailbox
--- a/emailservices/nmregister/src/nmmailboxregisterinterface.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmregister/src/nmmailboxregisterinterface.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -19,7 +19,7 @@
 
 #include <qservicemanager.h>
 #include <qserviceinterfacedescriptor.h>
-#include <HbIcon>
+#include <hbicon.h>
 #include <HbApplication>
 #include <QTranslator>
 #include "nmicons.h"
@@ -33,6 +33,7 @@
 //not mandatory 
 const QString hsItemWidgetUri("widget:uri");
 const QString hsItemDescription("item:description");
+const QString hsItemLocDescription("item:locdescription");
 //for icon - not mandatory 
 const QString hsIconFileName("icon:filename");//to display specific icon from file 
 const QString hsIconName("icon:name");// HbIcon 
@@ -198,7 +199,7 @@
     map[hsitemLaunchUri] = formLaunchUri(accountId);
     map[hsitemPublisherId] = NmPublisherName;
     map[hsItemWidgetUri] = NmHsWidget;
-    map[hsItemDescription] = hbTrId("txt_mail_widget_dblist_preview_of_recent_mail");
+    map[hsItemLocDescription] = "loc://" + KNmRegisterLocFileName + "/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);
--- a/emailservices/nmregister/translations/nmregister.ts	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailservices/nmregister/translations/nmregister.ts	Tue Jul 06 14:04:34 2010 +0300
@@ -3,23 +3,23 @@
 <TS version="3.0" sourcelanguage="en_GB">
 <context>
 <message numerus="no" id="txt_mail_widget_l_dblist_preview_of_recent_mail">
-    <comment>Custom layout ID parent (no children). Descriptive text of mail widget in application library, landscape</comment>        
+    <comment>Descriptive text of mail widget in application library, landscape</comment>        
     <source>Preview of recent mail</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_widget_l_dblist_preview_of_recent_mail</extra-loc-layout_id>    
+    <extra-loc-layout_id>qtl_list_sec2_large_graphic</extra-loc-layout_id>    
     <extra-loc-viewid>Mail Widget_L07</extra-loc-viewid>
     <extra-loc-positionid>dblist_1_val</extra-loc-positionid>
-    <extra-loc-feature>Mail Widget</extra-loc-feature>
+    <extra-loc-feature>Ma</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mail_widget_dblist_preview_of_recent_mail">
-    <comment>Custom layout ID parent (no children). Descriptive text of mail widget in application library, portrait</comment>        
+    <comment>Descriptive text of mail widget in application library, portrait</comment>        
     <source>Preview of recent mail</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>txt_mail_widget_dblist_preview_of_recent_mail</extra-loc-layout_id>    
+    <extra-loc-layout_id>qtl_list_sec_large_graphic</extra-loc-layout_id>    
     <extra-loc-viewid>Mail Widget_P07</extra-loc-viewid>
     <extra-loc-positionid>dblist_1_val</extra-loc-positionid>
-    <extra-loc-feature>Mail Widget</extra-loc-feature>
+    <extra-loc-feature>Ma</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 </context>
--- a/emailuis/nmailcpplugin/inc/nmsettingsplugin.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailcpplugin/inc/nmsettingsplugin.h	Tue Jul 06 14:04:34 2010 +0300
@@ -18,17 +18,17 @@
 #ifndef NMSETTINGSPLUGIN_H
 #define NMSETTINGSPLUGIN_H
 
-#include <cppluginplatinterface.h>
+#include <cpplugininterface.h>
 #include <qobject.h>
 
 class CpSettingFormItemData;
 class CpItemDataHelper;
 class QTranslator;
 
-class NmSettingsPlugin : public QObject, public CpPluginPlatInterface
+class NmSettingsPlugin : public QObject, public CpPluginInterface
     {
     Q_OBJECT
-    Q_INTERFACES(CpPluginPlatInterface)
+    Q_INTERFACES(CpPluginInterface)
 
 public:
 
@@ -36,7 +36,7 @@
 
     virtual ~NmSettingsPlugin();
 
-    virtual CpSettingFormItemData *createSettingFormItemData(
+    virtual QList<CpSettingFormItemData*> createSettingFormItemData(
         CpItemDataHelper &itemDataHelper) const;
 
 private:
--- a/emailuis/nmailcpplugin/src/nmsettingsplugin.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailcpplugin/src/nmsettingsplugin.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -27,7 +27,7 @@
 
 /*!
     \class NmSettingsPlugin
-    \brief The class implements CpPluginPlatInterface which is an interface
+    \brief The class implements CpPluginInterface which is an interface
            for plug-ins that are displayed in the control panel application.
            The class works as an entry point for NMail settings.
 
@@ -67,19 +67,20 @@
     \param itemDataHelper Helper class that helps control panel plug-ins to
            connect slots to inner widgets of the setting items.
 
-    \return Instance of CpSettingFormItemData.
-            Caller is the owner of the returned instance.
+    \return List of CpSettingFormItemData items.
 */
-CpSettingFormItemData *NmSettingsPlugin::createSettingFormItemData(
+QList<CpSettingFormItemData*> NmSettingsPlugin::createSettingFormItemData(
     CpItemDataHelper &itemDataHelper) const
 {
     NM_FUNCTION;
     
     HbIcon icon("qtg_large_email");
+    QList<CpSettingFormItemData*> list;
 
-    return new NmSettingsViewFactory(itemDataHelper,
-        hbTrId("txt_mail_title_control_panel"), "",
-        icon);
+    CpSettingFormItemData* viewFactory = new NmSettingsViewFactory(itemDataHelper,
+        hbTrId("txt_mail_title_control_panel"), "", icon);
+    list.append(viewFactory);
+    return list;
 }
 
 Q_EXPORT_PLUGIN2(nmsettingsplugin, NmSettingsPlugin);
--- a/emailuis/nmailui/conf/nmeditorview.docml	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/conf/nmeditorview.docml	Tue Jul 06 14:04:34 2010 +0300
@@ -4,138 +4,128 @@
         <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="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>
-                                <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
-                                    <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" 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="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>
-                                <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="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0un"/>
-                                    <linearitem itemname="editorCcLabel"/>
-                                    <linearitem itemname="editorCcEdit"/>
-                                    <linearitem itemname="editorCcButton"/>
-                                </layout>
-                            </widget>
-                            <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="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0un"/>
-                                    <linearitem itemname="editorBccLabel"/>
-                                    <linearitem itemname="editorBccEdit"/>
-                                    <linearitem itemname="editorBccButton"/>
-                                </layout>
-                            </widget>
-                            <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="editorSubjectEdit" plugin="nmailuiwidgetsplugin" type="NmHtmlLineEdit"/>
-                                <widget name="editPriorityIcon" 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>
-                                <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>
-                                <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
-                                    <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" 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">
-                            </widget>
-                            <widget name="BodyTextEditContainer" type="HbWidget">
-                                <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>
-                                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
-                                <layout type="anchor">
-                                    <anchoritem dst="BodyTextEdit" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
-                                    <anchoritem dst="BodyTextEdit" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
-                                    <anchoritem dst="BodyTextEdit" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
-                                    <anchoritem dst="BodyTextEdit" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
-                                </layout>
-                            </widget>
-                            <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
-                                <!-- Widget may have different left and right margins so they are not defined here -->
-                                <contentsmargins bottom="0un" left="0un" right="0un" top="var(hb-param-margin-gene-top)"/>
-                                <linearitem itemname="editorToField"/>
-                                <linearitem itemname="editorCcField"/>
-                                <linearitem itemname="editorBccField"/>
-                                <linearitem itemname="editorSubjectField"/>
-                                <linearitem itemname="attachmentListWidget"/>
-                                <linearitem itemname="BodyTextEditContainer"/>
-                            </layout>
+                    <widget name="editorToField" type="HbWidget">
+                        <widget name="editorToLabel" type="HbLabel">
+                            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                            <sizehint height="7.5un" 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.5un" type="FIXED" width="9.5un"/>
+                        </widget>
+                        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                        <sizehint type="PREFERRED" width="expr(var(hb-param-screen-width) )"/>
+                        <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
+                            <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" 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="7.5un" 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>
+                        <widget name="editorCcEdit" plugin="nmailuiwidgetsplugin" type="NmRecipientLineEdit"/>
+                        <widget name="editorCcButton" type="HbPushButton">
+                            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                            <sizehint height="7.5un" type="FIXED" width="9.5un"/>
+                        </widget>
+                        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                        <sizehint type="PREFERRED" width="expr(var(hb-param-screen-width) )"/>
+                        <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
+                            <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0un"/>
+                            <linearitem itemname="editorCcLabel"/>
+                            <linearitem itemname="editorCcEdit"/>
+                            <linearitem itemname="editorCcButton"/>
+                        </layout>
+                    </widget>
+                    <widget name="editorBccField" type="HbWidget">
+                        <widget name="editorBccLabel" type="HbLabel">
+                            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                            <sizehint height="7.5un" 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.5un" type="FIXED" width="9.5un"/>
+                        </widget>
+                        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                        <sizehint type="PREFERRED" width="expr(var(hb-param-screen-width) )"/>
+                        <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
+                            <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" top="0un"/>
+                            <linearitem itemname="editorBccLabel"/>
+                            <linearitem itemname="editorBccEdit"/>
+                            <linearitem itemname="editorBccButton"/>
+                        </layout>
+                    </widget>
+                    <widget name="editorSubjectField" type="HbWidget">
+                        <widget name="editorSubjectLabel" type="HbLabel">
+                            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                            <sizehint height="7.5un" 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="editorSubjectEdit" plugin="nmailuiwidgetsplugin" type="NmHtmlLineEdit"/>
+                        <widget name="editPriorityIcon" 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>
+                        <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>
+                        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                        <sizehint type="PREFERRED" width="expr(var(hb-param-screen-width) )"/>
+                        <layout orientation="Horizontal" spacing="var(hb-param-margin-gene-middle-horizontal)" type="linear">
+                            <contentsmargins bottom="0un" left="var(hb-param-margin-gene-left)" right="var(hb-param-margin-gene-right)" 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="Fixed" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                        <sizehint type="PREFERRED" width="expr(var(hb-param-screen-width) )"/>
+                    </widget>
+                    <widget name="BodyTextEditContainer" type="HbWidget">
+                        <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="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="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"/>
+                            <anchoritem dst="BodyTextEdit" dstEdge="LEFT" spacing="var(hb-param-margin-gene-left)" src="" srcEdge="LEFT"/>
+                            <anchoritem dst="BodyTextEdit" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                            <anchoritem dst="BodyTextEdit" dstEdge="RIGHT" spacing="-var(hb-param-margin-gene-right)" src="" srcEdge="RIGHT"/>
+                            <anchoritem dst="BodyTextEdit" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
                         </layout>
                     </widget>
                     <real name="z" value="0"/>
-                    <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
-                    <sizehint height="88un" type="PREFERRED" width="54un"/>
-                    <layout type="anchor">
-                        <anchoritem dst="container" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
-                        <anchoritem dst="container" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
-                        <anchoritem dst="container" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
-                        <anchoritem dst="container" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+                    <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
+                    <layout orientation="Vertical" spacing="var(hb-param-margin-gene-middle-vertical)" type="linear">
+                        <contentsmargins bottom="0un" left="0un" right="0un" top="var(hb-param-margin-gene-top)"/>
+                        <linearitem itemname="editorToField"/>
+                        <linearitem itemname="editorCcField"/>
+                        <linearitem itemname="editorBccField"/>
+                        <linearitem itemname="editorSubjectField"/>
+                        <linearitem itemname="attachmentListWidget"/>
+                        <linearitem itemname="BodyTextEditContainer"/>
                     </layout>
                 </widget>
             </widget>
--- a/emailuis/nmailui/conf/nmmailboxlistview.docml	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/conf/nmmailboxlistview.docml	Tue Jul 06 14:04:34 2010 +0300
@@ -3,8 +3,6 @@
     <widget name="NmMailboxListView" type="HbView">
         <widget name="content" role="HbView:widget" type="HbWidget">
             <widget name="MailboxListWidget" type="HbListView">
-                <real name="z" value="0.0001"/>
-                <sizehint height="85.67164un" type="PREFERRED" width="53.73134un"/>
             </widget>
             <layout type="anchor">
                 <anchoritem dst="MailboxListWidget" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
--- a/emailuis/nmailui/conf/nmmessagelistview.docml	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/conf/nmmessagelistview.docml	Tue Jul 06 14:04:34 2010 +0300
@@ -3,29 +3,17 @@
     <widget name="NmMessageListView" type="HbView">
         <widget name="content" role="HbView:widget" type="HbWidget">
             <widget name="MessageTreeList" type="HbTreeView">
-                <real name="z" value="1"/>
-                <sizehint height="76.71642un" type="PREFERRED" width="53.73134un"/>
                 <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
             </widget>
             <widget name="MessageListNoMessages" type="HbLabel">
                 <enums name="alignment" value="AlignLeft|AlignVCenter|AlignHCenter|AlignLeading"/>
-                <real name="z" value="2"/>
-                <sizehint height="4.47761un" type="PREFERRED" width="28.65672un"/>
                 <string locid="txt_mail_dblist_no_messages" name="plainText"/>
                 <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
             </widget>
             <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="syncIcon" type="HbLabel">
-                <enums name="alignment" value="AlignAbsolute|AlignLeft|AlignVCenter|AlignJustify|AlignHCenter|AlignLeading"/>
-                <real name="z" value="7"/>
-                <sizepolicy horizontalPolicy="Preferred" horizontalStretch="0" verticalPolicy="Preferred" verticalStretch="0"/>
-                <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) )"/>
+                <bool name="enabled" value="FALSE"/>
             </widget>
             <real name="z" value="0"/>
             <layout type="anchor">
@@ -39,9 +27,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="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"/>
             </layout>
         </widget>
         <string name="title" value="View"/>
--- a/emailuis/nmailui/conf/nmmessagesearchlistview.docml	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/conf/nmmessagesearchlistview.docml	Tue Jul 06 14:04:34 2010 +0300
@@ -1,55 +1,46 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <hbdocument version="1.1">
-    <widget name="NmMessageListView" type="HbView">
+    <widget name="NmMessageSearchListView" 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 name="LineEdit" type="HbLineEdit">
+                <fontspec name="fontSpec" role="Primary" textheight="26.8"/>
+                <sizehint height="8un" type="PREFERRED"/>
             </widget>
-            <widget name="SearchBarContainer" type="HbWidget">
-                <widget name="LineEdit" type="HbLineEdit">
-                    <fontspec name="fontSpec" role="Primary" textheight="26.8"/>
-                </widget>
-                <widget name="PushButton" type="HbPushButton">
-                    <sizehint type="MINIMUM" width="9un"/>
-                </widget>
-                <real name="z" value="8"/>
-                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
-                <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 name="PushButton" type="HbPushButton">
+                <sizehint height="8un" type="PREFERRED" width="9un"/>
+                <sizehint type="MAXIMUM" width="9un"/>
             </widget>
             <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"/>
+                <bool name="enabled" 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. "/>
+                <string locid="txt_mail_dblist_no_messages_matched_your_search" name="plainText"/>
+                <fontspec name="fontSpec" role="Primary" textheight="var(hb-param-text-height-primary)"/>
+            </widget>
+            <widget name="MessageTreeList" type="HbTreeView">
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
             </widget>
             <real name="z" value="0"/>
             <layout type="anchor">
-                <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="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="MessageTreeList" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
                 <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="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"/>
+                <anchoritem dst="LabelGroupBox" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="LabelGroupBox" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-middle-vertical) )" src="LineEdit" srcEdge="BOTTOM"/>
+                <anchoritem dst="LabelGroupBox" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="LineEdit" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-left) )" src="" srcEdge="LEFT"/>
+                <anchoritem dst="LineEdit" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-middle-vertical) )" src="" srcEdge="TOP"/>
+                <anchoritem dst="LineEdit" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-middle-horizontal) )" src="PushButton" srcEdge="LEFT"/>
+                <anchoritem dst="PushButton" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-middle-vertical) )" src="" srcEdge="TOP"/>
+                <anchoritem dst="PushButton" dstEdge="RIGHT" spacing="expr(-var(hb-param-margin-gene-right) )" src="" srcEdge="RIGHT"/>
             </layout>
         </widget>
         <string name="title" value="Search"/>
--- a/emailuis/nmailui/inc/nmaction.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmaction.h	Tue Jul 06 14:04:34 2010 +0300
@@ -40,7 +40,7 @@
     };
     
     inline NmAction(int priorityIndex);
-    inline void setPriorityIndex(int priorityIndex);
+    inline void setPriorityIndex(const int priorityIndex);
     inline int priorityIndex() const;
     inline void setAvailabilityCondition(NmAvailabilityCondition condition);
     inline NmAvailabilityCondition availabilityCondition() const;
--- a/emailuis/nmailui/inc/nmactionrequest.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmactionrequest.h	Tue Jul 06 14:04:34 2010 +0300
@@ -45,8 +45,6 @@
 	NmActionContextViewMessageSearchList,
 	NmActionContextViewViewer,
 	NmActionContextViewEditor
-    // Add more view id's when
-    // funtionality is added
 };
 
 /*!
@@ -58,9 +56,7 @@
 	NmActionContextDataNone=0,
 	NmActionContextDataMailbox,
 	NmActionContextDataFolder,
-	NmActionContextDataMessage,
-    //Add more context menu types
-    //when functionality is added
+	NmActionContextDataMessage
 };
 
 
@@ -77,7 +73,7 @@
 class NmActionRequest
 {
 public:
-    inline NmActionRequest(NmActionObserver* observer,
+    inline NmActionRequest(NmActionObserver *observer,
 		NmActionContextMenuType menuType=NmActionOptionsMenu,
 		NmActionContextView contextView=NmActionContextViewNone,
 		NmActionContextDataType contextDataType=NmActionContextDataNone,
@@ -95,7 +91,7 @@
     mMessageId(messageId),
     mRequestData(requestData){};
 
-    inline NmActionObserver* observer() const {return mObserver;}
+    inline NmActionObserver *observer() const {return mObserver;}
     inline NmActionContextMenuType menuType() const {return mMenuType;}
     inline NmActionContextView contextView() const {return mContextView;}
     inline NmActionContextDataType contextDataType() const {return mContextDataType;}
--- a/emailuis/nmailui/inc/nmapplication.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmapplication.h	Tue Jul 06 14:04:34 2010 +0300
@@ -44,7 +44,7 @@
 {
     Q_OBJECT
 public:
-    NmApplication(QObject *parent);
+    NmApplication(QObject *parent, quint32 accountId=0);
     ~NmApplication();
     void enterNmUiView(NmUiStartParam *startParam);
     HbMainWindow* mainWindow();
@@ -61,7 +61,7 @@
     void delayedExitApplication();
     void handleOperationCompleted(const NmOperationCompletionEvent &event);
     void viewReady();
-    void launchSettings(HbAction* action);
+    void launchSettings(HbAction *action);
     
 private:
     void createMainWindow();
@@ -69,10 +69,10 @@
     void resetViewStack();
 
 private:
-    HbMainWindow *mMainWindow;              // Not owned
+    HbMainWindow *mMainWindow;              // Owned
     QStack<NmBaseView*> *mViewStack;        // Owned
     NmUiViewId mActiveViewId;
-    NmUiEngine *mUiEngine;                  // Owned
+    NmUiEngine *mUiEngine;                  // Not owned, singleton instance
     HbAction *mBackAction;                  // Owned
     NmUiExtensionManager *mExtensionManager;// Owned
     NmSendServiceInterface *mSendServiceInterface;       // Owned
@@ -90,6 +90,7 @@
     bool mViewReady;
     NmId mLastOperationMailbox;
     HbMessageBox *mQueryDialog;             // Owned
+    bool mBackButtonPressed;
 };
 
 #endif // NMAPPLICATION_H
--- a/emailuis/nmailui/inc/nmattachmentmanager.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmattachmentmanager.h	Tue Jul 06 14:04:34 2010 +0300
@@ -59,7 +59,7 @@
     void changeProgress(int value);
     void completeAttachmentFetch(int result);
     void completeMessageFetch(int result);
-    
+
 private:
     NmUiEngine &mUiEngine;
     QPointer<NmOperation> mFetchOperation;      // Not owned
--- a/emailuis/nmailui/inc/nmattachmentpicker.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmattachmentpicker.h	Tue Jul 06 14:04:34 2010 +0300
@@ -31,7 +31,7 @@
     Q_OBJECT
 
 public:
-    NmAttachmentPicker(QObject* parent = 0);
+    NmAttachmentPicker(QObject *parent = 0);
     ~NmAttachmentPicker();
         
 public slots:
@@ -43,12 +43,12 @@
     void fetchCameraVideo();
 
 signals:
-    void attachmentsFetchOk(const QVariant& fileNames);
-    void attachmentsFetchError(int errorCode, const QString& errorMessage);
+    void attachmentsFetchOk(const QVariant &fileNames);
+    void attachmentsFetchError(int errorCode, const QString &errorMessage);
     
 private:   
-    void fetch(const QString& interface, const QString& operation, 
-        const QList<QVariant>* args = 0); 
+    void fetch(const QString &interface, const QString &operation, 
+                const QList<QVariant> *args = 0); 
     void fetchFromCamera(int mode);
     
 private:
--- a/emailuis/nmailui/inc/nmbaseview.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmbaseview.h	Tue Jul 06 14:04:34 2010 +0300
@@ -34,11 +34,11 @@
 {
 	Q_OBJECT
 public:
-    NmBaseView(NmUiStartParam* startParam,
+    NmBaseView(NmUiStartParam *startParam,
                NmApplication &application,
                QGraphicsItem *parent = 0);
     virtual ~NmBaseView();
-    virtual void reloadViewContents(NmUiStartParam* startParam) = 0;
+    virtual void reloadViewContents(NmUiStartParam *startParam) = 0;
     virtual NmUiViewId nmailViewId() const = 0;
     virtual void okToExitView();
     virtual void aboutToExitView();
--- a/emailuis/nmailui/inc/nmeditorcontent.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmeditorcontent.h	Tue Jul 06 14:04:34 2010 +0300
@@ -21,52 +21,60 @@
 #include <hbwidget.h>
 #include "nmuiviewids.h"
 
-enum MessageBodyType { PlainText, HTMLText };
-
 class HbAnchorLayout;
 class HbTextEdit;
 class HbDocumentLoader;
 class NmBaseViewScrollArea;
-class NmEditorView;
 class NmMessage;
 class NmMessageEnvelope;
 class NmEditorHeader;
 class NmEditorTextEdit;
 class QNetworkAccessManager;
+class NmApplication;
 
-class NmEditorContent : public HbWidget
+class NmEditorContent : public QObject
 {
 Q_OBJECT
 
 public:
-    NmEditorContent(QGraphicsItem *parent,
-                    NmEditorView *parentView,
+    NmEditorContent(QObject *parent,
                     HbDocumentLoader *documentLoader,
-                    QNetworkAccessManager &manager);
+                    QNetworkAccessManager &manager,
+                    NmApplication &application);
+
     virtual ~NmEditorContent();
 
     void setMessageData(const NmMessage &originalMessage,
-                        bool createReplyHeader = true);
+                        NmUiEditorStartMode &editorStartMode);
+
     NmEditorTextEdit* editor() const;
+
     NmEditorHeader* header() const;
-
+    
 private:
     void createConnections();
+    void removeEmbeddedImages(QString &bodyContent);
 
 signals:
     void setPlainText(const QString&);
+
     void setHtml(const QString&);
 
 public slots:
     void setEditorContentHeight();
+    void ensureCursorVisibility();
+
+private:
+    enum MessageBodyType { NmPlainText, NmHTMLText };
 
 private:
-    NmEditorHeader *mHeaderWidget;   // Owned
-    NmEditorView *mParentView;       // Not owned
-    HbAnchorLayout *mEditorLayout;   // Not owned
+    NmEditorHeader *mHeader; // Not owned
     MessageBodyType mMessageBodyType;
     NmEditorTextEdit *mEditorWidget; // Not owned
-    NmBaseViewScrollArea *mBackgroundScrollArea;
+    NmBaseViewScrollArea *mScrollArea; // Not owned
+    HbWidget *mScrollAreaContents; // Not owned
+    QPointF mScrollPosition;
+    NmApplication &mApplication;
 };
 
 #endif /* NMEDITORCONTENT_H_ */
--- a/emailuis/nmailui/inc/nmeditorheader.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmeditorheader.h	Tue Jul 06 14:04:34 2010 +0300
@@ -20,15 +20,6 @@
 
 #include <hbwidget.h>
 #include "nmactionresponse.h"
-// Header widget fields
-enum
-{
-    EEditorToLine=0,
-    EEditorCcLine,
-    EEditorBccLine,
-    EEditorSubjectLine,
-    EEditorAttachmentLine
-};
 
 class HbGroupBox;
 class HbLabel;
@@ -37,20 +28,20 @@
 class NmRecipientLineEdit;
 class QGraphicsLinearLayout;
 class NmRecipientField;
-class NmAttachmentList;
+class NmAttachmentList; 
 
 class NmEditorHeader : public QObject
 {
 Q_OBJECT
 
 public:
-    NmEditorHeader(HbDocumentLoader *documentLoader);
+    NmEditorHeader(QObject *parent, HbDocumentLoader *documentLoader);
     virtual ~NmEditorHeader();
     qreal headerHeight() const;
-    NmHtmlLineEdit* subjectEdit() const;
-    NmRecipientLineEdit* toEdit() const;
-    NmRecipientLineEdit* ccEdit() const;
-    NmRecipientLineEdit* bccEdit() const;
+    NmHtmlLineEdit *subjectEdit() const;
+    NmRecipientLineEdit *toEdit() const;
+    NmRecipientLineEdit *ccEdit() const;
+    NmRecipientLineEdit *bccEdit() const;
     void setPriority(NmMessagePriority priority=NmMessagePriorityNormal);
     void setPriority(NmActionResponseCommand prio=NmActionResponseCommandNone);
     void addAttachment(const QString &fileName, const QString &fileSize, const NmId &nmid);
--- a/emailuis/nmailui/inc/nmeditorview.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmeditorview.h	Tue Jul 06 14:04:34 2010 +0300
@@ -25,7 +25,6 @@
 #include "nmactionresponse.h"
 #include "nmattachmentfetchobserver.h"
 
-class QGraphicsLinearLayout;
 class HbTextEdit;
 class HbDocumentLoader;
 class HbProgressDialog;
@@ -45,7 +44,7 @@
 class NmAttachmentPicker;
 class HbMessageBox;
 class NmAttachmentManager;
-
+class HbVkbHost;
 
 class NmEditorView : public NmBaseView,
                      public NmActionObserver,
@@ -54,9 +53,8 @@
     Q_OBJECT
 
 public:
-
     NmEditorView(NmApplication &application,
-                 NmUiStartParam* startParam,
+                 NmUiStartParam *startParam,
                  NmUiEngine &uiEngine,
                  NmAttachmentManager &attaManager,
                  QGraphicsItem *parent = 0);
@@ -64,39 +62,33 @@
 
 
 public:
-
     void reloadViewContents(NmUiStartParam* startParam);
     NmUiViewId nmailViewId() const;
     HbWidget* scrollAreaContents();
     void okToExitView();
     void aboutToExitView();
     void viewReady();
-
+    void handleActionCommand(NmActionResponse &menuResponse);
+    void progressChanged(int value);
+    void fetchCompleted(int result);
+    
 public slots:
-
     void orientationChanged(Qt::Orientation orientation);
     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);
+    void sendProgressDialogCancelled();
+    
+protected:
+    void resizeEvent(QGraphicsSceneResizeEvent *event);
 
 private slots:
-
     void messageCreated(int result);
-    void adjustViewDimensions();
     void oneAttachmentAdded(const QString &fileName,
                             const NmId &msgPartId,
                             int result);
-
     void allAttachmentsAdded(int result);
     void attachmentRemoved(int result);
     void removeAttachmentTriggered();
@@ -106,9 +98,10 @@
     void onAttachmentsFetchError(int errorCode, const QString& errorMessage);
     void switchCcBccFieldVisibility();
 	void fetchProgressDialogCancelled();
+	void vkbOpened();
+	void vkbClosed();
 
 private:
-
     void loadViewLayout();
     void setMailboxName();
     void fetchProgressDialogShow();
@@ -126,33 +119,27 @@
     QString addressListToString(const QList<NmAddress*> &list) const;
     QString addressListToString(const QList<NmAddress> &list) const;
     void enableToolBarAttach(bool enable);
-
-public slots:
+    void showChrome(bool show);
 
-    void sendProgressDialogCancelled();
-
+signals:
+    void sizeChanged();
+    
 private: // Data
-
     NmApplication &mApplication;
     NmUiEngine &mUiEngine;
     NmAttachmentManager  &mAttaManager;
     HbDocumentLoader *mDocumentLoader;  // Owned
     QObjectList mWidgetList;            // Owned
-    NmBaseViewScrollArea *mScrollArea;  // Not owned
-    HbWidget *mScrollAreaContents;      // Not owned
-    NmEditorTextEdit *mEditWidget;      // Not owned
     NmEditorHeader *mHeaderWidget;      // Not owned
     NmMessage *mMessage;                // Owned
-    QGraphicsLinearLayout *mLayout;
-    NmEditorContent *mContentWidget;    // Owned
+    NmEditorContent *mContent;          // Not owned
     HbMenu *mPrioritySubMenu;           // Owned
     HbMenu *mAttachmentListContextMenu; // Owned
     NmId mSelectedAttachment;
-
+    HbVkbHost *mVkbHost;                // Not owned
     QPointer<NmMessageCreationOperation> mMessageCreationOperation;  // Not owned
     QPointer<NmAddAttachmentsOperation> mAddAttachmentOperation;     // Not owned 
     QPointer<NmOperation> mRemoveAttachmentOperation;                // Not owned 
-
     HbProgressDialog *mWaitDialog;         // Owned.    
     HbMessageBox* mQueryDialog;            // Owned
     NmAttachmentPicker* mAttachmentPicker; // Owned    
--- a/emailuis/nmailui/inc/nmmailboxlistview.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmmailboxlistview.h	Tue Jul 06 14:04:34 2010 +0300
@@ -33,7 +33,7 @@
 class HbAbstractViewItem;
 class NmAction;
 
-class NmMailboxListView : public NmBaseView, public NmActionObserver
+class NmMailboxListView : public NmBaseView
 {
     Q_OBJECT
 public:
@@ -49,9 +49,6 @@
     NmUiViewId nmailViewId() const;
     void viewReady();
 
-public: // From NmActionObserver
-    void handleActionCommand(NmActionResponse &menuResponse);
-
 public slots:
     void itemActivated(const QModelIndex &index);
     void openSelectedMailBox();
--- a/emailuis/nmailui/inc/nmmailboxlistviewitem.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmmailboxlistviewitem.h	Tue Jul 06 14:04:34 2010 +0300
@@ -33,7 +33,6 @@
     HbListViewItem *createItem();
     void updateChildItems();
     bool canSetModelIndex(const QModelIndex &index);
-    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
 
 protected:
     void polishEvent();
--- a/emailuis/nmailui/inc/nmmessagelistview.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmmessagelistview.h	Tue Jul 06 14:04:34 2010 +0300
@@ -72,7 +72,6 @@
     void showNoMessagesText();
     void hideNoMessagesText();
     void handleSyncStateEvent(NmSyncState syncState, const NmId & mailboxId);
-    void handleConnectionEvent(NmConnectState connectState, const NmId &mailboxId);
     void folderSelected();
     
 private:
@@ -102,6 +101,7 @@
     NmId mSelectedFolderId;
     NmId mSelectedMailboxId;
     int mPreviousModelCount;
+    bool mIsFirstSyncInMessageList;
 };
 
 #endif /* NMMESSAGELISTVIEW_H_ */
--- a/emailuis/nmailui/inc/nmmessagelistviewitem.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmmessagelistviewitem.h	Tue Jul 06 14:04:34 2010 +0300
@@ -23,10 +23,6 @@
 class HbLabel;
 class HbTextItem;
 class HbFrameItem;
-class QStyleOptionGraphicsItem;
-class QGraphicsLayoutItem;
-class HbWidgetBase;
-class HbStyleOptionAbstractViewItem;
 class NmMessageListModel;
 class NmMessageListModelItem;
 class NmMessageEnvelope;
@@ -43,7 +39,6 @@
     void updateChildItems();
     HbTreeViewItem *createItem();
     bool canSetModelIndex(const QModelIndex &index) const;
-    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
     QRectF contiguousSelectionArea() const { return QRectF(); };
 
 private:
@@ -51,7 +46,7 @@
     void setContentsToMessageItem(const NmMessageEnvelope &envelope, bool dividersActive);
     void setFontsRead();
     void setFontsUnread();
-    void setFonts(const QColor &colorRole, HbFontSpec &spekki);
+    void setFonts(const QColor &colorRole, HbFontSpec &fontSpec);
     void getFontSizes();    
     QString senderFieldText(const NmMessageEnvelope &envelope);
 
--- a/emailuis/nmailui/inc/nmrecipientfield.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmrecipientfield.h	Tue Jul 06 14:04:34 2010 +0300
@@ -49,9 +49,7 @@
 
 public slots:
     void setText(const QString &text);
-#ifdef Q_OS_SYMBIAN
     void launchContactsPicker();
-#endif
 
 private:
     HbDocumentLoader &mDocumentLoader;
--- a/emailuis/nmailui/inc/nmsendserviceinterface.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmsendserviceinterface.h	Tue Jul 06 14:04:34 2010 +0300
@@ -23,11 +23,7 @@
 #include <QObject>
 #include <QVariant>
 
-#ifdef Q_OS_SYMBIAN
 #include <xqserviceprovider.h>
-#else
-#define NM_WINS_ENV
-#endif
 
 //  FORWARD DECLARATIONS
 class NmDataManager;
@@ -41,11 +37,7 @@
 
 
 class NmSendServiceInterface
-#ifndef NM_WINS_ENV
     : public XQServiceProvider
-#else
-    : public QObject
-#endif
 {
     Q_OBJECT
 
@@ -69,11 +61,11 @@
 
 private: // Data
 
-    NmApplication *mApplication; // Not owned
+    NmApplication *mApplication;    // Not owned
     NmUiEngine &mUiEngine;
     int mAsyncReqId;
-    NmUiStartParam *mStartParam;
-    NmMailboxSelectionDialog *mSelectionDialog;
+    NmUiStartParam *mStartParam;    // Owned
+    NmMailboxSelectionDialog *mSelectionDialog; // Owned
     HbView *mCurrentView;
 };
 
--- a/emailuis/nmailui/inc/nmuidocumentloader.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmuidocumentloader.h	Tue Jul 06 14:04:34 2010 +0300
@@ -28,9 +28,9 @@
 {
 public:
     NmUiDocumentLoader(const HbMainWindow *window);
-    virtual ~NmUiDocumentLoader();
+    ~NmUiDocumentLoader();
 protected:
-    virtual QObject *createObject(const QString& type, const QString &name);
+    QObject *createObject(const QString& type, const QString &name);
 
 };
 
--- a/emailuis/nmailui/inc/nmuiheaders.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmuiheaders.h	Tue Jul 06 14:04:34 2010 +0300
@@ -42,6 +42,7 @@
 #include <QNetworkDiskCache>
 #include <QWebSettings>
 #include <QPointer>
+#include <QTapGesture>
 #include <QPinchGesture>
 #include <QInputContext>
 
@@ -87,8 +88,11 @@
 #include <hbeffect.h>
 #include <hbmodeliterator.h>
 #include <hbscrollarea.h>
+#include <hbinputvkbhost.h>
+#include <hbindicator.h>
+#include <hbformatdialog.h>
+#include <hbshrinkingvkbhost.h>
 
-#ifdef Q_OS_SYMBIAN
 #include <cntservicescontact.h>
 #include <xqservicerequest.h>
 #include <qtcontacts.h>
@@ -97,7 +101,8 @@
 #include <xqappmgr.h>
 #include <xqserviceipcmarshal.h>
 #include <xqsharablefile.h>
-#endif
+#include <fmfiledialog.h>
+#include <xqaiwdecl.h>
 
 #include <nmcommon.h>
 
@@ -117,6 +122,9 @@
 #include <emailmailboxinfo.h>
 #include <email_services_api.h>
 
+// other
+#include <math.h>
+
 // nmailui
 #include "nmhtmllineedit.h"
 #include "nmaction.h"
--- a/emailuis/nmailui/inc/nmuriserviceinterface.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmuriserviceinterface.h	Tue Jul 06 14:04:34 2010 +0300
@@ -22,57 +22,39 @@
 //  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
+class NmUriServiceInterface : public XQServiceProvider
 {
     Q_OBJECT
-
 public:
-
-    NmUriServiceInterface( QObject *parent,
-                           NmUiEngine &mailboxListModel,
-                           NmApplication* application);
+    NmUriServiceInterface(QObject *parent,
+                          NmUiEngine &uiEngine,
+                          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
+    NmApplication *mApplication;                // Not owned
     NmUiEngine &mUiEngine;
     int mAsyncReqId;
-    NmUiStartParam *mStartParam;
-    NmMailboxSelectionDialog *mSelectionDialog;
+    NmUiStartParam *mStartParam;                // Owned
+    NmMailboxSelectionDialog *mSelectionDialog; //Owned
     HbView *mCurrentView;
 };
 
--- a/emailuis/nmailui/inc/nmutilities.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmutilities.h	Tue Jul 06 14:04:34 2010 +0300
@@ -23,10 +23,7 @@
 class NmMessage;
 class NmMessageEnvelope;
 class NmAddress;
-class NmOperationCompletionEvent;
-class QFile;
 class XQSharableFile;
-class NmOperationCompletionEvent;
 class HbMessageBox;
 
 /*!
@@ -37,39 +34,28 @@
     Q_OBJECT
 public:
     enum NmAddressValidationType {
-        ValidAddress,
-        InvalidAddress,
-        Default
+        NmValidAddress,
+        NmInvalidAddress,
+        NmDefault
     };
-    
     static void getRecipientsFromMessage( const NmMessage &message, 
         QList<NmAddress> &recipients,
-        NmAddressValidationType type = Default );
-    
+        NmAddressValidationType type = NmDefault );
     static bool isValidEmailAddress( const QString &emailAddress );
-    
     static QString addressToDisplayName( const NmAddress &address );
-    
     static bool parseEmailAddress( const QString &emailAddress, NmAddress &address );
-    
     static QString cleanupDisplayName( const QString &displayName );     
-
-    static int openFile(XQSharableFile &file);
-    
+    static int openFile(XQSharableFile &file); 
     static QString truncate( const QString &string, int length );
-
     static QString attachmentSizeString(const int sizeInBytes);
-
     static void displayErrorNote(QString noteText); 
-
-    static HbMessageBox* displayQuestionNote(QString noteText,
-                                             QObject* receiver = 0,
-                                             const char* member = 0);
-    
-    static HbMessageBox* displayWarningNote(QString noteText,
-                                            QObject* receiver = 0,
-                                            const char* member = 0);
-
+    static HbMessageBox *displayQuestionNote(QString noteText,
+                                             QObject *receiver = 0,
+                                             const char *member = 0);
+   
+    static HbMessageBox *displayWarningNote(QString noteText,
+                                            QObject *receiver = 0,
+                                            const char *member = 0);
     static QString createReplyHeader(const NmMessageEnvelope &env);
 };
 
--- a/emailuis/nmailui/inc/nmviewerheader.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmviewerheader.h	Tue Jul 06 14:04:34 2010 +0300
@@ -11,7 +11,7 @@
 *
 * Contributors:
 *
-* Description:
+* Description: NMail viewer view header widget definition
 *
 */
 
@@ -54,7 +54,7 @@
     QString formatRecipientList(const QString &sender,
                                 const QList<NmAddress> &to,
                                 const QList<NmAddress> &cc);
-    QString addressToDisplayInHtml(const NmAddress &addr);
+    QString addressToDisplay(const NmAddress &addr);
     
 private:
     NmMessage *mMessage;                 // Not owned
--- a/emailuis/nmailui/inc/nmviewerserviceinterface.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmviewerserviceinterface.h	Tue Jul 06 14:04:34 2010 +0300
@@ -21,44 +21,27 @@
 
 //  INCLUDES
 #include <QObject>
-#ifdef Q_OS_SYMBIAN
 #include <xqserviceprovider.h>
-#else
-#define NM_WINS_ENV
-#include <QVariant>
-#endif
-
 
 //  FORWARD DECLARATIONS
-class HbView;
 class NmApplication;
 class NmUiEngine;
 class NmId;
 
-#ifndef NM_WINS_ENV
 class NmViewerServiceInterface : public XQServiceProvider
-#else
-class NmViewerServiceInterface : public QObject
-#endif
 {
     Q_OBJECT
-
 public:
-
     NmViewerServiceInterface(QObject *parent,
                               NmApplication *application,
                               NmUiEngine &uiEngine);
-
     ~NmViewerServiceInterface();
 
 
 public slots:
-
     void viewMessage(QVariant mailboxId, QVariant folderId, QVariant messageId);
 
-
 private:
-
     NmApplication *mApplication; // Not owned
     NmUiEngine &mUiEngine;
     int mAsyncReqId;
--- a/emailuis/nmailui/inc/nmviewerview.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmviewerview.h	Tue Jul 06 14:04:34 2010 +0300
@@ -24,7 +24,6 @@
 #include "nmactionobserver.h"
 #include "nmattachmentfetchobserver.h"
 
-class QGraphicsLinearLayout;
 class QWebPage;
 
 class HbWidget;
@@ -45,6 +44,7 @@
 class NmAttachmentListWidget;
 class NmAttachmentManager;
 class HbMessageBox;
+class NmMessagePart;
 
 class NmViewerView : public NmBaseView, public NmActionObserver, public NmAttachmentFetchObserver
 {
@@ -55,8 +55,8 @@
 				NmUiStartParam* startParam,
 				NmUiEngine &uiEngine,
 				HbMainWindow *mainWindow,
-            NmAttachmentManager &attaManager,
-            bool toolbar = false,
+				NmAttachmentManager &attaManager,
+				bool toolbar = false,
 				QGraphicsItem *parent = NULL);
     ~NmViewerView();
     void reloadViewContents(NmUiStartParam* startParam);
@@ -99,14 +99,14 @@
     void loadMessage();
     void loadViewLayout();
     QString formatMessage();
+    QString formatHtmlMessage(NmMessagePart *html);
+    QString formatPlainTextMessage(NmMessagePart *plain);
     bool eventOnTopOfHeaderArea(QGraphicsSceneMouseEvent *event);
     void changeMessageReadStatus(bool read);
     void setMailboxName();
     void createToolBar();
     void setAttachmentList();
     void createAndShowWaitDialog();
-    void setWebViewWidth(int width);
-    void setWebViewHeighth(int height);
 
 private:
     NmApplication &mApplication;
@@ -125,9 +125,8 @@
     QPointF mLatestScrollPos;
     bool mDisplayingPlainText;
     QObjectList mWidgetList;
-    NmUiDocumentLoader *mDocumentLoader;
-    HbWidget *mScrollAreaContents;
-    HbWidget *mViewerHeaderContainer;
+    NmUiDocumentLoader *mDocumentLoader;             // Owned
+    HbWidget *mScrollAreaContents;                   // Not owned
     QSize mScreenSize;
     HbProgressDialog *mWaitDialog;                   // Owned
     bool webFrameloadingCompleted;
--- a/emailuis/nmailui/inc/nmviewerviewnetreply.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmviewerviewnetreply.h	Tue Jul 06 14:04:34 2010 +0300
@@ -54,7 +54,7 @@
     NmId mFolderId;
     NmId mMessageId;
     NmId mMessagePartId;
-    NmOperation *mOperation;
+    NmOperation *mOperation;    // Not owned
     qint64 mReadIndex;
 };
 
--- a/emailuis/nmailui/inc/nmviewerwebview.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/inc/nmviewerwebview.h	Tue Jul 06 14:04:34 2010 +0300
@@ -42,27 +42,22 @@
 {
     Q_OBJECT
 public:
-	NmMailViewerWK();
-	~NmMailViewerWK();
+    NmMailViewerWK();
+    ~NmMailViewerWK();
     virtual QVariant loadResource (int type, const QUrl &name, NmId &partId, bool &isFetched);
-    void setParentView(NmViewerView *parentView);
     void addContent(QString key, QVariant val, NmId partId, bool isFetched);
-
+    bool event(QEvent* event);
+    
+protected:
+    void contextMenuEvent(QGraphicsSceneContextMenuEvent* event);
+    void gestureEvent(QGestureEvent* event);
+    void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event);
+    void mouseMoveEvent(QGraphicsSceneMouseEvent* event);
+    void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
+    
 private:
     QMap<QString,NmMailViewerWkContentItem> mContent;
-    NmViewerView *mParentView;                        // Not owned
-};
-
-class NmEventFilterWK : public QObject
-{
-    Q_OBJECT
-public:
-    NmEventFilterWK(QObject* parent = 0);
-protected:
-    bool eventFilter(QObject* object, QEvent* event);
-    bool gestureEvent(QGestureEvent* event);
-private:
-    Q_DISABLE_COPY(NmEventFilterWK)
+    bool mSuppressRelease;
 };
 
 #endif /* NMVIEWERWEBVIEW_H_*/
--- a/emailuis/nmailui/src/main.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/main.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -1,51 +1,53 @@
 /*
-* 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:
-*
-*/
-
+ * 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"
+ * 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 "nmuiheaders.h"
 
+const QString NmActivityName("EmailInboxView");
+
 /*!
-	int main
-*/
+    The main function.
+ */
 int main(int argc, char *argv[])
 {
-    NM_FUNCTION;
+    HbApplication app(argc,argv,Hb::NoSplash);
     
-    HbApplication app(argc, argv);
- 
     // Load the translation file.
     QTranslator translator;
-
-#ifdef Q_OS_SYMBIAN
     QString lang = QLocale::system().name();
     QString appName = "mail_";
     QString path = "Z:/resource/qt/translations/";
-#else
-    QString lang;
-    QString appName = "mail";
-    QString path = ":/translations";
-#endif
     translator.load(appName + lang, path);
     app.installTranslator(&translator);
-
+    
     app.setApplicationName(hbTrId("txt_mail_title_mail"));
-
-    NmApplication *nmApplication = new NmApplication(&app);
-
+    
+    NmApplication *nmApplication = NULL;
+    quint32 accountId = 0;
+    if (app.activateReason() == Hb::ActivationReasonActivity &&
+        app.activateId() == NmActivityName) {
+        QVariant data = app.activateParams().take("accountId");
+        QString accountIdString = data.toString();
+        accountId = accountIdString.toULongLong();
+        nmApplication = new NmApplication(&app,accountId);
+    } else {
+        nmApplication = new NmApplication(&app);
+    }
+    
     int ret = app.exec();
     delete nmApplication;
     return ret;
--- a/emailuis/nmailui/src/nmapplication.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmapplication.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -1,307 +1,320 @@
 /*
-* 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"
-* 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:
-*
-*/
+ * 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"
+ * 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 "nmuiheaders.h"
-#ifdef Q_OS_SYMBIAN
 #include <email_services_api.h>
 #include <e32base.h>
-#else
-#define NM_WINS_ENV
-#endif
 
 static const QString NmSendServiceName = "nmail.com.nokia.symbian.IFileShare";
 
 /*!
-	\class NmApplication
-	\brief Application class, creates main window and handles view switching
+    \class NmApplication
+    \brief Application class, creates main window and handles view switching.
 */
 
 /*!
-    Constructor
+    Constructor.
 */
-NmApplication::NmApplication(QObject *parent)
-:QObject(parent),
-mMainWindow(NULL),
-mViewStack(NULL),
-mActiveViewId(NmUiViewNone),
-mUiEngine(NULL),
-mBackAction(NULL),
-mExtensionManager(NULL),
-mMbListModel(NULL),
-mServiceViewId(NmUiViewNone),
-mForegroundService(false),
-mEffects(NULL),
-mAttaManager(NULL),
-mSettingsViewLauncher(NULL),
-mViewReady(false),
-mQueryDialog(NULL)
+NmApplication::NmApplication(QObject *parent, quint32 accountId)
+: QObject(parent),
+  mMainWindow(NULL),
+  mViewStack(NULL),
+  mActiveViewId(NmUiViewNone),
+  mUiEngine(NULL),
+  mBackAction(NULL),
+  mExtensionManager(NULL),
+  mMbListModel(NULL),
+  mServiceViewId(NmUiViewNone),
+  mForegroundService(false),
+  mEffects(NULL),
+  mAttaManager(NULL),
+  mSettingsViewLauncher(NULL),
+  mViewReady(false),
+  mQueryDialog(NULL),
+  mBackButtonPressed(false)
 {
-    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(*mUiEngine);
     QNetworkDiskCache *cache = new QNetworkDiskCache();
-    cache->setCacheDirectory(QDesktopServices::storageLocation(QDesktopServices::CacheLocation));
+    cache->setCacheDirectory(
+        QDesktopServices::storageLocation(QDesktopServices::CacheLocation));
     mNetManager->setCache(cache);
-
+    
     createMainWindow();
-
-    // attachment manager can be shared between viewer and editor, ownership in application class
+    
+    // Attachment manager can be shared between viewer and editor.
+    // The application class has the ownership.
     mAttaManager = new NmAttachmentManager(*mUiEngine);
-
-#ifndef NM_WINS_ENV
+    
     mSendServiceInterface =
-            new NmSendServiceInterface(NmSendServiceName, NULL, *mUiEngine, this);
+        new NmSendServiceInterface(NmSendServiceName, NULL, *mUiEngine, this);
     mSendServiceInterface2 =
-            new NmSendServiceInterface(emailFullServiceNameSend, NULL, *mUiEngine, this);
+        new NmSendServiceInterface(emailFullServiceNameSend, NULL, *mUiEngine, this);
     mUriServiceInterface =
         new NmUriServiceInterface(NULL, *mUiEngine, this);
     mMailboxServiceInterface =
-            new NmMailboxServiceInterface(NULL, *mUiEngine, this);
+        new NmMailboxServiceInterface(NULL, *mUiEngine, this);
     mViewerServiceInterface =
-            new NmViewerServiceInterface(NULL, this, *mUiEngine);
-#endif
-
+        new NmViewerServiceInterface(NULL, this, *mUiEngine);
+    
+    if(accountId != 0) {
+        QVariant mailbox;
+        mailbox.setValue(mUiEngine->getPluginIdByMailboxId(accountId).id());
+        mMailboxServiceInterface->displayInboxByMailboxId(mailbox);
+    }
+    
     mEffects = new NmUiEffects(*mMainWindow);
 }
 
 /*!
-    Destructor
+    Destructor.
 */
 NmApplication::~NmApplication()
 {
-    NM_FUNCTION;
-
-    if (mQueryDialog){
+    if (mQueryDialog) {
         delete mQueryDialog;
-        mQueryDialog=NULL;
+        mQueryDialog = NULL;
     }
-
-#ifndef NM_WINS_ENV
-	delete mSendServiceInterface;
-	delete mSendServiceInterface2;
-	delete mUriServiceInterface;
-	delete mMailboxServiceInterface;
-	delete mViewerServiceInterface;
-#endif
-
-	resetViewStack();
+    
+    delete mSendServiceInterface;
+    delete mSendServiceInterface2;
+    delete mUriServiceInterface;
+    delete mMailboxServiceInterface;
+    delete mViewerServiceInterface;
+    
+    resetViewStack();
     delete mViewStack;
+    
     NmIcons::freeIcons();
     NmUiEngine::releaseInstance(mUiEngine);
     mUiEngine = NULL;
+    
     delete mBackAction;
+    
+    // Workaround: the main window has to be closed (hidden) before deleting
+    // the extension manager in order to prevent the main window's title bar
+    // from showing when the application is closed.
+    if (mMainWindow) {
+        // Workaround: assert failure may happen if an open main window is
+        // deleted.
+        mMainWindow->close();
+    }
+    
     delete mExtensionManager;
-    if (mNetManager){
-        if (mNetManager->cache()){
+    
+    if (mNetManager) {
+        if (mNetManager->cache()) {
             mNetManager->cache()->clear();
         }
     delete mNetManager;
-    mNetManager=NULL;
+    mNetManager = NULL;
     }
-    // Effects needs to be deleted before MainWindow.
+    
+    // Effects need to be deleted before MainWindow.
     delete mEffects;
-    if (mMainWindow) {
-        // workaround: assert failure may happen otherwise
-        mMainWindow->close();
-    }
     delete mMainWindow;
     delete mAttaManager;
     delete mSettingsViewLauncher;
 }
 
 /*!
-    Main application window creation
+    Main application window creation.
 */
 void NmApplication::createMainWindow()
 {
     NM_FUNCTION;
-
-#ifndef NM_WINS_ENV
+    
     bool service = XQServiceUtil::isService();
-#else
-    bool service = false;
-#endif
-
-    // Register custom widget files
+    
+    // Register custom widget files.
     HbStyleLoader::registerFilePath(":nmmessagelistviewitem.widgetml");
     HbStyleLoader::registerFilePath(":nmmessagelistviewitem.css");
     HbStyleLoader::registerFilePath(":nmviewerheader.widgetml");
     HbStyleLoader::registerFilePath(":nmviewerheader.css");
-
-    // Create main window
+    
+    // Create main window.
     mMainWindow = new HbMainWindow();
-
-    // Connect to lazy loading signal
+    
+    // Connect to lazy loading signal.
     QObject::connect(mMainWindow, SIGNAL(viewReady ()),
                      this, SLOT(viewReady()));
-
-    // Create extension manager
+    
+    // Create extension manager.
     mExtensionManager = new NmUiExtensionManager();
-
-    // Create view stack
+    
+    // Create view stack.
     mViewStack = new QStack<NmBaseView*>;
-
-    // Create back action and connect it to prepareForPopView()
+    
+    // Create back action and connect it to prepareForPopView().
     if (mMainWindow) {
         mBackAction = new HbAction(Hb::BackNaviAction,this);
-        connect(mBackAction, SIGNAL(triggered()), this, SLOT(prepareForPopView()));
-
-        // Show mainwindow
-        // Services will active it when the view is ready
+        connect(mBackAction,
+                SIGNAL(triggered()),
+                this,
+                SLOT(prepareForPopView()));
+        
+        // Show mainwindow.
+        // Services will active it when the view is ready.
         if (!service) {
             mMainWindow->show();
         }
     }
-
-    // async operation completion related notifications
-    connect(
-        mUiEngine, SIGNAL(operationCompleted(const NmOperationCompletionEvent &)),
-        this, SLOT(handleOperationCompleted(const NmOperationCompletionEvent &)));
-
+    
+    // Asynchronous operation completion related notifications.
+    connect(mUiEngine,
+            SIGNAL(operationCompleted(const NmOperationCompletionEvent &)),
+            this,
+            SLOT(handleOperationCompleted(const NmOperationCompletionEvent &)));
+    
     mMbListModel = &mUiEngine->mailboxListModel();
-
-    // Start application to mailbox view
-    // If started as service, there is no need to create views
+    
+    // ----------------------------------------------------------------------
+    // TODO: Remove or comment out the following code block when the mail
+    //       wizard starts to work with Mfe.
+    // ----------------------------------------------------------------------
+    // Start application to mailbox view. If started as service, there is no
+    // need to create views.
     if (!service) {
         NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMailboxList);
         enterNmUiView(startParam);
     }
-
-    // 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
-    // an own QMainWindow class and do the capturing there, not in the views.
-    mMainWindow->installEventFilter(this);
+    // ----------------------------------------------------------------------
+    
+    if (mMainWindow) {
+        // 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 an own QMainWindow class and do the capturing there, not
+        // in the views.
+        mMainWindow->installEventFilter(this);
+        // Optimize the custom paint functions.
+        // Currently effects to NmViewerHeader::paint() and
+        // NmAttachmentListWidget::paint().
+        mMainWindow->setOptimizationFlag(QGraphicsView::DontSavePainterState);    
+    }
 }
 
 /*!
-    Slot. React to view ready signal and call
-    current view method.
+    Slot. React to view ready signal and call current view method.
 */
 void NmApplication::viewReady()
 {
-    NM_FUNCTION;
-
     mViewReady = true;
-    if (!mViewStack->isEmpty()) {
+    if (mViewStack && !mViewStack->isEmpty()) {
     	NmBaseView *currentView = mViewStack->top();
-        if (currentView){
+        if (currentView) {
             currentView->viewReady();
         }
     }
 }
 
 /*!
-    Event filter. End key is filtered from the main window and either the view takes case of the
-	or the app is exited by default.
+    Event filter. End key is filtered from the main window and either the
+    view takes case of the or the app is exited by default.
 */
 bool NmApplication::eventFilter(QObject *obj, QEvent *event)
 {
-    NM_FUNCTION;
-
-    bool consumed = false;
-
+    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 (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;
 }
 
 /*!
-    Push view to view stack
+    Push view to view stack.
 */
 void NmApplication::pushView(NmBaseView *newView)
 {
-    NM_FUNCTION;
-
-    if (newView) {
-        NM_COMMENT("nmailui: view exists");
+    if (newView && mViewStack) {
+        NM_COMMENT("NmApplication::pushView() : view exists.");
         newView->setNavigationAction(mBackAction);
-
-        // Store view to be hidden
+        
+        // Store view to be hidden.
         NmBaseView *hideView(NULL);
         if (!mViewStack->isEmpty()) {
             hideView = mViewStack->top();
         }
 		else {
-			// viewReady should be informed immediatelly
+			// viewReady should be informed immediately.
 			if (mViewReady) {
 				newView->viewReady();
 			}
 		}
-
-        // activate new view
-    	NM_COMMENT("nmailui: addView");
+        
+        // Activate new view.
+    	NM_COMMENT("NmApplication::pushView() : add view.");
         mMainWindow->addView(newView);
         mViewStack->push(newView);
         mMainWindow->setCurrentView(newView);
         mActiveViewId=newView->nmailViewId();
-
-        // Set toolbars orientation
+        
+        // Set toolbars orientation.
         HbToolBar *tb = newView->toolBar();
-        if(tb){
+        if (tb) {
             tb->setOrientation(Qt::Horizontal);
         }
-
-        // hide old view
-        NM_COMMENT("nmailui: removeView");
-        if (hideView){
+        
+        // Hide old view.
+        NM_COMMENT("NmApplication::pushView() : remove view.");
+        if (hideView) {
             mMainWindow->removeView(hideView);
         }
-
-        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.
+    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
+    if (mViewStack && mViewStack->size() > 0) {
+        // Get view pointer.
         NmBaseView *view = mViewStack->top();
-
-        // View will call/signal popView if exitting is ok.
-        view->okToExitView();
+        if (view){
+			NmUiViewId topViewId = view->nmailViewId();
+			
+			// We must know in popView, are we coming with back button from
+			// message view to prevent the send animation.
+			if (topViewId == NmUiViewMessageEditor) {
+				mBackButtonPressed = true;
+			}
+            
+            // 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) {
+    // 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 && mViewStack->size() == 0) {
         exitApplication();
     }
 }
@@ -311,71 +324,72 @@
 */
 void NmApplication::popView()
 {
-    NM_FUNCTION;
-
-    if (mViewStack->size() > 0) {
-        // Get view pointer
-        NmBaseView *view = mViewStack->top();
-
-        // ask view if it's ok to exit
-        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);
-
-        // 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);
-        }
-
-        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;
-            NM_COMMENT("Returned from service view");
-
-            // if started as embedded or while the app was in foreground,
-            // do not hide the app
-            if (!XQServiceUtil::isEmbedded() &&
-                !mForegroundService) {
-                XQServiceUtil::toBackground(true);
+    if (mViewStack && mViewStack->size() > 0) {
+        NmBaseView *view = mViewStack->top();    
+        if (view) {
+            // Get top view id.
+            NmUiViewId topViewId = view->nmailViewId();
+            
+            // Prepare for send animation if returing from editor and message
+            // has been sent.
+            if (topViewId == NmUiViewMessageEditor && mUiEngine->isSendingMessage()) {
+				// If we are coming from message editor with back button.
+				// do not prepare the send animation.
+				if (!mBackButtonPressed) {
+					mEffects->prepareEffect(NmUiEffects::NmEditorSendMessageAnimation);
+				}
+	        }
+            mBackButtonPressed = false;
+            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 (!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;
+            
+            // 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;
+                NM_COMMENT("NmApplication::popView() : returned from service view.");
+                // If started as embedded or while the app was in foreground,
+                // do not hide the app.
+                if (!XQServiceUtil::isEmbedded() &&
+                    !mForegroundService) {
+                    XQServiceUtil::toBackground(true);
+                }
             }
         }
-#endif
     }
-
-    // If the view stack is now empty quit the app
-    // This happens also when the app has been started as a service
-    if (mViewStack->size()==0) {
+    
+    // If the view stack is now empty quit the app. This happens also when
+    // the app has been started as a service.
+    if (mViewStack && mViewStack->size() == 0) {
         exitApplication();
     }
 }
@@ -385,48 +399,46 @@
 */
 void NmApplication::resetViewStack()
 {
-    NM_FUNCTION;
-
     if (mViewStack && !mViewStack->isEmpty()) {
 	    int viewCount = mViewStack->count();
         // Pop and destroy all views
-	    for (int i=0;i<viewCount;i++) {
+	    for (int i=0 ; i < viewCount ; i++) {
 		    NmBaseView *view = mViewStack->pop();
             mMainWindow->removeView(view);
             delete view;
         }
-	    mActiveViewId=NmUiViewNone;
+	    mActiveViewId = NmUiViewNone;
     }
 }
 
 /*!
-    Function activates view based on viewId parameter.
-    If requested view is already open, it is requested to reload.
-    Otherwise view object is created and pushed to view stack
+    Function activates view based on viewId parameter. If requested view is
+    already open, it is requested to reload. Otherwise view object is created
+    and pushed to view stack.
 */
-void NmApplication::enterNmUiView(NmUiStartParam* startParam)
+void NmApplication::enterNmUiView(NmUiStartParam *startParam)
 {
     NM_FUNCTION;
-
-    // Check the validity of start parameter object
+    
+    // Check the validity of start parameter object.
     if (startParam) {
-
+        
         if (startParam->service() && mMainWindow) {
-			// 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).
-
-
-		    // reset the foreground service flag while popping the views
+			// 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).
+            
+		    // Reset the foreground service flag while popping the views.
 		    bool previousForegroundService = mForegroundService;
 		    mForegroundService = true;
-
-		    // at least one view must remain in the stack
-			while (mViewStack->count()>1) {
+		    
+		    // At least one view must remain in the stack.
+			while (mViewStack->count( )> 1) {
 			    NmUiViewId topId = mViewStack->top()->nmailViewId();
-			    if (topId!=NmUiViewMessageEditor &&
-			        topId!=NmUiViewMailboxList &&
-			        topId!=startParam->viewId()) {
+			    if (topId != NmUiViewMessageEditor &&
+			        topId != NmUiViewMailboxList &&
+			        topId != startParam->viewId()) {
 			        prepareForPopView();
 			    }
 			    else {
@@ -436,11 +448,11 @@
 			}
 			mForegroundService = previousForegroundService;
         }
-
-        // Check whether requested view is already active
-        // and if so, ask it to reload contents with new start parameter data
-        // Do not reuse the view if started as service to editor view (ShareUI)
-        if (mActiveViewId==startParam->viewId() &&
+        
+        // Check whether requested view is already active and if so, ask it
+        // to reload contents with new start parameter data. Do not reuse the
+        // view if started as service to editor view (ShareUI).
+        if (mActiveViewId == startParam->viewId() &&
         	(!startParam->service() || mActiveViewId!=NmUiViewMessageEditor)) {
             mViewStack->top()->reloadViewContents(startParam);
         }
@@ -457,7 +469,7 @@
                 case NmUiViewMessageList:
                 {
                     // Check the topmost view. If it is an editor, do not open
-                    // a new mail list view
+                    // a new mail list view.
                     if (startParam->service() && !mViewStack->isEmpty() &&
                         mViewStack->top()->nmailViewId()==NmUiViewMessageEditor) {
                         break;
@@ -478,14 +490,14 @@
                         mViewStack->top()->nmailViewId() == NmUiViewMessageEditor) {
                         break;
                     }
-
+                    
                     NmMessageListModel &model =
                         mUiEngine->messageListModelForSearch(startParam->mailboxId());
-
+                    
                     NmMessageSearchListView *searchListView = new NmMessageSearchListView(
                         *this, startParam, *mUiEngine, model,
                         new HbDocumentLoader(mMainWindow));
-
+                    
                     pushView(searchListView);
                 }
                 break;
@@ -497,31 +509,29 @@
                     pushView(new NmEditorView(*this, startParam, *mUiEngine, *mAttaManager));
                     break;
                 default:
-                    // Reset view stack and exit application
+                    // Reset view stack and exit application.
                     delete startParam;
-                    startParam=NULL;
+                    startParam = NULL;
                     resetViewStack();
                     break;
             }
         }
-
+        
         if (startParam && startParam->service()) {
-            // Store the view id that was launched as service
+            // Store the view id that was launched as service.
             mServiceViewId = mActiveViewId;
 		}
     }
 }
 
 /*!
-    Function can be used from views to exit the application
-    View stack is cleared. Views can connect exit menu
-    selection to this slot.
+    Function can be used from views to exit the application. View stack is
+    cleared. Views can connect exit menu selection to this slot.
 */
 void NmApplication::exitApplication()
 {
     NM_FUNCTION;
-
-#ifndef NM_WINS_ENV
+    
     delete mSendServiceInterface;
     mSendServiceInterface = NULL;
     delete mSendServiceInterface2;
@@ -532,69 +542,57 @@
     mMailboxServiceInterface = NULL;
     delete mViewerServiceInterface;
     mViewerServiceInterface = NULL;
-#endif
     resetViewStack();
-    // Do housekeeping if needed.
     qApp->quit();
 }
 
 /*!
-   Exit the application in the next event loop
+   Exit the application in the next event loop.
 */
 void NmApplication::delayedExitApplication()
 {
-    NM_FUNCTION;
-
-    // Exit the application in the next event loop
-    QTimer::singleShot(0, this, SLOT(exitApplication()));
+    // Exit the application in the next event loop.
+    QMetaObject::invokeMethod(this, "exitApplication", Qt::QueuedConnection);
 }
 
 /*!
     Getter for main window instance.
 */
-HbMainWindow* NmApplication::mainWindow()
+HbMainWindow *NmApplication::mainWindow()
 {
-    NM_FUNCTION;
-
     return mMainWindow;
 }
 
 /*!
-    Getter for main UI extension manager
+    Getter for main UI extension manager.
 */
-NmUiExtensionManager& NmApplication::extManager()
+NmUiExtensionManager &NmApplication::extManager()
 {
-    NM_FUNCTION;
-
     return *mExtensionManager;
 }
 
 /*!
-    Getter for network access manager
+    Getter for network access manager.
 */
-NmViewerViewNetManager& NmApplication::networkAccessManager()
+NmViewerViewNetManager &NmApplication::networkAccessManager()
 {
-    NM_FUNCTION;
-
     return *mNetManager;
 }
 
 /*!
-    screen size. Function returns curtent screen size
+    Get the screen size. Function returns curtent screen size.
 */
 QSize NmApplication::screenSize()
 {
-    NM_FUNCTION;
-
     QSize ret(0,0);
     if (mMainWindow){
         HbDeviceProfile currentP = HbDeviceProfile::current();
         HbDeviceProfile altP(currentP.alternateProfileName());
         QSize curPSize = currentP.logicalSize();
         QSize altPSize = altP.logicalSize();
-        if (mMainWindow->orientation()==Qt::Horizontal){
-            // Get wide profile size in landscape
-            if (curPSize.width()>altPSize.width()){
+        if (mMainWindow->orientation() == Qt::Horizontal) {
+            // Get wide profile size in landscape.
+            if (curPSize.width() > altPSize.width()) {
                 ret = curPSize;
             }
             else{
@@ -602,8 +600,8 @@
             }
         }
         else {
-            // Get narrow profile size in portrait
-            if (curPSize.width()<altPSize.width()){
+            // Get narrow profile size in portrait.
+            if (curPSize.width() < altPSize.width()) {
                 ret = curPSize;
             }
             else{
@@ -615,72 +613,65 @@
 }
 
 /*!
-    handles all asynchronous operation's completions at UI level
+    Handles all asynchronous operation's completions at UI level.
 */
 void NmApplication::handleOperationCompleted(const NmOperationCompletionEvent &event)
 {
-    NM_FUNCTION;
-
-    if(event.mCompletionCode != NmNoError && event.mCompletionCode != NmCancelError) {
-        if(event.mOperationType == Synch && event.mCompletionCode == NmAuthenticationError) {
-            mLastOperationMailbox=event.mMailboxId;
-            if (mQueryDialog){
+    if (event.mCompletionCode != NmNoError && event.mCompletionCode != NmCancelError) {
+        if (event.mOperationType == Synch && event.mCompletionCode == NmAuthenticationError) {
+            mLastOperationMailbox = event.mMailboxId;
+            if (mQueryDialog) {
                 delete mQueryDialog;
-                mQueryDialog=NULL;
+                mQueryDialog = NULL;
             }
             mQueryDialog = NmUtilities::displayQuestionNote(hbTrId("txt_mail_dialog_address_or_password_incorrect"),
                                                     this, SLOT(launchSettings(HbAction*)));
         }
-        if(event.mOperationType == Synch && event.mCompletionCode == NmServerConnectionError) {
+        if (event.mOperationType == Synch && event.mCompletionCode == NmServerConnectionError) {
             mLastOperationMailbox=event.mMailboxId;
-            if (mQueryDialog){
+            if (mQueryDialog) {
                 delete mQueryDialog;
-                mQueryDialog=NULL;
+                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) {
+        // 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
+    Launches settings view of the specified mailbox.
 */
 void NmApplication::launchSettings(HbAction* action)
 {
-    NM_FUNCTION;
-
-    // Check whether yes button was pressed
+    // Check whether yes button was pressed.
     if (mQueryDialog&& action == mQueryDialog->actions().at(0)) {
-        // create settingslauncher if doesn't exist
+        // 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());
-            }
+        // Mailboxname required.
+        NmMailboxMetaData *mailboxMetaData = mUiEngine->mailboxById(mLastOperationMailbox); // No ownership.
+        if( mailboxMetaData ) {
+            // Launch.
+            mSettingsViewLauncher->launchSettingsView(mLastOperationMailbox, mailboxMetaData->name());
         }
     }
 }
 
 /*!
 	Stores the visibility state, e.g. when the service was launched.
-	\return true if the app was visible
+	\return true if the app was visible.
 */
 bool NmApplication::updateVisibilityState()
 {
-    // At the moment there is no good way to check the foreground state
+    // 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));
+	mForegroundService = (surface != 0);
+	NM_COMMENT(QString("NmApplication::updateVisibilityState() : mForegroundService == %1").arg(mForegroundService));
 	return mForegroundService;
 }
--- a/emailuis/nmailui/src/nmattachmentlist.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmattachmentlist.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -37,12 +37,10 @@
 NmAttachmentList::~NmAttachmentList()
 { 
     NM_FUNCTION;
-    
-    clearList();
 }
 
 /*!
-    Insert new list item. Returns the count of the attachment in list
+    Insert new list item. Returns the index of the attachment in list
 */
 int NmAttachmentList::insertAttachment(
     const QString &fullFileName,
@@ -95,13 +93,14 @@
 }
 
 /*!
-    Remove attachment from list position
+    Removes attachment from list position
 */
 void NmAttachmentList::removeAttachment(int arrayIndex)
 {
     NM_FUNCTION;
     
-    if (arrayIndex < count()) {
+    if (arrayIndex < count() && 
+        arrayIndex >= 0 ) {
         // Remove UI
         mListWidget.removeAttachment(arrayIndex);
         // Remove from data structure
--- a/emailuis/nmailui/src/nmattachmentmanager.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmattachmentmanager.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -17,7 +17,7 @@
 
 #include "nmuiheaders.h"
 
-const int NmAttachmentManagerInitialProgressPercent = 5;
+static const int NmAttachmentManagerInitialProgressPercent = 5;
 
 /*!
     \class NmAttachmentManager
@@ -32,6 +32,7 @@
     mFetchOperation(NULL),
     mMsgFetchOperation(NULL),
     mFetchObserver(NULL),
+    mFetchMsg(NULL),
     mAttaId(0),
     mProgressValue(0),
     mIsFetching(false)
@@ -48,6 +49,9 @@
     
     // fetch operation deleted in cancel fetch
     cancelFetch();
+    
+    delete mFetchMsg;
+    mFetchMsg = NULL;
 }
 
 /*!
@@ -82,7 +86,7 @@
 
 /*!
     Fetch attachments to a message. 
-    Set observer with setObserver method to get process and complete events
+    Set observer with setObserver method to get progress and complete events
     
     \return bool true if fetch started, otherwise false.
 */
@@ -93,7 +97,7 @@
         QList<NmId> &messagePartIds)
 {
     NM_FUNCTION;
-    bool result = false;
+    bool result(false);
     // cancel old fetch operation, Does nothing if fetch not ongoing
     cancelFetch();
     
@@ -123,7 +127,7 @@
     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
+    Set observer with setObserver method to get progress and complete events
 */
 void NmAttachmentManager::fetchAllMessageParts(
         const NmId &mailboxId, 
@@ -134,7 +138,7 @@
     mFetchMsg = mUiEngine.message(mailboxId,folderId,messageId);
     
     // Check if we have part data structure.    
-    if (mFetchMsg->childParts().count() == 0 &&
+    if (mFetchMsg && mFetchMsg->childParts().count() == 0 &&
         mFetchMsg->fetchedSize() < mFetchMsg->size()) {
 
         // cancel old fetch operation, Does nothing if fetch not ongoing
@@ -239,30 +243,44 @@
     
     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());
+            
+            NmId mailboxId = mFetchMsg->envelope().mailboxId();
+            NmId folderId = mFetchMsg->envelope().folderId();
+            NmId messageId = mFetchMsg->envelope().messageId();
+            
+            // Delete object
+            delete mFetchMsg;
+            mFetchMsg = NULL;
+            
+            // Reload message
+            mFetchMsg = mUiEngine.message(mailboxId,folderId,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 (partIds.count() > 0) {
+                    mMsgFetchOperation = NULL;
+                    fetchAttachments(
+                        mFetchMsg->envelope().mailboxId(),
+                        mFetchMsg->envelope().folderId(),
+                        mFetchMsg->envelope().messageId(),
+                        partIds);
+                }
+                else {
+                    mFetchObserver->fetchCompleted(NmNoError);
+                }
+                // Delete object
+                delete mFetchMsg;
+                mFetchMsg = NULL;
             }
             else {
-                mFetchObserver->fetchCompleted(NmNoError);
+                mFetchObserver->fetchCompleted(NmNotFoundError);
             }
         }
         else {
@@ -308,4 +326,3 @@
     
     return mProgressValue;
 }
-
--- a/emailuis/nmailui/src/nmattachmentpicker.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmattachmentpicker.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,11 +15,10 @@
 *
 */
 
-#include <fmfiledialog.h>
-#include <xqaiwdecl.h>
 #include "nmuiheaders.h"
-const int NmAttachmentPickerStillMode = 0;
-const int NmAttachmentPickerVideoMode = 1;
+
+static const int NmAttachmentPickerStillMode = 0;
+static const int NmAttachmentPickerVideoMode = 1;
 
 /*!
     \class NmAttachmentPicker
@@ -29,7 +28,7 @@
 /*!
     Constructor
 */
-NmAttachmentPicker::NmAttachmentPicker(QObject* parent):
+NmAttachmentPicker::NmAttachmentPicker(QObject *parent):
     QObject(parent),
     mRequest(NULL)
 {
@@ -85,7 +84,7 @@
     QString path;
     path = FmFileDialog::getSaveFileName(0, hbTrId("txt_mail_dialog_select_file"));
     
-    if(!path.isEmpty()) {
+    if (!path.isEmpty()) {
         QString temp = QDir::toNativeSeparators(path);
         emit attachmentsFetchOk(QVariant(temp));    
     }
@@ -116,11 +115,11 @@
 {
     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
+    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);
@@ -141,8 +140,8 @@
     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 QList<QVariant>* args)
+void NmAttachmentPicker::fetch(const QString &interface, 
+    const QString &operation, const QList<QVariant> *args)
 {
     NM_FUNCTION;
     
--- a/emailuis/nmailui/src/nmbaseview.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmbaseview.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -26,7 +26,7 @@
 /*!
     Constructor
 */
-NmBaseView::NmBaseView(NmUiStartParam* startParam,
+NmBaseView::NmBaseView(NmUiStartParam *startParam,
                        NmApplication &application,
                        QGraphicsItem *parent)
 : HbView(parent),
--- a/emailuis/nmailui/src/nmeditorcontent.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmeditorcontent.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -19,26 +19,32 @@
 
 // Layout
 static const char *NMUI_EDITOR_BODY = "BodyTextEdit";
+static const char *NMUI_EDITOR_SCROLL_AREA = "scrollArea";
+static const char *NMUI_EDITOR_SCROLL_AREA_CONTENTS = "scrollAreaContents";
 
+// Regular expression for selecting img tags with "cid" in the mail.
+static const char *NMUI_EDITOR_REMOVE_EMBD_IMAGES_REG = 
+    "(<img[^<]+(src\\s*=\\s*)(.{0,1}cid)([^<]+)(>\\s*|/>\\s*|></img>\\s*))";
+	
 /*!
     Constructor
 */
-NmEditorContent::NmEditorContent(QGraphicsItem *parent,
-                                 NmEditorView *parentView,
+NmEditorContent::NmEditorContent(QObject *parent,
                                  HbDocumentLoader *documentLoader,
-                                 QNetworkAccessManager &manager) :
-    HbWidget(parent),
-    mHeaderWidget(NULL),
-    mParentView(parentView),
-    mEditorLayout(NULL),
-    mMessageBodyType(PlainText),
+                                 QNetworkAccessManager &manager,
+                                 NmApplication &application) :
+    QObject(parent),
+    mHeader(NULL),
+    mMessageBodyType(NmPlainText),
     mEditorWidget(NULL),
-    mBackgroundScrollArea((NmBaseViewScrollArea*)parent)
+    mScrollArea(NULL),
+    mScrollAreaContents(NULL),
+    mApplication(application)
 {
     NM_FUNCTION;
 
-    // Add header area handling widget into layout
-    mHeaderWidget = new NmEditorHeader(documentLoader);
+    // Construct container for the header widgets
+    mHeader = new NmEditorHeader(this, documentLoader);
 
     // Get pointer to body text area handling widget
     mEditorWidget = qobject_cast<NmEditorTextEdit *>(documentLoader->findWidget(NMUI_EDITOR_BODY));
@@ -48,14 +54,16 @@
     mEditorWidget->setDocument(textDocument); 
     textDocument->setParent(mEditorWidget); // ownership changes
 
-    mEditorWidget->init(mBackgroundScrollArea);
-    // we are interested in the editor widget's height changes
-    connect(mEditorWidget, SIGNAL(editorContentHeightChanged()), this,
-        SLOT(setEditorContentHeight()));
-
+    mScrollArea = qobject_cast<NmBaseViewScrollArea *>
+        (documentLoader->findWidget(NMUI_EDITOR_SCROLL_AREA));
+    mScrollArea->setScrollDirections(Qt::Vertical | Qt::Horizontal);
+    
     // Enable style picker menu item.
     mEditorWidget->setFormatDialog(new HbFormatDialog());
 
+    mScrollAreaContents =
+        qobject_cast<HbWidget *>(documentLoader->findWidget(NMUI_EDITOR_SCROLL_AREA_CONTENTS));
+    
     // Create signal slot connections
     createConnections();
 }
@@ -66,8 +74,6 @@
 NmEditorContent::~NmEditorContent()
 {
     NM_FUNCTION;
-    
-   delete mHeaderWidget;
 }
 
 /*!
@@ -75,88 +81,83 @@
     present, reply header is generated and set to editor. Reply
     envelope ownership is not transferred here.
  */
-void NmEditorContent::setMessageData(const NmMessage &originalMessage,
-                                     bool createReplyHeader)
+void NmEditorContent::setMessageData(const NmMessage &originalMessage, 
+                                     NmUiEditorStartMode &editorStartMode)
 {
     NM_FUNCTION;
     
     QString bodyContent;
     
-    // We create the "reply" header (also for forward message), but not to draft message.
-    if (mEditorWidget && createReplyHeader) {          
-        QTextCursor cursor = mEditorWidget->textCursor();
-        cursor.setPosition(0);
-        cursor.insertHtml(NmUtilities::createReplyHeader(originalMessage.envelope()));
+    // Create the "reply" header (also for forward message)
+    if (editorStartMode==NmUiEditorReply || editorStartMode==NmUiEditorReplyAll || 
+        editorStartMode==NmUiEditorForward) {
+        bodyContent.append(NmUtilities::createReplyHeader(originalMessage.envelope()));
     }
-    // Take reply header as html format.
-    bodyContent.append(mEditorWidget->toHtml());
     
     // Check which part is present. Html or plain text part. We use the original message parts.
     const NmMessagePart *htmlPart = originalMessage.htmlBodyPart();
     const NmMessagePart *plainPart = originalMessage.plainTextBodyPart();
  
-    if (htmlPart && mEditorWidget) {
+    if (htmlPart) {
         bodyContent.append(htmlPart->textContent());
+        if(editorStartMode==NmUiEditorReply || editorStartMode==NmUiEditorReplyAll ) {
+            removeEmbeddedImages(bodyContent);
+        }
         emit setHtml(bodyContent);
-        mMessageBodyType = HTMLText;
+        mMessageBodyType = NmHTMLText;
     }
     else if (plainPart) {
         // Plain text part was present, set it to HbTextEdit
         bodyContent.append(plainPart->textContent());
         emit setPlainText(bodyContent);
-        mMessageBodyType = PlainText;
+        mMessageBodyType = NmPlainText;
     }
 }  
 
 /*!
-   This method set new height for the editor content when header or body field
-   height has been changed.
- */
-void NmEditorContent::setEditorContentHeight()
-{
-    NM_FUNCTION;
-    
-	const QSizeF reso = HbDeviceProfile::current().logicalSize();
-    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();
-        mEditorWidget->setPreferredHeight(bodyContentHeight);
-        mEditorWidget->setMaximumHeight(bodyContentHeight);
-    }
-    mParentView->scrollAreaContents()->setMinimumHeight(containerHeight);
-    mParentView->scrollAreaContents()->setMaximumHeight(containerHeight);
-    mBackgroundScrollArea->setMaximumHeight(containerHeight);
-}
-
-/*!
    This method creates all needed signal-slot connections
  */
 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)));
     // Signal for setting HbTextEdit widgets html content
     connect(this, SIGNAL(setHtml(QString)),
             mEditorWidget, SLOT(setHtml(QString)), Qt::QueuedConnection);
+
     // Signal for setting HbTextEdit widgets plain text content
     connect(this, SIGNAL(setPlainText(QString)),
             mEditorWidget, SLOT(setPlainText(QString)), Qt::QueuedConnection);
+
     // Inform text edit widget that header height has been changed
-    connect(mHeaderWidget, SIGNAL(headerHeightChanged(int)),
-            mEditorWidget, SLOT(setHeaderHeight(int)));
+    connect(mHeader, SIGNAL(headerHeightChanged(int)), this, SLOT(setEditorContentHeight()),
+        Qt::QueuedConnection);
+
+    // we are interested in the document's height changes
+    connect(mEditorWidget->document()->documentLayout(), SIGNAL(documentSizeChanged(QSizeF)), this,
+        SLOT(setEditorContentHeight()), Qt::QueuedConnection);
+
+    // We need to update the scroll position according the editor's cursor position
+    connect(mHeader->toEdit(), SIGNAL(cursorPositionChanged(int, int)), this, 
+        SLOT(ensureCursorVisibility()), Qt::QueuedConnection);
+    connect(mHeader->ccEdit(), SIGNAL(cursorPositionChanged(int, int)), this, 
+        SLOT(ensureCursorVisibility()), Qt::QueuedConnection);
+    connect(mHeader->bccEdit(), SIGNAL(cursorPositionChanged(int, int)), this, 
+        SLOT(ensureCursorVisibility()), Qt::QueuedConnection);
+    connect(mHeader->subjectEdit(), SIGNAL(cursorPositionChanged(int, int)), this, 
+        SLOT(ensureCursorVisibility()), Qt::QueuedConnection);
+    connect(mEditorWidget, SIGNAL(cursorPositionChanged(int, int)), this, 
+        SLOT(ensureCursorVisibility()), Qt::QueuedConnection);
+
+    // listen to the parent's (NmEditorView) size changes which happen eg. when VKB is opened/closed
+    connect(parent(), SIGNAL(sizeChanged()), this, SLOT(ensureCursorVisibility()),
+        Qt::QueuedConnection);
 }
 
 /*!
     Return pointer to the email body text edit widget
  */
-NmEditorTextEdit* NmEditorContent::editor() const
+NmEditorTextEdit *NmEditorContent::editor() const
 {
     NM_FUNCTION;
     
@@ -166,10 +167,100 @@
 /*!
     Return pointer to the header widget
  */
-NmEditorHeader* NmEditorContent::header() const
+NmEditorHeader *NmEditorContent::header() const
+{
+    NM_FUNCTION;
+    
+    return mHeader;
+}
+
+/*!
+    This slot is called when header widget height has been changed. Function performs
+    the repositioning of the body field and resizing of the editor and content area.
+ */
+void NmEditorContent::setEditorContentHeight()
 {
     NM_FUNCTION;
     
-    return mHeaderWidget;
+    // the height of the margin between the title bar and the header
+    qreal topMargin = 0;
+    HbStyle().parameter("hb-param-margin-gene-top", topMargin);
+    
+    // header height
+    qreal headerHeight = mHeader->headerHeight();
+
+    // body area editor's document height with margins added
+    qreal documentHeightAndMargins = mEditorWidget->document()->size().height() +
+        (mEditorWidget->document()->documentMargin() * 2);
+
+    // chrome height
+    qreal chromeHeight = 0;
+    HbStyle().parameter("hb-param-widget-chrome-height", chromeHeight);
+    
+    // screen height
+    qreal screenHeight = mApplication.screenSize().height();
+
+    // set min size for the body area so that at least the screen area is always filled
+    qreal bodyAreaMinSize = screenHeight - chromeHeight - topMargin - headerHeight;
+    
+    qreal bodyAreaSize = fmax(bodyAreaMinSize, documentHeightAndMargins);
+
+    mScrollAreaContents->setPreferredHeight(topMargin + headerHeight + bodyAreaSize);
 }
 
+/*!
+    This slot is called when the cursor visibility has to be ensured ie. the scroll position is 
+    adjusted so that the cursor can be seen.
+*/
+void NmEditorContent::ensureCursorVisibility()
+{
+    NM_FUNCTION;
+
+    // check which of the editors has the focus and get the x/y coordinates for the cursor position
+    QGraphicsWidget *focused = mScrollAreaContents->focusWidget();
+    
+    if (focused) {
+        QRectF localRect(0, 0, 0, 0);
+        bool notFound = false;
+        
+        if (focused == mHeader->toEdit()) {
+            localRect = mHeader->toEdit()->rectForCursorPosition();
+        }
+        else if (focused == mHeader->ccEdit()) {
+            localRect = mHeader->ccEdit()->rectForCursorPosition();
+        }
+        else if (focused == mHeader->bccEdit()) {
+            localRect = mHeader->bccEdit()->rectForCursorPosition();
+        }
+        else if (focused == mHeader->subjectEdit()) {
+            localRect = mHeader->subjectEdit()->rectForCursorPosition();
+        }
+        else if (focused == mEditorWidget) {
+            localRect = mEditorWidget->rectForCursorPosition();
+        }
+        else {
+            notFound = true;
+        }
+
+        if (!notFound) {
+            QPointF topLeftPos = focused->mapToItem(mScrollAreaContents, localRect.topLeft());
+            QPointF bottomRightPos =
+                focused->mapToItem(mScrollAreaContents, localRect.bottomRight());
+            qreal marginRight = 0;
+            HbStyle().parameter("hb-param-margin-gene-right", marginRight);
+            bottomRightPos.rx() += marginRight;
+            mScrollArea->ensureVisible(topLeftPos);
+            mScrollArea->ensureVisible(bottomRightPos);
+        }
+    }
+}
+/*!
+    Removes embedded images from the message body
+ */
+void NmEditorContent::removeEmbeddedImages(QString &bodyContent)
+{
+    NM_FUNCTION;
+ 
+    QRegExp regExp(NMUI_EDITOR_REMOVE_EMBD_IMAGES_REG, Qt::CaseInsensitive);
+    bodyContent.remove(regExp);
+}
--- a/emailuis/nmailui/src/nmeditorheader.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmeditorheader.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -19,7 +19,7 @@
 
 // Layout
 // These match to the defintions in nmeditorview.docml
-static const char *NMUI_EDITOR_CONTAINER = "containerContents";
+static const char *NMUI_EDITOR_CONTAINER = "scrollAreaContents";
 static const char *NMUI_EDITOR_SUBJECT_FIELD = "editorSubjectField";
 static const char *NMUI_EDITOR_SUBJECT_EDIT = "editorSubjectEdit";
 static const char *NMUI_EDITOR_CC_FIELD = "editorCcField";
@@ -31,15 +31,16 @@
 static const char *NMUI_EDITOR_PREFIX_CC = "editorCc";
 static const char *NMUI_EDITOR_PREFIX_BCC = "editorBcc";
 
-static const int MaxRows = 10000;
+static const int NmMaxRows = 10000;
 
 // this timeout seems to be long enough for all cases. see sendDelayedHeaderHeightChanged
-static const int LayoutSystemWaitTimer = 500; // 0.5 sec
+static const int NmLayoutSystemWaitTimer = 500; // 0.5 sec
 
 /*!
     Constructor
 */
-NmEditorHeader::NmEditorHeader(HbDocumentLoader *documentLoader) :
+NmEditorHeader::NmEditorHeader(QObject *parent, HbDocumentLoader *documentLoader) :
+    QObject(parent),
     mDocumentLoader(documentLoader),
     mHeaderHeight(0),
     mIconVisible(false),
@@ -76,52 +77,62 @@
     // 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);
+    if (contentWidget) {
+        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);
+    
+        // Sets up editor properties like no prediction, lower case preferred etc.
+        HbEditorInterface toEditorInterface(mToField->editor());
+        HbEditorInterface ccEditorInterface(mCcField->editor());
+        HbEditorInterface bccEditorInterface(mBccField->editor());
+        toEditorInterface.setUpAsLatinAlphabetOnlyEditor();
+        ccEditorInterface.setUpAsLatinAlphabetOnlyEditor();
+        bccEditorInterface.setUpAsLatinAlphabetOnlyEditor();
 
-    // 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());
+        // 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);
     
-    // Add Subject: field
-    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);
-
-    // 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);
+        mSubjectWidget =
+            qobject_cast<HbWidget *>(mDocumentLoader->findWidget(NMUI_EDITOR_SUBJECT_FIELD));
+        mSubjectLayout = static_cast<QGraphicsLinearLayout *>(mSubjectWidget->layout());
+          
+        // Add Subject: field
+        mSubjectEdit = qobject_cast<NmHtmlLineEdit *>
+            (mDocumentLoader->findWidget(NMUI_EDITOR_SUBJECT_EDIT));
+        mSubjectEdit->setMaxRows(NmMaxRows);
+    
+        // 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);
+    
+        // 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);    
+    }
 }
 
 /*!
@@ -179,7 +190,7 @@
 }
 
 /*!
-    Return the height of the whole header widget.
+    Return the sum of the header widget heights. This contains all the spacings a well. 
  */
 qreal NmEditorHeader::headerHeight() const
 {
@@ -225,7 +236,7 @@
 void NmEditorHeader::sendDelayedHeaderHeightChanged()
 {
     NM_FUNCTION;
-	QTimer::singleShot(LayoutSystemWaitTimer, this, SLOT(sendHeaderHeightChanged()));
+	QTimer::singleShot(NmLayoutSystemWaitTimer, this, SLOT(sendHeaderHeightChanged()));
 }
 
 /*!
@@ -289,7 +300,7 @@
 {
     NM_FUNCTION;
     
-    bool recipientsFieldsEmpty = true;
+    bool recipientsFieldsEmpty(true);
     if (mToField->text().length()) {
         recipientsFieldsEmpty = false;
     }
@@ -380,7 +391,7 @@
         mLayout->insertItem(mLayout->count() - 1, &mAttachmentList->listWidget());
         mAttachmentList->listWidget().show();
     }
-    sendDelayedHeaderHeightChanged();
+    sendHeaderHeightChanged();
 }
 
 /*!
@@ -439,8 +450,7 @@
 void NmEditorHeader::attachmentActivated(int arrayIndex)
 {
     NM_FUNCTION;
-    
-    //
+
     emit attachmentShortPressed(mAttachmentList->nmIdByIndex(arrayIndex));    
 }
 
--- a/emailuis/nmailui/src/nmeditortextdocument.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmeditortextdocument.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -67,8 +67,10 @@
                 emit documentLayoutChanged();
             }
         }
-        mReplyList.removeAll(reply);
-        reply->deleteLater();
+        // If this has created the request, then this needs to handle deletion also.
+        if (mReplyList.removeAll(reply)) {
+            reply->deleteLater();
+        }
     }
 }
 
--- a/emailuis/nmailui/src/nmeditorview.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmeditorview.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -19,12 +19,8 @@
 // Layout file and view
 static const char *NMUI_EDITOR_VIEW_XML = ":/docml/nmeditorview.docml";
 static const char *NMUI_EDITOR_VIEW= "editorview";
-static const char *NMUI_EDITOR_SCROLL_AREA = "scrollArea";
-static const char *NMUI_EDITOR_SCROLL_AREA_CONTENTS = "scrollAreaContents";
 
-static const int NmOrientationTimer=100;
-
-static const QString Delimiter("; ");
+static const QString NmDelimiter("; ");
 
 /*!
 	\class NmEditorView
@@ -45,11 +41,9 @@
       mUiEngine(uiEngine),
       mAttaManager(attaManager),
       mDocumentLoader(NULL),
-      mScrollArea(NULL),
-      mEditWidget(NULL),
       mHeaderWidget(NULL),
       mMessage(NULL),
-      mContentWidget(NULL),
+      mContent(NULL),
       mAttachmentListContextMenu(NULL),
       mMessageCreationOperation(NULL),
       mAddAttachmentOperation(NULL),
@@ -92,7 +86,6 @@
     delete mMessage;
     mWidgetList.clear();
     delete mDocumentLoader;
-    delete mContentWidget;
     delete mPrioritySubMenu;
     
     if (mAttachmentListContextMenu) {
@@ -124,25 +117,23 @@
     mPrioritySubMenu = NULL;
 
     // Use document loader to load the view
-    bool ok = false;
+    bool ok(false);
+
+    setObjectName(QString(NMUI_EDITOR_VIEW));
+    QObjectList objectList;
+    objectList.append(this);
+    // Pass the view to documentloader. Document loader uses this view
+    // when docml is parsed, instead of creating new view.
+    // documentloader is created in constructor
+    mDocumentLoader->setObjectTree(objectList);
+
     mWidgetList = mDocumentLoader->load(NMUI_EDITOR_VIEW_XML, &ok);
 
-    if (ok == true && mWidgetList.count()) {
-        // Set view
-        QGraphicsWidget *view = mDocumentLoader->findWidget(NMUI_EDITOR_VIEW);
-        if (view){
-            setWidget(view);
-        }
+   if (ok) {
+        mContent = new NmEditorContent(this, mDocumentLoader, 
+            mApplication.networkAccessManager(), mApplication);
 
-        mScrollArea = qobject_cast<NmBaseViewScrollArea *>
-            (mDocumentLoader->findObject(NMUI_EDITOR_SCROLL_AREA));
-        mScrollAreaContents = qobject_cast<HbWidget *>
-             (mDocumentLoader->findObject(NMUI_EDITOR_SCROLL_AREA_CONTENTS));
-
-        mContentWidget = new NmEditorContent(mScrollArea, this, mDocumentLoader, 
-            mApplication.networkAccessManager());
-        mEditWidget = mContentWidget->editor();
-        mHeaderWidget = mContentWidget->header();
+        mHeaderWidget = mContent->header();
 
         // Set default color for user - entered text if editor is in re/reAll/fw mode
         if (mStartParam) {
@@ -150,7 +141,7 @@
             if (mode == NmUiEditorReply
                 || mode == NmUiEditorReplyAll 
                 || mode == NmUiEditorForward) {
-                mEditWidget->setCustomTextColor(true, Qt::blue);
+                mContent->editor()->setCustomTextColor(true, Qt::blue);
             }
         }
 
@@ -198,22 +189,38 @@
     NM_FUNCTION;
     
     Q_UNUSED(orientation);
-    // Adjust content height
-    QTimer::singleShot(NmOrientationTimer, this, SLOT(adjustViewDimensions()));
-    QTimer::singleShot(NmOrientationTimer, mHeaderWidget, SLOT(sendHeaderHeightChanged()));
+    
+    // content widget height needs to be set according to the new orientation to get the scroll
+	// area work correctly
+	mHeaderWidget->sendDelayedHeaderHeightChanged();
+}
+
+/*!
+    This slot is signaled by VKB when it opens
+ */
+void NmEditorView::vkbOpened()
+{
+    showChrome(false);	
 }
 
 /*!
-    Set new dimensions after orientation change.
-*/
-void NmEditorView::adjustViewDimensions()
+    This slot is signaled by VKB when it closes.
+ */
+void NmEditorView::vkbClosed()
 {
-    NM_FUNCTION;
-    
-    if (mScrollAreaContents) {
-        const QSize reso = mApplication.screenSize();
-        mScrollAreaContents->setMinimumWidth(reso.width());
-        mScrollAreaContents->setMaximumWidth(reso.width());
+	showChrome(true);
+}
+
+/*!
+    Hide or show chrome.
+ */
+void NmEditorView::showChrome(bool show)
+{
+    if (show) {
+        showItems(Hb::StatusBarItem | Hb::TitleBarItem | Hb::ToolBarItem);
+    }
+    else {
+        hideItems(Hb::StatusBarItem | Hb::TitleBarItem | Hb::ToolBarItem);
     }
 }
 
@@ -227,52 +234,45 @@
     return NmUiViewMessageEditor;
 }
 
-/*!
-    ScrollArea contents
-*/
-HbWidget* NmEditorView::scrollAreaContents()
-{
-    NM_FUNCTION;
-    
-    return mScrollAreaContents;
-}
-
 /*
    Launch dialog for query user if we want to exit the editor
 */
 void NmEditorView::okToExitView()
 {
     NM_FUNCTION;
-    
-    NmEditorHeader *header = mContentWidget->header();
-    
-    bool okToExit = true;
+       
+    bool okToExit(true);
     
-    // show the query if the message has not been sent
-    if (mMessage && header) {
-        // see if editor has any content
-        int subjectLength = 0;
-        if (header->subjectEdit()) {
-            subjectLength = header->subjectEdit()->text().length();
-        }
-        
-        QList<NmMessagePart*> attachmentList;
-        mMessage->attachmentList(attachmentList);
-                    
-        okToExit = (subjectLength == 0 && mContentWidget->editor()->document()->isEmpty());
-
-        // content exists, verify exit from user
-        if (!okToExit) {
-            if (mQueryDialog) {
-                delete mQueryDialog;
-                mQueryDialog = 0;
+    if (mContent) {
+        NmEditorHeader *header = mContent->header();
+        // show the query if the message has not been sent
+        if (mMessage && header) {
+            // see if editor has any content
+            int subjectLength = 0;
+            if (header->subjectEdit()) {
+                subjectLength = header->subjectEdit()->text().length();
             }
-            // Launch query dialog.
-            mQueryDialog = 
-                NmUtilities::displayQuestionNote(hbTrId("txt_mail_dialog_save_message_to_drafts"),
-                                                            this,
-                                                            SLOT(okToExitQuery(HbAction*)));
-        }
+            
+            QList<NmMessagePart*> attachmentList;
+            mMessage->attachmentList(attachmentList);
+            
+            if (mContent->editor()) {
+                okToExit = (subjectLength == 0 && mContent->editor()->document()->isEmpty());            
+            }
+    
+            // content exists, verify exit from user
+            if (!okToExit) {
+                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.
@@ -286,7 +286,7 @@
 /*!
     Handle the user selection is it ok to exit.
 */
-void NmEditorView::okToExitQuery(HbAction* action)
+void NmEditorView::okToExitQuery(HbAction *action)
 {
     NM_FUNCTION;
     
@@ -355,13 +355,17 @@
     NmAction *dummy = new NmAction(0);
     menu()->addAction(dummy);
 
+    mVkbHost = new HbShrinkingVkbHost(this);
+    
     initializeVKB();
-    connect(mContentWidget->header(), SIGNAL(recipientFieldsHaveContent(bool)),
+    
+    //start to listen VKB open and close signals for hiding the chrome.
+    connect(mVkbHost, SIGNAL(keypadOpened()), this, SLOT(vkbOpened()));
+    connect(mVkbHost, SIGNAL(keypadClosed()), this, SLOT(vkbClosed()));
+    
+    connect(mContent->header(), SIGNAL(recipientFieldsHaveContent(bool)),
             this, SLOT(setButtonsDimming(bool)) );
 
-    // Set dimensions
-    adjustViewDimensions();
-	
     // Connect to observe orientation change events
     connect(mApplication.mainWindow(), SIGNAL(orientationChanged(Qt::Orientation)),
             this, SLOT(orientationChanged(Qt::Orientation)));
@@ -427,19 +431,34 @@
         startMessageCreation(*mStartParam);
     }
     else {
-        mWaitDialog->close();
-		
-        // Show fetching failed note         
-        HbNotificationDialog *note = new HbNotificationDialog(); 
-        note->setIcon(HbIcon(QLatin1String("note_warning")));
-        QString noteText = hbTrId("txt_mail_dpopinfo_loading_failed");
-        note->setTitle(noteText);
-        note->setTitleTextWrapping(Hb::TextWordWrap);
-        note->setDismissPolicy(HbPopup::TapAnywhere);
-        note->setAttribute(Qt::WA_DeleteOnClose);
-        note->setSequentialShow(true);
-        note->show();
+        // Show the fetching failed note only when
+        // the error is not Device/System errors, 
+        if (result != NmNoError && 
+            result != NmNotFoundError &&
+            result != NmGeneralError &&
+            result != NmCancelError &&
+            result != NmAuthenticationError &&
+            result != NmServerConnectionError &&
+            result != NmConnectionError) {
+            
+            HbNotificationDialog *note = new HbNotificationDialog(); 
+            
+            bool enalbeAttribute(true);
+            note->setAttribute(Qt::WA_DeleteOnClose, enalbeAttribute);
+            
+            note->setIcon(HbIcon(QLatin1String("note_warning")));
+            
+            note->setTitle(hbTrId("txt_mail_dpopinfo_loading_failed"));
+            note->setTitleTextWrapping(Hb::TextWordWrap);
+            
+            note->setDismissPolicy(HbNotificationDialog::TapAnywhere);
+            note->setTimeout(HbNotificationDialog::StandardTimeout);
+            
+            note->setSequentialShow(true);
+            note->show();
+        }
         
+        mWaitDialog->close();         
         QMetaObject::invokeMethod(&mApplication, "popView", Qt::QueuedConnection);
     }
 }
@@ -486,7 +505,7 @@
     if (mMessageCreationOperation && mMessageCreationOperation->isRunning()) {
         mMessageCreationOperation->cancelOperation();
     }
-	
+	  
     // original message is now fetched so start message creation
     if (startMode == NmUiEditorForward) {
         mMessageCreationOperation = mUiEngine.createForwardMessage(mailboxId, msgId);
@@ -530,7 +549,7 @@
     // verify addresses before sending
     QList<NmAddress> invalidAddresses;
     if (mMessage) {
-        NmUtilities::getRecipientsFromMessage(*mMessage, invalidAddresses, NmUtilities::InvalidAddress);
+        NmUtilities::getRecipientsFromMessage(*mMessage, invalidAddresses, NmUtilities::NmInvalidAddress);
     }
     
     if (invalidAddresses.count() > 0) {
@@ -575,11 +594,7 @@
     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.
@@ -595,12 +610,10 @@
         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);
@@ -627,6 +640,18 @@
 }
 
 /*!
+    This is called when the view's geometry size has been changed, eg. when VKB is opened/closed.
+*/
+void NmEditorView::resizeEvent(QGraphicsSceneResizeEvent *event)
+{
+    NM_FUNCTION;
+    
+    NmBaseView::resizeEvent(event);
+    
+    emit sizeChanged();
+}
+
+/*!
     This is signalled by mMessageCreationOperation when message is created.
 */
 void NmEditorView::messageCreated(int result)
@@ -662,45 +687,45 @@
     NM_FUNCTION;
     
     if (mMessage) {
-        if (mContentWidget && mContentWidget->editor()) {
+        if (mContent && mContent->editor()) {
             NmMessagePart* bodyPart = mMessage->htmlBodyPart();
             if (bodyPart) {
-                bodyPart->setTextContent(mContentWidget->editor()->toHtml(), NmContentTypeTextHtml);
+                bodyPart->setTextContent(mContent->editor()->toHtml(), NmContentTypeTextHtml);
             }
             bodyPart = mMessage->plainTextBodyPart();
             if (bodyPart) {
-                bodyPart->setTextContent(mContentWidget->editor()->toPlainText(), NmContentTypeTextPlain);
+                bodyPart->setTextContent(mContent->editor()->toPlainText(), NmContentTypeTextPlain);
             }
         }
-        if (mContentWidget && mContentWidget->header() ) {
-            if (mContentWidget->header()->subjectEdit()) {
+        if (mContent && mContent->header() ) {
+            if (mContent->header()->subjectEdit()) {
                 mMessage->envelope().setSubject(
-                    mContentWidget->header()->subjectEdit()->text());
+                    mContent->header()->subjectEdit()->text());
             }
-            if (mContentWidget->header()->toEdit()) {
+            if (mContent->header()->toEdit()) {
                 QString toFieldText =
-                    mContentWidget->header()->toEdit()->text();
+                    mContent->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()->toEdit()->emailAddressList());  
+                    mMessage->envelope().setToRecipients(mContent->header()->toEdit()->emailAddressList());  
                 }
             }
-            if (mContentWidget->header()->ccEdit()) {
+            if (mContent->header()->ccEdit()) {
                 QString ccFieldText =
-                    mContentWidget->header()->ccEdit()->text();
+                    mContent->header()->ccEdit()->text();
 
                 if (ccFieldText.length() > 0) {
-                    mMessage->envelope().setCcRecipients(mContentWidget->header()->ccEdit()->emailAddressList());      
+                    mMessage->envelope().setCcRecipients(mContent->header()->ccEdit()->emailAddressList());      
                 }
             }
-            if (mContentWidget->header()->bccEdit()) {
+            if (mContent->header()->bccEdit()) {
                 QString bccFieldText =
-                    mContentWidget->header()->bccEdit()->text();
+                    mContent->header()->bccEdit()->text();
 
                 if (bccFieldText.length() > 0) {
-                    mMessage->envelope().setBccRecipients(mContentWidget->header()->bccEdit()->emailAddressList());  
+                    mMessage->envelope().setBccRecipients(mContent->header()->bccEdit()->emailAddressList());  
                 }
             }
         }
@@ -716,7 +741,7 @@
 {
     NM_FUNCTION;
     
-    if (!mStartParam || !mMessage || !mContentWidget) {
+    if (!mStartParam || !mMessage || !mContent) {
         return;
     }
 
@@ -746,14 +771,14 @@
         bccAddressesString = addressListToString(messageEnvelope.bccRecipients());
     }
 
-    mContentWidget->header()->toEdit()->setPlainText(toAddressesString);
-    mContentWidget->header()->ccEdit()->setPlainText(ccAddressesString);
-    mContentWidget->header()->bccEdit()->setPlainText(bccAddressesString);
+    mContent->header()->toEdit()->setPlainText(toAddressesString);
+    mContent->header()->ccEdit()->setPlainText(ccAddressesString);
+    mContent->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()->setFieldVisibility(true);
+        mContent->header()->setFieldVisibility(true);
     }
 
     // Set subject.
@@ -761,16 +786,20 @@
         QString *subject = mStartParam->subject();
 
         if (subject) {
-            mContentWidget->header()->subjectEdit()->setPlainText(*subject);
+            mContent->header()->subjectEdit()->setPlainText(*subject);
         }
     }
     else {
         // Construct the subject field.
-        mContentWidget->header()->subjectEdit()->setPlainText(
+        mContent->header()->subjectEdit()->setPlainText(
             addSubjectPrefix(editorStartMode, messageEnvelope.subject()));
     }
 
     // Set priority.
+    if (editorStartMode==NmUiEditorReply || editorStartMode==NmUiEditorReplyAll) {
+        //Clear the importance flag. Replied messages dont keep the importance
+        setPriority(NmActionResponseCommandNone);
+    }
     mHeaderWidget->setPriority(messageEnvelope.priority());
     
     // Set the message body.
@@ -803,12 +832,7 @@
                                                *htmlPart);
             }
 
-            if (editorStartMode==NmUiEditorFromDrafts) {
-                mContentWidget->setMessageData(*originalMessage, false);
-            }
-            else {
-                mContentWidget->setMessageData(*originalMessage);
-            }
+		mContent->setMessageData(*originalMessage, editorStartMode);
         }
 
         delete originalMessage;
@@ -1028,7 +1052,7 @@
         // Set the VKB action states
         // All editors of the view share the same action, so it is enough to set
         // this only to one of them.
-        HbEditorInterface editorInterface(mContentWidget->editor());
+        HbEditorInterface editorInterface(mContent->editor());
         QList<HbAction *> vkbList = editorInterface.actions();
         count = vkbList.count();
         for (int i = 0; i < count; i++) {
@@ -1070,15 +1094,15 @@
 
             // Link VKB to the action. This must be done to all
             // editors that show the button in VKB.
-            HbEditorInterface editorInterface(mContentWidget->editor());
+            HbEditorInterface editorInterface(mContent->editor());
             editorInterface.addAction(list[i]);
-            HbEditorInterface toEditorInterface(mContentWidget->header()->toEdit());
+            HbEditorInterface toEditorInterface(mContent->header()->toEdit());
             toEditorInterface.addAction(list[i]);
-            HbEditorInterface ccEditorInterface(mContentWidget->header()->ccEdit());
+            HbEditorInterface ccEditorInterface(mContent->header()->ccEdit());
             ccEditorInterface.addAction(list[i]);
-            HbEditorInterface bccEditorInterface(mContentWidget->header()->bccEdit());
+            HbEditorInterface bccEditorInterface(mContent->header()->bccEdit());
             bccEditorInterface.addAction(list[i]);
-            HbEditorInterface subjectEditorInterface(mContentWidget->header()->subjectEdit());
+            HbEditorInterface subjectEditorInterface(mContent->header()->subjectEdit());
             subjectEditorInterface.addAction(list[i]);
         }
     }
@@ -1283,13 +1307,16 @@
         NmId mailboxId = mMessage->envelope().mailboxId();
         NmId folderId = mMessage->envelope().folderId();
         NmId msgId = mMessage->envelope().messageId();
-
+        NmMessagePriority messagePriority = mMessage->envelope().priority();        
+        
         delete mMessage;
         mMessage = NULL;
         
         mMessage = mUiEngine.message(mailboxId, folderId, msgId);
 
         if (mMessage) {
+            mMessage->envelope().setPriority(messagePriority);
+            mMessage->envelope().setHasAttachments(true);
             // Get attachment list from the message
             QList<NmMessagePart*> attachmentList;
             mMessage->attachmentList(attachmentList);
@@ -1367,7 +1394,7 @@
     while (i != list.constEnd() && *i) {
         if (i > list.constBegin()) {
             // Add the delimiter.
-            addressesString += Delimiter;
+            addressesString += NmDelimiter;
         }
 
         addressesString += (*i)->address();
@@ -1395,7 +1422,7 @@
     while (i != list.constEnd()) {
         if (i > list.constBegin()) {
             // Add the delimiter.
-            addressesString += Delimiter;
+            addressesString += NmDelimiter;
         }
 
         addressesString += (*i).address();
@@ -1447,11 +1474,24 @@
         NmId mailboxId = mMessage->envelope().mailboxId();
         NmId folderId = mMessage->envelope().folderId();
         NmId msgId = mMessage->envelope().messageId();
+        NmMessagePriority messagePriority = mMessage->envelope().priority();    
 
         delete mMessage;
         mMessage = NULL;
     
         mMessage = mUiEngine.message(mailboxId, folderId, msgId);
+        
+        if(mMessage) {
+            // Set the correct priority
+            mMessage->envelope().setPriority(messagePriority);    
+            
+            // If there is no more attachments in the message, set the correct value
+            QList<NmMessagePart*> attachmentList;
+            mMessage->attachmentList(attachmentList);
+            if(attachmentList.count() == 0) {
+                mMessage->envelope().setHasAttachments(false);
+            }
+        }
     }
 }
 
@@ -1493,6 +1533,3 @@
         }
     }
 }
-
-
-// End of file.
--- a/emailuis/nmailui/src/nmmailboxlistview.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxlistview.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -77,19 +77,20 @@
 {
     NM_FUNCTION;
     
+
     // Use document loader to load the view
-    bool ok = false;
-    setObjectName(QString(NMUI_MAILBOX_LIST_VIEW));
-    QObjectList objectList;
-    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_MAILBOX_LIST_VIEW_XML, &ok);
-    }
+     bool ok(false);
+     setObjectName(QString(NMUI_MAILBOX_LIST_VIEW));
+     QObjectList objectList;
+     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_MAILBOX_LIST_VIEW_XML, &ok);
+     }
 
-    if (ok == true && mWidgetList.count()) {
+    if (ok) {
         // Create item context menu
         mItemContextMenu = new HbMenu();
         // Get mailbox widget pointer and set parameters
@@ -211,17 +212,4 @@
     }
 }
 
-/*!
-    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	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxlistviewitem.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -132,17 +132,3 @@
     QGraphicsWidget::polishEvent();
 }
 
-/*!
-    paint. Paint function for line painting.
-*/
-void NmMailboxListViewItem::paint(
-    QPainter *painter,
-    const QStyleOptionGraphicsItem *option,
-    QWidget *widget)
-{
-    NM_FUNCTION;
-    
-    Q_UNUSED(option);
-    Q_UNUSED(widget);
-    Q_UNUSED(painter);
-}
--- a/emailuis/nmailui/src/nmmailboxselectiondialog.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxselectiondialog.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -43,8 +43,6 @@
       mMailboxId(0)
 {
     NM_FUNCTION;
-    
-    // No implementation required.
 }
 
 
@@ -107,7 +105,7 @@
     
     // Use the document loader to load the widgets.
     HbDocumentLoader documentLoader;
-    bool documentLoaded = false;
+    bool documentLoaded(false);
 
     QObjectList objectList;
     objectList.append(this);
--- a/emailuis/nmailui/src/nmmailboxserviceinterface.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxserviceinterface.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -33,18 +33,12 @@
 NmMailboxServiceInterface::NmMailboxServiceInterface(QObject *parent,
         NmUiEngine &uiEngine,
         NmApplication *application)
-#ifndef NM_WINS_ENV
     : XQServiceProvider(emailFullServiceNameMailbox, parent),
-#else
-    : QObject(parent),
-#endif
       mUiEngine(uiEngine),
       mApplication(application),
       mAsyncReqId(0)
 {
-#ifndef NM_WINS_ENV
     publishAll();
-#endif
 }
 
 
@@ -66,7 +60,6 @@
 {
     NM_FUNCTION;
 
-#ifndef NM_WINS_ENV
 
     // Get the given ID and convert it into NmId type.
     NmId mailboxNmId(data.toULongLong());
@@ -84,21 +77,23 @@
 
         // Bring the application to the foreground.
         XQServiceUtil::toBackground(false);
-        HbMainWindow *mainWindow = mApplication->mainWindow();
-        mainWindow->show();
+        if (mApplication) {
+            HbMainWindow *mainWindow = mApplication->mainWindow();
+            mainWindow->show();
 
-        // Launch the message list view.
-        NmUiStartParam *startParam =
-            new NmUiStartParam(NmUiViewMessageList,
-                               mailboxNmId,
-                               inboxId, // folder id
-                               0, // message id
-                               NmUiEditorCreateNew, // editor start mode
-                               NULL, // address list
-                               NULL, // attachment list
-                               true); // start as service
-        mApplication->enterNmUiView(startParam);
-
+            // Launch the message list view.
+            NmUiStartParam *startParam =
+                new NmUiStartParam(NmUiViewMessageList,
+                                   mailboxNmId,
+                                   inboxId, // folder id
+                                   0, // message id
+                                   NmUiEditorCreateNew, // editor start mode
+                                   NULL, // address list
+                                   NULL, // attachment list
+                                   true); // start as service
+            mApplication->enterNmUiView(startParam);
+        }
+       
         completeRequest(mAsyncReqId, 0);
     }
     else {
@@ -117,7 +112,6 @@
                     mApplication, SLOT(delayedExitApplication()));
         }
     }
-#endif
 }
 
 
@@ -143,7 +137,9 @@
         modelIndex = mailboxListModel.index(i, 0);
         mailbox = mailboxListModel.data(modelIndex);
         mailboxMetaData = mailbox.value<NmMailboxMetaData*>();
-        currentId = mailboxMetaData->id();
+        if (mailboxMetaData) {
+            currentId = mailboxMetaData->id();        
+        }
 
         if (currentId.id() == mailboxId.id()) {
             // Found a mailbox with the matching ID.
--- a/emailuis/nmailui/src/nmmessagelistview.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmmessagelistview.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -20,11 +20,11 @@
 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 = "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"
 
+const QString syncIndicatorName = "com.nokia.nmail.indicatorplugin.sync/1.0";
+
 /*! 
 	\class NmMessageListView
 	\brief Message list view
@@ -52,23 +52,18 @@
 mLongPressedItem(NULL),
 mNoMessagesLabel(NULL),
 mFolderLabel(NULL),
-mSyncIcon(NULL),
 mViewReady(false),
 mCurrentFolderType(NmFolderInbox),
 mSettingsLaunched(false),
-mPreviousModelCount(0)
+mPreviousModelCount(0),
+mIsFirstSyncInMessageList(true)
 {
     NM_FUNCTION;
 
-    // Load view layout
     loadViewLayout();
-    //create toolbar
     createToolBar();
-    // Init tree view
     initTreeView();
-    // set title
     setMailboxName();
-    // Set folder name
     setFolderName();
 }
 
@@ -95,7 +90,7 @@
     NM_FUNCTION;
 
     // Use document loader to load the view
-    bool ok = false;
+    bool ok(false);
     setObjectName(QString(NMUI_MESSAGE_LIST_VIEW));
     QObjectList objectList;
     objectList.append(this);
@@ -106,7 +101,7 @@
         mWidgetList = mDocumentLoader->load(NMUI_MESSAGE_LIST_VIEW_XML, &ok);
     }
 
-    if (ok == true && mWidgetList.count()) {
+    if (ok) {
         // Get message list widget
         mMessageListWidget = qobject_cast<HbTreeView *>
             (mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_TREE_LIST));
@@ -144,19 +139,11 @@
 
         mFolderLabel = qobject_cast<HbGroupBox *>(mDocumentLoader->findWidget(NMUI_MESSAGE_LIST_FOLDER_LABEL));
 
-        // 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));
-        }
-
         // Connect options menu about to show to create options menu function
         QObject::connect(menu(), SIGNAL(aboutToShow()),
                          this, SLOT(createOptionsMenu()));
         QObject::connect(&mUiEngine, SIGNAL(syncStateEvent(NmSyncState, const NmId &)),
                          this, SLOT(handleSyncStateEvent(NmSyncState, const NmId &)));
-        QObject::connect(&mUiEngine, SIGNAL(connectionEvent(NmConnectState, const NmId &)),
-                                        this, SLOT(handleConnectionEvent(NmConnectState, const NmId &)));
 
         // Menu needs one dummy item so that aboutToShow signal is emitted.
         NmAction *dummy = new NmAction(0);
@@ -235,7 +222,7 @@
 /*!
     Reload view contents with new start parameters
     Typically when view is already open and external view activation occurs
-    for this same view
+    for this same view. Startparam ownership is transferred to this view
 */
 void NmMessageListView::reloadViewContents(NmUiStartParam* startParam)
 {
@@ -281,44 +268,38 @@
 {
     NM_FUNCTION;
 
-    NmId mailboxId = mMessageListModel->currentMailboxId();
-    if (mSyncIcon && mailboxId == mMessageListModel->currentMailboxId()) {
-        if (mUiEngine.syncState(mailboxId) == Synchronizing) {
-            mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconSynching));
-        }
-        else {
-            if (mUiEngine.connectionState(mailboxId) == Connected) {
-                mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconOnline));
-            }
-            else {
-                mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconOffline));
+    if (mMessageListModel) {
+        NmId mailboxId = mMessageListModel->currentMailboxId();    
+        // 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());
+            
+            NmFolderType folderType = mUiEngine.folderTypeById(mStartParam->mailboxId(),
+                                              mStartParam->folderId());
+            if (folderType == NmFolderInbox) { // If the new folder is an inbox, first automatic sync should be shown
+                mIsFirstSyncInMessageList = true; 
             }
         }
-    }
-
-    // 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)),
-                this, SLOT(itemsAdded(const QModelIndex&,int,int)));
-        QObject::connect(mMessageListModel, SIGNAL(rowsRemoved(const QModelIndex&,int,int)),
-                this, SLOT(itemsRemoved()));
-        QObject::connect(mMessageListModel, SIGNAL(setNewParam(NmUiStartParam*)),
-                this, SLOT(reloadViewContents(NmUiStartParam*)));
+        // Set item model to message list widget
+        if (mMessageListWidget) {
+            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)),
+                    this, SLOT(itemsRemoved()));
+            QObject::connect(mMessageListModel, SIGNAL(setNewParam(NmUiStartParam*)),
+                    this, SLOT(reloadViewContents(NmUiStartParam*)));
 
-        mPreviousModelCount=mMessageListModel->rowCount();
-        if (mPreviousModelCount==0){
-            showNoMessagesText();
-        }
-        else{
-            hideNoMessagesText();
-        }
+            mPreviousModelCount=mMessageListModel->rowCount();
+            if (mPreviousModelCount==0){
+                showNoMessagesText();
+            }
+            else{
+                hideNoMessagesText();
+            }
+        }    
     }
 }
 
@@ -328,11 +309,9 @@
 void NmMessageListView::handleSyncStateEvent(NmSyncState syncState, const NmId & mailboxId)
 {
     NM_FUNCTION;
-
-    if (mSyncIcon && mailboxId == mMessageListModel->currentMailboxId()) {
+    if (mMessageListModel && mailboxId == mMessageListModel->currentMailboxId()) {
         if (syncState == Synchronizing) {
-            mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconSynching));
-            // before first sync inbox id might be zero
+             // 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(
@@ -340,35 +319,17 @@
                     NmFolderInbox);
                 mStartParam->setFolderId(folderId);
             }
-        }
-        else {
-            if (mUiEngine.connectionState(mailboxId) == Connected) {
-                mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconOnline));
-            }
-            else {
-                mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconOffline));
+            // Show sync icon only for the first automatic sync after opening message list.
+            // Sync icon for manual sync is shown in NmUiEngine::refreshMailbox, not here.
+            if (mIsFirstSyncInMessageList) {
+                HbIndicator indicator;
+                indicator.activate(syncIndicatorName, QVariant());
+                mIsFirstSyncInMessageList = false;
             }
         }
     }
 }
 
-/*!
-    Connection event handling
-*/
-void NmMessageListView::handleConnectionEvent(NmConnectState connectState, const NmId &mailboxId)
-{
-    NM_FUNCTION;
-
-    if (mSyncIcon && mailboxId == mMessageListModel->currentMailboxId() && mUiEngine.syncState(mailboxId) != Synchronizing) {
-        if (connectState == Connected) {
-            mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconOnline));
-        }
-        else {
-            mSyncIcon->setIcon(NmIcons::getIcon(NmIcons::NmIconOffline));
-        }
-    }
-}
-
 /*! 
     folder selection handling within current mailbox
 */
--- a/emailuis/nmailui/src/nmmessagelistviewitem.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmmessagelistviewitem.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -236,21 +236,6 @@
 }
 
 /*!
-    paint. Paint function for line painting.
-*/
-void NmMessageListViewItem::paint(
-    QPainter *painter,
-    const QStyleOptionGraphicsItem *option,
-    QWidget *widget)
-{
-    NM_FUNCTION;
-    
-    Q_UNUSED(option);
-    Q_UNUSED(widget);
-    Q_UNUSED(painter);
-}
-
-/*!
     setFontsUnread
 */
 void  NmMessageListViewItem::setFontsUnread()
@@ -258,8 +243,8 @@
     NM_FUNCTION;
     
     static QColor colorRole = HbColorScheme::color("qtc_list_item_title_normal");
-    HbFontSpec spekki(HbFontSpec::Primary);
-    setFonts(colorRole, spekki);
+    HbFontSpec fontSpec(HbFontSpec::Primary);
+    setFonts(colorRole, fontSpec);
 }
 
 /*!
@@ -270,8 +255,8 @@
     NM_FUNCTION;
     
     static QColor colorRole = HbColorScheme::color("qtc_list_item_content_normal");
-    HbFontSpec spekki(HbFontSpec::Secondary);
-    setFonts(colorRole, spekki);
+    HbFontSpec fontSpec(HbFontSpec::Secondary);
+    setFonts(colorRole, fontSpec);
 }
 
 /*!
@@ -283,16 +268,15 @@
     
     // Get font sizes from style  
     qreal currentSize;
-    HbStyle mystyle;
-    bool found = mystyle.parameter(QString("hb-param-text-height-primary"), currentSize );
+    bool found = style()->parameter(QString("hb-param-text-height-primary"), currentSize );
     if (found) {
         mPrimarySize = currentSize;
     }      
-    found = mystyle.parameter(QString("hb-param-text-height-secondary"), currentSize );
+    found = style()->parameter(QString("hb-param-text-height-secondary"), currentSize );
     if (found) {
         mSecondarySize = currentSize;
     }        
-    found = mystyle.parameter(QString("hb-param-text-height-tiny"), currentSize );
+    found = style()->parameter(QString("hb-param-text-height-tiny"), currentSize );
     if (found) {
         mTinySize = currentSize;
     } 
@@ -302,7 +286,7 @@
     setFonts.
 */
 void  NmMessageListViewItem::setFonts(const QColor &colorRole, 
-        HbFontSpec &spekki)
+        HbFontSpec &fontSpec)
 {
     NM_FUNCTION;
     
@@ -310,21 +294,21 @@
     if (mSender && mSubject && mTime) {
         
         if (mPrimarySize) {
-            spekki.setTextHeight(mPrimarySize);
+            fontSpec.setTextHeight(mPrimarySize);
         }      
-        mSender->setFontSpec(spekki);
+        mSender->setFontSpec(fontSpec);
         mSender->setTextColor(colorRole);
         
         if (mSecondarySize) {
-            spekki.setTextHeight(mSecondarySize);
+            fontSpec.setTextHeight(mSecondarySize);
         }        
-        mSubject->setFontSpec(spekki);
+        mSubject->setFontSpec(fontSpec);
         mSubject->setTextColor(colorRole);
 
         if (mTinySize) {
-            spekki.setTextHeight(mTinySize);
+            fontSpec.setTextHeight(mTinySize);
         } 
-        mTime->setFontSpec(spekki);        
+        mTime->setFontSpec(fontSpec);        
         mTime->setTextColor(colorRole);
     }
 }
--- a/emailuis/nmailui/src/nmmessagesearchlistview.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmmessagesearchlistview.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -16,7 +16,7 @@
 */
 
 static const char *NMUI_MESSAGE_SEARCH_LIST_VIEW_XML = ":/docml/nmmessagesearchlistview.docml";
-static const char *NMUI_MESSAGE_SEARCH_LIST_VIEW = "NmMessageListView";
+static const char *NMUI_MESSAGE_SEARCH_LIST_VIEW = "NmMessageSearchListView";
 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 = "LabelGroupBox";
@@ -187,7 +187,41 @@
         mWidgetList = mDocumentLoader->load(NMUI_MESSAGE_SEARCH_LIST_VIEW_XML, &ok);
     }
 
-    if (ok && mWidgetList.count()) {
+    if (ok) {
+        // Load the search panel (contains the line edit and the push button
+        // widgets.
+        mLineEdit = qobject_cast<HbLineEdit *>(
+            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_LINE_EDIT));
+
+        if (mLineEdit) {
+            connect(mLineEdit, SIGNAL(textChanged(QString)), 
+                    this, SLOT(criteriaChanged(QString)));
+        }
+    
+        mPushButton = qobject_cast<HbPushButton *>(
+        mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_PUSH_BUTTON));
+
+        if (mPushButton) {
+            // button is disabled when line edit is empty
+            mPushButton->setEnabled(false);
+
+            // The push button both starts and stops the search.
+            connect(mPushButton, SIGNAL(clicked()), this, SLOT(toggleSearch()));
+            mPushButton->setIcon(HbIcon("qtg_mono_search"));
+        }
+
+        // Load the info label.
+        mInfoLabel = qobject_cast<HbGroupBox *>(
+            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_INFO_LABEL));
+
+        if (mInfoLabel) {
+            NM_COMMENT("NmMessageSearchListView: info label loaded");
+
+            // If the heading is empty, the widget will not be shown which in
+            // turn would ruin the layout.
+            mInfoLabel->setHeading(" ");
+        }
+
         // Get the message list widget.
         mMessageListWidget = qobject_cast<HbTreeView *>(
             mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_TREE_LIST));
@@ -210,15 +244,6 @@
                                                      HbAbstractItemView::Expand);
         }
 
-        // 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));
@@ -227,24 +252,6 @@
             NMLOG("NmMessageSearchListView: No messages label loaded.");
             mNoMessagesLabel->hide();
         }
-
-        // Load the search panel.
-        mLineEdit = qobject_cast<HbLineEdit *>(
-            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_LINE_EDIT));
-        if (mLineEdit) {
-            connect(mLineEdit, SIGNAL(textChanged(QString)), 
-                this, SLOT(criteriaChanged(QString)));
-        }
-        
-        mPushButton = qobject_cast<HbPushButton *>(
-            mDocumentLoader->findWidget(NMUI_MESSAGE_SEARCH_LIST_PUSH_BUTTON));
-        if (mPushButton) {
-			// button is disabled when line edit is empty
-			mPushButton->setEnabled(false);
-            // The push button both starts and stops the search.
-            connect(mPushButton, SIGNAL(clicked()), this, SLOT(toggleSearch()));
-            mPushButton->setIcon(HbIcon("qtg_mono_search"));
-        }
     }
     else {
         NM_ERROR(1, "NmMessageSearchListView: failed to load widgets from XML");
@@ -618,7 +625,13 @@
 
         connect(&mMsgListModel, SIGNAL(setNewParam(NmUiStartParam*)),
                 this, SLOT(reloadViewContents(NmUiStartParam*)), Qt::UniqueConnection);
+    }
 
+    // The info label cannot be hidden when constructed because doing so would
+    // ruin the layout (for example the line edit widget's width would be too
+    // short in lanscape).
+    if (mInfoLabel) {
+        mInfoLabel->hide();
     }
 }
 
--- a/emailuis/nmailui/src/nmrecipientfield.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmrecipientfield.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -17,11 +17,11 @@
 
 #include "nmuiheaders.h"
 
-static const QString ContactsServiceName = "com.nokia.services.phonebookservices";
-static const QString ContactsInterfaceName = "Fetch";
-static const QString ContactsOperationName = "fetch(QString,QString,QString)";
+static const QString NmContactsServiceName = "com.nokia.services.phonebookservices";
+static const QString NmContactsInterfaceName = "Fetch";
+static const QString NmContactsOperationName = "fetch(QString,QString,QString)";
 
-static const int MaxRows = 10000;
+static const int NmMaxRows = 10000;
 
 /*!
    widget is created using AD/docml
@@ -46,12 +46,15 @@
 
     mRecipientsEditor = qobject_cast<NmRecipientLineEdit *>
         (mDocumentLoader.findWidget(mObjectPrefix + "Edit"));
-    mRecipientsEditor->setMaxRows(MaxRows);
+    if (mRecipientsEditor) {
+        mRecipientsEditor->setMaxRows(NmMaxRows);    
+    }
 
     mLaunchContactsPickerButton = qobject_cast<HbPushButton *>
         (mDocumentLoader.findWidget(mObjectPrefix + "Button"));
-
-    mLaunchContactsPickerButton->setIcon(NmIcons::getIcon(NmIcons::NmIconContacts));
+    if (mLaunchContactsPickerButton) {
+        mLaunchContactsPickerButton->setIcon(NmIcons::getIcon(NmIcons::NmIconContacts));    
+    }
 
     createConnections();
 }
@@ -73,10 +76,8 @@
         this, SIGNAL(selectionChanged()));
     connect(mLaunchContactsPickerButton, SIGNAL(pressed()),
             this, SIGNAL(launchContactsPickerButtonClicked()));
-
-#ifdef Q_OS_SYMBIAN
-    connect(mLaunchContactsPickerButton, SIGNAL(pressed()), this, SLOT(launchContactsPicker()));
-#endif
+    connect(mLaunchContactsPickerButton, SIGNAL(pressed()), 
+            this, SLOT(launchContactsPicker()));
 }
 
 
@@ -134,7 +135,6 @@
 }
 
 
-#ifdef Q_OS_SYMBIAN
 /*!
    This Slot launches the contacts-picker
 */
@@ -146,12 +146,12 @@
     XQAiwRequest *launchContactsPickerRequest;
     
     bool isEmbeded = true;
-    launchContactsPickerRequest = mAppmgr.create(ContactsServiceName, ContactsInterfaceName, 
-                                                 ContactsOperationName, isEmbeded);
+    launchContactsPickerRequest = mAppmgr.create(NmContactsServiceName, NmContactsInterfaceName, 
+                                                 NmContactsOperationName, isEmbeded);
     
     if (launchContactsPickerRequest) {
         connect(launchContactsPickerRequest, SIGNAL(requestOk(QVariant)),
-                mRecipientsEditor, SLOT(insertSelectedContacts(QVariant)));
+                mRecipientsEditor, SLOT(addSelectedContacts(QVariant)));
     }
     else {
         // Failed creating request 
@@ -172,6 +172,5 @@
     }
         
     delete launchContactsPickerRequest;
-    launchContactsPickerRequest = 0;
+    launchContactsPickerRequest = NULL;
 }
-#endif
--- a/emailuis/nmailui/src/nmsendserviceinterface.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmsendserviceinterface.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -58,7 +58,7 @@
     {
         NM_FUNCTION;
         
-        bool success = false;
+        bool success(false);
 
         if (data.canConvert(QVariant::Map)) {
             // The given data may contain a mail subject and recipient lists.
@@ -249,11 +249,7 @@
                                                QObject *parent,
                                                NmUiEngine &uiEngine,
                                                NmApplication *application)
-#ifndef NM_WINS_ENV
     : XQServiceProvider(interfaceName, parent),
-#else
-    : QObject(parent),
-#endif
       mApplication(application),
       mUiEngine(uiEngine),
       mAsyncReqId(0),
@@ -261,9 +257,7 @@
       mSelectionDialog(NULL),
       mCurrentView(NULL)
 {
-#ifndef NM_WINS_ENV
     publishAll();
-#endif
 }
 
 
@@ -311,17 +305,19 @@
 {
     NM_FUNCTION;
     
-#ifndef NM_WINS_ENV
+    HbMainWindow *mainWindow(NULL);
     
     // Make sure that qmail stays background if user presses back in editorview
-    mApplication->updateVisibilityState();
+    if (mApplication) {
+        mApplication->updateVisibilityState();
+        
+        mainWindow = mApplication->mainWindow();
+        mCurrentView = mainWindow->currentView();
     
-    HbMainWindow *mainWindow = mApplication->mainWindow();
-    mCurrentView = mainWindow->currentView();
-
-    // Hide the current view.
-    if (mCurrentView) {
-        mCurrentView->hide();
+        // Hide the current view.
+        if (mCurrentView) {
+            mCurrentView->hide();
+        }    
     }
 
     // Check the given data.
@@ -347,9 +343,9 @@
         cancelService();
     }
     else { // count > 0
-        // Make sure the NMail application is in the foreground.
-        XQServiceUtil::toBackground(false);
-        mainWindow->show();
+        if (mainWindow) {
+            mainWindow->show();        
+        }
 
     	mStartParam = new NmUiStartParam(
         	NmUiViewMessageEditor,
@@ -378,8 +374,9 @@
                 mSelectionDialog =
                     new NmMailboxSelectionDialog(mUiEngine.mailboxListModel());
             }
-            connect(mSelectionDialog,SIGNAL(selectionDialogClosed(NmId&)),
-                this,SLOT(selectionDialogClosed(NmId&)));
+
+            connect(mSelectionDialog, SIGNAL(selectionDialogClosed(NmId&)),
+                    this, SLOT(selectionDialogClosed(NmId&)));
             mSelectionDialog->open();
 
             // launch the editor when the dialog is closed
@@ -440,8 +437,4 @@
     }
 }
 
-#endif /* NM_WINS_ENV */
-
-
-
 // End of file.
--- a/emailuis/nmailui/src/nmuidocumentloader.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmuidocumentloader.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -40,7 +40,7 @@
 {
     NM_FUNCTION;
     
-    QObject *res = NULL;
+    QObject *res(NULL);
     if( type == NmMailViewerWK::staticMetaObject.className() ) {
         res = new NmMailViewerWK();
         res->setObjectName(name);
@@ -57,7 +57,7 @@
         res = new NmAttachmentListWidget();
         res->setObjectName(name);
     }    
-    if (res == NULL) {
+    if (!res) {
         res = HbDocumentLoader::createObject(type, name);
     }
     return res;
--- a/emailuis/nmailui/src/nmuieffects.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmuieffects.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -17,7 +17,7 @@
 
 #include "nmuiheaders.h"
 
-static const char *SendAnimation = ":/effects/mail_send.fxml";
+static const char *NmSendAnimation = ":/effects/mail_send.fxml";
 
 /*!
     \class NmEffects
@@ -55,32 +55,35 @@
     NM_FUNCTION;
     
     switch (effect) {
-    case NmEditorSendMessageAnimation:
-        // delete any existing stuff
-        resetSendAnimation();
-        
-        // This effect is for editor send message. Get the screen capture of
-        // editor view for animation which will be lauched soon.
-        mDoSendAnimation = true;
-
-        // take screen shot
-        mSendAnimationScreenShot = screenShot();
+        case NmEditorSendMessageAnimation: {
+            // delete any existing stuff
+            resetSendAnimation();
+            
+            // This effect is for editor send message. Get the screen capture of
+            // editor view for animation which will be lauched soon.
+            mDoSendAnimation = true;
+    
+            // take screen shot
+            mSendAnimationScreenShot = screenShot();
+            
+            if (mSendAnimationScreenShot){
+                // Create graphics item based pixmap image but don't show it yet.
+                mSendAnimationScreenShot->hide();
+                mSendAnimationScreenShot->setPos(0,0);
+                mSendAnimationScreenShot->setZValue(0);
         
-        // Create graphics item based pixmap image but don't show it yet.
-        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.
-        // New view is drawn under this image.
-        mSendAnimationScreenShot->show();
-
-        HbEffect::add(mSendAnimationScreenShot, SendAnimation, "mail_send");
-        break;
+                // 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.
+                // New view is drawn under this image.
+                mSendAnimationScreenShot->show();
+        
+                HbEffect::add(mSendAnimationScreenShot, NmSendAnimation, "mail_send");        
+            }
+            break;
+        }
     }
 }
 
@@ -92,14 +95,15 @@
     NM_FUNCTION;
     
     switch (effect) {
-    case NmEditorSendMessageAnimation:
-        // Send message animation for editor view.
-        if (mDoSendAnimation && mSendAnimationScreenShot) {
-            mDoSendAnimation = false;
-            // Start animation and connect completion signal to sendAnimationComplete slot.
-            HbEffect::start(mSendAnimationScreenShot, "mail_send", this, "sendAnimationComplete");
+        case NmEditorSendMessageAnimation: {
+            // Send message animation for editor view.
+            if (mDoSendAnimation && mSendAnimationScreenShot) {
+                mDoSendAnimation = false;
+                // Start animation and connect completion signal to sendAnimationComplete slot.
+                HbEffect::start(mSendAnimationScreenShot, "mail_send", this, "sendAnimationComplete");
+            }
+            break;
         }
-        break;
     }
 }
 
@@ -113,8 +117,7 @@
     
     // Grab whole view into pixmap image (also chrome is included)
     QPixmap screenCapture = QPixmap::grabWindow(mMainWindow.internalWinId());
-
-    QGraphicsPixmapItem *ret = NULL;
+    QGraphicsPixmapItem *ret(NULL);
     
     // for landscape, the screenshot must be rotated
     if(mMainWindow.orientation() == Qt::Horizontal) {
@@ -138,7 +141,7 @@
     
     if (mSendAnimationScreenShot) {
         // Clean send animation
-        HbEffect::remove(mSendAnimationScreenShot, SendAnimation, "mail_send");
+        HbEffect::remove(mSendAnimationScreenShot, NmSendAnimation, "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
--- a/emailuis/nmailui/src/nmuiextensionmanager.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmuiextensionmanager.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -17,13 +17,13 @@
 
 #include "nmuiheaders.h"
 
+static const QString NmSettingsPluginFolderPath("/resource/qt/plugins/nmail/uiext");
+
 /*!
     \class NmUiExtensionManager
     \brief Handles ui extension plugins
  */
 
-// ======== HELPER FUNCTIONS ========
-
 /*!
   Creates list of folder paths where plug-ins can be loaded from.
   \return folder path list.
@@ -32,7 +32,6 @@
 {
     NM_FUNCTION;
     
-    const QString NmSettingsPluginFolderPath("/resource/qt/plugins/nmail/uiext");
     QStringList pluginDirectories;
     QFileInfoList driveList = QDir::drives();
 
@@ -81,7 +80,7 @@
     NM_FUNCTION;
     
     for (int i = 0; i < mExtensions.count(); i++) {
-    	NmUiExtensionInterface* interface = mExtensions[i];
+    	NmUiExtensionInterface *interface = mExtensions[i];
         interface->getActions(menuRequest, actionList);
     }
 }
@@ -107,7 +106,7 @@
         }
     }
     
-    NmUiExtensionInterface *interface = NULL;    
+    NmUiExtensionInterface *interface(NULL);    
     foreach (QPluginLoader *loader, mPluginLoaders) {      
         NM_COMMENT(QString("Plugin fileName() : %1").arg(loader->fileName()));
         QString fileName = loader->fileName();        
--- a/emailuis/nmailui/src/nmuriserviceinterface.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmuriserviceinterface.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -17,7 +17,6 @@
 */
 
 //  INCLUDES
-#include <xqaiwdecl.h>
 #include "nmuiheaders.h"
 
 /*!
@@ -32,10 +31,10 @@
         Class constructor.
     */
     inline NmStartParamDataHelper()
-    : mSubject(0),
-      mToAddresses(0),
-      mCcAddresses(0),
-      mBccAddresses(0)
+    : mSubject(NULL),
+      mToAddresses(NULL),
+      mCcAddresses(NULL),
+      mBccAddresses(NULL)
     {
         NM_FUNCTION;
     }
@@ -57,7 +56,7 @@
     {
         NM_FUNCTION;
         
-        bool success = false;
+        bool success(false);
         
         QUrl uri(data);
         
@@ -165,11 +164,7 @@
 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),
@@ -177,9 +172,7 @@
       mSelectionDialog(NULL),
       mCurrentView(NULL)
 {
-#ifndef NM_WINS_ENV
     publishAll();
-#endif
 }
 
 
@@ -221,14 +214,17 @@
 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();
+      
+    HbMainWindow *mainWindow(NULL);
+    if (mApplication) {
+        // Make sure that nmail stays background if user presses back in editorview
+        mApplication->updateVisibilityState();
+        
+        mainWindow = mApplication->mainWindow();
+        if (mainWindow) {
+            mCurrentView = mainWindow->currentView();  
+        } 
+    }
 
     // Hide the current view.
     if (mCurrentView) {
@@ -260,7 +256,9 @@
     else { // count > 0
         // Make sure the NMail application is in the foreground.
         XQServiceUtil::toBackground(false);
-        mainWindow->show();
+        if (mainWindow) {
+            mainWindow->show();        
+        }
 
     	mStartParam = new NmUiStartParam(
         	NmUiViewMessageEditor,
@@ -353,8 +351,4 @@
     }
 }
 
-#endif /* NM_WINS_ENV */
-
-
-
 // End of file.
--- a/emailuis/nmailui/src/nmutilities.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmutilities.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -18,9 +18,9 @@
 #include "nmuiheaders.h"
 
 static const int NmMegabyte = 1048576;
-
+static const qreal NmMinAttachmentSize = 0.1;
 // taken from http://www.regular-expressions.info/email.html
-static const QRegExp EmailAddressPattern("[A-Za-z\\d!#$%&'*+/=?^_`{|}~-]+"
+static const QRegExp NmEmailAddressPattern("[A-Za-z\\d!#$%&'*+/=?^_`{|}~-]+"
                                          "(?:"
                                          "\\."
                                          "[A-Za-z\\d!#$%&'*+/=?^_`{|}~-]+"
@@ -48,44 +48,47 @@
 {
     NM_FUNCTION;
 
+    // Get envelope from message
+    const NmMessageEnvelope &env = message.envelope();
+    
     // validate TO addresses
-    QList<NmAddress> toRecipients = message.envelope().toRecipients();
+    QList<NmAddress> toRecipients = env.toRecipients();
     int recipientCount = toRecipients.count();
 
     for (int i = 0; i < recipientCount; ++i) {
         bool validAddress = isValidEmailAddress(toRecipients.at(i).address());
 
-        if (type == Default ||
-            type == ValidAddress && validAddress ||
-            type == InvalidAddress && !validAddress) {
+        if (type == NmDefault ||
+            type == NmValidAddress && validAddress ||
+            type == NmInvalidAddress && !validAddress) {
             recipients.append(toRecipients.at(i));
         }
     }
 
     // validate CC addresses
-    QList<NmAddress> ccRecipients = message.envelope().ccRecipients();
+    QList<NmAddress> ccRecipients = env.ccRecipients();
     recipientCount = ccRecipients.count();
 
     for (int i = 0; i < recipientCount; ++i) {
         bool validAddress = isValidEmailAddress(ccRecipients.at(i).address());
 
-        if (type == Default ||
-            type == ValidAddress && validAddress ||
-            type == InvalidAddress && !validAddress) {
+        if (type == NmDefault ||
+            type == NmValidAddress && validAddress ||
+            type == NmInvalidAddress && !validAddress) {
             recipients.append(ccRecipients.at(i));
         }
     }
 
     // validate BCC addresses
-    QList<NmAddress> bccRecipients = message.envelope().bccRecipients();
+    QList<NmAddress> bccRecipients = env.bccRecipients();
     recipientCount = bccRecipients.count();
 
     for (int i = 0; i < recipientCount; ++i) {
         bool validAddress = isValidEmailAddress(bccRecipients.at(i).address());
 
-        if (type == Default ||
-            type == ValidAddress && validAddress ||
-            type == InvalidAddress && !validAddress) {
+        if (type == NmDefault ||
+            type == NmValidAddress && validAddress ||
+            type == NmInvalidAddress && !validAddress) {
             recipients.append(bccRecipients.at(i));
         }
     }
@@ -98,7 +101,7 @@
 {
     NM_FUNCTION;
 
-    return EmailAddressPattern.exactMatch(emailAddress);
+    return NmEmailAddressPattern.exactMatch(emailAddress);
 }
 
 /*!
@@ -128,9 +131,9 @@
 {
     NM_FUNCTION;
 
-    bool foundAddress = false;
+    bool foundAddress(false);
 
-    QRegExp rx(EmailAddressPattern);
+    QRegExp rx(NmEmailAddressPattern);
     // locate the email address in the string
     int pos = rx.indexIn(emailAddress);
     if (pos != -1) {
@@ -169,7 +172,7 @@
 }
 
 /*!
-  Opens file specified by RFile handle. Usually used by viewer
+  Opens file specified by XQSharableFile handle. Usually used by viewer
   for opening attachments from message store as RFiles
 */
 int NmUtilities::openFile(XQSharableFile &file)
@@ -243,10 +246,10 @@
     NM_FUNCTION;
 
     qreal sizeMb = (qreal)sizeInBytes / (qreal)NmMegabyte;
-    if (sizeMb < 0.1) {
-        // 0.1 Mb is the minimum size shown for attachment
-        sizeMb = 0.1;
-    }
+    if (sizeMb < NmMinAttachmentSize) {
+        // NmMinAttachmentSize (0.1Mb) is the minimum size shown for attachment
+        sizeMb = NmMinAttachmentSize;
+    }   
     return QString().sprintf("(%.1f Mb)", sizeMb); // Use loc string when available
 }
 
--- a/emailuis/nmailui/src/nmviewerheader.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerheader.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -11,14 +11,14 @@
 *
 * Contributors:
 *
-* Description:
+* Description: NMail viewer view header widget implementation
 *
 */
 
 
 #include "nmuiheaders.h"
 
-static const qreal nmHeaderLineOpacity = 0.4;
+static const qreal NmHeaderLineOpacity = 0.4;
 
 /*!
     \class NmViewerHeader
@@ -119,7 +119,7 @@
     Q_UNUSED(widget);
     if (painter) {
         painter->save();
-        painter->setOpacity(nmHeaderLineOpacity);
+        painter->setOpacity(NmHeaderLineOpacity);
         QLineF line1( rect().topLeft().x(), rect().bottomRight().y(),
                      rect().bottomRight().x(), rect().bottomRight().y());
         painter->drawLine(line1);
@@ -160,7 +160,7 @@
         // Set recipients to text edit field as html 
         NmAddress sender = mMessage->envelope().sender();      
         if (mRecipientsBox){  
-            mRecipientsBox->setHtml(formatRecipientList(addressToDisplayInHtml(sender),
+            mRecipientsBox->setHtml(formatRecipientList(addressToDisplay(sender),
                                     mMessage->envelope().toRecipients(), 
                                     mMessage->envelope().ccRecipients()));
         }       
@@ -272,7 +272,7 @@
         // Set recipients to text edit field as html 
         NmAddress sender = mMessage->envelope().sender();               
         if (mMessage) {
-            mRecipientsBox->setHtml(formatRecipientList(addressToDisplayInHtml(sender),
+            mRecipientsBox->setHtml(formatRecipientList(addressToDisplay(sender),
                                     mMessage->envelope().toRecipients(), 
                                     mMessage->envelope().ccRecipients()));
         }
@@ -294,8 +294,8 @@
     
     QString result;
     result.append("<html><body link=\"blue\" topmargin=\"0\" leftmargin=\"0\" marginheight=\"0\"");
-    result.append("marginwidth=\"0\" bgcolor=\"white\" text=\"black\">");    
-    result.append("<font color=\"black\" face=\"");
+    result.append("marginwidth=\"0\">");    
+    result.append("<font face=\"");
     result.append("Nokia Sans");
     result.append("\"size=\"3\">"); 
     // Set text in HTML format based on layout direction
@@ -309,7 +309,7 @@
         result.append(" </b>");
         int reciCount = to.count();
         for (int i=0; i < reciCount; i++) { 
-            result.append(addressToDisplayInHtml(to[i]));
+            result.append(addressToDisplay(to[i]));
             result.append(" ");
         } 
         reciCount = cc.count();
@@ -318,7 +318,7 @@
             result.append(hbTrId("txt_mail_list_cc"));
             result.append(" </b>");
             for (int i=0; i < reciCount; i++) {
-                result.append(addressToDisplayInHtml(cc[i]));
+                result.append(addressToDisplay(cc[i]));
                 result.append(" "); 
             }
         }   
@@ -333,7 +333,7 @@
         result.append(" </b>");
         int reciCount = to.count();
         for (int i=0; i < reciCount; i++) { 
-            result.append(addressToDisplayInHtml(to[i]));
+            result.append(addressToDisplay(to[i]));
             result.append("; ");
         }
         reciCount = cc.count();
@@ -342,7 +342,7 @@
             result.append(hbTrId("txt_mail_list_cc"));
             result.append(" </b>");
             for (int i=0; i < reciCount; i++) {
-                result.append(addressToDisplayInHtml(cc[i]));
+                result.append(addressToDisplay(cc[i]));
                 result.append("; ");
             }
         }   
@@ -355,7 +355,7 @@
     Function retursn address string from NmAddress to
     be displayed in HTML format
 */
-QString NmViewerHeader::addressToDisplayInHtml(const NmAddress &addr)
+QString NmViewerHeader::addressToDisplay(const NmAddress &addr)
 {
     NM_FUNCTION;
     
--- a/emailuis/nmailui/src/nmviewerserviceinterface.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerserviceinterface.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -31,18 +31,12 @@
 NmViewerServiceInterface::NmViewerServiceInterface(QObject *parent,
         NmApplication *application,
         NmUiEngine &uiEngine)
-#ifndef NM_WINS_ENV
     : XQServiceProvider(emailFullServiceNameMessage, parent),
-#else
-    : QObject(parent),
-#endif
       mApplication(application),
       mUiEngine(uiEngine),
       mAsyncReqId(0)
 {
-#ifndef NM_WINS_ENV
     publishAll();
-#endif
 }
 
 
@@ -62,7 +56,6 @@
 {
     NM_FUNCTION;
 
-#ifndef NM_WINS_ENV
     mAsyncReqId = setCurrentRequestAsync();
 
     NmId mailboxNmId(mailboxId.toULongLong());
@@ -122,7 +115,6 @@
                     mApplication, SLOT(delayedExitApplication()));
         }
     }
-#endif
 }
 
 // End of file.
--- a/emailuis/nmailui/src/nmviewerview.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerview.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -11,7 +11,7 @@
  *
  * Contributors:
  *
- * Description:
+ * Description: Mail viewer implementation.
  *
  */
 
@@ -25,11 +25,14 @@
 static const char *NMUI_MESSAGE_VIEWER_HEADER = "viewerHeader";
 static const char *NMUI_MESSAGE_VIEWER_ATTALIST = "viewerAttaList";
 static const char *NMUI_MESSAGE_VIEWER_SCROLL_WEB_VIEW = "viewerWebView";
-
 static const int NmOrientationTimer = 100;
 static const int NmHeaderMargin = 3;
-
+static const int NmWhitePixmapSize = 10;
+static const int NmProgressValueComplete = 100;
 static const QString NmParamTextHeightSecondary = "hb-param-text-height-secondary";
+static const QString NmHttpLinkScheme = "http";
+static const QString NmHttpsLinkScheme = "https";
+static const QString NmMailtoLinkScheme = "mailto";
 
 /*!
 	\class NmViewerView
@@ -62,7 +65,6 @@
 mDisplayingPlainText(false),
 mDocumentLoader(NULL),
 mScrollAreaContents(NULL),
-mViewerHeaderContainer(NULL),
 mScreenSize(QSize(0,0)),
 mWaitDialog(NULL),
 webFrameloadingCompleted(false),
@@ -72,7 +74,7 @@
 mViewReady(false),
 mWaitNoteCancelled(false),
 mErrorNote(NULL)
-    {
+{
     // Create documentloader
     mDocumentLoader = new NmUiDocumentLoader(mMainWindow);
     // Get screensize
@@ -117,6 +119,7 @@
     // View is about to exit, for safety, stop 
     // loading of content before closing the view
     if (mWebView){
+        mAttaManager.cancelFetch();
         mWebView->stop();
         if (mWebView->page()){
             mWebView->page()->deleteLater();
@@ -132,18 +135,18 @@
     NM_FUNCTION;
     
     // Use document loader to load the view
-    bool ok = false;
+    bool ok(false);
     setObjectName(QString(NMUI_MESSAGE_VIEWER_VIEW));
-    QObjectList objectList;
-    objectList.append(this);
-    // Pass the view to documentloader. Document loader uses this view
-    // when docml is parsed, instead of creating new view.
-    // documentloader is created in constructor
-    mDocumentLoader->setObjectTree(objectList);
-    mWidgetList = mDocumentLoader->load(NMUI_MESSAGE_VIEWER_XML, &ok);
-    int widgetCount = mWidgetList.count();
-    if (ok == true && widgetCount)
-    {
+   QObjectList objectList;
+   objectList.append(this);
+   // Pass the view to documentloader. Document loader uses this view
+   // when docml is parsed, instead of creating new view.
+   // documentloader is created in constructor
+   mDocumentLoader->setObjectTree(objectList);
+   mWidgetList = mDocumentLoader->load(NMUI_MESSAGE_VIEWER_XML, &ok);
+
+   if (ok)
+   {
         // Create content and content layout
         // qobject_cast not work in this case, using reinterpret_cast
         mViewerContent = reinterpret_cast<HbWidget *>(
@@ -166,7 +169,7 @@
                     layout->setContentsMargins(0,0,0,0);
                 }
                 // Set white pixmap to backgrounditem 
-                QPixmap whitePixmap(10,10);
+                QPixmap whitePixmap(NmWhitePixmapSize,NmWhitePixmapSize);
                 whitePixmap.fill(Qt::white);
                 QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem(whitePixmap);
                 mScrollAreaContents->setBackgroundItem(pixmapItem);
@@ -186,7 +189,6 @@
             mWebView = reinterpret_cast<NmMailViewerWK *>(
                     mDocumentLoader->findObject(QString(NMUI_MESSAGE_VIEWER_SCROLL_WEB_VIEW)));
             if (mWebView) {
-                mWebView->setParentView(this);
                 // Set auto load images and private browsing(no history) attributes
                 QWebSettings *settings = mWebView->settings();
                 if (settings) {
@@ -385,8 +387,9 @@
   	// if everything is ok, set message to html viewer
     if (mMessage && mWebView && page) {
         // Set initial size of component and content before loading data
-        mWebView->setMaximumWidth(mScreenSize.width());
-        page->setPreferredContentsSize(mScreenSize);
+        mWebView->setPreferredWidth(mScreenSize.width());
+        QRectF myGeometry = geometry();
+        page->setViewportSize(myGeometry.size().toSize());
         //Set message data to html viewer.
         mWebView->setHtml(formatMessage());
         // Connect to link clicked
@@ -416,7 +419,7 @@
         // Set attawidget minimum & maximum size
         mAttaWidget->setMinimumWidth(mScreenSize.width());
         mAttaWidget->setMaximumWidth(mScreenSize.width());
-        bool inserted = false;
+        bool inserted(false);
         QList<NmMessagePart*> messageParts;
         mMessage->attachmentList(messageParts);
         for (int i = 0; i < messageParts.count();i++) {
@@ -458,39 +461,44 @@
 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
-        if (messageParts[i]->partId() == attaId &&
-            messageParts[i]->size() > messageParts[i]->fetchedSize()) {
-            // do not start if there's already ongoing fetch
-            if (mAttaIndexUnderFetch == NmNotFoundError) {
-                mAttaIndexUnderFetch = index;
-                mAttaManager.fetchAttachment(mailboxId, folderId,
-                                             messageId, attaId);
-            }
-        }
-        // attachment is fetched, open file
-        else if (messageParts[i]->partId() == attaId) {
-            XQSharableFile file = mUiEngine.messagePartFile(mailboxId, folderId,
-                                                            messageId, attaId);
-            int error = NmUtilities::openFile(file);
-            file.close();
-            if (error==NmNotFoundError){
-                delete mErrorNote;
-                mErrorNote=NULL;
-                mErrorNote = NmUtilities::displayWarningNote(hbTrId("txt_mail_dialog_unable_to_open_attachment_file_ty"));
-            }
-        }
+    if (index >= 0) {
+        NmId attaId = mAttaIdList.at(index);
+        // reload message to get updates part sizes
+        loadMessage();
+        QList<NmMessagePart*> messageParts;
+        if (mMessage) {
+            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
+                 if (messageParts[i]->partId() == attaId &&
+                     messageParts[i]->size() > messageParts[i]->fetchedSize()) {
+                     // do not start if there's already ongoing fetch
+                     if (mAttaIndexUnderFetch == NmNotFoundError) {
+                         mAttaIndexUnderFetch = index;
+                         mAttaManager.fetchAttachment(mailboxId, folderId,
+                                                      messageId, attaId);
+                     }
+                 }
+                 // attachment is fetched, open file
+                 else if (messageParts[i]->partId() == attaId) {
+                     mAttaManager.cancelFetch();
+                     XQSharableFile file = mUiEngine.messagePartFile(mailboxId, folderId,
+                                                                     messageId, attaId);
+                     int error = NmUtilities::openFile(file);
+                     file.close();
+                     if (error==NmNotFoundError){
+                         delete mErrorNote;
+                         mErrorNote=NULL;
+                         mErrorNote = NmUtilities::displayWarningNote(
+                                 hbTrId("txt_mail_dialog_unable_to_open_attachment_file_ty"));
+                     }
+                 }
+             }            
+         }
     }
 }
 
@@ -502,12 +510,33 @@
     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) {
+    if (mMessage) {
+        NmMessagePart *html = mMessage->htmlBodyPart();
+        if (html) {
+            msg += formatHtmlMessage(html);
+        }
+        else {
+            NmMessagePart *plain = mMessage->plainTextBodyPart();
+            if (plain) {
+                msg += formatPlainTextMessage(plain);
+            }
+        }    
+    }
+    return msg;
+}
+
+/*!
+    Function formats html message
+*/
+QString NmViewerView::formatHtmlMessage(NmMessagePart *html)
+{    
+    NM_FUNCTION;
+
+    QString msg = "";
+    if (html && mMessage) {
+        NmId mailboxId = mMessage->envelope().mailboxId();
+        NmId folderId = mMessage->envelope().folderId();
+        NmId messageId = mMessage->envelope().messageId();
         QList<NmMessagePart*> parts;
         mMessage->attachmentList(parts);
         for (int i=0; i < parts.count(); i++) {
@@ -533,49 +562,60 @@
         }
         int ret = mUiEngine.contentToMessagePart(mailboxId, folderId, messageId, *html);
         if (ret == NmNoError) {
-            msg = html->textContent();
-        }
+         msg = html->textContent();
+        }    
     }
-    else {
-        NmMessagePart *plain = mMessage->plainTextBodyPart();
-        if (plain) {
-            int ret = mUiEngine.contentToMessagePart(mailboxId, folderId,
-                                                     messageId, *plain);
-            if (ret == NmNoError) {
-                QTextDocument document;
-                // set font
-                QFont currentFont = document.defaultFont();
-                currentFont.setWeight(QFont::Normal);
-                qreal secondarySize;
-                HbStyle myStyle;
-                bool found = myStyle.parameter(NmParamTextHeightSecondary, secondarySize);
-                if (found) {
-                    HbFontSpec fontSpec(HbFontSpec::Secondary);
-                    fontSpec.setTextHeight(secondarySize);
-                    currentFont.setPixelSize(fontSpec.font().pixelSize());
-                }
-                document.setDefaultFont(currentFont);
-                // convert to html
-                document.setPlainText(plain->textContent());
-                msg = document.toHtml();
+    return msg;
+}
 
-                if (qApp->layoutDirection()==Qt::RightToLeft){
-                    // add right alignment to document css section
-                    QRegExp rx("(<style type=\"text/css\">)(.+)(</style>)", Qt::CaseInsensitive);
-                    rx.setMinimal(true);
-                    int pos = rx.indexIn(msg);
-                    if (pos > -1) {
-                        QString newStr = rx.cap(1);
-                        newStr.append(rx.cap(2));
-                        newStr.append("p { text-align: right } ");
-                        newStr.append(rx.cap(3));
-                        msg.replace(rx, newStr);
-                    }
+/*!
+    Function formats plain text message message
+*/
+QString NmViewerView::formatPlainTextMessage(NmMessagePart *plain)
+{
+    NM_FUNCTION;
+      
+    QString msg = "";
+    if (plain && mMessage) {
+        NmId mailboxId = mMessage->envelope().mailboxId();
+        NmId folderId = mMessage->envelope().folderId();
+        NmId messageId = mMessage->envelope().messageId();
+        int ret = mUiEngine.contentToMessagePart(mailboxId, folderId,
+                                                 messageId, *plain);
+        if (ret == NmNoError) {
+            QTextDocument document;
+            // set font
+            QFont currentFont = document.defaultFont();
+            currentFont.setWeight(QFont::Normal);
+            qreal secondarySize;
+            HbStyle myStyle;
+            bool found = myStyle.parameter(NmParamTextHeightSecondary, secondarySize);
+            if (found) {
+                HbFontSpec fontSpec(HbFontSpec::Secondary);
+                fontSpec.setTextHeight(secondarySize);
+                currentFont.setPixelSize(fontSpec.font().pixelSize());
+            }
+            document.setDefaultFont(currentFont);
+            // convert to html
+            document.setPlainText(plain->textContent());
+            msg = document.toHtml();
+    
+            if (qApp->layoutDirection()==Qt::RightToLeft){
+                // add right alignment to document css section
+                QRegExp rx("(<style type=\"text/css\">)(.+)(</style>)", Qt::CaseInsensitive);
+                rx.setMinimal(true);
+                int pos = rx.indexIn(msg);
+                if (pos > -1) {
+                    QString newStr = rx.cap(1);
+                    newStr.append(rx.cap(2));
+                    newStr.append("p { text-align: right } ");
+                    newStr.append(rx.cap(3));
+                    msg.replace(rx, newStr);
                 }
             }
-            mDisplayingPlainText=true;
-        }
+        }    
     }
+    mDisplayingPlainText=true;  
     return msg;
 }
 
@@ -637,18 +677,17 @@
     // same size value is received more than once.
     if (size != mLatestLoadingSize) {
         if (!webFrameloadingCompleted && mWebView && mWebView->page() &&
-            (size.width() > mScreenSize.width() || size.height() > mScreenSize.height())) {
+            (size.width() > mScreenSize.width() || size.height() > geometry().height())) {
             int width = (int)size.width();
             int height = (int)size.height();
             // Set content (webview) width
             if (mDisplayingPlainText){
-                setWebViewWidth(mScreenSize.width());
+                mWebView->setPreferredWidth(geometry().width());           
             }
             else {
-                setWebViewWidth(width);
+                mWebView->setPreferredWidth(width);
             }
-            mWebView->setMinimumHeight(height);
-            mWebView->setPreferredHeight(height);
+            mWebView->setPreferredHeight(height);        
         }
     }
     mLatestLoadingSize = size;
@@ -659,33 +698,18 @@
 */
 void NmViewerView::scaleWebViewWhenLoaded()
 {
-    if (mWebView&&mWebView->page()) {
-        QSizeF contentSize = mWebView->page()->mainFrame()->contentsSize();
+    QRectF myGeometry = geometry();
+    QWebPage *page = mWebView->page();
+    if (mWebView && page) {
+        page->setViewportSize(myGeometry.size().toSize());
+        QSizeF contentSize = page->mainFrame()->contentsSize();
         int width = (int)contentSize.width();
-        int height = (int)contentSize.height();
-        // Set content (webview) width
-        if (mDisplayingPlainText) {
-            mWebView->page()->setPreferredContentsSize(mScreenSize);
-            setWebViewWidth(mScreenSize.width());
-        } else {
-            setWebViewWidth(width);
-        }
-        // Set content (webview) height
-        if (mScrollAreaContents){
-            QRectF contentRect = mScrollAreaContents->geometry();
-            if (contentRect.height()<geometry().height()){
-                contentRect.setHeight(geometry().height());
-                mViewerContent->setPreferredHeight(contentRect.height());
-                qreal webViewHeight = geometry().height()-mHeaderWidget->geometry().height();
-                setWebViewHeighth(webViewHeight);
-            } else {
-                setWebViewHeighth(height);
-            }
-        }
+        int height = (int)contentSize.height();  
+        mWebView->setPreferredWidth(width);
+        mWebView->setPreferredHeight(height);
     }
 }
 
-
 /*!
     Set new dimensions after orientation change.
 */
@@ -701,31 +725,8 @@
         // Set attawidget minimum & maximum size
         mAttaWidget->setMinimumWidth(mScreenSize.width());
         mAttaWidget->setMaximumWidth(mScreenSize.width());
-    }
-
-    // Scale web view and its contens
-    if (mWebView){
-        if (mDisplayingPlainText){
-            mWebView->setMaximumWidth((int)mScreenSize.width());
-            mWebView->page()->setPreferredContentsSize(QSize((int)mScreenSize.width(),
-                                           (int)mScreenSize.height()));
-        }
-        else{
-            // Check whether contentsize fits to screen
-            // and if not, set preferred size again to allow panning
-            QSizeF contentSize = mWebView->page()->mainFrame()->contentsSize();
-            if (contentSize.width()>mScreenSize.width()){
-                mWebView->setMaximumWidth((int)contentSize.width());
-                mWebView->page()->setPreferredContentsSize(QSize((int)contentSize.width(),
-                                                           (int)contentSize.height()));
-            }
-            else{
-                mWebView->setMaximumWidth((int)mScreenSize.width());
-                mWebView->page()->setPreferredContentsSize(QSize((int)mScreenSize.width(),
-                                               (int)mScreenSize.height()));
-            }
-        }
-    }
+    }    
+    scaleWebViewWhenLoaded();
 
     if (mToolbarEnabled) {
 		// Re-create toolbar in orientation switch
@@ -733,7 +734,6 @@
     }
 }
 
-
 /*!
    Screen orientation changed. Web view needs to be scaled when
    landscape <-> portrait switch occurs because text needs to
@@ -752,25 +752,28 @@
 {
     NM_FUNCTION;
     
-      if (link.scheme() == "http" ||
-          link.scheme() == "https" ) {
-          QDesktopServices::openUrl(link);
-      }
-      else if (link.scheme() == "mailto"){
-          QList<NmAddress*> *addrList = new QList<NmAddress*>();
-          NmAddress *mailtoAddr = new NmAddress();
-          QString address = link.toString(QUrl::RemoveScheme);
-          mailtoAddr->setAddress(address);
-          mailtoAddr->setDisplayName(address);
-          addrList->append(mailtoAddr);
-          // Create start parameters. Address list ownership
-          // is transferred to startparam object
-          NmUiStartParam* param = new NmUiStartParam(NmUiViewMessageEditor,
-                                                     mStartParam->mailboxId(),
-                                                      mStartParam->folderId(),
-                                                     0, NmUiEditorMailto, addrList );
-          mApplication.enterNmUiView(param);
-      }
+    if (link.scheme() == NmHttpLinkScheme ||
+        link.scheme() == NmHttpsLinkScheme) {
+        mAttaManager.cancelFetch();
+        QDesktopServices::openUrl(link);
+    } else if (link.scheme() == NmMailtoLinkScheme){
+        mAttaManager.cancelFetch();
+        QList<NmAddress*> *addrList = new QList<NmAddress*>();
+        NmAddress *mailtoAddr = new NmAddress();
+        QString address = link.toString(QUrl::RemoveScheme);
+        mailtoAddr->setAddress(address);
+        mailtoAddr->setDisplayName(address);
+        addrList->append(mailtoAddr);
+        // Create start parameters. Address list ownership
+        // is transferred to startparam object
+        NmUiStartParam* param = new NmUiStartParam(NmUiViewMessageEditor,
+                                                   mStartParam->mailboxId(),
+                                                   mStartParam->folderId(),
+                                                   0,
+                                                   NmUiEditorMailto,
+                                                   addrList);
+        mApplication.enterNmUiView(param);
+    }    
 }
 
 /*!
@@ -792,7 +795,7 @@
 }
 
 /*!
-   get function for content widget web view.
+    Get function for content widget web view.
 */
 NmMailViewerWK* NmViewerView::webView()
 {
@@ -800,7 +803,7 @@
 }
 
 /*!
-
+    Get function for message being viewed
 */
 NmMessage* NmViewerView::message()
 {
@@ -934,6 +937,7 @@
     	actionResponse.menuType() == NmActionToolbar) {
         switch (actionResponse.responseCommand()) {
             case NmActionResponseCommandReply: {
+                mAttaManager.cancelFetch();
                 NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor,
                     mStartParam->mailboxId(), mStartParam->folderId(),
                     mStartParam->messageId(), NmUiEditorReply);
@@ -941,6 +945,7 @@
             }
             break;
             case NmActionResponseCommandReplyAll: {
+                mAttaManager.cancelFetch();
                 NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor,
                     mStartParam->mailboxId(), mStartParam->folderId(),
                     mStartParam->messageId(), NmUiEditorReplyAll);
@@ -948,6 +953,7 @@
             }
             break;
             case NmActionResponseCommandForward: {
+                mAttaManager.cancelFetch();
                 NmUiStartParam *startParam = new NmUiStartParam(NmUiViewMessageEditor,
                     mStartParam->mailboxId(), mStartParam->folderId(),
                     mStartParam->messageId(), NmUiEditorForward);
@@ -955,6 +961,7 @@
             }
             break;
             case NmActionResponseCommandDeleteMail: {
+                mAttaManager.cancelFetch();
                 deleteMessage();
                 }
             break;
@@ -972,17 +979,11 @@
     NM_FUNCTION;
     
     QList<NmId> messageList;
-    messageList.append(mStartParam->messageId());
-    
+    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));
-    }
 }
 
 
@@ -1006,7 +1007,7 @@
 {
     if (mAttaWidget && mAttaIndexUnderFetch != NmNotFoundError) {
         if (result == NmNoError) {
-            progressValueChanged(mAttaIndexUnderFetch, 100);
+            progressValueChanged(mAttaIndexUnderFetch, NmProgressValueComplete);
             openAttachment(mAttaIndexUnderFetch);
         } else {
             mAttaWidget->hideProgressBar(mAttaIndexUnderFetch);
@@ -1016,7 +1017,7 @@
 }
 
 /*!
-    externalDelete. From NmMessageListModel, handles viewer shutdown when current message is deleted.
+    externalDelete. From NmUiEngine, handles viewer shutdown when current message is deleted.
 */
 void NmViewerView::messageDeleted(const NmId &mailboxId, const NmId &folderId, const NmId &messageId)
 {
@@ -1047,25 +1048,3 @@
     // Display wait dialog
     mWaitDialog->show(); 
 }
-
-/*!
-    Helper function for width.
-*/
-void NmViewerView::setWebViewWidth(int width)
-{
-    // 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)
-{
-    // null pointer check for mWebView in calling function
-    mWebView->setMinimumHeight(height);
-    mWebView->setMaximumHeight(height);
-    mWebView->setPreferredHeight(height);
-}
--- a/emailuis/nmailui/src/nmviewerviewnetmanager.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerviewnetmanager.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -11,8 +11,9 @@
 *
 * Contributors:
 *
-* Description:
-*
+* Description: NMail viewer net manager implementation.
+*              This class is needed to separate cid
+*              images from url-based images
 */
 
 #include "nmuiheaders.h"
@@ -73,19 +74,20 @@
         && requestUrl.scheme()==NmViewerViewNetManagerScheme) {
         QString id = requestUrl.path();
         NmId partId;
-        bool isFetched = false;
+        bool isFetched(false);
         NmMessage *message = mMessageView->message();
         if (message) {
             QVariant data = mMessageView->webView()->loadResource(
                     QTextDocument::ImageResource, requestUrl, partId, isFetched);
-            NmViewerViewNetReply* reply = NULL;
+            NmViewerViewNetReply* reply(NULL);
             if (isFetched) {
                 reply = new NmViewerViewNetReply(data, mUiEngine);
             }
-            else  {
+            else {
+                const NmMessageEnvelope &env = message->envelope();
                 reply = new NmViewerViewNetReply(data, mUiEngine,
-                        message->envelope().mailboxId(), message->envelope().folderId(),
-                        message->envelope().messageId(), partId);
+                        env.mailboxId(), env.folderId(),
+                        env.messageId(), partId);
             }
             reply->setOriginalRequest(myRequest);
             return reply;
--- a/emailuis/nmailui/src/nmviewerviewnetreply.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerviewnetreply.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -94,6 +94,9 @@
     // Insert embedded images into cache manually
     if(manager()) {
         if(manager()->cache() && request().url().scheme() == NMUI_NET_REPLY_CONTENT_ID) {
+            // Store url to use for reply in access manager finished emitting. 
+            setUrl(request().url());
+            
             // Metadata required for inserted data
             QNetworkCacheMetaData metaData;
             metaData.setUrl(request().url());
@@ -120,18 +123,16 @@
     NM_FUNCTION;
     
     Q_UNUSED(result);
-    NmMessage *message = NULL;
-    message = mUiEngine.message(
-            mMailboxId,
-            mFolderId,
-            mMessageId);
+    NmMessage *message = mUiEngine.message(
+                        mMailboxId, mFolderId, mMessageId);
     if (message) {
         QList<NmMessagePart*> partList;
         message->attachmentList(partList);
-        NmMessagePart *part = NULL;
+        NmMessagePart *part(NULL);
         for (int i = 0; !part && i < partList.count(); i++) {
             if (partList[i]->partId() == mMessagePartId) {
                 part = partList[i];
+                break;
             }
         }
         if (part) {
--- a/emailuis/nmailui/src/nmviewerwebview.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerwebview.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -11,8 +11,8 @@
  *
  * Contributors:
  *
- * Description:
- *
+ * Description: NMailUI web viewer. Inherits from
+ *              QGrapohicsWebView and handles gestures, etc.
  */
 
 #include "nmuiheaders.h"
@@ -21,11 +21,15 @@
     Constructor.
 */
 NmMailViewerWK::NmMailViewerWK()
-: QGraphicsWebView()
+: QGraphicsWebView(),
+  mContent(),
+  mSuppressRelease(false)
 {
+    // Subscribe this widget to tap and pinch gestures.
+    grabGesture(Qt::TapGesture);
     grabGesture(Qt::PinchGesture);
-    installEventFilter(new NmEventFilterWK(this));
-    setFlag(QGraphicsItem::ItemIsFocusable,false);
+    // Prevent this widget from accepting focus.
+    setFocusPolicy(Qt::NoFocus);
 }
 
 /*!
@@ -37,14 +41,6 @@
 }
 
 /*!
-    Sets the parent view.
- */
-void NmMailViewerWK::setParentView(NmViewerView *parentView)
-{
-    mParentView = parentView;
-}
-
-/*!
     Adds content into web view.
  */
 void NmMailViewerWK::addContent(QString key, QVariant val, NmId partId, bool isFetched) 
@@ -69,42 +65,34 @@
             isFetched = mContent[key].mIsFetched;
             return mContent[key].mData;
         }
-        return 0;
     }
     return 0;
 }
 
 /*!
-    Filter class' constructor.
+    This is the main event handler that processes all incoming events in an
+    appropriate manner.
  */
-NmEventFilterWK::NmEventFilterWK(QObject* parent)
-: QObject(parent)
+bool NmMailViewerWK::event(QEvent* event)
 {
-}
-
-/*
-    Filters events if this object has been installed as an event filter.
- */
-bool NmEventFilterWK::eventFilter(QObject* object, QEvent* event) {
-    Q_UNUSED(object);
     bool consumed = false;
     if (event) {
         switch (event->type()) {
         case QEvent::Gesture:
-            consumed = gestureEvent(static_cast<QGestureEvent*>(event));
-            break;
-        case QEvent::GraphicsSceneMouseDoubleClick:
-            // Handle double click (instant zoom).
-            // At the moment we simply consume the event.
-            event->accept();
-            consumed = true;
+            // Handle gesture events.
+            gestureEvent(static_cast<QGestureEvent*>(event));
+            consumed = event->isAccepted();
             break;
         case QEvent::GraphicsSceneContextMenu:
-        case QEvent::GraphicsSceneMouseMove:
-            event->accept();
-            consumed = true;
+            // Handle context-menu events.
+            // contextMenuEvent() is invoked directly in order to override
+            // text selection in QWebPage.
+            contextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent*>(event));
+            consumed = event->isAccepted();
             break;
         default:
+            // Invoke base class' event handler.
+            consumed = QGraphicsWebView::event(event);
             break;
         }
     }
@@ -112,18 +100,78 @@
 }
 
 /*!
-    Handles gesture events. This function is invoked by the eventFilter()
-    function in case of gesture events.
+    Handles context-menu events.
+ */
+void NmMailViewerWK::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
+{
+    if (event) {
+        // Suppress context-menu invocations.
+        event->accept();
+    }
+}
+
+/*!
+    Handles gesture events.
  */
-bool NmEventFilterWK::gestureEvent(QGestureEvent* event) {
-    bool consumed = false;
+void NmMailViewerWK::gestureEvent(QGestureEvent* event)
+{
     if (event) {
+        if (QTapGesture* tap = static_cast<QTapGesture*>(event->gesture(Qt::TapGesture))) {
+            switch (tap->state()) {
+            case Qt::GestureCanceled:
+                // Tap cancellation suppresses the following mouse release.
+                mSuppressRelease = true;
+                break;
+            default:
+                // Other states disclose the following mouse release.
+                mSuppressRelease = false;
+                break;
+            }
+            event->accept();
+        }
         if (QPinchGesture* pinch = static_cast<QPinchGesture*>(event->gesture(Qt::PinchGesture))) {
             // Handle pinch (zoom).
             // At the moment we simply consume the event.
             event->accept();
-            consumed = true;
         }
     }
-    return consumed;
+}
+
+/*!
+    Handles double-click events.
+ */
+void NmMailViewerWK::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
+{
+    if (event) {
+        // Handle double clicks (instant zoom).
+        // At the moment we simply consume the event.
+        event->accept();
+    }
 }
+
+/*!
+    Handles mouse-move events.
+ */
+void NmMailViewerWK::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
+{
+    if (event) {
+        // Suppress drag selection.
+        event->accept();
+    }
+}
+
+/*!
+    Handles mouse-release events.
+ */
+void NmMailViewerWK::mouseReleaseEvent(QGraphicsSceneMouseEvent* event)
+{
+    if (event) {
+        // Suppress mouse release if the previous tap was cancelled.
+        // Otherwise, invoke the base class' event handler.
+        if (mSuppressRelease) {
+            event->accept();
+        } else {
+            QGraphicsWebView::mouseReleaseEvent(event);
+        }
+    }
+}
Binary file emailuis/nmailui/translations/mail.qm has changed
--- a/emailuis/nmailui/translations/mail.ts	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailui/translations/mail.ts	Tue Jul 06 14:04:34 2010 +0300
@@ -7,7 +7,7 @@
     <source>(No Subject)</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-viewid>mail_002</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>
@@ -17,7 +17,7 @@
     <source>Delete</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-viewid>mail_002</extra-loc-viewid>
     <extra-loc-positionid>opt</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -32,12 +32,22 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_subhead_outbox">
+    <comment>Text for indicating the current folder in mail list view. Component is simple label</comment>        
+    <source>Outbox</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>txt_mail_subhead_inbox</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_001</extra-loc-viewid>
+    <extra-loc-positionid>subhead</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_remove_all">
     <comment>Item specific menu item for removing all attachments from the highlighted mail in mail editor</comment>        
     <source>Remove all</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>menu</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -47,7 +57,7 @@
     <source>To:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_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>
@@ -63,11 +73,11 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mail_dialog_save_message_to_drafts">
-    <comment>Dialog that is shown if the editor if the user tries to go back without sending the message.</comment>        
+    <comment>Dialog that is shown if the editor if the user tries to go back without sending the message. Drafts refers to the name of the folder where unsent messages are saved.</comment>        
     <source>Do you want to save this message to drafts?</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-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>dialog</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -77,7 +87,7 @@
     <source>Normal</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>opt_1_sub</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -87,17 +97,17 @@
     <source>Attach</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_toolbar_tiny_2</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>button</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_photo">
-    <comment>Attach toolbar extension item in the viewer, opens images fetch for selecting image. Allows the user to attach an image to the message.</comment>        
+    <comment>Attach toolbar extension item in the editor, opens images fetch for selecting image. Allows the user to attach an image to the message. Note! The text is Image in the visio file but it is not consistent with other apps so it has been decided to change.</comment>        
     <source>Photo</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_b</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -117,7 +127,7 @@
     <source>Cc:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_03</extra-loc-viewid>
+    <extra-loc-viewid>mail_003</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -127,7 +137,7 @@
     <source>Mark as read</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_001_c</extra-loc-viewid>
     <extra-loc-positionid>menu</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -137,7 +147,7 @@
     <source>Hide cc / bcc</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_a</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_a</extra-loc-viewid>
     <extra-loc-positionid>opt</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -147,7 +157,7 @@
     <source>Send</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_toolbar_tiny_2</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>button</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -167,7 +177,7 @@
     <source>Reply all</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-viewid>mail_002</extra-loc-viewid>
     <extra-loc-positionid>opt</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -177,13 +187,13 @@
     <source>Reply</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-viewid>mail_002</extra-loc-viewid>
     <extra-loc-positionid>opt</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_send_as_mail">
-    <comment>text for share ui component. By selecting this the selected content will be sent as mail</comment>        
+    <comment>text for share ui component. By selecting this the selected content will be sent as mail. For selecting content from another application to 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>    
@@ -197,7 +207,7 @@
     <source>High</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>opt_1_sub</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -207,7 +217,7 @@
     <source>(No messages)</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_dblist_val_no_subject</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01</extra-loc-viewid>
+    <extra-loc-viewid>mail_001</extra-loc-viewid>
     <extra-loc-positionid>dblist_2</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -217,7 +227,7 @@
     <source>High</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_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>
@@ -227,7 +237,7 @@
     <source>Settings</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01_a</extra-loc-viewid>
+    <extra-loc-viewid>mail_001_a</extra-loc-viewid>
     <extra-loc-positionid>opt</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -237,7 +247,7 @@
     <source>New</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_toolbar_tiny_2</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01</extra-loc-viewid>
+    <extra-loc-viewid>mail_001</extra-loc-viewid>
     <extra-loc-positionid>button</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -247,7 +257,7 @@
     <source>Sending mail %[]1 failed. Try to send it again or press back to cancel</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-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>dialog</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -257,7 +267,7 @@
     <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_02_a</extra-loc-viewid>
+    <extra-loc-viewid>mail_002_a</extra-loc-viewid>
     <extra-loc-positionid>dialog</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -307,7 +317,7 @@
     <source>Delete</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_001_c</extra-loc-viewid>
     <extra-loc-positionid>menu</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -317,7 +327,17 @@
     <source>Subject:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_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_status_menu_sending">
+    <comment>Secondary text for status menu item: indicates the sending progress is ongoing.</comment>        
+    <source>Sending in progress</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_sec_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_001_d</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -327,7 +347,7 @@
     <source>(%L1 Mb)</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-viewid>mail_002</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -337,7 +357,7 @@
     <source>Sending, please wait</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_notifdialog_pri2</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>dialog</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -347,27 +367,37 @@
     <source>Invalid mail address: %[]1. Send anyway?</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-viewid>mail_004</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_opt_change_folder">
+    <comment>options menu item for changing the folder </comment>        
+    <source>Folders</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_001_a</extra-loc-viewid>
+    <extra-loc-positionid>opt_2</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_searching">
     <comment>Text for indicating that the search is ongoing in mail list view. Component is simple label</comment>        
-    <source>Seaching</source>
+    <source>Searching</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_subhead_inbox</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_08</extra-loc-viewid>
+    <extra-loc-viewid>mail_008</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_editor_subject">
-    <comment>Subject label in mail editor</comment>        
+    <comment>Subject label in mail editor. Label for a field in message editor in which the user enters the subject of the message.</comment>        
     <source>Subject:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_editor_to</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -377,7 +407,7 @@
     <source>From:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_03</extra-loc-viewid>
+    <extra-loc-viewid>mail_003</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -387,7 +417,7 @@
     <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-viewid>mail_001_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>
@@ -397,7 +427,7 @@
     <source>Low</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_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>
@@ -407,7 +437,7 @@
     <source>Cc:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_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>
@@ -417,7 +447,7 @@
     <source>Add priority</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>opt_1</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -426,8 +456,8 @@
     <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_01_d</extra-loc-viewid>
+    <extra-loc-layout_id>qtl_notifdialog_sec_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_001_d</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -443,11 +473,11 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mail_dialog_loading_mail_content">
-    <comment>Wait note shown until the mail content is loaded </comment>        
+    <comment>Wait note shown until the mail content is loaded. Dublicate. I need to check which one is used in implementation.</comment>        
     <source>Loading mail content</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri3</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-viewid>mail_002</extra-loc-viewid>
     <extra-loc-positionid>dialog</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -462,12 +492,22 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_status_menu_unset">
+    <comment>Primary text for status menu item: indicates that there are unsent messages in outbox. %[]1 is account name.</comment>        
+    <source>%[]1: Unsent</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_notifdialog_pri_medium_graphic</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_001_d</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_viewer_opt_forward">
     <comment>Options menu item in mail viewer: opens editor for forwarding</comment>        
     <source>Forward</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-viewid>mail_002</extra-loc-viewid>
     <extra-loc-positionid>opt</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -482,6 +522,16 @@
     <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_004</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>
@@ -493,11 +543,11 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mail_list_new_video">
-    <comment>Attach toolbar extension item in the viewer, opens camera for taking a new video</comment>        
+    <comment>Attach toolbar extension item in the editor, opens camera for taking a new video</comment>        
     <source>New video</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_b</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -507,17 +557,17 @@
     <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-viewid>mail_002</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_dialog_select_file">
-    <comment>Title text in file picker view. File picker view is opened when the user selects &quot;Other&quot; option from attachment list.</comment>        
+    <comment>Title text in file picker view. File picker view is opened when the user selects &quot;Other&quot; option from attachment list. For attaching files to mail messages. Underneath a list of selectable files is displayed.</comment>        
     <source>Select file</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_07</extra-loc-viewid>
+    <extra-loc-viewid>mail_007</extra-loc-viewid>
     <extra-loc-positionid>dpophead</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -527,7 +577,7 @@
     <source>Open</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_001_c</extra-loc-viewid>
     <extra-loc-positionid>menu</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -537,9 +587,9 @@
     <source>Mail</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_pri_graphic</extra-loc-layout_id>    
-    <extra-loc-viewid>Mail</extra-loc-viewid>
+    <extra-loc-viewid>mail</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
-    <extra-loc-feature>Mail</extra-loc-feature>
+    <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mail_dblist_no_messages_matched_your_search">
@@ -547,17 +597,27 @@
     <source>No messages matched your search. Try another search term. </source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_dblist_val_no_subject</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_08</extra-loc-viewid>
+    <extra-loc-viewid>mail_008</extra-loc-viewid>
     <extra-loc-positionid>dblist_4</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_sound">
+    <comment>Attach toolbar extension item in the editor, opens music fetch for selecting sound file. Allows the user to attach a sound file to the message. Note! The text is Music in the visio file but it is not consistent with other apps so it has been decided to change.</comment>        
+    <source>Sound</source>
+    <translation variants="yes" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_004_b</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_editor_to">
-    <comment>Custom layout ID parent. To label in mail editor</comment>        
+    <comment>Custom layout ID parent. To label in mail editor. Label for a field in message editor in which the user enters the mail addresses of the main recipients  of the message.</comment>        
     <source>To:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_editor_to</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -577,7 +637,7 @@
     <source>Importance:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_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>
@@ -587,7 +647,7 @@
     <source>To:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_03</extra-loc-viewid>
+    <extra-loc-viewid>mail_003</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -597,11 +657,21 @@
     <source>Sent:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_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>Shown when the user tries to open the mailbox. </comment>        
+    <source>Account disabled due to security issues. Contact your system administrator.</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_dialog_7</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>
@@ -627,17 +697,27 @@
     <source>Refresh</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01_a</extra-loc-viewid>
+    <extra-loc-viewid>mail_001_a</extra-loc-viewid>
     <extra-loc-positionid>opt</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_subhead_sent_items">
+    <comment>Text for indicating the current folder in mail list view. Component is simple label</comment>        
+    <source>Sent items</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>txt_mail_subhead_inbox</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_001</extra-loc-viewid>
+    <extra-loc-positionid>subhead</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_low">
     <comment>Suboption for option &quot;Add priority&quot; to set mail as low priority</comment>        
     <source>Low</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>opt_1_sub</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -647,7 +727,7 @@
     <source>Mailbox deleted. </source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_notifdialog_pri2</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06</extra-loc-viewid>
+    <extra-loc-viewid>mail_006</extra-loc-viewid>
     <extra-loc-positionid>dialog</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -657,7 +737,7 @@
     <source>---- Original message ----</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_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>
@@ -667,7 +747,7 @@
     <source>Remove</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>menu</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -677,15 +757,25 @@
     <source>Delete mail?</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-viewid>mail_002</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_select_contacts">
+    <comment>Title text shown in status pane when contacts are fetched from Phonebook.</comment>        
+    <source>Select contacts</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
+    <extra-loc-viewid>mail</extra-loc-viewid>
+    <extra-loc-positionid>dpophead</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_no">
     <comment>Button for notes txt_mail_dialog_server_settings_incorrect and txt_mail_dialog_address_or_password_incorrect.</comment>        
     <source>No</source>
-    <translation variants="no" type="unfinished"></translation>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_softkey_2</extra-loc-layout_id>    
     <extra-loc-viewid>mail_dialog_14_15</extra-loc-viewid>
     <extra-loc-positionid>dialog</extra-loc-positionid>
@@ -717,17 +807,17 @@
     <source>(No Subject)</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_dblist_val_no_subject</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01</extra-loc-viewid>
+    <extra-loc-viewid>mail_001</extra-loc-viewid>
     <extra-loc-positionid>dblist_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_editor_bcc">
-    <comment>Bcc: label in mail editor</comment>        
+    <comment>Bcc: label in mail editor. Bcc = blind carbon copy. Label for a field in message editor in which the user enters the mail addresses of those recipients whose names s/he does not want to show to the rest of the recipients.</comment>        
     <source>Bcc:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_editor_to</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -737,17 +827,17 @@
     <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-viewid>mail_001_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>        
+    <comment>Cc: label in mail editor. Cc = carbon copy. Label for a field in message editor in which the user enters the mail addresses of additional recipients  who are not the main recipients of the message.</comment>        
     <source>Cc:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_editor_to</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04</extra-loc-viewid>
+    <extra-loc-viewid>mail_004</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -757,7 +847,7 @@
     <source>Loading mail content</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_notifdialog_pri2_medium_graphic</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02</extra-loc-viewid>
+    <extra-loc-viewid>mail_002</extra-loc-viewid>
     <extra-loc-positionid>dpophead</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -767,7 +857,7 @@
     <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-viewid>mail_001_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>
@@ -777,7 +867,7 @@
     <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-viewid>mail_001_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>
@@ -795,19 +885,29 @@
 <message numerus="no" id="txt_mail_dialog_yes">
     <comment>Button for notes txt_mail_dialog_server_settings_incorrect and txt_mail_dialog_address_or_password_incorrect.</comment>        
     <source>Yes</source>
-    <translation variants="no" type="unfinished"></translation>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_softkey_2</extra-loc-layout_id>    
     <extra-loc-viewid>mail_dialog_14_15</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_button_download_rest">
+    <comment>Button that is shown if all the message content is not downloaded while message is opened.</comment>        
+    <source>Download rest</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id></extra-loc-layout_id>    
+    <extra-loc-viewid>mail_002_b</extra-loc-viewid>
+    <extra-loc-positionid>button</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_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-viewid>mail_001_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>
@@ -817,7 +917,7 @@
     <source>From:</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>none</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_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>
@@ -832,22 +932,32 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_dialog_mail_address_incorrect">
+    <comment>The information dialog that is shown if the user&apos;s own mail address is incorrect and the user tries to sync or send mail.</comment>        
+    <source>Your mail address is incorrect. Check the mail address settings?</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>dpopinfo</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_text_attachment">
-    <comment>Text that is shown in POP mailboxes when there are attachments that are not downloaded yet.</comment>        
+    <comment>Text that is shown in POP mailboxes when there are attachments that are not downloaded yet. This text is preceded by an icon, therefore the lower-case initial letter.</comment>        
     <source>attachment</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_02_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_002_b</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_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>        
+    <comment>Text for status menu item: indicates that there are unsent messages in outbox. %L1 is the number of unsent mails in that mailbox. L1% is usually less than 10 but can be also more.</comment>        
     <source>Waiting to send (%L1)</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_notifdialog_sec_medium_graphic</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_001_d</extra-loc-viewid>
     <extra-loc-positionid>dblist_5_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -867,7 +977,7 @@
     <source>Mail</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_titlebar</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_05</extra-loc-viewid>
+    <extra-loc-viewid>mail_005</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -877,7 +987,7 @@
     <source>Show cc / bcc</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_a</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_a</extra-loc-viewid>
     <extra-loc-positionid>opt</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -892,12 +1002,12 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<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>
+<message numerus="yes" id="txt_mail_list_search_results">
+    <comment>Text for indicating the search results in mail list view. Component is simple label. %Ln stands for the number of search results found in the search. The parameter can be even up to 9999.</comment>        
+    <source>%Ln results</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_subhead_inbox</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_08</extra-loc-viewid>
+    <extra-loc-viewid>mail_008</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -907,17 +1017,17 @@
     <source>Mark as unread</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_menu_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_001_c</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_other">
-    <comment>Attach toolbar extension item in the viewer, opens file fetch for selecting any type of file</comment>        
+    <comment>Attach toolbar extension item in the editor, opens file fetch for selecting any type of file</comment>        
     <source>Other</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_b</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -927,14 +1037,24 @@
     <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-viewid>mail_002</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_subhead_drafts">
+    <comment>Text for indicating the current folder in mail list view. Component is simple label</comment>        
+    <source>Drafts</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>txt_mail_subhead_inbox</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_001</extra-loc-viewid>
+    <extra-loc-positionid>subhead</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_address_or_password_incorrect">
-    <comment>Notification shown when the connection fails (e.g. when syncing) due to mail address or password. </comment>        
-    <source>Mail address or password is incorrect. Do you want to check the settings?</source>
+    <comment>Notification shown when the connection fails (e.g. when syncing) due to username or password. </comment>        
+    <source>Username or password is incorrect. Do you want to check the settings?</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
     <extra-loc-viewid>mail_dialog_15</extra-loc-viewid>
@@ -942,23 +1062,23 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mail_list_music">
-    <comment>Attach toolbar extension item in the viewer, opens music fetch for selecting music file. Allows the user to attach a music file to the message.</comment>        
-    <source>Music</source>
+<message numerus="no" id="txt_mail_list_new_photo">
+    <comment>Attach toolbar extension item in the editor, opens camera for taking a new photo</comment>        
+    <source>New photo</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_b</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_list_new_photo">
-    <comment>Attach toolbar extension item in the viewer, opens camera for taking a new photo</comment>        
-    <source>New photo</source>
-    <translation variants="yes" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_b</extra-loc-viewid>
-    <extra-loc-positionid>list</extra-loc-positionid>
+<message numerus="no" id="txt_mail_subhead_deleted_items">
+    <comment>Text for indicating the current folder in mail list view. Component is simple label</comment>        
+    <source>Deleted items</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>txt_mail_subhead_inbox</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_001</extra-loc-viewid>
+    <extra-loc-positionid>subhead</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
@@ -973,11 +1093,11 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mail_list_video">
-    <comment>Attach toolbar extension item in the viewer, opens video fetch for selecting video file. Allows the user to attach a video file to the message.</comment>        
+    <comment>Attach toolbar extension item in the editor, opens video fetch for selecting video file. Allows the user to attach a video file to the message.</comment>        
     <source>Video</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_04_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_004_b</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -987,10 +1107,20 @@
     <source>Inbox </source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_subhead_inbox</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_01</extra-loc-viewid>
+    <extra-loc-viewid>mail_001</extra-loc-viewid>
     <extra-loc-positionid>subhead</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>Shown when the user tries to open the mailbox if her password has expired.</comment>        
+    <source>Password expired. New security credentials must be created on your computer.</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri5</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_dialog_6</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	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiengine/bwins/nmailuiengineu.def	Tue Jul 06 14:04:34 2010 +0300
@@ -69,246 +69,247 @@
 	?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)
-	?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 &)
-	?markAsRead@NmBaseClientPlugin@@QAEXXZ @ 116 NONAME ; void NmBaseClientPlugin::markAsRead(void)
-	?getInsertionIndex@NmMessageListModel@@ABEHABVNmMessageEnvelope@@@Z @ 117 NONAME ; int NmMessageListModel::getInsertionIndex(class NmMessageEnvelope const &) const
-	?updateOperationProgress@NmOperation@@QAEXH@Z @ 118 NONAME ; void NmOperation::updateOperationProgress(int)
-	??1NmFolderListModel@@UAE@XZ @ 119 NONAME ; NmFolderListModel::~NmFolderListModel(void)
-	?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 *)
-	?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 * *)
-	?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 &)
+	?getPluginIdByMailboxId@NmUiEngine@@QAE?AVNmId@@I@Z @ 71 NONAME ; class NmId NmUiEngine::getPluginIdByMailboxId(unsigned int)
+	?applicationStateInterfaceInstance@NmDataPluginFactory@@AAEPAVNmApplicationStateInterface@@PAVQObject@@@Z @ 72 NONAME ; class NmApplicationStateInterface * NmDataPluginFactory::applicationStateInterfaceInstance(class QObject *)
+	?metaObject@NmMessageListModel@@UBEPBUQMetaObject@@XZ @ 73 NONAME ; struct QMetaObject const * NmMessageListModel::metaObject(void) const
+	?messageBeingSent@NmUiEngine@@QBEPBVNmMessage@@XZ @ 74 NONAME ; class NmMessage const * NmUiEngine::messageBeingSent(void) const
+	?handleMailboxEvent@NmUiEngine@@AAEXW4NmMailboxEvent@@ABV?$QList@VNmId@@@@@Z @ 75 NONAME ; void NmUiEngine::handleMailboxEvent(enum NmMailboxEvent, class QList<class NmId> const &)
+	?interfaceInstance@NmDataPluginFactory@@QAEPAVNmDataPluginInterface@@VNmId@@@Z @ 76 NONAME ; class NmDataPluginInterface * NmDataPluginFactory::interfaceInstance(class NmId)
+	?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 *)
+	?handleMessageEvent@NmMessageListModel@@QAEXW4NmMessageEvent@@ABVNmId@@ABV?$QList@VNmId@@@@1@Z @ 81 NONAME ; void NmMessageListModel::handleMessageEvent(enum NmMessageEvent, class NmId const &, class QList<class NmId> const &, class NmId 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 &)
+	??_ENmMessageListModelItem@@UAE@I@Z @ 98 NONAME ; NmMessageListModelItem::~NmMessageListModelItem(unsigned int)
+	?replyAllMail@NmBaseClientPlugin@@QAEXXZ @ 99 NONAME ; void NmBaseClientPlugin::replyAllMail(void)
+	?handleMatchFound@NmUiEngine@@AAEXABVNmId@@0@Z @ 100 NONAME ; void NmUiEngine::handleMatchFound(class NmId const &, class NmId const &)
+	?syncStateEvent@NmUiEngine@@IAEXW4NmSyncState@@ABVNmId@@@Z @ 101 NONAME ; void NmUiEngine::syncStateEvent(enum NmSyncState, class NmId const &)
+	?refreshModelItem@NmMailboxListModel@@QAEXABVNmId@@@Z @ 102 NONAME ; void NmMailboxListModel::refreshModelItem(class NmId const &)
+	?trUtf8@NmDataManager@@SA?AVQString@@PBD0@Z @ 103 NONAME ; class QString NmDataManager::trUtf8(char const *, char const *)
+	?setEnvelopeProperties@NmMessageListModel@@QAEXW4NmEnvelopeProperties@@ABV?$QList@VNmId@@@@@Z @ 104 NONAME ; void NmMessageListModel::setEnvelopeProperties(enum NmEnvelopeProperties, class QList<class NmId> const &)
+	??1NmStoreEnvelopesOperation@@MAE@XZ @ 105 NONAME ; NmStoreEnvelopesOperation::~NmStoreEnvelopesOperation(void)
+	?tr@NmUiEngine@@SA?AVQString@@PBD0@Z @ 106 NONAME ; class QString NmUiEngine::tr(char const *, char const *)
+	?mPluginLoaderArray@NmDataPluginFactory@@0V?$QList@PAVQPluginLoader@@@@A @ 107 NONAME ; class QList<class QPluginLoader *> NmDataPluginFactory::mPluginLoaderArray
+	?trUtf8@NmBaseClientPlugin@@SA?AVQString@@PBD0@Z @ 108 NONAME ; class QString NmBaseClientPlugin::trUtf8(char const *, char const *)
+	?deleteOperation@NmOperation@@AAEXXZ @ 109 NONAME ; void NmOperation::deleteOperation(void)
+	?trUtf8@NmBaseClientPlugin@@SA?AVQString@@PBD0H@Z @ 110 NONAME ; class QString NmBaseClientPlugin::trUtf8(char const *, char const *, int)
+	?createViewerViewCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 111 NONAME ; void NmBaseClientPlugin::createViewerViewCommands(class NmActionRequest const &, class QList<class NmAction *> &)
+	?fetchMessagePart@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmId@@000@Z @ 112 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 @ 113 NONAME ; class QString NmMailboxListModel::tr(char const *, char const *, int)
+	?handleConnectEvent@NmUiEngine@@QAEXW4NmConnectState@@ABVNmId@@H@Z @ 114 NONAME ; void NmUiEngine::handleConnectEvent(enum NmConnectState, class NmId const &, int)
+	?trUtf8@NmUiEngine@@SA?AVQString@@PBD0H@Z @ 115 NONAME ; class QString NmUiEngine::trUtf8(char const *, char const *, int)
+	?createMailboxItem@NmMailboxListModel@@AAEPAVNmMailboxListModelItem@@PBVNmMailbox@@@Z @ 116 NONAME ; class NmMailboxListModelItem * NmMailboxListModel::createMailboxItem(class NmMailbox const *)
+	?setTitleDivider@NmMessageListModelItem@@QAEXABVQString@@@Z @ 117 NONAME ; void NmMessageListModelItem::setTitleDivider(class QString const &)
+	?markAsRead@NmBaseClientPlugin@@QAEXXZ @ 118 NONAME ; void NmBaseClientPlugin::markAsRead(void)
+	?getInsertionIndex@NmMessageListModel@@ABEHABVNmMessageEnvelope@@@Z @ 119 NONAME ; int NmMessageListModel::getInsertionIndex(class NmMessageEnvelope const &) const
+	?updateOperationProgress@NmOperation@@QAEXH@Z @ 120 NONAME ; void NmOperation::updateOperationProgress(int)
+	?messageEventForListModel@NmUiEngine@@AAEXW4NmMessageEvent@@ABVNmId@@ABV?$QList@VNmId@@@@1@Z @ 121 NONAME ; void NmUiEngine::messageEventForListModel(enum NmMessageEvent, class NmId const &, class QList<class NmId> const &, class NmId const &)
+	??1NmFolderListModel@@UAE@XZ @ 122 NONAME ; NmFolderListModel::~NmFolderListModel(void)
+	?operationCompleted@NmUiEngine@@IAEXABVNmOperationCompletionEvent@@@Z @ 123 NONAME ; void NmUiEngine::operationCompleted(class NmOperationCompletionEvent const &)
+	??1NmDataManager@@UAE@XZ @ 124 NONAME ; NmDataManager::~NmDataManager(void)
+	?trUtf8@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0@Z @ 125 NONAME ; class QString NmStoreEnvelopesOperation::trUtf8(char const *, char const *)
+	?setAddress@NmMailboxMetaData@@QAEXABVQString@@@Z @ 126 NONAME ; void NmMailboxMetaData::setAddress(class QString const &)
+	?getStaticMetaObject@NmMessageCreationOperation@@SAABUQMetaObject@@XZ @ 127 NONAME ; struct QMetaObject const & NmMessageCreationOperation::getStaticMetaObject(void)
+	?updateActiveFolder@NmUiEngine@@QAEXABVNmId@@0@Z @ 128 NONAME ; void NmUiEngine::updateActiveFolder(class NmId const &, class NmId const &)
+	?trUtf8@NmAddAttachmentsOperation@@SA?AVQString@@PBD0@Z @ 129 NONAME ; class QString NmAddAttachmentsOperation::trUtf8(char const *, char const *)
+	?name@NmMailboxMetaData@@QBE?AVQString@@XZ @ 130 NONAME ; class QString NmMailboxMetaData::name(void) const
+	?qt_metacall@NmDataManager@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 131 NONAME ; int NmDataManager::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?runAsyncOperation@NmOperation@@MAEXXZ @ 132 NONAME ; void NmOperation::runAsyncOperation(void)
+	??0NmFolderListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 133 NONAME ; NmFolderListModel::NmFolderListModel(class NmDataManager &, class QObject *)
+	?folderTypeById@NmDataManager@@QAE?AW4NmFolderType@@VNmId@@0@Z @ 134 NONAME ; enum NmFolderType NmDataManager::folderTypeById(class NmId, class NmId)
+	?tr@NmBaseClientPlugin@@SA?AVQString@@PBD0H@Z @ 135 NONAME ; class QString NmBaseClientPlugin::tr(char const *, char const *, int)
+	??0NmMailboxMetaData@@QAE@XZ @ 136 NONAME ; NmMailboxMetaData::NmMailboxMetaData(void)
+	?setEnvelope@NmMessageListModelItem@@QAEXPAVNmMessageEnvelope@@@Z @ 137 NONAME ; void NmMessageListModelItem::setEnvelope(class NmMessageEnvelope *)
+	?saveMessage@NmUiEngine@@QAEHABVNmMessage@@@Z @ 138 NONAME ; int NmUiEngine::saveMessage(class NmMessage const &)
+	?setId@NmMailboxMetaData@@QAEXABVNmId@@@Z @ 139 NONAME ; void NmMailboxMetaData::setId(class NmId const &)
+	?folderTypeById@NmUiEngine@@QAE?AW4NmFolderType@@VNmId@@0@Z @ 140 NONAME ; enum NmFolderType NmUiEngine::folderTypeById(class NmId, class NmId)
+	?mReferenceCount@NmDataPluginFactory@@0HA @ 141 NONAME ; int NmDataPluginFactory::mReferenceCount
+	?tr@NmOperation@@SA?AVQString@@PBD0@Z @ 142 NONAME ; class QString NmOperation::tr(char const *, char const *)
+	?updateMessageEnvelope@NmMessageListModel@@AAEXABVNmId@@00@Z @ 143 NONAME ; void NmMessageListModel::updateMessageEnvelope(class NmId const &, class NmId const &, class NmId const &)
+	?tr@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0@Z @ 144 NONAME ; class QString NmStoreEnvelopesOperation::tr(char const *, char const *)
+	?messagesBelongUnderSameDivider@NmMessageListModel@@ABE_NPBVNmMessageEnvelope@@0@Z @ 145 NONAME ; bool NmMessageListModel::messagesBelongUnderSameDivider(class NmMessageEnvelope const *, class NmMessageEnvelope const *) const
+	?matchFound@NmUiEngine@@IAEXABVNmId@@0@Z @ 146 NONAME ; void NmUiEngine::matchFound(class NmId const &, class NmId const &)
+	?metaObject@NmDataManager@@UBEPBUQMetaObject@@XZ @ 147 NONAME ; struct QMetaObject const * NmDataManager::metaObject(void) const
+	?isSendingMessage@NmUiEngine@@QBE_NXZ @ 148 NONAME ; bool NmUiEngine::isSendingMessage(void) const
+	?freeIcons@NmIcons@@SAXXZ @ 149 NONAME ; void NmIcons::freeIcons(void)
+	?tr@NmAddAttachmentsOperation@@SA?AVQString@@PBD0@Z @ 150 NONAME ; class QString NmAddAttachmentsOperation::tr(char const *, char const *)
+	?itemFromModel@NmMessageListModel@@AAEPAVNmMessageListModelItem@@ABVNmId@@@Z @ 151 NONAME ; class NmMessageListModelItem * NmMessageListModel::itemFromModel(class NmId const &)
+	?instance@NmUiEngine@@SAPAV1@XZ @ 152 NONAME ; class NmUiEngine * NmUiEngine::instance(void)
+	?createMessageListCommands@NmBaseClientPlugin@@AAEXABVNmActionRequest@@AAV?$QList@PAVNmAction@@@@@Z @ 153 NONAME ; void NmBaseClientPlugin::createMessageListCommands(class NmActionRequest const &, class QList<class NmAction *> &)
+	?updateEnvelopeProperty@NmBaseClientPlugin@@AAEXW4NmEnvelopeProperties@@@Z @ 154 NONAME ; void NmBaseClientPlugin::updateEnvelopeProperty(enum NmEnvelopeProperties)
+	??1NmAddAttachmentsOperation@@MAE@XZ @ 155 NONAME ; NmAddAttachmentsOperation::~NmAddAttachmentsOperation(void)
+	?goOffline@NmUiEngine@@QAEHABVNmId@@@Z @ 156 NONAME ; int NmUiEngine::goOffline(class NmId const &)
+	?staticMetaObject@NmDataManager@@2UQMetaObject@@B @ 157 NONAME ; struct QMetaObject const NmDataManager::staticMetaObject
+	?mInstance@NmUiEngine@@0PAV1@A @ 158 NONAME ; class NmUiEngine * NmUiEngine::mInstance
+	?attach@NmBaseClientPlugin@@QAEXXZ @ 159 NONAME ; void NmBaseClientPlugin::attach(void)
+	?setIgnoreFolderIds@NmMessageListModel@@QAEX_N@Z @ 160 NONAME ; void NmMessageListModel::setIgnoreFolderIds(bool)
+	?metaObject@NmAddAttachmentsOperation@@UBEPBUQMetaObject@@XZ @ 161 NONAME ; struct QMetaObject const * NmAddAttachmentsOperation::metaObject(void) const
+	?refresh@NmFolderListModel@@QAEXAAV?$QList@PAVNmFolder@@@@@Z @ 162 NONAME ; void NmFolderListModel::refresh(class QList<class NmFolder *> &)
+	?handleCompletedRemoveDraftOperation@NmUiEngine@@QAEXXZ @ 163 NONAME ; void NmUiEngine::handleCompletedRemoveDraftOperation(void)
+	?trUtf8@NmMailboxListModel@@SA?AVQString@@PBD0@Z @ 164 NONAME ; class QString NmMailboxListModel::trUtf8(char const *, char const *)
+	?envelopeById@NmDataManager@@QAEPAVNmMessageEnvelope@@ABVNmId@@00@Z @ 165 NONAME ; class NmMessageEnvelope * NmDataManager::envelopeById(class NmId const &, class NmId const &, class NmId const &)
+	?getStaticMetaObject@NmOperation@@SAABUQMetaObject@@XZ @ 166 NONAME ; struct QMetaObject const & NmOperation::getStaticMetaObject(void)
+	?trUtf8@NmOperation@@SA?AVQString@@PBD0@Z @ 167 NONAME ; class QString NmOperation::trUtf8(char const *, char const *)
+	?addAttachments@NmUiEngine@@QAE?AV?$QPointer@VNmAddAttachmentsOperation@@@@ABVNmMessage@@ABV?$QList@VQString@@@@@Z @ 168 NONAME ; class QPointer<class NmAddAttachmentsOperation> NmUiEngine::addAttachments(class NmMessage const &, class QList<class QString> const &)
+	?doCancelOperation@NmOperation@@MAEXXZ @ 169 NONAME ; void NmOperation::doCancelOperation(void)
+	?tr@NmOperation@@SA?AVQString@@PBD0H@Z @ 170 NONAME ; class QString NmOperation::tr(char const *, char const *, int)
+	??_ENmOperation@@UAE@I@Z @ 171 NONAME ; NmOperation::~NmOperation(unsigned int)
+	?tr@NmMessageCreationOperation@@SA?AVQString@@PBD0@Z @ 172 NONAME ; class QString NmMessageCreationOperation::tr(char const *, char const *)
+	?qt_metacall@NmMessageListModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 173 NONAME ; int NmMessageListModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?staticMetaObject@NmOperation@@2UQMetaObject@@B @ 174 NONAME ; struct QMetaObject const NmOperation::staticMetaObject
+	??1NmUiEngine@@EAE@XZ @ 175 NONAME ; NmUiEngine::~NmUiEngine(void)
+	?messagePartFile@NmUiEngine@@QAE?AVXQSharableFile@@ABVNmId@@000@Z @ 176 NONAME ; class XQSharableFile NmUiEngine::messagePartFile(class NmId const &, class NmId const &, class NmId const &, class NmId const &)
+	??_ENmMessageListModel@@UAE@I@Z @ 177 NONAME ; NmMessageListModel::~NmMessageListModel(unsigned int)
+	?addPreliminaryOperation@NmOperation@@QAEXPAV1@@Z @ 178 NONAME ; void NmOperation::addPreliminaryOperation(class NmOperation *)
+	?deleteMessages@NmUiEngine@@QAEHABVNmId@@0ABV?$QList@VNmId@@@@@Z @ 179 NONAME ; int NmUiEngine::deleteMessages(class NmId const &, class NmId const &, class QList<class NmId> const &)
+	??_ENmStoreEnvelopesOperation@@UAE@I@Z @ 180 NONAME ; NmStoreEnvelopesOperation::~NmStoreEnvelopesOperation(unsigned int)
+	?mailboxById@NmDataManager@@QAEPAVNmMailboxMetaData@@ABVNmId@@@Z @ 181 NONAME ; class NmMailboxMetaData * NmDataManager::mailboxById(class NmId const &)
+	?messageListModelForSearch@NmUiEngine@@QAEAAVNmMessageListModel@@ABVNmId@@@Z @ 182 NONAME ; class NmMessageListModel & NmUiEngine::messageListModelForSearch(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 *> &)
+	??1NmBaseClientPlugin@@UAE@XZ @ 187 NONAME ; NmBaseClientPlugin::~NmBaseClientPlugin(void)
+	?qt_metacast@NmDataManager@@UAEPAXPBD@Z @ 188 NONAME ; void * NmDataManager::qt_metacast(char const *)
+	??0NmMessageCreationOperation@@QAE@XZ @ 189 NONAME ; NmMessageCreationOperation::NmMessageCreationOperation(void)
+	?qt_metacall@NmBaseClientPlugin@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 190 NONAME ; int NmBaseClientPlugin::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?envelopePtr@NmMessageListModelItem@@QAEPAVNmMessageEnvelope@@XZ @ 191 NONAME ; class NmMessageEnvelope * NmMessageListModelItem::envelopePtr(void)
+	?messageListModel@NmUiEngine@@QAEAAVNmMessageListModel@@ABVNmId@@0@Z @ 192 NONAME ; class NmMessageListModel & NmUiEngine::messageListModel(class NmId const &, class NmId const &)
+	??1NmMailboxMetaData@@UAE@XZ @ 193 NONAME ; NmMailboxMetaData::~NmMailboxMetaData(void)
+	?connectionEvent@NmUiEngine@@IAEXW4NmConnectState@@ABVNmId@@@Z @ 194 NONAME ; void NmUiEngine::connectionEvent(enum NmConnectState, class NmId const &)
+	?mailbox@NmDataManager@@QAEPAVNmMailbox@@ABVNmId@@@Z @ 195 NONAME ; class NmMailbox * NmDataManager::mailbox(class NmId const &)
+	?interfaceInstance@NmDataPluginFactory@@QAEPAVNmDataPluginInterface@@PAVQObject@@@Z @ 196 NONAME ; class NmDataPluginInterface * NmDataPluginFactory::interfaceInstance(class QObject *)
+	?metaObject@NmMailboxListModel@@UBEPBUQMetaObject@@XZ @ 197 NONAME ; struct QMetaObject const * NmMailboxListModel::metaObject(void) const
+	?IconId@NmMailboxMetaData@@QBE?AVNmId@@XZ @ 198 NONAME ; class NmId NmMailboxMetaData::IconId(void) const
+	?sendOperationCompleted@NmUiEngine@@IAEXXZ @ 199 NONAME ; void NmUiEngine::sendOperationCompleted(void)
+	??0NmFolderMetaData@@QAE@XZ @ 200 NONAME ; NmFolderMetaData::NmFolderMetaData(void)
+	?staticMetaObject@NmAddAttachmentsOperation@@2UQMetaObject@@B @ 201 NONAME ; struct QMetaObject const NmAddAttachmentsOperation::staticMetaObject
+	?connectionState@NmUiEngine@@QAE?AW4NmConnectState@@ABVNmId@@@Z @ 202 NONAME ; enum NmConnectState NmUiEngine::connectionState(class NmId const &)
+	?createTitleDividerItem@NmMessageListModel@@AAEPAVNmMessageListModelItem@@PAVNmMessageEnvelope@@@Z @ 203 NONAME ; class NmMessageListModelItem * NmMessageListModel::createTitleDividerItem(class NmMessageEnvelope *)
+	?setId@NmFolderMetaData@@QAEXABVNmId@@@Z @ 204 NONAME ; void NmFolderMetaData::setId(class NmId const &)
+	??0NmOperation@@QAE@XZ @ 205 NONAME ; NmOperation::NmOperation(void)
+	?cancelOperation@NmOperation@@QAEXXZ @ 206 NONAME ; void NmOperation::cancelOperation(void)
+	??_ENmFolderMetaData@@UAE@I@Z @ 207 NONAME ; NmFolderMetaData::~NmFolderMetaData(unsigned int)
+	?qt_metacast@NmMessageListModel@@UAEPAXPBD@Z @ 208 NONAME ; void * NmMessageListModel::qt_metacast(char const *)
+	?operationProgressChanged@NmOperation@@IAEXH@Z @ 209 NONAME ; void NmOperation::operationProgressChanged(int)
+	?trUtf8@NmOperation@@SA?AVQString@@PBD0H@Z @ 210 NONAME ; class QString NmOperation::trUtf8(char const *, char const *, int)
+	??_ENmMailboxListModel@@UAE@I@Z @ 211 NONAME ; NmMailboxListModel::~NmMailboxListModel(unsigned int)
+	?messageDeleted@NmUiEngine@@IAEXABVNmId@@00@Z @ 212 NONAME ; void NmUiEngine::messageDeleted(class NmId const &, class NmId const &, class NmId const &)
+	?trUtf8@NmMessageCreationOperation@@SA?AVQString@@PBD0@Z @ 213 NONAME ; class QString NmMessageCreationOperation::trUtf8(char const *, char const *)
+	?metaObject@NmUiEngine@@UBEPBUQMetaObject@@XZ @ 214 NONAME ; struct QMetaObject const * NmUiEngine::metaObject(void) const
+	??_ENmBaseClientPlugin@@UAE@I@Z @ 215 NONAME ; NmBaseClientPlugin::~NmBaseClientPlugin(unsigned int)
+	?markAsUnread@NmBaseClientPlugin@@QAEXXZ @ 216 NONAME ; void NmBaseClientPlugin::markAsUnread(void)
+	?metaObject@NmBaseClientPlugin@@UBEPBUQMetaObject@@XZ @ 217 NONAME ; struct QMetaObject const * NmBaseClientPlugin::metaObject(void) const
+	?tr@NmDataManager@@SA?AVQString@@PBD0@Z @ 218 NONAME ; class QString NmDataManager::tr(char const *, char const *)
+	?mailboxListModel@NmUiEngine@@QAEAAVNmMailboxListModel@@XZ @ 219 NONAME ; class NmMailboxListModel & NmUiEngine::mailboxListModel(void)
+	?fetchMessage@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmId@@00@Z @ 220 NONAME ; class QPointer<class NmOperation> NmUiEngine::fetchMessage(class NmId const &, class NmId const &, class NmId const &)
+	?setIconId@NmMailboxMetaData@@QAEXABVNmId@@@Z @ 221 NONAME ; void NmMailboxMetaData::setIconId(class NmId const &)
+	??1NmDataPluginFactory@@EAE@XZ @ 222 NONAME ; NmDataPluginFactory::~NmDataPluginFactory(void)
+	?refreshMailboxListModel@NmUiEngine@@QAEXXZ @ 223 NONAME ; void NmUiEngine::refreshMailboxListModel(void)
+	?qt_metacall@NmStoreEnvelopesOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 224 NONAME ; int NmStoreEnvelopesOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@NmMessageListModel@@SA?AVQString@@PBD0@Z @ 225 NONAME ; class QString NmMessageListModel::trUtf8(char const *, char const *)
+	?rowCount@NmFolderListModel@@UBEHABVQModelIndex@@@Z @ 226 NONAME ; int NmFolderListModel::rowCount(class QModelIndex const &) const
+	?doUpdateOperationProgress@NmOperation@@MAEXXZ @ 227 NONAME ; void NmOperation::doUpdateOperationProgress(void)
+	?tr@NmMailboxListModel@@SA?AVQString@@PBD0@Z @ 228 NONAME ; class QString NmMailboxListModel::tr(char const *, char const *)
+	?removeMessage@NmUiEngine@@QAEHABVNmId@@00@Z @ 229 NONAME ; int NmUiEngine::removeMessage(class NmId const &, class NmId const &, class NmId const &)
+	??_ENmUiEngine@@UAE@I@Z @ 230 NONAME ; NmUiEngine::~NmUiEngine(unsigned int)
+	?operationCompleted@NmOperation@@IAEXH@Z @ 231 NONAME ; void NmOperation::operationCompleted(int)
+	?callEmitDataChanged@NmMessageListModelItem@@QAEXXZ @ 232 NONAME ; void NmMessageListModelItem::callEmitDataChanged(void)
+	?handleRequest@NmBaseClientPlugin@@IAEXW4NmActionResponseCommand@@ABVNmActionRequest@@@Z @ 233 NONAME ; void NmBaseClientPlugin::handleRequest(enum NmActionResponseCommand, class NmActionRequest const &)
+	??0NmMessageListModel@@QAE@AAVNmDataManager@@PAVQObject@@@Z @ 234 NONAME ; NmMessageListModel::NmMessageListModel(class NmDataManager &, class QObject *)
+	??_ENmAddAttachmentsOperation@@UAE@I@Z @ 235 NONAME ; NmAddAttachmentsOperation::~NmAddAttachmentsOperation(unsigned int)
+	?syncState@NmUiEngine@@QAE?AW4NmSyncState@@ABVNmId@@@Z @ 236 NONAME ; enum NmSyncState NmUiEngine::syncState(class NmId const &)
+	??1NmOperation@@MAE@XZ @ 237 NONAME ; NmOperation::~NmOperation(void)
+	?tr@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0H@Z @ 238 NONAME ; class QString NmStoreEnvelopesOperation::tr(char const *, char const *, int)
+	?listMailboxes@NmDataManager@@QAEXAAV?$QList@PAVNmMailbox@@@@@Z @ 239 NONAME ; void NmDataManager::listMailboxes(class QList<class NmMailbox *> &)
+	?message@NmUiEngine@@QAEPAVNmMessage@@ABVNmId@@00@Z @ 240 NONAME ; class NmMessage * NmUiEngine::message(class NmId const &, class NmId const &, class NmId const &)
+	?refreshMailbox@NmUiEngine@@QAEHABVNmId@@@Z @ 241 NONAME ; int NmUiEngine::refreshMailbox(class NmId const &)
+	?trUtf8@NmUiEngine@@SA?AVQString@@PBD0@Z @ 242 NONAME ; class QString NmUiEngine::trUtf8(char const *, char const *)
+	?contentToMessagePart@NmUiEngine@@QAEHABVNmId@@00AAVNmMessagePart@@@Z @ 243 NONAME ; int NmUiEngine::contentToMessagePart(class NmId const &, class NmId const &, class NmId const &, class NmMessagePart &)
+	?removeItem@NmMessageListModel@@AAEXHAAVNmMessageListModelItem@@@Z @ 244 NONAME ; void NmMessageListModel::removeItem(int, class NmMessageListModelItem &)
+	??1NmMailboxListModel@@UAE@XZ @ 245 NONAME ; NmMailboxListModel::~NmMailboxListModel(void)
+	??0NmBaseClientPlugin@@QAE@XZ @ 246 NONAME ; NmBaseClientPlugin::NmBaseClientPlugin(void)
+	?forwardMail@NmBaseClientPlugin@@QAEXXZ @ 247 NONAME ; void NmBaseClientPlugin::forwardMail(void)
+	?setItemType@NmMessageListModelItem@@QAEXW4NmMessageItemType@1@@Z @ 248 NONAME ; void NmMessageListModelItem::setItemType(enum NmMessageListModelItem::NmMessageItemType)
+	??_ENmDataPluginFactory@@UAE@I@Z @ 249 NONAME ; NmDataPluginFactory::~NmDataPluginFactory(unsigned int)
+	?mailboxListChanged@NmBaseClientPlugin@@AAEXABVNmId@@W4MailboxEventType@NmSettings@@@Z @ 250 NONAME ; void NmBaseClientPlugin::mailboxListChanged(class NmId const &, enum NmSettings::MailboxEventType)
+	?expanded@NmMessageListModelItem@@QBE_NXZ @ 251 NONAME ; bool NmMessageListModelItem::expanded(void) const
+	?columnCount@NmFolderListModel@@UBEHABVQModelIndex@@@Z @ 252 NONAME ; int NmFolderListModel::columnCount(class QModelIndex const &) const
+	?pluginInstance@NmDataPluginFactory@@QAEPAVQObject@@VNmId@@@Z @ 253 NONAME ; class QObject * NmDataPluginFactory::pluginInstance(class NmId)
+	?setNewParam@NmMessageListModel@@IAEXPAVNmUiStartParam@@@Z @ 254 NONAME ; void NmMessageListModel::setNewParam(class NmUiStartParam *)
+	?data@NmMessageListModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 255 NONAME ; class QVariant NmMessageListModel::data(class QModelIndex const &, int) const
+	?goOnline@NmBaseClientPlugin@@AAEXABVNmId@@@Z @ 256 NONAME ; void NmBaseClientPlugin::goOnline(class NmId const &)
+	?createNewMail@NmBaseClientPlugin@@QAEXXZ @ 257 NONAME ; void NmBaseClientPlugin::createNewMail(void)
+	?qt_metacast@NmBaseClientPlugin@@UAEPAXPBD@Z @ 258 NONAME ; void * NmBaseClientPlugin::qt_metacast(char const *)
+	?staticMetaObject@NmBaseClientPlugin@@2UQMetaObject@@B @ 259 NONAME ; struct QMetaObject const NmBaseClientPlugin::staticMetaObject
+	?searchComplete@NmUiEngine@@IAEXXZ @ 260 NONAME ; void NmUiEngine::searchComplete(void)
+	?setEnvelope@NmMessageListModelItem@@QAEXABVNmMessageEnvelope@@@Z @ 261 NONAME ; void NmMessageListModelItem::setEnvelope(class NmMessageEnvelope const &)
+	?qt_metacast@NmAddAttachmentsOperation@@UAEPAXPBD@Z @ 262 NONAME ; void * NmAddAttachmentsOperation::qt_metacast(char const *)
+	?createNewMailViewerToolBar@NmBaseClientPlugin@@QAEXXZ @ 263 NONAME ; void NmBaseClientPlugin::createNewMailViewerToolBar(void)
+	?staticMetaObject@NmMailboxListModel@@2UQMetaObject@@B @ 264 NONAME ; struct QMetaObject const NmMailboxListModel::staticMetaObject
+	?qt_metacall@NmMessageCreationOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 265 NONAME ; int NmMessageCreationOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@NmDataManager@@SA?AVQString@@PBD0H@Z @ 266 NONAME ; class QString NmDataManager::trUtf8(char const *, char const *, int)
+	?trUtf8@NmMessageCreationOperation@@SA?AVQString@@PBD0H@Z @ 267 NONAME ; class QString NmMessageCreationOperation::trUtf8(char const *, char const *, int)
+	?createForwardMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@0@Z @ 268 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createForwardMessage(class NmId const &, class NmId const &)
+	?handleSyncStateEvent@NmUiEngine@@QAEXW4NmSyncState@@ABVNmOperationCompletionEvent@@@Z @ 269 NONAME ; void NmUiEngine::handleSyncStateEvent(enum NmSyncState, class NmOperationCompletionEvent const &)
+	?completeOperation@NmOperation@@QAEXH@Z @ 270 NONAME ; void NmOperation::completeOperation(int)
+	?parent@NmFolderListModel@@UBE?AVQModelIndex@@ABV2@@Z @ 271 NONAME ; class QModelIndex NmFolderListModel::parent(class QModelIndex const &) const
+	?folder@NmDataManager@@QAEPAVNmFolder@@ABVNmId@@0@Z @ 272 NONAME ; class NmFolder * NmDataManager::folder(class NmId const &, class NmId const &)
+	??0NmMessageSendingOperation@@QAE@XZ @ 273 NONAME ; NmMessageSendingOperation::NmMessageSendingOperation(void)
+	?replyMail@NmBaseClientPlugin@@QAEXXZ @ 274 NONAME ; void NmBaseClientPlugin::replyMail(void)
+	??1NmMessageListModelItem@@UAE@XZ @ 275 NONAME ; NmMessageListModelItem::~NmMessageListModelItem(void)
+	?mailboxPropertyChanged@NmBaseClientPlugin@@AAEXABVNmId@@VQVariant@@1@Z @ 276 NONAME ; void NmBaseClientPlugin::mailboxPropertyChanged(class NmId const &, class QVariant, class QVariant)
+	?qt_metacall@NmOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 277 NONAME ; int NmOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?removeMessageFromModel@NmMessageListModel@@AAEXABVNmId@@@Z @ 278 NONAME ; void NmMessageListModel::removeMessageFromModel(class NmId const &)
+	?trUtf8@NmMessageListModel@@SA?AVQString@@PBD0H@Z @ 279 NONAME ; class QString NmMessageListModel::trUtf8(char const *, char const *, int)
+	?operationPartCompleted@NmAddAttachmentsOperation@@IAEXABVQString@@ABVNmId@@H@Z @ 280 NONAME ; void NmAddAttachmentsOperation::operationPartCompleted(class QString const &, class NmId const &, int)
+	?trUtf8@NmStoreEnvelopesOperation@@SA?AVQString@@PBD0H@Z @ 281 NONAME ; class QString NmStoreEnvelopesOperation::trUtf8(char const *, char const *, int)
+	?tr@NmMessageListModel@@SA?AVQString@@PBD0@Z @ 282 NONAME ; class QString NmMessageListModel::tr(char const *, char const *)
+	?doCompleteOperation@NmOperation@@MAEXXZ @ 283 NONAME ; void NmOperation::doCompleteOperation(void)
+	?dividerInsertionIndex@NmMessageListModel@@AAEHH@Z @ 284 NONAME ; int NmMessageListModel::dividerInsertionIndex(int)
+	?createMessageItem@NmMessageListModel@@AAEPAVNmMessageListModelItem@@PAVNmMessageEnvelope@@@Z @ 285 NONAME ; class NmMessageListModelItem * NmMessageListModel::createMessageItem(class NmMessageEnvelope *)
+	?id@NmFolderMetaData@@QBE?AVNmId@@XZ @ 286 NONAME ; class NmId NmFolderMetaData::id(void) const
+	?createReplyMessage@NmUiEngine@@QAE?AV?$QPointer@VNmMessageCreationOperation@@@@ABVNmId@@0_N@Z @ 287 NONAME ; class QPointer<class NmMessageCreationOperation> NmUiEngine::createReplyMessage(class NmId const &, class NmId const &, bool)
+	?getStandardFolderId@NmDataManager@@QAE?AVNmId@@ABV2@W4NmFolderType@@@Z @ 288 NONAME ; class NmId NmDataManager::getStandardFolderId(class NmId const &, enum NmFolderType)
+	?address@NmMailboxMetaData@@QBE?AVQString@@XZ @ 289 NONAME ; class QString NmMailboxMetaData::address(void) const
+	?dividersActive@NmMessageListModel@@QAE_NXZ @ 290 NONAME ; bool NmMessageListModel::dividersActive(void)
+	?titleDivider@NmMessageListModelItem@@QBE?AVQString@@XZ @ 291 NONAME ; class QString NmMessageListModelItem::titleDivider(void) const
+	?getStaticMetaObject@NmBaseClientPlugin@@SAABUQMetaObject@@XZ @ 292 NONAME ; struct QMetaObject const & NmBaseClientPlugin::getStaticMetaObject(void)
+	?qt_metacast@NmMessageCreationOperation@@UAEPAXPBD@Z @ 293 NONAME ; void * NmMessageCreationOperation::qt_metacast(char const *)
+	?updateEnvelope@NmMessageListModel@@AAEXW4NmEnvelopeProperties@@ABVNmId@@@Z @ 294 NONAME ; void NmMessageListModel::updateEnvelope(enum NmEnvelopeProperties, class NmId const &)
+	??_ENmDataManager@@UAE@I@Z @ 295 NONAME ; NmDataManager::~NmDataManager(unsigned int)
+	?qt_metacast@NmMailboxListModel@@UAEPAXPBD@Z @ 296 NONAME ; void * NmMailboxListModel::qt_metacast(char const *)
+	?search@NmUiEngine@@QAEHABVNmId@@ABVQStringList@@@Z @ 297 NONAME ; int NmUiEngine::search(class NmId const &, class QStringList const &)
+	?setEnvelopes@NmUiEngine@@QAE?AV?$QPointer@VNmStoreEnvelopesOperation@@@@ABVNmId@@0W4NmEnvelopeProperties@@ABV?$QList@PB$$CBVNmMessageEnvelope@@@@@Z @ 298 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 @ 299 NONAME ; void NmBaseClientPlugin::getActions(class NmActionRequest const &, class QList<class NmAction *> &)
+	?qt_metacast@NmStoreEnvelopesOperation@@UAEPAXPBD@Z @ 300 NONAME ; void * NmStoreEnvelopesOperation::qt_metacast(char const *)
+	??_ENmMailboxMetaData@@UAE@I@Z @ 301 NONAME ; NmMailboxMetaData::~NmMailboxMetaData(unsigned int)
+	??0NmMessageListModelItem@@QAE@XZ @ 302 NONAME ; NmMessageListModelItem::NmMessageListModelItem(void)
+	?tr@NmAddAttachmentsOperation@@SA?AVQString@@PBD0H@Z @ 303 NONAME ; class QString NmAddAttachmentsOperation::tr(char const *, char const *, int)
+	?setDividers@NmMessageListModel@@QAEX_N@Z @ 304 NONAME ; void NmMessageListModel::setDividers(bool)
+	?loadPlugin@NmDataPluginFactory@@QAEPAVQObject@@ABVQDir@@ABVQString@@@Z @ 305 NONAME ; class QObject * NmDataPluginFactory::loadPlugin(class QDir const &, class QString const &)
+	?qt_metacast@NmOperation@@UAEPAXPBD@Z @ 306 NONAME ; void * NmOperation::qt_metacast(char const *)
+	?tr@NmMessageListModel@@SA?AVQString@@PBD0H@Z @ 307 NONAME ; class QString NmMessageListModel::tr(char const *, char const *, int)
+	?removeAttachment@NmUiEngine@@QAE?AV?$QPointer@VNmOperation@@@@ABVNmMessage@@ABVNmId@@@Z @ 308 NONAME ; class QPointer<class NmOperation> NmUiEngine::removeAttachment(class NmMessage const &, class NmId const &)
+	?staticMetaObject@NmMessageListModel@@2UQMetaObject@@B @ 309 NONAME ; struct QMetaObject const NmMessageListModel::staticMetaObject
+	?qt_metacall@NmAddAttachmentsOperation@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 310 NONAME ; int NmAddAttachmentsOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@NmUiEngine@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 311 NONAME ; int NmUiEngine::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?message@NmDataManager@@QAEPAVNmMessage@@ABVNmId@@00@Z @ 312 NONAME ; class NmMessage * NmDataManager::message(class NmId const &, class NmId const &, class NmId const &)
+	?metaObject@NmOperation@@UBEPBUQMetaObject@@XZ @ 313 NONAME ; struct QMetaObject const * NmOperation::metaObject(void) const
 
--- a/emailuis/nmailuiengine/eabi/nmailuiengineu.def	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiengine/eabi/nmailuiengineu.def	Tue Jul 06 14:04:34 2010 +0300
@@ -43,279 +43,280 @@
 	_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
+	_ZN10NmUiEngine22getPluginIdByMailboxIdEj @ 45 NONAME
+	_ZN10NmUiEngine22sendOperationCompletedEv @ 46 NONAME
+	_ZN10NmUiEngine23refreshMailboxListModelEv @ 47 NONAME
+	_ZN10NmUiEngine24messageEventForListModelE14NmMessageEventRK4NmIdRK5QListIS1_ES3_ @ 48 NONAME
+	_ZN10NmUiEngine25messageListModelForSearchERK4NmId @ 49 NONAME
+	_ZN10NmUiEngine28handleCompletedSendOperationEv @ 50 NONAME
+	_ZN10NmUiEngine33handleCompletedSaveDraftOperationEv @ 51 NONAME
+	_ZN10NmUiEngine35handleCompletedRemoveDraftOperationEv @ 52 NONAME
+	_ZN10NmUiEngine6searchERK4NmIdRK11QStringList @ 53 NONAME
+	_ZN10NmUiEngine7messageERK4NmIdS2_S2_ @ 54 NONAME
+	_ZN10NmUiEngine8goOnlineERK4NmId @ 55 NONAME
+	_ZN10NmUiEngine8instanceEv @ 56 NONAME
+	_ZN10NmUiEngine9goOfflineERK4NmId @ 57 NONAME
+	_ZN10NmUiEngine9mInstanceE @ 58 NONAME DATA 4
+	_ZN10NmUiEngine9syncStateERK4NmId @ 59 NONAME
+	_ZN10NmUiEngineC1Ev @ 60 NONAME
+	_ZN10NmUiEngineC2Ev @ 61 NONAME
+	_ZN10NmUiEngineD0Ev @ 62 NONAME
+	_ZN10NmUiEngineD1Ev @ 63 NONAME
+	_ZN10NmUiEngineD2Ev @ 64 NONAME
+	_ZN11NmOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 65 NONAME
+	_ZN11NmOperation11qt_metacastEPKc @ 66 NONAME
+	_ZN11NmOperation15cancelOperationEv @ 67 NONAME
+	_ZN11NmOperation15deleteOperationEv @ 68 NONAME
+	_ZN11NmOperation16staticMetaObjectE @ 69 NONAME DATA 16
+	_ZN11NmOperation17completeOperationEi @ 70 NONAME
+	_ZN11NmOperation17doCancelOperationEv @ 71 NONAME
+	_ZN11NmOperation17runAsyncOperationEv @ 72 NONAME
+	_ZN11NmOperation18operationCancelledEv @ 73 NONAME
+	_ZN11NmOperation18operationCompletedEi @ 74 NONAME
+	_ZN11NmOperation19doCompleteOperationEv @ 75 NONAME
+	_ZN11NmOperation19getStaticMetaObjectEv @ 76 NONAME
+	_ZN11NmOperation23addPreliminaryOperationEPS_ @ 77 NONAME
+	_ZN11NmOperation23updateOperationProgressEi @ 78 NONAME
+	_ZN11NmOperation24operationProgressChangedEi @ 79 NONAME
+	_ZN11NmOperation25doUpdateOperationProgressEv @ 80 NONAME
+	_ZN11NmOperation34handlePreliminaryOperationFinishedEv @ 81 NONAME
+	_ZN11NmOperationC2Ev @ 82 NONAME
+	_ZN11NmOperationD0Ev @ 83 NONAME
+	_ZN11NmOperationD1Ev @ 84 NONAME
+	_ZN11NmOperationD2Ev @ 85 NONAME
+	_ZN13NmDataManager10folderByIdERK4NmIdS2_ @ 86 NONAME
+	_ZN13NmDataManager11listFoldersE4NmIdR5QListIP8NmFolderE @ 87 NONAME
+	_ZN13NmDataManager11mailboxByIdERK4NmId @ 88 NONAME
+	_ZN13NmDataManager11qt_metacallEN11QMetaObject4CallEiPPv @ 89 NONAME
+	_ZN13NmDataManager11qt_metacastEPKc @ 90 NONAME
+	_ZN13NmDataManager12envelopeByIdERK4NmIdS2_S2_ @ 91 NONAME
+	_ZN13NmDataManager12listMessagesERK4NmIdS2_R5QListIP17NmMessageEnvelopeE @ 92 NONAME
+	_ZN13NmDataManager13listMailboxesER5QListIP9NmMailboxE @ 93 NONAME
+	_ZN13NmDataManager14folderTypeByIdE4NmIdS0_ @ 94 NONAME
+	_ZN13NmDataManager14listMailboxIdsER5QListI4NmIdE @ 95 NONAME
+	_ZN13NmDataManager16staticMetaObjectE @ 96 NONAME DATA 16
+	_ZN13NmDataManager19getStandardFolderIdERK4NmId12NmFolderType @ 97 NONAME
+	_ZN13NmDataManager19getStaticMetaObjectEv @ 98 NONAME
+	_ZN13NmDataManager20contentToMessagePartERK4NmIdS2_S2_R13NmMessagePart @ 99 NONAME
+	_ZN13NmDataManager6folderERK4NmIdS2_ @ 100 NONAME
+	_ZN13NmDataManager7mailboxERK4NmId @ 101 NONAME
+	_ZN13NmDataManager7messageERK4NmIdS2_S2_ @ 102 NONAME
+	_ZN13NmDataManagerC1Ev @ 103 NONAME
+	_ZN13NmDataManagerC2Ev @ 104 NONAME
+	_ZN13NmDataManagerD0Ev @ 105 NONAME
+	_ZN13NmDataManagerD1Ev @ 106 NONAME
+	_ZN13NmDataManagerD2Ev @ 107 NONAME
+	_ZN16NmFolderMetaData5setIdERK4NmId @ 108 NONAME
+	_ZN16NmFolderMetaData7setNameERK7QString @ 109 NONAME
+	_ZN16NmFolderMetaDataC1Ev @ 110 NONAME
+	_ZN16NmFolderMetaDataC2Ev @ 111 NONAME
+	_ZN16NmFolderMetaDataD0Ev @ 112 NONAME
+	_ZN16NmFolderMetaDataD1Ev @ 113 NONAME
+	_ZN16NmFolderMetaDataD2Ev @ 114 NONAME
+	_ZN17NmFolderListModel7refreshER5QListIP8NmFolderE @ 115 NONAME
+	_ZN17NmFolderListModelC1ER13NmDataManagerP7QObject @ 116 NONAME
+	_ZN17NmFolderListModelC2ER13NmDataManagerP7QObject @ 117 NONAME
+	_ZN17NmFolderListModelD0Ev @ 118 NONAME
+	_ZN17NmFolderListModelD1Ev @ 119 NONAME
+	_ZN17NmFolderListModelD2Ev @ 120 NONAME
+	_ZN17NmMailboxMetaData10setAddressERK7QString @ 121 NONAME
+	_ZN17NmMailboxMetaData5setIdERK4NmId @ 122 NONAME
+	_ZN17NmMailboxMetaData7setNameERK7QString @ 123 NONAME
+	_ZN17NmMailboxMetaData9setIconIdERK4NmId @ 124 NONAME
+	_ZN17NmMailboxMetaDataC1Ev @ 125 NONAME
+	_ZN17NmMailboxMetaDataC2Ev @ 126 NONAME
+	_ZN17NmMailboxMetaDataD0Ev @ 127 NONAME
+	_ZN17NmMailboxMetaDataD1Ev @ 128 NONAME
+	_ZN17NmMailboxMetaDataD2Ev @ 129 NONAME
+	_ZN18NmBaseClientPlugin10getActionsERK15NmActionRequestR5QListIP8NmActionE @ 130 NONAME
+	_ZN18NmBaseClientPlugin10markAsReadEv @ 131 NONAME
+	_ZN18NmBaseClientPlugin11forwardMailEv @ 132 NONAME
+	_ZN18NmBaseClientPlugin11openMessageEv @ 133 NONAME
+	_ZN18NmBaseClientPlugin11qt_metacallEN11QMetaObject4CallEiPPv @ 134 NONAME
+	_ZN18NmBaseClientPlugin11qt_metacastEPKc @ 135 NONAME
+	_ZN18NmBaseClientPlugin12markAsUnreadEv @ 136 NONAME
+	_ZN18NmBaseClientPlugin12replyAllMailEv @ 137 NONAME
+	_ZN18NmBaseClientPlugin13createNewMailEv @ 138 NONAME
+	_ZN18NmBaseClientPlugin13deleteMessageEv @ 139 NONAME
+	_ZN18NmBaseClientPlugin13handleRequestE23NmActionResponseCommandRK15NmActionRequest @ 140 NONAME
+	_ZN18NmBaseClientPlugin14openAttachmentEv @ 141 NONAME
+	_ZN18NmBaseClientPlugin14setPriorityLowEv @ 142 NONAME
+	_ZN18NmBaseClientPlugin15setPriorityHighEv @ 143 NONAME
+	_ZN18NmBaseClientPlugin16removeAttachmentEv @ 144 NONAME
+	_ZN18NmBaseClientPlugin16staticMetaObjectE @ 145 NONAME DATA 16
+	_ZN18NmBaseClientPlugin17setPriorityNormalEv @ 146 NONAME
+	_ZN18NmBaseClientPlugin18mailboxListChangedERK4NmIdN10NmSettings16MailboxEventTypeE @ 147 NONAME
+	_ZN18NmBaseClientPlugin19getStaticMetaObjectEv @ 148 NONAME
+	_ZN18NmBaseClientPlugin22mailboxPropertyChangedERK4NmId8QVariantS3_ @ 149 NONAME
+	_ZN18NmBaseClientPlugin22updateEnvelopePropertyE20NmEnvelopeProperties @ 150 NONAME
+	_ZN18NmBaseClientPlugin24createEditorViewCommandsERK15NmActionRequestR5QListIP8NmActionE @ 151 NONAME
+	_ZN18NmBaseClientPlugin24createViewerViewCommandsERK15NmActionRequestR5QListIP8NmActionE @ 152 NONAME
+	_ZN18NmBaseClientPlugin25createMessageListCommandsERK15NmActionRequestR5QListIP8NmActionE @ 153 NONAME
+	_ZN18NmBaseClientPlugin26createNewMailViewerToolBarEv @ 154 NONAME
+	_ZN18NmBaseClientPlugin27deleteMessageFromViewerViewEv @ 155 NONAME
+	_ZN18NmBaseClientPlugin6attachEv @ 156 NONAME
+	_ZN18NmBaseClientPlugin6searchEv @ 157 NONAME
+	_ZN18NmBaseClientPlugin7refreshEv @ 158 NONAME
+	_ZN18NmBaseClientPlugin8goOnlineERK4NmId @ 159 NONAME
+	_ZN18NmBaseClientPlugin8sendMailEv @ 160 NONAME
+	_ZN18NmBaseClientPlugin8settingsEv @ 161 NONAME
+	_ZN18NmBaseClientPlugin9goOfflineERK4NmId @ 162 NONAME
+	_ZN18NmBaseClientPlugin9replyMailEv @ 163 NONAME
+	_ZN18NmBaseClientPluginC2Ev @ 164 NONAME
+	_ZN18NmBaseClientPluginD0Ev @ 165 NONAME
+	_ZN18NmBaseClientPluginD1Ev @ 166 NONAME
+	_ZN18NmBaseClientPluginD2Ev @ 167 NONAME
+	_ZN18NmMailboxListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 168 NONAME
+	_ZN18NmMailboxListModel11qt_metacastEPKc @ 169 NONAME
+	_ZN18NmMailboxListModel16refreshModelItemERK4NmId @ 170 NONAME
+	_ZN18NmMailboxListModel16staticMetaObjectE @ 171 NONAME DATA 16
+	_ZN18NmMailboxListModel17createMailboxItemEPK9NmMailbox @ 172 NONAME
+	_ZN18NmMailboxListModel18handleMailboxEventE14NmMailboxEventRK5QListI4NmIdE @ 173 NONAME
+	_ZN18NmMailboxListModel19getStaticMetaObjectEv @ 174 NONAME
+	_ZN18NmMailboxListModel7refreshER5QListIP9NmMailboxE @ 175 NONAME
+	_ZN18NmMailboxListModelC1ER13NmDataManagerP7QObject @ 176 NONAME
+	_ZN18NmMailboxListModelC2ER13NmDataManagerP7QObject @ 177 NONAME
+	_ZN18NmMailboxListModelD0Ev @ 178 NONAME
+	_ZN18NmMailboxListModelD1Ev @ 179 NONAME
+	_ZN18NmMailboxListModelD2Ev @ 180 NONAME
+	_ZN18NmMessageListModel10removeItemEiR22NmMessageListModelItem @ 181 NONAME
+	_ZN18NmMessageListModel11qt_metacallEN11QMetaObject4CallEiPPv @ 182 NONAME
+	_ZN18NmMessageListModel11qt_metacastEPKc @ 183 NONAME
+	_ZN18NmMessageListModel11setDividersEb @ 184 NONAME
+	_ZN18NmMessageListModel11setNewParamEP14NmUiStartParam @ 185 NONAME
+	_ZN18NmMessageListModel13itemFromModelERK4NmId @ 186 NONAME
+	_ZN18NmMessageListModel14dividersActiveEv @ 187 NONAME
+	_ZN18NmMessageListModel14updateEnvelopeE20NmEnvelopePropertiesRK4NmId @ 188 NONAME
+	_ZN18NmMessageListModel16currentMailboxIdEv @ 189 NONAME
+	_ZN18NmMessageListModel16staticMetaObjectE @ 190 NONAME DATA 16
+	_ZN18NmMessageListModel17createMessageItemEP17NmMessageEnvelope @ 191 NONAME
+	_ZN18NmMessageListModel18handleMessageEventE14NmMessageEventRK4NmIdRK5QListIS1_ES3_ @ 192 NONAME
+	_ZN18NmMessageListModel18setIgnoreFolderIdsEb @ 193 NONAME
+	_ZN18NmMessageListModel19getStaticMetaObjectEv @ 194 NONAME
+	_ZN18NmMessageListModel21dividerInsertionIndexEi @ 195 NONAME
+	_ZN18NmMessageListModel21setEnvelopePropertiesE20NmEnvelopePropertiesRK5QListI4NmIdE @ 196 NONAME
+	_ZN18NmMessageListModel21updateMessageEnvelopeERK4NmIdS2_S2_ @ 197 NONAME
+	_ZN18NmMessageListModel22createTitleDividerItemEP17NmMessageEnvelope @ 198 NONAME
+	_ZN18NmMessageListModel22insertDividerIntoModelEP17NmMessageEnvelopei @ 199 NONAME
+	_ZN18NmMessageListModel22insertMessageIntoModelEP17NmMessageEnvelopeib @ 200 NONAME
+	_ZN18NmMessageListModel22removeMessageFromModelERK4NmId @ 201 NONAME
+	_ZN18NmMessageListModel25insertNewMessageIntoModelERK4NmIdS2_S2_ @ 202 NONAME
+	_ZN18NmMessageListModel7changedERK17NmMessageEnvelopeS2_ @ 203 NONAME
+	_ZN18NmMessageListModel7refreshE4NmIdS0_RK5QListIP17NmMessageEnvelopeE @ 204 NONAME
+	_ZN18NmMessageListModelC1ER13NmDataManagerP7QObject @ 205 NONAME
+	_ZN18NmMessageListModelC2ER13NmDataManagerP7QObject @ 206 NONAME
+	_ZN18NmMessageListModelD0Ev @ 207 NONAME
+	_ZN18NmMessageListModelD1Ev @ 208 NONAME
+	_ZN18NmMessageListModelD2Ev @ 209 NONAME
+	_ZN19NmDataPluginFactory10loadPluginERK4QDirRK7QString @ 210 NONAME
+	_ZN19NmDataPluginFactory12mPluginArrayE @ 211 NONAME DATA 4
+	_ZN19NmDataPluginFactory14pluginInstanceE4NmId @ 212 NONAME
+	_ZN19NmDataPluginFactory15mReferenceCountE @ 213 NONAME DATA 4
+	_ZN19NmDataPluginFactory15pluginInstancesEv @ 214 NONAME
+	_ZN19NmDataPluginFactory15releaseInstanceERPS_ @ 215 NONAME
+	_ZN19NmDataPluginFactory17interfaceInstanceE4NmId @ 216 NONAME
+	_ZN19NmDataPluginFactory17interfaceInstanceEP7QObject @ 217 NONAME
+	_ZN19NmDataPluginFactory18mPluginLoaderArrayE @ 218 NONAME DATA 4
+	_ZN19NmDataPluginFactory33applicationStateInterfaceInstanceE4NmId @ 219 NONAME
+	_ZN19NmDataPluginFactory33applicationStateInterfaceInstanceEP7QObject @ 220 NONAME
+	_ZN19NmDataPluginFactory8instanceEv @ 221 NONAME
+	_ZN19NmDataPluginFactory9mInstanceE @ 222 NONAME DATA 4
+	_ZN19NmDataPluginFactoryC1Ev @ 223 NONAME
+	_ZN19NmDataPluginFactoryC2Ev @ 224 NONAME
+	_ZN19NmDataPluginFactoryD0Ev @ 225 NONAME
+	_ZN19NmDataPluginFactoryD1Ev @ 226 NONAME
+	_ZN19NmDataPluginFactoryD2Ev @ 227 NONAME
+	_ZN22NmMessageListModelItem11envelopePtrEv @ 228 NONAME
+	_ZN22NmMessageListModelItem11setEnvelopeEP17NmMessageEnvelope @ 229 NONAME
+	_ZN22NmMessageListModelItem11setEnvelopeERK17NmMessageEnvelope @ 230 NONAME
+	_ZN22NmMessageListModelItem11setExpandedEb @ 231 NONAME
+	_ZN22NmMessageListModelItem11setItemTypeENS_17NmMessageItemTypeE @ 232 NONAME
+	_ZN22NmMessageListModelItem15setTitleDividerERK7QString @ 233 NONAME
+	_ZN22NmMessageListModelItem19callEmitDataChangedEv @ 234 NONAME
+	_ZN22NmMessageListModelItemC1Ev @ 235 NONAME
+	_ZN22NmMessageListModelItemC2Ev @ 236 NONAME
+	_ZN22NmMessageListModelItemD0Ev @ 237 NONAME
+	_ZN22NmMessageListModelItemD1Ev @ 238 NONAME
+	_ZN22NmMessageListModelItemD2Ev @ 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
+	_ZNK17NmMailboxMetaData7addressEv @ 275 NONAME
+	_ZNK18NmBaseClientPlugin10metaObjectEv @ 276 NONAME
+	_ZNK18NmMailboxListModel10metaObjectEv @ 277 NONAME
+	_ZNK18NmMailboxListModel4dataERK11QModelIndexi @ 278 NONAME
+	_ZNK18NmMessageListModel10metaObjectEv @ 279 NONAME
+	_ZNK18NmMessageListModel17getInsertionIndexERK17NmMessageEnvelope @ 280 NONAME
+	_ZNK18NmMessageListModel30messagesBelongUnderSameDividerEPK17NmMessageEnvelopeS2_ @ 281 NONAME
+	_ZNK18NmMessageListModel4dataERK11QModelIndexi @ 282 NONAME
+	_ZNK22NmMessageListModelItem12titleDividerEv @ 283 NONAME
+	_ZNK22NmMessageListModelItem8envelopeEv @ 284 NONAME
+	_ZNK22NmMessageListModelItem8expandedEv @ 285 NONAME
+	_ZNK22NmMessageListModelItem8itemTypeEv @ 286 NONAME
+	_ZNK25NmAddAttachmentsOperation10metaObjectEv @ 287 NONAME
+	_ZNK25NmStoreEnvelopesOperation10metaObjectEv @ 288 NONAME
+	_ZNK26NmMessageCreationOperation10metaObjectEv @ 289 NONAME
+	_ZTI10NmUiEngine @ 290 NONAME
+	_ZTI11NmOperation @ 291 NONAME
+	_ZTI13NmDataManager @ 292 NONAME
+	_ZTI16NmFolderMetaData @ 293 NONAME
+	_ZTI17NmFolderListModel @ 294 NONAME
+	_ZTI17NmMailboxMetaData @ 295 NONAME
+	_ZTI18NmBaseClientPlugin @ 296 NONAME
+	_ZTI18NmMailboxListModel @ 297 NONAME
+	_ZTI18NmMessageListModel @ 298 NONAME
+	_ZTI19NmDataPluginFactory @ 299 NONAME
+	_ZTI22NmMessageListModelItem @ 300 NONAME
+	_ZTI25NmAddAttachmentsOperation @ 301 NONAME
+	_ZTI25NmStoreEnvelopesOperation @ 302 NONAME
+	_ZTI26NmMessageCreationOperation @ 303 NONAME
+	_ZTV10NmUiEngine @ 304 NONAME
+	_ZTV11NmOperation @ 305 NONAME
+	_ZTV13NmDataManager @ 306 NONAME
+	_ZTV16NmFolderMetaData @ 307 NONAME
+	_ZTV17NmFolderListModel @ 308 NONAME
+	_ZTV17NmMailboxMetaData @ 309 NONAME
+	_ZTV18NmBaseClientPlugin @ 310 NONAME
+	_ZTV18NmMailboxListModel @ 311 NONAME
+	_ZTV18NmMessageListModel @ 312 NONAME
+	_ZTV19NmDataPluginFactory @ 313 NONAME
+	_ZTV22NmMessageListModelItem @ 314 NONAME
+	_ZTV25NmAddAttachmentsOperation @ 315 NONAME
+	_ZTV25NmStoreEnvelopesOperation @ 316 NONAME
+	_ZTV26NmMessageCreationOperation @ 317 NONAME
+	_ZThn8_N18NmBaseClientPlugin10getActionsERK15NmActionRequestR5QListIP8NmActionE @ 318 NONAME
+	_ZThn8_N18NmBaseClientPluginD0Ev @ 319 NONAME
+	_ZThn8_N18NmBaseClientPluginD1Ev @ 320 NONAME
 
--- a/emailuis/nmailuiengine/inc/nmdataplugininterface.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmdataplugininterface.h	Tue Jul 06 14:04:34 2010 +0300
@@ -59,7 +59,7 @@
     
     virtual int getMailboxById(const NmId &id, NmMailbox *&mailbox) = 0;
     
-    virtual int deleteMailboxById(const NmId &id) = 0;
+    virtual QPointer<NmOperation> deleteMailboxById(const NmId &id) = 0;
     
     virtual int getMessageById(
         const NmId &mailboxId,
@@ -186,6 +186,12 @@
     virtual int cancelSearch(const NmId &mailboxId) = 0;
 
     virtual QPointer<NmOperation> removeDraftMessage(NmMessage *message) = 0;
+
+    virtual int copyMessages(
+        const NmId &mailboxId,
+        const QList<quint64> &messageIds, 
+        const NmId &sourceFolderId,
+        const NmId &destinationFolderId) = 0;
 };
 
 Q_DECLARE_INTERFACE(NmDataPluginInterface, "sf.app.commonmail.emailuis.nmailuiengine.NmDataPluginInterface/1.0")
--- a/emailuis/nmailuiengine/inc/nmuiengine.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiengine/inc/nmuiengine.h	Tue Jul 06 14:04:34 2010 +0300
@@ -55,6 +55,8 @@
 
     void refreshMailboxListModel();
 
+    NmId getPluginIdByMailboxId(quint32 accountId);
+    
     NmMessageListModel &messageListModel(const NmId &mailboxId,
                                          const NmId &folderId);
 
--- a/emailuis/nmailuiengine/src/nmuiengine.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiengine/src/nmuiengine.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -82,7 +82,7 @@
 
 
 /*!
-    Destructor
+    Class destructor.
 */
 NmUiEngine::~NmUiEngine()
 {
@@ -95,46 +95,66 @@
         delete mMessageSearchListModel;
         mMessageSearchListModel = NULL;
     }
+
     if (mInboxListModel) {
         delete mInboxListModel;
         mInboxListModel = NULL;
-    }  
+    }
+
     if (mMessageListModel) {
         delete mMessageListModel;
         mMessageListModel = NULL;
     }
+
     if (mMailboxListModel) {
         delete mMailboxListModel;
         mMailboxListModel = NULL;
     }
-    // do the unsubscriptions
+
+    // Do the unsubscriptions.
     QList<NmId> mailboxIdList;
     mDataManager->listMailboxIds(mailboxIdList);
+
     for (int i(0); i < mailboxIdList.count(); i++) {
         NmId id = mailboxIdList[i];
-        NmDataPluginInterface *pluginInterface = mPluginFactory->interfaceInstance(id);
+        NmDataPluginInterface *pluginInterface =
+            mPluginFactory->interfaceInstance(id);
+
         if (pluginInterface) {
             pluginInterface->unsubscribeMailboxEvents(id);
         }
     }
+
     mailboxIdList.clear();
+
     NmDataPluginFactory::releaseInstance(mPluginFactory);
+
     delete mDataManager;
+
+    // Cancel all operations.
     if (mSendOperation && mSendOperation->isRunning()) {
         mSendOperation->cancelOperation();
     }
-    if(mRemoveDraftOperation && mRemoveDraftOperation->isRunning()) {
+
+    if (mRemoveDraftOperation && mRemoveDraftOperation->isRunning()) {
         mRemoveDraftOperation->cancelOperation();        
     }
-    if(mSaveDraftOperation && mSaveDraftOperation->isRunning()) {
+
+    if (mSaveDraftOperation && mSaveDraftOperation->isRunning()) {
         mSaveDraftOperation->cancelOperation();
     }
+
+    // Call processEvents() to ensure that the cancelled operations get the time
+    // they need to destroy themselves.
+    qApp->processEvents();
+
     if(mDraftMessage) {
         delete mDraftMessage;
         mDraftMessage = NULL;
     }
 }
 
+
 /*!
 
 */
@@ -1235,3 +1255,23 @@
         emit operationCompleted(event);
     }
 }
+
+/*!
+    returns full mailbox id from plain account id
+*/
+NmId NmUiEngine::getPluginIdByMailboxId(quint32 accountId)
+{
+    NM_FUNCTION;
+    
+    NmId fullId = NULL;
+    fullId.setId32(accountId);
+    QList<NmId> mailboxList;
+    if(mDataManager){
+        mDataManager->listMailboxIds(mailboxList);
+        for(int i=0;i<mailboxList.count();i++){
+            if(mailboxList.at(i).id32() == accountId)
+                fullId.setPluginId32(mailboxList.at(i).pluginId32());
+            }
+        }
+    return fullId;
+}
--- a/emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def	Tue Jul 06 14:04:34 2010 +0300
@@ -1,138 +1,133 @@
 EXPORTS
 	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *, int)
-	?itemActivated@NmAttachmentListWidget@@IAEXH@Z @ 2 NONAME ; void NmAttachmentListWidget::itemActivated(int)
-	?textCursor@NmHtmlLineEdit@@QBE?AVQTextCursor@@XZ @ 3 NONAME ; class QTextCursor NmHtmlLineEdit::textCursor(void) const
-	?keyPressEvent@NmRecipientLineEdit@@MAEXPAVQKeyEvent@@@Z @ 4 NONAME ; void NmRecipientLineEdit::keyPressEvent(class QKeyEvent *)
-	?paint@NmAttachmentListWidget@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 5 NONAME ; void NmAttachmentListWidget::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *)
-	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *, int)
-	?toHtml@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 7 NONAME ; class QString NmHtmlLineEdit::toHtml(void) const
-	?metaObject@NmBaseViewScrollArea@@UBEPBUQMetaObject@@XZ @ 8 NONAME ; struct QMetaObject const * NmBaseViewScrollArea::metaObject(void) const
-	?init@NmEditorTextEdit@@QAEXPAVNmBaseViewScrollArea@@@Z @ 9 NONAME ; void NmEditorTextEdit::init(class NmBaseViewScrollArea *)
-	?emailAddressList@NmRecipientLineEdit@@QAE?AV?$QList@VNmAddress@@@@XZ @ 10 NONAME ; class QList<class NmAddress> NmRecipientLineEdit::emailAddressList(void)
-	?getStaticMetaObject@NmAttachmentListItem@@SAABUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const & NmAttachmentListItem::getStaticMetaObject(void)
-	?getStaticMetaObject@NmBaseViewScrollArea@@SAABUQMetaObject@@XZ @ 12 NONAME ; struct QMetaObject const & NmBaseViewScrollArea::getStaticMetaObject(void)
-	?getStaticMetaObject@NmAttachmentListWidget@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & NmAttachmentListWidget::getStaticMetaObject(void)
-	??_ENmAttachmentListItem@@UAE@I@Z @ 14 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(unsigned int)
-	?updateEditorHeight@NmEditorTextEdit@@QAEXXZ @ 15 NONAME ; void NmEditorTextEdit::updateEditorHeight(void)
-	?qt_metacast@NmHtmlLineEdit@@UAEPAXPBD@Z @ 16 NONAME ; void * NmHtmlLineEdit::qt_metacast(char const *)
-	?metaObject@NmEditorTextEdit@@UBEPBUQMetaObject@@XZ @ 17 NONAME ; struct QMetaObject const * NmEditorTextEdit::metaObject(void) const
-	?setFileNameText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 18 NONAME ; void NmAttachmentListItem::setFileNameText(class QString const &)
-	?qt_metacast@NmBaseViewScrollArea@@UAEPAXPBD@Z @ 19 NONAME ; void * NmBaseViewScrollArea::qt_metacast(char const *)
-	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *, int)
-	?qt_metacall@NmAttachmentListWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 21 NONAME ; int NmAttachmentListWidget::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 22 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *, int)
-	?qt_metacall@NmRecipientLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 23 NONAME ; int NmRecipientLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??0NmAttachmentListItem@@QAE@PAVQGraphicsItem@@@Z @ 24 NONAME ; NmAttachmentListItem::NmAttachmentListItem(class QGraphicsItem *)
-	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 25 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *, int)
-	??1NmHtmlLineEdit@@UAE@XZ @ 26 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(void)
-	?setProgressBarValue@NmAttachmentListItem@@QAEXH@Z @ 27 NONAME ; void NmAttachmentListItem::setProgressBarValue(int)
-	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 28 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *)
-	?gestureEvent@NmAttachmentListItem@@MAEXPAVQGestureEvent@@@Z @ 29 NONAME ; void NmAttachmentListItem::gestureEvent(class QGestureEvent *)
-	??0NmRecipientLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 30 NONAME ; NmRecipientLineEdit::NmRecipientLineEdit(class QGraphicsItem *)
-	?setAttachmentSize@NmAttachmentListWidget@@QAEXHABVQString@@@Z @ 31 NONAME ; void NmAttachmentListWidget::setAttachmentSize(int, class QString const &)
-	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 32 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *, int)
-	?setPlainText@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 33 NONAME ; void NmHtmlLineEdit::setPlainText(class QString const &)
-	?longPressGesture@NmBaseViewScrollArea@@MAEXABVQPointF@@@Z @ 34 NONAME ; void NmBaseViewScrollArea::longPressGesture(class QPointF const &)
-	?updateCustomTextColor@NmEditorTextEdit@@QAEXXZ @ 35 NONAME ; void NmEditorTextEdit::updateCustomTextColor(void)
-	?orientationChanged@NmAttachmentListWidget@@AAEXW4Orientation@Qt@@@Z @ 36 NONAME ; void NmAttachmentListWidget::orientationChanged(enum Qt::Orientation)
-	?insertSelectedContacts@NmRecipientLineEdit@@QAEXABVQVariant@@@Z @ 37 NONAME ; void NmRecipientLineEdit::insertSelectedContacts(class QVariant const &)
-	?qt_metacast@NmAttachmentListWidget@@UAEPAXPBD@Z @ 38 NONAME ; void * NmAttachmentListWidget::qt_metacast(char const *)
-	?getStaticMetaObject@NmHtmlLineEdit@@SAABUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const & NmHtmlLineEdit::getStaticMetaObject(void)
-	?qt_metacall@NmEditorTextEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 40 NONAME ; int NmEditorTextEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??1NmAttachmentListWidget@@UAE@XZ @ 41 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(void)
-	??_ENmRecipientLineEdit@@UAE@I@Z @ 42 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(unsigned int)
-	?qt_metacast@NmRecipientLineEdit@@UAEPAXPBD@Z @ 43 NONAME ; void * NmRecipientLineEdit::qt_metacast(char const *)
-	?setCustomTextColor@NmEditorTextEdit@@QAEXABU?$QPair@_NVQColor@@@@@Z @ 44 NONAME ; void NmEditorTextEdit::setCustomTextColor(struct QPair<bool, class QColor> const &)
-	?setDocument@NmHtmlLineEdit@@QAEXPAVQTextDocument@@@Z @ 45 NONAME ; void NmHtmlLineEdit::setDocument(class QTextDocument *)
-	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 46 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *)
-	??0NmBaseViewScrollArea@@QAE@PAVQGraphicsItem@@@Z @ 47 NONAME ; NmBaseViewScrollArea::NmBaseViewScrollArea(class QGraphicsItem *)
-	?longPressed@NmAttachmentListWidget@@IAEXHVQPointF@@@Z @ 48 NONAME ; void NmAttachmentListWidget::longPressed(int, class QPointF)
-	?staticMetaObject@NmEditorTextEdit@@2UQMetaObject@@B @ 49 NONAME ; struct QMetaObject const NmEditorTextEdit::staticMetaObject
-	??0NmEditorTextEdit@@QAE@PAVQGraphicsItem@@@Z @ 50 NONAME ; NmEditorTextEdit::NmEditorTextEdit(class QGraphicsItem *)
-	??_ENmEditorTextEdit@@UAE@I@Z @ 51 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(unsigned int)
-	?hideProgressBar@NmAttachmentListItem@@QAEXXZ @ 52 NONAME ; void NmAttachmentListItem::hideProgressBar(void)
-	?qt_metacast@NmAttachmentListItem@@UAEPAXPBD@Z @ 53 NONAME ; void * NmAttachmentListItem::qt_metacast(char const *)
-	?handleMouseReleaseEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 54 NONAME ; void NmBaseViewScrollArea::handleMouseReleaseEvent(class QGraphicsSceneMouseEvent *)
-	?removeProgressBar@NmAttachmentListItem@@AAEXXZ @ 55 NONAME ; void NmAttachmentListItem::removeProgressBar(void)
-	??1NmBaseViewScrollArea@@UAE@XZ @ 56 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(void)
-	??_ENmHtmlLineEdit@@UAE@I@Z @ 57 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(unsigned int)
-	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 58 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *, int)
-	?handleMousePressEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 59 NONAME ; void NmBaseViewScrollArea::handleMousePressEvent(class QGraphicsSceneMouseEvent *)
-	?insertItemToLayout@NmAttachmentListWidget@@AAEXPAVNmAttachmentListItem@@@Z @ 60 NONAME ; void NmAttachmentListWidget::insertItemToLayout(class NmAttachmentListItem *)
-	?metaObject@NmHtmlLineEdit@@UBEPBUQMetaObject@@XZ @ 61 NONAME ; struct QMetaObject const * NmHtmlLineEdit::metaObject(void) const
-	?editorContentHeightChanged@NmEditorTextEdit@@IAEXXZ @ 62 NONAME ; void NmEditorTextEdit::editorContentHeightChanged(void)
-	?setTextColor@NmAttachmentListItem@@QAEXVQColor@@@Z @ 63 NONAME ; void NmAttachmentListItem::setTextColor(class QColor)
-	??1NmAttachmentListItem@@UAE@XZ @ 64 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(void)
-	?count@NmAttachmentListWidget@@QBEHXZ @ 65 NONAME ; int NmAttachmentListWidget::count(void) const
-	?handleTextChanged@NmRecipientLineEdit@@AAEXABVQString@@@Z @ 66 NONAME ; void NmRecipientLineEdit::handleTextChanged(class QString const &)
-	?handleLongPressGesture@NmBaseViewScrollArea@@IAEXABVQPointF@@@Z @ 67 NONAME ; void NmBaseViewScrollArea::handleLongPressGesture(class QPointF const &)
-	?updateScrollPosition@NmEditorTextEdit@@QAEXABVQPointF@@@Z @ 68 NONAME ; void NmEditorTextEdit::updateScrollPosition(class QPointF const &)
-	?contentHeight@NmEditorTextEdit@@QBEMXZ @ 69 NONAME ; float NmEditorTextEdit::contentHeight(void) const
-	?qt_metacast@NmEditorTextEdit@@UAEPAXPBD@Z @ 70 NONAME ; void * NmEditorTextEdit::qt_metacast(char const *)
-	?mouseMoveEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 71 NONAME ; void NmBaseViewScrollArea::mouseMoveEvent(class QGraphicsSceneMouseEvent *)
-	?qt_metacall@NmAttachmentListItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 72 NONAME ; int NmAttachmentListItem::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?handleLongPressed@NmAttachmentListWidget@@AAEXVQPointF@@@Z @ 73 NONAME ; void NmAttachmentListWidget::handleLongPressed(class QPointF)
-	?staticMetaObject@NmBaseViewScrollArea@@2UQMetaObject@@B @ 74 NONAME ; struct QMetaObject const NmBaseViewScrollArea::staticMetaObject
-	?setHeaderHeight@NmEditorTextEdit@@QAEXH@Z @ 75 NONAME ; void NmEditorTextEdit::setHeaderHeight(int)
-	?init@NmAttachmentListWidget@@AAEXXZ @ 76 NONAME ; void NmAttachmentListWidget::init(void)
-	?rearrangeLayout@NmAttachmentListWidget@@AAEXXZ @ 77 NONAME ; void NmAttachmentListWidget::rearrangeLayout(void)
-	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 78 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *)
-	?metaObject@NmRecipientLineEdit@@UBEPBUQMetaObject@@XZ @ 79 NONAME ; struct QMetaObject const * NmRecipientLineEdit::metaObject(void) const
-	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 80 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *)
-	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 81 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *)
-	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 82 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *)
-	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 83 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *)
-	?setFileSizeText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 84 NONAME ; void NmAttachmentListItem::setFileSizeText(class QString const &)
-	?customTextColor@NmEditorTextEdit@@QBE?AU?$QPair@_NVQColor@@@@XZ @ 85 NONAME ; struct QPair<bool, class QColor> NmEditorTextEdit::customTextColor(void) const
-	?staticMetaObject@NmHtmlLineEdit@@2UQMetaObject@@B @ 86 NONAME ; struct QMetaObject const NmHtmlLineEdit::staticMetaObject
-	?inputMethodEvent@NmRecipientLineEdit@@MAEXPAVQInputMethodEvent@@@Z @ 87 NONAME ; void NmRecipientLineEdit::inputMethodEvent(class QInputMethodEvent *)
-	?mouseReleaseEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 88 NONAME ; void NmBaseViewScrollArea::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
-	?constructUi@NmAttachmentListWidget@@AAEXXZ @ 89 NONAME ; void NmAttachmentListWidget::constructUi(void)
-	?toPlainText@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 90 NONAME ; class QString NmHtmlLineEdit::toPlainText(void) const
-	?getStaticMetaObject@NmEditorTextEdit@@SAABUQMetaObject@@XZ @ 91 NONAME ; struct QMetaObject const & NmEditorTextEdit::getStaticMetaObject(void)
-	?setScrollPosition@NmEditorTextEdit@@QAEXHH@Z @ 92 NONAME ; void NmEditorTextEdit::setScrollPosition(int, int)
-	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 93 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *)
-	?staticMetaObject@NmAttachmentListItem@@2UQMetaObject@@B @ 94 NONAME ; struct QMetaObject const NmAttachmentListItem::staticMetaObject
-	??_ENmBaseViewScrollArea@@UAE@I@Z @ 95 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(unsigned int)
-	?itemLongPressed@NmAttachmentListItem@@IAEXVQPointF@@@Z @ 96 NONAME ; void NmAttachmentListItem::itemLongPressed(class QPointF)
-	?progressBarValue@NmAttachmentListItem@@QBEHXZ @ 97 NONAME ; int NmAttachmentListItem::progressBarValue(void) const
-	?setCustomTextColor@NmEditorTextEdit@@QAEX_NABVQColor@@@Z @ 98 NONAME ; void NmEditorTextEdit::setCustomTextColor(bool, class QColor const &)
-	??0NmHtmlLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 99 NONAME ; NmHtmlLineEdit::NmHtmlLineEdit(class QGraphicsItem *)
-	?init@NmAttachmentListItem@@AAEXXZ @ 100 NONAME ; void NmAttachmentListItem::init(void)
-	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 101 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *)
-	??1NmEditorTextEdit@@UAE@XZ @ 102 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(void)
-	?generateEmailAddressList@NmRecipientLineEdit@@AAEXXZ @ 103 NONAME ; void NmRecipientLineEdit::generateEmailAddressList(void)
-	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 104 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *)
-	?mousePressEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 105 NONAME ; void NmBaseViewScrollArea::mousePressEvent(class QGraphicsSceneMouseEvent *)
-	?handleItemActivated@NmAttachmentListWidget@@AAEXXZ @ 106 NONAME ; void NmAttachmentListWidget::handleItemActivated(void)
-	?metaObject@NmAttachmentListWidget@@UBEPBUQMetaObject@@XZ @ 107 NONAME ; struct QMetaObject const * NmAttachmentListWidget::metaObject(void) const
-	?constructUi@NmAttachmentListItem@@AAEXXZ @ 108 NONAME ; void NmAttachmentListItem::constructUi(void)
-	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 109 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *, int)
-	?setHtml@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 110 NONAME ; void NmHtmlLineEdit::setHtml(class QString const &)
-	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 111 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *, int)
-	?itemActivated@NmAttachmentListItem@@IAEXXZ @ 112 NONAME ; void NmAttachmentListItem::itemActivated(void)
-	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 113 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *)
-	?getStaticMetaObject@NmRecipientLineEdit@@SAABUQMetaObject@@XZ @ 114 NONAME ; struct QMetaObject const & NmRecipientLineEdit::getStaticMetaObject(void)
-	?findItem@NmAttachmentListWidget@@AAEHPBVQObject@@@Z @ 115 NONAME ; int NmAttachmentListWidget::findItem(class QObject const *)
-	??1NmRecipientLineEdit@@UAE@XZ @ 116 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(void)
-	?removeAttachment@NmAttachmentListWidget@@QAEXH@Z @ 117 NONAME ; void NmAttachmentListWidget::removeAttachment(int)
-	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 118 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *, int)
-	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 119 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *, int)
-	?progressValue@NmAttachmentListWidget@@QBEHH@Z @ 120 NONAME ; int NmAttachmentListWidget::progressValue(int) const
-	?staticMetaObject@NmAttachmentListWidget@@2UQMetaObject@@B @ 121 NONAME ; struct QMetaObject const NmAttachmentListWidget::staticMetaObject
-	??_ENmAttachmentListWidget@@UAE@I@Z @ 122 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(unsigned int)
-	?setTextColor@NmAttachmentListWidget@@QAEXVQColor@@@Z @ 123 NONAME ; void NmAttachmentListWidget::setTextColor(class QColor)
-	?setTextCursor@NmHtmlLineEdit@@QAEXABVQTextCursor@@@Z @ 124 NONAME ; void NmHtmlLineEdit::setTextCursor(class QTextCursor const &)
-	?handleMouseMoveEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 125 NONAME ; void NmBaseViewScrollArea::handleMouseMoveEvent(class QGraphicsSceneMouseEvent *)
-	?staticMetaObject@NmRecipientLineEdit@@2UQMetaObject@@B @ 126 NONAME ; struct QMetaObject const NmRecipientLineEdit::staticMetaObject
-	?setProgressBarValue@NmAttachmentListWidget@@QAEXHH@Z @ 127 NONAME ; void NmAttachmentListWidget::setProgressBarValue(int, int)
-	?metaObject@NmAttachmentListItem@@UBEPBUQMetaObject@@XZ @ 128 NONAME ; struct QMetaObject const * NmAttachmentListItem::metaObject(void) const
-	?insertAttachment@NmAttachmentListWidget@@QAEXHABVQString@@0@Z @ 129 NONAME ; void NmAttachmentListWidget::insertAttachment(int, class QString const &, class QString const &)
-	?hideProgressBar@NmAttachmentListWidget@@QAEXH@Z @ 130 NONAME ; void NmAttachmentListWidget::hideProgressBar(int)
-	??0NmAttachmentListWidget@@QAE@PAVQGraphicsItem@@@Z @ 131 NONAME ; NmAttachmentListWidget::NmAttachmentListWidget(class QGraphicsItem *)
-	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 132 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *, int)
-	?document@NmHtmlLineEdit@@QBEPAVQTextDocument@@XZ @ 133 NONAME ; class QTextDocument * NmHtmlLineEdit::document(void) const
-	?qt_metacall@NmBaseViewScrollArea@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 134 NONAME ; int NmBaseViewScrollArea::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?qt_metacall@NmHtmlLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 135 NONAME ; int NmHtmlLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 136 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *)
+	?handleLongPressGesture@NmBaseViewScrollArea@@IAEXABVQPointF@@@Z @ 2 NONAME ; void NmBaseViewScrollArea::handleLongPressGesture(class QPointF const &)
+	?qt_metacast@NmEditorTextEdit@@UAEPAXPBD@Z @ 3 NONAME ; void * NmEditorTextEdit::qt_metacast(char const *)
+	?itemActivated@NmAttachmentListWidget@@IAEXH@Z @ 4 NONAME ; void NmAttachmentListWidget::itemActivated(int)
+	?mouseMoveEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 5 NONAME ; void NmBaseViewScrollArea::mouseMoveEvent(class QGraphicsSceneMouseEvent *)
+	?textCursor@NmHtmlLineEdit@@QBE?AVQTextCursor@@XZ @ 6 NONAME ; class QTextCursor NmHtmlLineEdit::textCursor(void) const
+	?qt_metacall@NmAttachmentListItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 7 NONAME ; int NmAttachmentListItem::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?keyPressEvent@NmRecipientLineEdit@@MAEXPAVQKeyEvent@@@Z @ 8 NONAME ; void NmRecipientLineEdit::keyPressEvent(class QKeyEvent *)
+	?handleLongPressed@NmAttachmentListWidget@@AAEXVQPointF@@@Z @ 9 NONAME ; void NmAttachmentListWidget::handleLongPressed(class QPointF)
+	?staticMetaObject@NmBaseViewScrollArea@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const NmBaseViewScrollArea::staticMetaObject
+	?paint@NmAttachmentListWidget@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 11 NONAME ; void NmAttachmentListWidget::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *)
+	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *, int)
+	?init@NmAttachmentListWidget@@AAEXXZ @ 13 NONAME ; void NmAttachmentListWidget::init(void)
+	?rearrangeLayout@NmAttachmentListWidget@@AAEXXZ @ 14 NONAME ; void NmAttachmentListWidget::rearrangeLayout(void)
+	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 15 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *)
+	?toHtml@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 16 NONAME ; class QString NmHtmlLineEdit::toHtml(void) const
+	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 17 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *)
+	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *)
+	?metaObject@NmRecipientLineEdit@@UBEPBUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const * NmRecipientLineEdit::metaObject(void) const
+	?metaObject@NmBaseViewScrollArea@@UBEPBUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const * NmBaseViewScrollArea::metaObject(void) const
+	?emailAddressList@NmRecipientLineEdit@@QAE?AV?$QList@VNmAddress@@@@XZ @ 21 NONAME ; class QList<class NmAddress> NmRecipientLineEdit::emailAddressList(void)
+	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 22 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *)
+	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 23 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *)
+	?getStaticMetaObject@NmAttachmentListItem@@SAABUQMetaObject@@XZ @ 24 NONAME ; struct QMetaObject const & NmAttachmentListItem::getStaticMetaObject(void)
+	?getStaticMetaObject@NmBaseViewScrollArea@@SAABUQMetaObject@@XZ @ 25 NONAME ; struct QMetaObject const & NmBaseViewScrollArea::getStaticMetaObject(void)
+	?getStaticMetaObject@NmAttachmentListWidget@@SAABUQMetaObject@@XZ @ 26 NONAME ; struct QMetaObject const & NmAttachmentListWidget::getStaticMetaObject(void)
+	??_ENmAttachmentListItem@@UAE@I@Z @ 27 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(unsigned int)
+	?rectForCursorPosition@NmEditorTextEdit@@QBE?AVQRectF@@XZ @ 28 NONAME ; class QRectF NmEditorTextEdit::rectForCursorPosition(void) const
+	?setFileSizeText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 29 NONAME ; void NmAttachmentListItem::setFileSizeText(class QString const &)
+	?qt_metacast@NmHtmlLineEdit@@UAEPAXPBD@Z @ 30 NONAME ; void * NmHtmlLineEdit::qt_metacast(char const *)
+	?metaObject@NmEditorTextEdit@@UBEPBUQMetaObject@@XZ @ 31 NONAME ; struct QMetaObject const * NmEditorTextEdit::metaObject(void) const
+	?staticMetaObject@NmHtmlLineEdit@@2UQMetaObject@@B @ 32 NONAME ; struct QMetaObject const NmHtmlLineEdit::staticMetaObject
+	?setFileNameText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 33 NONAME ; void NmAttachmentListItem::setFileNameText(class QString const &)
+	?customTextColor@NmEditorTextEdit@@QBE?AU?$QPair@_NVQColor@@@@XZ @ 34 NONAME ; struct QPair<bool, class QColor> NmEditorTextEdit::customTextColor(void) const
+	?qt_metacast@NmBaseViewScrollArea@@UAEPAXPBD@Z @ 35 NONAME ; void * NmBaseViewScrollArea::qt_metacast(char const *)
+	?inputMethodEvent@NmRecipientLineEdit@@MAEXPAVQInputMethodEvent@@@Z @ 36 NONAME ; void NmRecipientLineEdit::inputMethodEvent(class QInputMethodEvent *)
+	?mouseReleaseEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 37 NONAME ; void NmBaseViewScrollArea::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 38 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *, int)
+	?qt_metacall@NmAttachmentListWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 39 NONAME ; int NmAttachmentListWidget::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 40 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *, int)
+	?constructUi@NmAttachmentListWidget@@AAEXXZ @ 41 NONAME ; void NmAttachmentListWidget::constructUi(void)
+	?qt_metacall@NmRecipientLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 42 NONAME ; int NmRecipientLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??0NmAttachmentListItem@@QAE@PAVQGraphicsItem@@@Z @ 43 NONAME ; NmAttachmentListItem::NmAttachmentListItem(class QGraphicsItem *)
+	?addSelectedContacts@NmRecipientLineEdit@@QAEXABVQVariant@@@Z @ 44 NONAME ; void NmRecipientLineEdit::addSelectedContacts(class QVariant const &)
+	?toPlainText@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 45 NONAME ; class QString NmHtmlLineEdit::toPlainText(void) const
+	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 46 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *, int)
+	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 47 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *)
+	?getStaticMetaObject@NmEditorTextEdit@@SAABUQMetaObject@@XZ @ 48 NONAME ; struct QMetaObject const & NmEditorTextEdit::getStaticMetaObject(void)
+	?staticMetaObject@NmAttachmentListItem@@2UQMetaObject@@B @ 49 NONAME ; struct QMetaObject const NmAttachmentListItem::staticMetaObject
+	??1NmHtmlLineEdit@@UAE@XZ @ 50 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(void)
+	?setProgressBarValue@NmAttachmentListItem@@QAEXH@Z @ 51 NONAME ; void NmAttachmentListItem::setProgressBarValue(int)
+	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 52 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *)
+	??_ENmBaseViewScrollArea@@UAE@I@Z @ 53 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(unsigned int)
+	?progressBarValue@NmAttachmentListItem@@QBEHXZ @ 54 NONAME ; int NmAttachmentListItem::progressBarValue(void) const
+	?itemLongPressed@NmAttachmentListItem@@IAEXVQPointF@@@Z @ 55 NONAME ; void NmAttachmentListItem::itemLongPressed(class QPointF)
+	?gestureEvent@NmAttachmentListItem@@MAEXPAVQGestureEvent@@@Z @ 56 NONAME ; void NmAttachmentListItem::gestureEvent(class QGestureEvent *)
+	?setCustomTextColor@NmEditorTextEdit@@QAEX_NABVQColor@@@Z @ 57 NONAME ; void NmEditorTextEdit::setCustomTextColor(bool, class QColor const &)
+	?init@NmAttachmentListItem@@AAEXXZ @ 58 NONAME ; void NmAttachmentListItem::init(void)
+	??0NmRecipientLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 59 NONAME ; NmRecipientLineEdit::NmRecipientLineEdit(class QGraphicsItem *)
+	??0NmHtmlLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 60 NONAME ; NmHtmlLineEdit::NmHtmlLineEdit(class QGraphicsItem *)
+	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 61 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *)
+	?setAttachmentSize@NmAttachmentListWidget@@QAEXHABVQString@@@Z @ 62 NONAME ; void NmAttachmentListWidget::setAttachmentSize(int, class QString const &)
+	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 63 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *, int)
+	?setPlainText@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 64 NONAME ; void NmHtmlLineEdit::setPlainText(class QString const &)
+	?longPressGesture@NmBaseViewScrollArea@@MAEXABVQPointF@@@Z @ 65 NONAME ; void NmBaseViewScrollArea::longPressGesture(class QPointF const &)
+	?updateCustomTextColor@NmEditorTextEdit@@QAEXXZ @ 66 NONAME ; void NmEditorTextEdit::updateCustomTextColor(void)
+	?orientationChanged@NmAttachmentListWidget@@AAEXW4Orientation@Qt@@@Z @ 67 NONAME ; void NmAttachmentListWidget::orientationChanged(enum Qt::Orientation)
+	?qt_metacast@NmAttachmentListWidget@@UAEPAXPBD@Z @ 68 NONAME ; void * NmAttachmentListWidget::qt_metacast(char const *)
+	?getStaticMetaObject@NmHtmlLineEdit@@SAABUQMetaObject@@XZ @ 69 NONAME ; struct QMetaObject const & NmHtmlLineEdit::getStaticMetaObject(void)
+	?qt_metacall@NmEditorTextEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 70 NONAME ; int NmEditorTextEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??1NmEditorTextEdit@@UAE@XZ @ 71 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(void)
+	?generateEmailAddressList@NmRecipientLineEdit@@AAEXXZ @ 72 NONAME ; void NmRecipientLineEdit::generateEmailAddressList(void)
+	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 73 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *)
+	??1NmAttachmentListWidget@@UAE@XZ @ 74 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(void)
+	??_ENmRecipientLineEdit@@UAE@I@Z @ 75 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(unsigned int)
+	?mousePressEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 76 NONAME ; void NmBaseViewScrollArea::mousePressEvent(class QGraphicsSceneMouseEvent *)
+	?qt_metacast@NmRecipientLineEdit@@UAEPAXPBD@Z @ 77 NONAME ; void * NmRecipientLineEdit::qt_metacast(char const *)
+	?setCustomTextColor@NmEditorTextEdit@@QAEXABU?$QPair@_NVQColor@@@@@Z @ 78 NONAME ; void NmEditorTextEdit::setCustomTextColor(struct QPair<bool, class QColor> const &)
+	?setDocument@NmHtmlLineEdit@@QAEXPAVQTextDocument@@@Z @ 79 NONAME ; void NmHtmlLineEdit::setDocument(class QTextDocument *)
+	?handleItemActivated@NmAttachmentListWidget@@AAEXXZ @ 80 NONAME ; void NmAttachmentListWidget::handleItemActivated(void)
+	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 81 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *)
+	??0NmBaseViewScrollArea@@QAE@PAVQGraphicsItem@@@Z @ 82 NONAME ; NmBaseViewScrollArea::NmBaseViewScrollArea(class QGraphicsItem *)
+	?metaObject@NmAttachmentListWidget@@UBEPBUQMetaObject@@XZ @ 83 NONAME ; struct QMetaObject const * NmAttachmentListWidget::metaObject(void) const
+	?constructUi@NmAttachmentListItem@@AAEXXZ @ 84 NONAME ; void NmAttachmentListItem::constructUi(void)
+	?longPressed@NmAttachmentListWidget@@IAEXHVQPointF@@@Z @ 85 NONAME ; void NmAttachmentListWidget::longPressed(int, class QPointF)
+	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 86 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *, int)
+	?staticMetaObject@NmEditorTextEdit@@2UQMetaObject@@B @ 87 NONAME ; struct QMetaObject const NmEditorTextEdit::staticMetaObject
+	??0NmEditorTextEdit@@QAE@PAVQGraphicsItem@@@Z @ 88 NONAME ; NmEditorTextEdit::NmEditorTextEdit(class QGraphicsItem *)
+	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 89 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *, int)
+	?setHtml@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 90 NONAME ; void NmHtmlLineEdit::setHtml(class QString const &)
+	??_ENmEditorTextEdit@@UAE@I@Z @ 91 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(unsigned int)
+	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 92 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *)
+	?itemActivated@NmAttachmentListItem@@IAEXXZ @ 93 NONAME ; void NmAttachmentListItem::itemActivated(void)
+	?hideProgressBar@NmAttachmentListItem@@QAEXXZ @ 94 NONAME ; void NmAttachmentListItem::hideProgressBar(void)
+	?qt_metacast@NmAttachmentListItem@@UAEPAXPBD@Z @ 95 NONAME ; void * NmAttachmentListItem::qt_metacast(char const *)
+	?getStaticMetaObject@NmRecipientLineEdit@@SAABUQMetaObject@@XZ @ 96 NONAME ; struct QMetaObject const & NmRecipientLineEdit::getStaticMetaObject(void)
+	?findItem@NmAttachmentListWidget@@AAEHPBVQObject@@@Z @ 97 NONAME ; int NmAttachmentListWidget::findItem(class QObject const *)
+	?removeAttachment@NmAttachmentListWidget@@QAEXH@Z @ 98 NONAME ; void NmAttachmentListWidget::removeAttachment(int)
+	??1NmRecipientLineEdit@@UAE@XZ @ 99 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(void)
+	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 100 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *, int)
+	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 101 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *, int)
+	?progressValue@NmAttachmentListWidget@@QBEHH@Z @ 102 NONAME ; int NmAttachmentListWidget::progressValue(int) const
+	?staticMetaObject@NmAttachmentListWidget@@2UQMetaObject@@B @ 103 NONAME ; struct QMetaObject const NmAttachmentListWidget::staticMetaObject
+	??_ENmAttachmentListWidget@@UAE@I@Z @ 104 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(unsigned int)
+	?setTextCursor@NmHtmlLineEdit@@QAEXABVQTextCursor@@@Z @ 105 NONAME ; void NmHtmlLineEdit::setTextCursor(class QTextCursor const &)
+	?setTextColor@NmAttachmentListWidget@@QAEXVQColor@@@Z @ 106 NONAME ; void NmAttachmentListWidget::setTextColor(class QColor)
+	?rectForCursorPosition@NmHtmlLineEdit@@QBE?AVQRectF@@XZ @ 107 NONAME ; class QRectF NmHtmlLineEdit::rectForCursorPosition(void) const
+	?handleMouseMoveEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 108 NONAME ; void NmBaseViewScrollArea::handleMouseMoveEvent(class QGraphicsSceneMouseEvent *)
+	?staticMetaObject@NmRecipientLineEdit@@2UQMetaObject@@B @ 109 NONAME ; struct QMetaObject const NmRecipientLineEdit::staticMetaObject
+	?setProgressBarValue@NmAttachmentListWidget@@QAEXHH@Z @ 110 NONAME ; void NmAttachmentListWidget::setProgressBarValue(int, int)
+	?handleMouseReleaseEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 111 NONAME ; void NmBaseViewScrollArea::handleMouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	?insertAttachment@NmAttachmentListWidget@@QAEXHABVQString@@0@Z @ 112 NONAME ; void NmAttachmentListWidget::insertAttachment(int, class QString const &, class QString const &)
+	?metaObject@NmAttachmentListItem@@UBEPBUQMetaObject@@XZ @ 113 NONAME ; struct QMetaObject const * NmAttachmentListItem::metaObject(void) const
+	?removeProgressBar@NmAttachmentListItem@@AAEXXZ @ 114 NONAME ; void NmAttachmentListItem::removeProgressBar(void)
+	??1NmBaseViewScrollArea@@UAE@XZ @ 115 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(void)
+	?hideProgressBar@NmAttachmentListWidget@@QAEXH@Z @ 116 NONAME ; void NmAttachmentListWidget::hideProgressBar(int)
+	??0NmAttachmentListWidget@@QAE@PAVQGraphicsItem@@@Z @ 117 NONAME ; NmAttachmentListWidget::NmAttachmentListWidget(class QGraphicsItem *)
+	??_ENmHtmlLineEdit@@UAE@I@Z @ 118 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(unsigned int)
+	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 119 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *, int)
+	?handleMousePressEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 120 NONAME ; void NmBaseViewScrollArea::handleMousePressEvent(class QGraphicsSceneMouseEvent *)
+	?insertItemToLayout@NmAttachmentListWidget@@AAEXPAVNmAttachmentListItem@@@Z @ 121 NONAME ; void NmAttachmentListWidget::insertItemToLayout(class NmAttachmentListItem *)
+	?metaObject@NmHtmlLineEdit@@UBEPBUQMetaObject@@XZ @ 122 NONAME ; struct QMetaObject const * NmHtmlLineEdit::metaObject(void) const
+	?setTextColor@NmAttachmentListItem@@QAEXVQColor@@@Z @ 123 NONAME ; void NmAttachmentListItem::setTextColor(class QColor)
+	??1NmAttachmentListItem@@UAE@XZ @ 124 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(void)
+	?count@NmAttachmentListWidget@@QBEHXZ @ 125 NONAME ; int NmAttachmentListWidget::count(void) const
+	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 126 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *, int)
+	?handleTextChanged@NmRecipientLineEdit@@AAEXABVQString@@@Z @ 127 NONAME ; void NmRecipientLineEdit::handleTextChanged(class QString const &)
+	?document@NmHtmlLineEdit@@QBEPAVQTextDocument@@XZ @ 128 NONAME ; class QTextDocument * NmHtmlLineEdit::document(void) const
+	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 129 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *)
+	?qt_metacall@NmHtmlLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 130 NONAME ; int NmHtmlLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@NmBaseViewScrollArea@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 131 NONAME ; int NmBaseViewScrollArea::qt_metacall(enum QMetaObject::Call, int, void * *)
 
--- a/emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def	Tue Jul 06 14:04:34 2010 +0300
@@ -14,155 +14,150 @@
 	_ZN14NmHtmlLineEditD2Ev @ 13 NONAME
 	_ZN16NmEditorTextEdit11qt_metacallEN11QMetaObject4CallEiPPv @ 14 NONAME
 	_ZN16NmEditorTextEdit11qt_metacastEPKc @ 15 NONAME
-	_ZN16NmEditorTextEdit15setHeaderHeightEi @ 16 NONAME
-	_ZN16NmEditorTextEdit16staticMetaObjectE @ 17 NONAME DATA 16
-	_ZN16NmEditorTextEdit17setScrollPositionEii @ 18 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
-	_ZN20NmAttachmentListItem11constructUiEv @ 47 NONAME
-	_ZN20NmAttachmentListItem11qt_metacallEN11QMetaObject4CallEiPPv @ 48 NONAME
-	_ZN20NmAttachmentListItem11qt_metacastEPKc @ 49 NONAME
-	_ZN20NmAttachmentListItem12gestureEventEP13QGestureEvent @ 50 NONAME
-	_ZN20NmAttachmentListItem12setTextColorE6QColor @ 51 NONAME
-	_ZN20NmAttachmentListItem13itemActivatedEv @ 52 NONAME
-	_ZN20NmAttachmentListItem15hideProgressBarEv @ 53 NONAME
-	_ZN20NmAttachmentListItem15itemLongPressedE7QPointF @ 54 NONAME
-	_ZN20NmAttachmentListItem15setFileNameTextERK7QString @ 55 NONAME
-	_ZN20NmAttachmentListItem15setFileSizeTextERK7QString @ 56 NONAME
-	_ZN20NmAttachmentListItem16staticMetaObjectE @ 57 NONAME DATA 16
-	_ZN20NmAttachmentListItem17removeProgressBarEv @ 58 NONAME
-	_ZN20NmAttachmentListItem19getStaticMetaObjectEv @ 59 NONAME
-	_ZN20NmAttachmentListItem19setProgressBarValueEi @ 60 NONAME
-	_ZN20NmAttachmentListItem4initEv @ 61 NONAME
-	_ZN20NmAttachmentListItemC1EP13QGraphicsItem @ 62 NONAME
-	_ZN20NmAttachmentListItemC2EP13QGraphicsItem @ 63 NONAME
-	_ZN20NmAttachmentListItemD0Ev @ 64 NONAME
-	_ZN20NmAttachmentListItemD1Ev @ 65 NONAME
-	_ZN20NmAttachmentListItemD2Ev @ 66 NONAME
-	_ZN20NmBaseViewScrollArea11qt_metacallEN11QMetaObject4CallEiPPv @ 67 NONAME
-	_ZN20NmBaseViewScrollArea11qt_metacastEPKc @ 68 NONAME
-	_ZN20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 69 NONAME
-	_ZN20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 70 NONAME
-	_ZN20NmBaseViewScrollArea16longPressGestureERK7QPointF @ 71 NONAME
-	_ZN20NmBaseViewScrollArea16staticMetaObjectE @ 72 NONAME DATA 16
-	_ZN20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 73 NONAME
-	_ZN20NmBaseViewScrollArea19getStaticMetaObjectEv @ 74 NONAME
-	_ZN20NmBaseViewScrollArea20handleMouseMoveEventEP24QGraphicsSceneMouseEvent @ 75 NONAME
-	_ZN20NmBaseViewScrollArea21handleMousePressEventEP24QGraphicsSceneMouseEvent @ 76 NONAME
-	_ZN20NmBaseViewScrollArea22handleLongPressGestureERK7QPointF @ 77 NONAME
-	_ZN20NmBaseViewScrollArea23handleMouseReleaseEventEP24QGraphicsSceneMouseEvent @ 78 NONAME
-	_ZN20NmBaseViewScrollAreaC1EP13QGraphicsItem @ 79 NONAME
-	_ZN20NmBaseViewScrollAreaC2EP13QGraphicsItem @ 80 NONAME
-	_ZN20NmBaseViewScrollAreaD0Ev @ 81 NONAME
-	_ZN20NmBaseViewScrollAreaD1Ev @ 82 NONAME
-	_ZN20NmBaseViewScrollAreaD2Ev @ 83 NONAME
-	_ZN22NmAttachmentListWidget11constructUiEv @ 84 NONAME
-	_ZN22NmAttachmentListWidget11longPressedEi7QPointF @ 85 NONAME
-	_ZN22NmAttachmentListWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 86 NONAME
-	_ZN22NmAttachmentListWidget11qt_metacastEPKc @ 87 NONAME
-	_ZN22NmAttachmentListWidget12setTextColorE6QColor @ 88 NONAME
-	_ZN22NmAttachmentListWidget13itemActivatedEi @ 89 NONAME
-	_ZN22NmAttachmentListWidget15hideProgressBarEi @ 90 NONAME
-	_ZN22NmAttachmentListWidget15rearrangeLayoutEv @ 91 NONAME
-	_ZN22NmAttachmentListWidget16insertAttachmentEiRK7QStringS2_ @ 92 NONAME
-	_ZN22NmAttachmentListWidget16removeAttachmentEi @ 93 NONAME
-	_ZN22NmAttachmentListWidget16staticMetaObjectE @ 94 NONAME DATA 16
-	_ZN22NmAttachmentListWidget17handleLongPressedE7QPointF @ 95 NONAME
-	_ZN22NmAttachmentListWidget17setAttachmentSizeEiRK7QString @ 96 NONAME
-	_ZN22NmAttachmentListWidget18insertItemToLayoutEP20NmAttachmentListItem @ 97 NONAME
-	_ZN22NmAttachmentListWidget18orientationChangedEN2Qt11OrientationE @ 98 NONAME
-	_ZN22NmAttachmentListWidget19getStaticMetaObjectEv @ 99 NONAME
-	_ZN22NmAttachmentListWidget19handleItemActivatedEv @ 100 NONAME
-	_ZN22NmAttachmentListWidget19setProgressBarValueEii @ 101 NONAME
-	_ZN22NmAttachmentListWidget4initEv @ 102 NONAME
-	_ZN22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 103 NONAME
-	_ZN22NmAttachmentListWidget8findItemEPK7QObject @ 104 NONAME
-	_ZN22NmAttachmentListWidgetC1EP13QGraphicsItem @ 105 NONAME
-	_ZN22NmAttachmentListWidgetC2EP13QGraphicsItem @ 106 NONAME
-	_ZN22NmAttachmentListWidgetD0Ev @ 107 NONAME
-	_ZN22NmAttachmentListWidgetD1Ev @ 108 NONAME
-	_ZN22NmAttachmentListWidgetD2Ev @ 109 NONAME
-	_ZNK14NmHtmlLineEdit10metaObjectEv @ 110 NONAME
-	_ZNK14NmHtmlLineEdit10textCursorEv @ 111 NONAME
-	_ZNK14NmHtmlLineEdit11toPlainTextEv @ 112 NONAME
-	_ZNK14NmHtmlLineEdit6toHtmlEv @ 113 NONAME
-	_ZNK14NmHtmlLineEdit8documentEv @ 114 NONAME
-	_ZNK16NmEditorTextEdit10metaObjectEv @ 115 NONAME
-	_ZNK16NmEditorTextEdit13contentHeightEv @ 116 NONAME
-	_ZNK16NmEditorTextEdit15customTextColorEv @ 117 NONAME
-	_ZNK19NmRecipientLineEdit10metaObjectEv @ 118 NONAME
-	_ZNK20NmAttachmentListItem10metaObjectEv @ 119 NONAME
-	_ZNK20NmAttachmentListItem16progressBarValueEv @ 120 NONAME
-	_ZNK20NmBaseViewScrollArea10metaObjectEv @ 121 NONAME
-	_ZNK22NmAttachmentListWidget10metaObjectEv @ 122 NONAME
-	_ZNK22NmAttachmentListWidget13progressValueEi @ 123 NONAME
-	_ZNK22NmAttachmentListWidget5countEv @ 124 NONAME
-	_ZTI14NmHtmlLineEdit @ 125 NONAME
-	_ZTI16NmEditorTextEdit @ 126 NONAME
-	_ZTI19NmRecipientLineEdit @ 127 NONAME
-	_ZTI20NmAttachmentListItem @ 128 NONAME
-	_ZTI20NmBaseViewScrollArea @ 129 NONAME
-	_ZTI22NmAttachmentListWidget @ 130 NONAME
-	_ZTV14NmHtmlLineEdit @ 131 NONAME
-	_ZTV16NmEditorTextEdit @ 132 NONAME
-	_ZTV19NmRecipientLineEdit @ 133 NONAME
-	_ZTV20NmAttachmentListItem @ 134 NONAME
-	_ZTV20NmBaseViewScrollArea @ 135 NONAME
-	_ZTV22NmAttachmentListWidget @ 136 NONAME
-	_ZThn16_N14NmHtmlLineEditD0Ev @ 137 NONAME
-	_ZThn16_N14NmHtmlLineEditD1Ev @ 138 NONAME
-	_ZThn16_N16NmEditorTextEditD0Ev @ 139 NONAME
-	_ZThn16_N16NmEditorTextEditD1Ev @ 140 NONAME
-	_ZThn16_N19NmRecipientLineEditD0Ev @ 141 NONAME
-	_ZThn16_N19NmRecipientLineEditD1Ev @ 142 NONAME
-	_ZThn16_N20NmAttachmentListItemD0Ev @ 143 NONAME
-	_ZThn16_N20NmAttachmentListItemD1Ev @ 144 NONAME
-	_ZThn16_N20NmBaseViewScrollAreaD0Ev @ 145 NONAME
-	_ZThn16_N20NmBaseViewScrollAreaD1Ev @ 146 NONAME
-	_ZThn16_N22NmAttachmentListWidgetD0Ev @ 147 NONAME
-	_ZThn16_N22NmAttachmentListWidgetD1Ev @ 148 NONAME
-	_ZThn8_N14NmHtmlLineEditD0Ev @ 149 NONAME
-	_ZThn8_N14NmHtmlLineEditD1Ev @ 150 NONAME
-	_ZThn8_N16NmEditorTextEditD0Ev @ 151 NONAME
-	_ZThn8_N16NmEditorTextEditD1Ev @ 152 NONAME
-	_ZThn8_N19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 153 NONAME
-	_ZThn8_N19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 154 NONAME
-	_ZThn8_N19NmRecipientLineEditD0Ev @ 155 NONAME
-	_ZThn8_N19NmRecipientLineEditD1Ev @ 156 NONAME
-	_ZThn8_N20NmAttachmentListItemD0Ev @ 157 NONAME
-	_ZThn8_N20NmAttachmentListItemD1Ev @ 158 NONAME
-	_ZThn8_N20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 159 NONAME
-	_ZThn8_N20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 160 NONAME
-	_ZThn8_N20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 161 NONAME
-	_ZThn8_N20NmBaseViewScrollAreaD0Ev @ 162 NONAME
-	_ZThn8_N20NmBaseViewScrollAreaD1Ev @ 163 NONAME
-	_ZThn8_N22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 164 NONAME
-	_ZThn8_N22NmAttachmentListWidgetD0Ev @ 165 NONAME
-	_ZThn8_N22NmAttachmentListWidgetD1Ev @ 166 NONAME
+	_ZN16NmEditorTextEdit16staticMetaObjectE @ 16 NONAME DATA 16
+	_ZN16NmEditorTextEdit18setCustomTextColorERK5QPairIb6QColorE @ 17 NONAME
+	_ZN16NmEditorTextEdit18setCustomTextColorEbRK6QColor @ 18 NONAME
+	_ZN16NmEditorTextEdit19getStaticMetaObjectEv @ 19 NONAME
+	_ZN16NmEditorTextEdit21updateCustomTextColorEv @ 20 NONAME
+	_ZN16NmEditorTextEditC1EP13QGraphicsItem @ 21 NONAME
+	_ZN16NmEditorTextEditC2EP13QGraphicsItem @ 22 NONAME
+	_ZN16NmEditorTextEditD0Ev @ 23 NONAME
+	_ZN16NmEditorTextEditD1Ev @ 24 NONAME
+	_ZN16NmEditorTextEditD2Ev @ 25 NONAME
+	_ZN19NmRecipientLineEdit11qt_metacallEN11QMetaObject4CallEiPPv @ 26 NONAME
+	_ZN19NmRecipientLineEdit11qt_metacastEPKc @ 27 NONAME
+	_ZN19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 28 NONAME
+	_ZN19NmRecipientLineEdit16emailAddressListEv @ 29 NONAME
+	_ZN19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 30 NONAME
+	_ZN19NmRecipientLineEdit16staticMetaObjectE @ 31 NONAME DATA 16
+	_ZN19NmRecipientLineEdit17handleTextChangedERK7QString @ 32 NONAME
+	_ZN19NmRecipientLineEdit19addSelectedContactsERK8QVariant @ 33 NONAME
+	_ZN19NmRecipientLineEdit19getStaticMetaObjectEv @ 34 NONAME
+	_ZN19NmRecipientLineEdit24generateEmailAddressListEv @ 35 NONAME
+	_ZN19NmRecipientLineEditC1EP13QGraphicsItem @ 36 NONAME
+	_ZN19NmRecipientLineEditC2EP13QGraphicsItem @ 37 NONAME
+	_ZN19NmRecipientLineEditD0Ev @ 38 NONAME
+	_ZN19NmRecipientLineEditD1Ev @ 39 NONAME
+	_ZN19NmRecipientLineEditD2Ev @ 40 NONAME
+	_ZN20NmAttachmentListItem11constructUiEv @ 41 NONAME
+	_ZN20NmAttachmentListItem11qt_metacallEN11QMetaObject4CallEiPPv @ 42 NONAME
+	_ZN20NmAttachmentListItem11qt_metacastEPKc @ 43 NONAME
+	_ZN20NmAttachmentListItem12gestureEventEP13QGestureEvent @ 44 NONAME
+	_ZN20NmAttachmentListItem12setTextColorE6QColor @ 45 NONAME
+	_ZN20NmAttachmentListItem13itemActivatedEv @ 46 NONAME
+	_ZN20NmAttachmentListItem15hideProgressBarEv @ 47 NONAME
+	_ZN20NmAttachmentListItem15itemLongPressedE7QPointF @ 48 NONAME
+	_ZN20NmAttachmentListItem15setFileNameTextERK7QString @ 49 NONAME
+	_ZN20NmAttachmentListItem15setFileSizeTextERK7QString @ 50 NONAME
+	_ZN20NmAttachmentListItem16staticMetaObjectE @ 51 NONAME DATA 16
+	_ZN20NmAttachmentListItem17removeProgressBarEv @ 52 NONAME
+	_ZN20NmAttachmentListItem19getStaticMetaObjectEv @ 53 NONAME
+	_ZN20NmAttachmentListItem19setProgressBarValueEi @ 54 NONAME
+	_ZN20NmAttachmentListItem4initEv @ 55 NONAME
+	_ZN20NmAttachmentListItemC1EP13QGraphicsItem @ 56 NONAME
+	_ZN20NmAttachmentListItemC2EP13QGraphicsItem @ 57 NONAME
+	_ZN20NmAttachmentListItemD0Ev @ 58 NONAME
+	_ZN20NmAttachmentListItemD1Ev @ 59 NONAME
+	_ZN20NmAttachmentListItemD2Ev @ 60 NONAME
+	_ZN20NmBaseViewScrollArea11qt_metacallEN11QMetaObject4CallEiPPv @ 61 NONAME
+	_ZN20NmBaseViewScrollArea11qt_metacastEPKc @ 62 NONAME
+	_ZN20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 63 NONAME
+	_ZN20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 64 NONAME
+	_ZN20NmBaseViewScrollArea16longPressGestureERK7QPointF @ 65 NONAME
+	_ZN20NmBaseViewScrollArea16staticMetaObjectE @ 66 NONAME DATA 16
+	_ZN20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 67 NONAME
+	_ZN20NmBaseViewScrollArea19getStaticMetaObjectEv @ 68 NONAME
+	_ZN20NmBaseViewScrollArea20handleMouseMoveEventEP24QGraphicsSceneMouseEvent @ 69 NONAME
+	_ZN20NmBaseViewScrollArea21handleMousePressEventEP24QGraphicsSceneMouseEvent @ 70 NONAME
+	_ZN20NmBaseViewScrollArea22handleLongPressGestureERK7QPointF @ 71 NONAME
+	_ZN20NmBaseViewScrollArea23handleMouseReleaseEventEP24QGraphicsSceneMouseEvent @ 72 NONAME
+	_ZN20NmBaseViewScrollAreaC1EP13QGraphicsItem @ 73 NONAME
+	_ZN20NmBaseViewScrollAreaC2EP13QGraphicsItem @ 74 NONAME
+	_ZN20NmBaseViewScrollAreaD0Ev @ 75 NONAME
+	_ZN20NmBaseViewScrollAreaD1Ev @ 76 NONAME
+	_ZN20NmBaseViewScrollAreaD2Ev @ 77 NONAME
+	_ZN22NmAttachmentListWidget11constructUiEv @ 78 NONAME
+	_ZN22NmAttachmentListWidget11longPressedEi7QPointF @ 79 NONAME
+	_ZN22NmAttachmentListWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 80 NONAME
+	_ZN22NmAttachmentListWidget11qt_metacastEPKc @ 81 NONAME
+	_ZN22NmAttachmentListWidget12setTextColorE6QColor @ 82 NONAME
+	_ZN22NmAttachmentListWidget13itemActivatedEi @ 83 NONAME
+	_ZN22NmAttachmentListWidget15hideProgressBarEi @ 84 NONAME
+	_ZN22NmAttachmentListWidget15rearrangeLayoutEv @ 85 NONAME
+	_ZN22NmAttachmentListWidget16insertAttachmentEiRK7QStringS2_ @ 86 NONAME
+	_ZN22NmAttachmentListWidget16removeAttachmentEi @ 87 NONAME
+	_ZN22NmAttachmentListWidget16staticMetaObjectE @ 88 NONAME DATA 16
+	_ZN22NmAttachmentListWidget17handleLongPressedE7QPointF @ 89 NONAME
+	_ZN22NmAttachmentListWidget17setAttachmentSizeEiRK7QString @ 90 NONAME
+	_ZN22NmAttachmentListWidget18insertItemToLayoutEP20NmAttachmentListItem @ 91 NONAME
+	_ZN22NmAttachmentListWidget18orientationChangedEN2Qt11OrientationE @ 92 NONAME
+	_ZN22NmAttachmentListWidget19getStaticMetaObjectEv @ 93 NONAME
+	_ZN22NmAttachmentListWidget19handleItemActivatedEv @ 94 NONAME
+	_ZN22NmAttachmentListWidget19setProgressBarValueEii @ 95 NONAME
+	_ZN22NmAttachmentListWidget4initEv @ 96 NONAME
+	_ZN22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 97 NONAME
+	_ZN22NmAttachmentListWidget8findItemEPK7QObject @ 98 NONAME
+	_ZN22NmAttachmentListWidgetC1EP13QGraphicsItem @ 99 NONAME
+	_ZN22NmAttachmentListWidgetC2EP13QGraphicsItem @ 100 NONAME
+	_ZN22NmAttachmentListWidgetD0Ev @ 101 NONAME
+	_ZN22NmAttachmentListWidgetD1Ev @ 102 NONAME
+	_ZN22NmAttachmentListWidgetD2Ev @ 103 NONAME
+	_ZNK14NmHtmlLineEdit10metaObjectEv @ 104 NONAME
+	_ZNK14NmHtmlLineEdit10textCursorEv @ 105 NONAME
+	_ZNK14NmHtmlLineEdit11toPlainTextEv @ 106 NONAME
+	_ZNK14NmHtmlLineEdit21rectForCursorPositionEv @ 107 NONAME
+	_ZNK14NmHtmlLineEdit6toHtmlEv @ 108 NONAME
+	_ZNK14NmHtmlLineEdit8documentEv @ 109 NONAME
+	_ZNK16NmEditorTextEdit10metaObjectEv @ 110 NONAME
+	_ZNK16NmEditorTextEdit15customTextColorEv @ 111 NONAME
+	_ZNK16NmEditorTextEdit21rectForCursorPositionEv @ 112 NONAME
+	_ZNK19NmRecipientLineEdit10metaObjectEv @ 113 NONAME
+	_ZNK20NmAttachmentListItem10metaObjectEv @ 114 NONAME
+	_ZNK20NmAttachmentListItem16progressBarValueEv @ 115 NONAME
+	_ZNK20NmBaseViewScrollArea10metaObjectEv @ 116 NONAME
+	_ZNK22NmAttachmentListWidget10metaObjectEv @ 117 NONAME
+	_ZNK22NmAttachmentListWidget13progressValueEi @ 118 NONAME
+	_ZNK22NmAttachmentListWidget5countEv @ 119 NONAME
+	_ZTI14NmHtmlLineEdit @ 120 NONAME
+	_ZTI16NmEditorTextEdit @ 121 NONAME
+	_ZTI19NmRecipientLineEdit @ 122 NONAME
+	_ZTI20NmAttachmentListItem @ 123 NONAME
+	_ZTI20NmBaseViewScrollArea @ 124 NONAME
+	_ZTI22NmAttachmentListWidget @ 125 NONAME
+	_ZTV14NmHtmlLineEdit @ 126 NONAME
+	_ZTV16NmEditorTextEdit @ 127 NONAME
+	_ZTV19NmRecipientLineEdit @ 128 NONAME
+	_ZTV20NmAttachmentListItem @ 129 NONAME
+	_ZTV20NmBaseViewScrollArea @ 130 NONAME
+	_ZTV22NmAttachmentListWidget @ 131 NONAME
+	_ZThn16_N14NmHtmlLineEditD0Ev @ 132 NONAME
+	_ZThn16_N14NmHtmlLineEditD1Ev @ 133 NONAME
+	_ZThn16_N16NmEditorTextEditD0Ev @ 134 NONAME
+	_ZThn16_N16NmEditorTextEditD1Ev @ 135 NONAME
+	_ZThn16_N19NmRecipientLineEditD0Ev @ 136 NONAME
+	_ZThn16_N19NmRecipientLineEditD1Ev @ 137 NONAME
+	_ZThn16_N20NmAttachmentListItemD0Ev @ 138 NONAME
+	_ZThn16_N20NmAttachmentListItemD1Ev @ 139 NONAME
+	_ZThn16_N20NmBaseViewScrollAreaD0Ev @ 140 NONAME
+	_ZThn16_N20NmBaseViewScrollAreaD1Ev @ 141 NONAME
+	_ZThn16_N22NmAttachmentListWidgetD0Ev @ 142 NONAME
+	_ZThn16_N22NmAttachmentListWidgetD1Ev @ 143 NONAME
+	_ZThn8_N14NmHtmlLineEditD0Ev @ 144 NONAME
+	_ZThn8_N14NmHtmlLineEditD1Ev @ 145 NONAME
+	_ZThn8_N16NmEditorTextEditD0Ev @ 146 NONAME
+	_ZThn8_N16NmEditorTextEditD1Ev @ 147 NONAME
+	_ZThn8_N19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 148 NONAME
+	_ZThn8_N19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 149 NONAME
+	_ZThn8_N19NmRecipientLineEditD0Ev @ 150 NONAME
+	_ZThn8_N19NmRecipientLineEditD1Ev @ 151 NONAME
+	_ZThn8_N20NmAttachmentListItemD0Ev @ 152 NONAME
+	_ZThn8_N20NmAttachmentListItemD1Ev @ 153 NONAME
+	_ZThn8_N20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 154 NONAME
+	_ZThn8_N20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 155 NONAME
+	_ZThn8_N20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 156 NONAME
+	_ZThn8_N20NmBaseViewScrollAreaD0Ev @ 157 NONAME
+	_ZThn8_N20NmBaseViewScrollAreaD1Ev @ 158 NONAME
+	_ZThn8_N22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 159 NONAME
+	_ZThn8_N22NmAttachmentListWidgetD0Ev @ 160 NONAME
+	_ZThn8_N22NmAttachmentListWidgetD1Ev @ 161 NONAME
 
--- a/emailuis/nmailuiwidgets/inc/nmeditortextedit.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmeditortextedit.h	Tue Jul 06 14:04:34 2010 +0300
@@ -21,10 +21,6 @@
 #include <hbtextedit.h>
 #include "nmailuiwidgetsdef.h"
 
-class NmBaseViewScrollArea;
-class HbScrollArea;
-
-
 class NMAILUIWIDGETS_EXPORT NmEditorTextEdit : public HbTextEdit
 {
 Q_OBJECT
@@ -33,32 +29,16 @@
     NmEditorTextEdit(QGraphicsItem *parent = 0);
     virtual ~NmEditorTextEdit();
 
-    void init(NmBaseViewScrollArea *bgScrollArea);
-    qreal contentHeight() const;
-
     void setCustomTextColor(const QPair<bool, QColor> &customColor);
     void setCustomTextColor(bool useCustom, const QColor& color = Qt::black);
     QPair<bool, QColor> customTextColor() const;
 
-signals:
-    void editorContentHeightChanged();
+    QRectF rectForCursorPosition() const;
 
 public slots:
-    void updateEditorHeight();
-    void setHeaderHeight(int);
-    void setScrollPosition(int oldPos, int newPos);
-    void updateScrollPosition(const QPointF &newPosition);
     void updateCustomTextColor();
 
 private:
-    HbScrollArea *mScrollArea;
-    NmBaseViewScrollArea *mBackgroundScrollArea;
-    qreal mPreviousContentsHeight;
-    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/nmhtmllineedit.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmhtmllineedit.h	Tue Jul 06 14:04:34 2010 +0300
@@ -38,6 +38,8 @@
     QString toPlainText() const;
     QString toHtml() const;
 
+    QRectF rectForCursorPosition() const;
+
 public slots:
     void setPlainText(const QString &text);
     void setHtml(const QString &text);
--- a/emailuis/nmailuiwidgets/inc/nmrecipientlineedit.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmrecipientlineedit.h	Tue Jul 06 14:04:34 2010 +0300
@@ -38,7 +38,7 @@
 	
 public slots:
 #ifdef Q_OS_SYMBIAN
-    void insertSelectedContacts(const QVariant &selectedContacts);
+    void addSelectedContacts(const QVariant &selectedContacts);
 #endif
 
 protected:	// from HbLineEdit
--- a/emailuis/nmailuiwidgets/nmailuiwidgets.qrc	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiwidgets/nmailuiwidgets.qrc	Tue Jul 06 14:04:34 2010 +0300
@@ -3,5 +3,7 @@
         <file alias="nmattachmentlistwidget.docml" >resources/nmattachmentlistwidget.docml</file>
         <file alias="nmattachmentlistitem.widgetml" >resources/nmattachmentlistitem.widgetml</file>
         <file alias="nmattachmentlistitem.css" >resources/nmattachmentlistitem.css</file>
+        <file alias="nmeditortextedit.css" >resources/nmeditortextedit.css</file>
+        <file alias="nmeditortextedit.widgetml" >resources/nmeditortextedit.widgetml</file>
     </qresource>
 </RCC>
--- a/emailuis/nmailuiwidgets/src/nmattachmentlistwidget.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmattachmentlistwidget.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -119,7 +119,10 @@
 {
     NM_FUNCTION;
     
+    qDeleteAll(mItemList);
+
     mItemList.clear();
+	
 }
 
 /*!
@@ -257,6 +260,8 @@
     Q_UNUSED(option);
     Q_UNUSED(widget);
     if (painter&&mLayout){
+        painter->save();
+        
         // Use text color as a line color if set, otherwise use theme
         // normal list content color.
         if (mTextColor.isValid()){
@@ -280,7 +285,8 @@
                               layoutRect.bottomRight().x(), itemRect.bottomRight().y());
                 painter->drawLine(line1);                     
             }     
-        }        
+        }
+        painter->restore();
     }
 }
 
@@ -318,8 +324,9 @@
     //construct UI after orientation has been figured out
     constructUi();
 
-    //set default values, needed?
-    setFlag(QGraphicsItem::ItemIsFocusable);      
+    //set flags
+    setFlag(QGraphicsItem::ItemIsFocusable);  
+    setFlag(QGraphicsItem::ItemHasNoContents,false);
 }
 
 /*!
@@ -339,8 +346,7 @@
     loader.setObjectTree(objectList);
     QObjectList widgetlist = loader.load(FILE_PATH_DOCML, &loadingOk);
 
-    int widgetCount = widgetlist.count();
-    if(loadingOk && widgetCount){
+    if(loadingOk){
         if(layout()){
             mLayout = dynamic_cast<QGraphicsGridLayout*>(layout());
             mLayout->setContentsMargins(0,0,0,0);
--- a/emailuis/nmailuiwidgets/src/nmeditortextedit.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmeditortextedit.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -17,23 +17,52 @@
 
 #include "nmailuiwidgetsheaders.h"
 
-// Following constants will be removed later when possible
-static const double Un = 6.66;
-static const double BodyMargin = Un;
-static const int ChromeHeight = 160;
-static const double FieldHeightWhenSecondaryFont = 7.46 * Un;
-static const int GroupBoxTitleHeight = 42;
-static const double HeightOfTheHeaderOnStartup =
-    2 * FieldHeightWhenSecondaryFont + GroupBoxTitleHeight;
+static const QString FILE_PATH_CSS = ":nmeditortextedit.css";
+static const QString FILE_PATH_WIDGETML = ":nmeditortextedit.widgetml";
 
 /*!
     Constructor
 */
 NmEditorTextEdit::NmEditorTextEdit(QGraphicsItem *parent) :
-    HbTextEdit(parent),
-    mFirstTimeToScrollPosUpdate(true)
+    HbTextEdit(parent)
 {
     NM_FUNCTION;
+    
+    HbStyleLoader::registerFilePath(FILE_PATH_WIDGETML);
+    HbStyleLoader::registerFilePath(FILE_PATH_CSS);
+
+    mCustomTextColor = QPair<bool, QColor>(false, Qt::black);
+    
+    // Disable HbTextEdit scrolling. Background scroll area will handle scrolling.
+    setScrollable(false);
+    scrollArea()->setScrollDirections(0);
+
+    // set background colour to plain white
+    QPixmap whitePixmap(10,10);
+    whitePixmap.fill(Qt::white);
+    QGraphicsPixmapItem *pixmapItem = new QGraphicsPixmapItem (whitePixmap);
+    setBackgroundItem(pixmapItem); 
+    
+    // disables highlight frame for now - new api to set the frame item should be release somewhere wk26
+    setFocusHighlight(HbStyle::P_TextEdit_frame_highlight, HbWidget::FocusHighlightNone);
+    
+    // Create custom palette based on the current one
+    QPalette testPalette = QApplication::palette();
+
+    // Sets the selection background colour
+    testPalette.setColor(QPalette::Active, QPalette::Highlight, Qt::cyan);
+    testPalette.setColor(QPalette::Inactive, QPalette::Highlight, Qt::cyan);
+
+    // Sets the link and visited link colours
+    testPalette.setColor(QPalette::Active, QPalette::Link, Qt::darkBlue);
+    testPalette.setColor(QPalette::Inactive, QPalette::Link, Qt::darkBlue);
+    testPalette.setColor(QPalette::Active, QPalette::LinkVisited, Qt::darkMagenta);
+    testPalette.setColor(QPalette::Inactive, QPalette::LinkVisited, Qt::darkMagenta);
+
+    // Update custom palette for this widget
+    setPalette(testPalette);
+
+    connect(this, SIGNAL(contentsChanged()), this, SLOT(updateCustomTextColor()));
 }
 
 /*!
@@ -42,132 +71,9 @@
 NmEditorTextEdit::~NmEditorTextEdit()
 {
     NM_FUNCTION;
-}
-
-void NmEditorTextEdit::init(NmBaseViewScrollArea *bgScrollArea)
-{
-    NM_FUNCTION;
     
-    mPreviousContentsHeight = 0;
-    mFirstTime = true;
-    mCustomTextColor = QPair<bool, QColor>(false,Qt::black);
-    mBackgroundScrollArea = bgScrollArea;
-    mHeaderHeight = (int)HeightOfTheHeaderOnStartup;
-    mBgScrollPosition.setX(0);
-    mBgScrollPosition.setY(0);
-    document()->setDocumentMargin(BodyMargin);
-
-    mScrollArea = this->scrollArea();
-
-    // Enable scrolling using cursor
-    setScrollable(true);
-    mScrollArea->setScrollDirections(Qt::Horizontal);
-
-    connect(this, SIGNAL(contentsChanged()), this, SLOT(updateEditorHeight()));
-    connect(this, SIGNAL(cursorPositionChanged(int, int)),
-            this, SLOT(setScrollPosition(int, int)));
-    connect(this, SIGNAL(contentsChanged()), this, SLOT(updateCustomTextColor()));
-}
-
-/*!
-    This function returns the height (pixels) of the body fields document content.
- */
-qreal NmEditorTextEdit::contentHeight() const
-{
-    NM_FUNCTION;
-    
-    QSizeF s = document()->size();
-    return s.height();
-}
-
-/*!
-   This slot updates the editor height. It is called every time when text edit
-   widget content has been changed.
- */
-void NmEditorTextEdit::updateEditorHeight()
-{
-    NM_FUNCTION;
-    
-    // Get current body content height
-    qreal heightOfTheTextEdit = contentHeight();
-
-    // Check if height is changed
-    if (mPreviousContentsHeight != heightOfTheTextEdit) {
-        mPreviousContentsHeight = heightOfTheTextEdit;
-        setPreferredHeight(heightOfTheTextEdit);
-        setMaximumHeight(heightOfTheTextEdit);
-    }
-    // Inform parent that content height has been changed
-    emit editorContentHeightChanged();
-}
-
-/*!
-    This slot is called when cursor position is changed in body area using
-    'pointing stick' or keyboard. Function will update the scroll position
-    of the content so that cursor does not go outside of the screen or
-    behind the virtual keyboard.
- */
-void NmEditorTextEdit::setScrollPosition(int oldPos, int newPos)
-{
-    NM_FUNCTION;
-    
-    Q_UNUSED(oldPos);
-
-    if (mFirstTime) {
-        // For some reason content height of the HbTextEdit is wrong
-        // right after construction. That is the reason why this mFirstTime
-        // member is used to set content height bit later.
-        mFirstTime = false;
-        updateEditorHeight();
-    }
-    const QSizeF screenReso = HbDeviceProfile::current().logicalSize();
-    qreal maxHeight = screenReso.height() - ChromeHeight;
-
-    // Get cursor position coordinates
-    QRectF cursorPosPix = rectForPosition(newPos);
-
-    // Calculate the screen top and bottom boundaries, this means the part of the
-    // background scroll area which is currently visible.
-    qreal visibleRectTopBoundary;
-    qreal visibleRectBottomBoundary;
-
-    if (mBgScrollPosition.y() < mHeaderHeight) {
-        // Header is completely or partially visible
-        visibleRectTopBoundary = mHeaderHeight - mBgScrollPosition.y();
-        visibleRectBottomBoundary = maxHeight - visibleRectTopBoundary;
-    }
-    else {
-        // Header is not visible
-        visibleRectTopBoundary = mBgScrollPosition.y() - mHeaderHeight;
-        visibleRectBottomBoundary = visibleRectTopBoundary + maxHeight;
-    }
-
-    // Do scrolling if cursor is out of the screen boundaries
-    if (cursorPosPix.y() > visibleRectBottomBoundary) {
-        // Do scroll forward
-        mBackgroundScrollArea->scrollContentsTo(
-            QPointF(0,cursorPosPix.y() - maxHeight + mHeaderHeight));
-    }
-    else if (cursorPosPix.y() + mHeaderHeight < mBgScrollPosition.y()) {
-        // Do scroll backward
-        mBackgroundScrollArea->scrollContentsTo(QPointF(0,cursorPosPix.y() + mHeaderHeight));
-    }
-}
-
-/*!
-    This slot is called when background scroll areas scroll position has been shanged.
-*/
-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;
+    HbStyleLoader::unregisterFilePath(FILE_PATH_WIDGETML);
+    HbStyleLoader::unregisterFilePath(FILE_PATH_CSS);    
 }
 
 /*!
@@ -193,7 +99,8 @@
                     tcursor.mergeCharFormat(fmt);
                 }
             }
-        } else {
+        }
+        else {
             fmt = tcursor.charFormat();
             fmt.setForeground(mCustomTextColor.second);
             tcursor.mergeCharFormat(fmt);
@@ -203,18 +110,6 @@
 }
 
 /*!
-    This slot is called when header widget height has been changed. Function performs
-    the repositioning of the body field and resizing of the editor and content area.
- */
-void NmEditorTextEdit::setHeaderHeight(int newHeight)
-{
-    NM_FUNCTION;
-    
-    mHeaderHeight = newHeight;
-    updateEditorHeight();
-}
-
-/*!
    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.
@@ -254,3 +149,14 @@
     
     return mCustomTextColor;
 }
+
+/*!
+ *  Returns the rectangle for the cursor.
+ */
+QRectF NmEditorTextEdit::rectForCursorPosition() const
+{
+    NM_FUNCTION;
+    
+    return HbTextEdit::rectForPosition(cursorPosition());
+}
+
--- a/emailuis/nmailuiwidgets/src/nmhtmllineedit.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmhtmllineedit.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -26,6 +26,10 @@
     HbLineEdit(parent)
 {
     NM_FUNCTION;
+
+    // Disable scrolling so that baunch effect works correctly
+    HbAbstractEdit::setScrollable(false);
+    HbAbstractEdit::scrollArea()->setScrollDirections(0);
 }
 
 /*!
@@ -96,3 +100,13 @@
     
     HbAbstractEdit::setPlainText(text);
 }
+
+/*!
+ *  Returns the rectangle for the cursor.
+ */
+QRectF NmHtmlLineEdit::rectForCursorPosition() const
+{
+    NM_FUNCTION;
+    
+    return HbLineEdit::rectForPosition(cursorPosition());
+}
--- a/emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -65,29 +65,43 @@
 
 #ifdef Q_OS_SYMBIAN
 /*!
-   This Slot inserts the selected contacts from Contacts-picker into the lineedit cursor position.    
+   This Slot appends the selected contacts to the end of the lineedit content.    
 */
-void NmRecipientLineEdit::insertSelectedContacts(const QVariant &selectedContacts)
+void NmRecipientLineEdit::addSelectedContacts(const QVariant &selectedContacts)
 {
     NM_FUNCTION;
     
-    if (!selectedContacts.isNull()) {
-        CntServicesContactList contactList;
-        contactList = qVariantValue<CntServicesContactList>(selectedContacts);
+    // If user selected contact
+    if (!selectedContacts.isNull()) {        
+
+        // If the lineedit is not empty and if there is no ";" or "; " at the end,
+        // add a delimiter("; ") at the end.
+        if (this->text().length() != 0 && !(this->text().endsWith(Semicolon)) && 
+            !(this->text().endsWith(Delimiter))){
+            
+            // Move cursor to the end of the lineedit.
+            this->setCursorPosition(this->text().length());       
+            QTextCursor textCursor(this->textCursor());
+            // Append delimiter("; ") to the end of the lineedit
+            textCursor.insertText(Delimiter);
+        }
+        
+        CntServicesContactList contactList = qVariantValue<CntServicesContactList>(selectedContacts);
 
         // Loop through all the selected contacts.
         for (int i = 0; i < contactList.count(); ++i) {
+            QString contactName = contactList[i].mDisplayName;
             QString contactEmailAddress = contactList[i].mEmailAddress;
-            QString contactName = contactList[i].mDisplayName;
-
-            // If this contact has no name.
-            if(contactName.isEmpty()) {				
-                // Generate a custom keyevent for this contact's emailaddress.
-                QKeyEvent contactEmailAddressKeyEvent(QEvent::KeyPress, Qt::Key_unknown, 
-                		                              Qt::NoModifier, contactEmailAddress);
-                // Forward this contactEmailAddressKeyEvent to base class to handle.
-                NmHtmlLineEdit::keyPressEvent(&contactEmailAddressKeyEvent);
+            
+            // If this contact has no name, use it's emailaddress as the display name
+            if(contactName.isEmpty()) {	
+                // Move cursor to the end of the lineedit.
+                this->setCursorPosition(this->text().length());       
+                QTextCursor textCursor(this->textCursor());
+                // Append contactEmailAddress to the end of the lineedit
+                textCursor.insertText(contactEmailAddress);
             }
+            // If this contact has name, use the name as the display name
             else {
                 // Handle a rare case: there are contacts has same name but different emailaddress.
                 for (int i = 0; i != mRecipientsAddedFromContacts.count(); ++i) {
@@ -100,19 +114,17 @@
                     }
                 }
                 
-                // Generate custom keyevent for this contact's name.
-                QKeyEvent contactNameKeyEvent(QEvent::KeyPress, Qt::Key_unknown, 
-                                              Qt::NoModifier, contactName);
-                // Forward this contactNameKeyEvent to base class to handle.
-                NmHtmlLineEdit::keyPressEvent(&contactNameKeyEvent);
+                // Move cursor to the end of the lineedit.
+                this->setCursorPosition(this->text().length());       
+                QTextCursor textCursor(this->textCursor());
+                // Append contactName to the end of the lineedit
+                textCursor.insertText(contactName);
             }
-
-            // Generate custom keyevent for Delimiter("; ").
-            QKeyEvent delimiterKeyEvent(QEvent::KeyPress, Qt::Key_unknown, 
-                                        Qt::NoModifier, Delimiter);
-            // Forward the delimiterKeyEvent to base class to handle.
-            NmHtmlLineEdit::keyPressEvent(&delimiterKeyEvent);
-			
+                
+            QTextCursor textCursor(this->textCursor());
+            // Append delimiter("; ")
+            textCursor.insertText(Delimiter);
+            
             // Form the contact into Qmail NmAddress format.
             NmAddress contact;
             contact.setAddress(contactEmailAddress);
@@ -120,7 +132,7 @@
             
             // Add this NmAddress formated contact into mRecipientsAddedFromContacts.
             mRecipientsAddedFromContacts.append(contact);
-        }
+        } 
     }
     else {
         //Request returned NULL 
--- a/emailuis/nmframeworkadapter/inc/nmframeworkadapter.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmframeworkadapter.h	Tue Jul 06 14:04:34 2010 +0300
@@ -66,7 +66,7 @@
 
     int getMailboxById(const NmId& id, NmMailbox*& mailbox);
 
-    int deleteMailboxById(const NmId& id);
+    QPointer<NmOperation> deleteMailboxById(const NmId& id);
 
     int getMessageById(
             const NmId& mailboxId,
@@ -200,6 +200,12 @@
     void updateActiveFolder(const NmId &mailboxId, const NmId &folderId);
     
     QPointer<NmOperation> removeDraftMessage(NmMessage *message);
+	
+	int copyMessages(
+        const NmId &mailboxId,
+        const QList<quint64> &messageIds,
+        const NmId &sourceFolderId,
+        const NmId &destinationFolderId);
     
 signals:
 
@@ -295,7 +301,15 @@
     
     void doUpdateActiveFolderL(const NmId &mailboxId, const NmId &folderId);
     
-    CEmailExtension* getEMailStateExtensionL();      
+    CEmailExtension* getEMailStateExtensionL();  
+	
+    void copyMessagesL(
+        const NmId &mailboxId, 
+        const QList<quint64> &messageIds,
+        const NmId &sourceFolderId,
+        const NmId &destinationFolderId);
+	
+	void deleteMailboxByIdL(const NmId &mailboxId);    
 
 
 private: // Data
@@ -303,7 +317,9 @@
     CFSMailClient* mFSfw; // Singleton, not owned
     NmMailboxSearchObserver *mSearchObserver; // Owned
     CFSMailBox* mCurrentMailBox; // Owned
-    CEmailExtension* mEmailExtension; // not owned
+    CEmailExtension* mStateExtension; // not owned
+
+
 };
 
 
--- a/emailuis/nmframeworkadapter/inc/nmframeworkadapterheaders.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmframeworkadapter/inc/nmframeworkadapterheaders.h	Tue Jul 06 14:04:34 2010 +0300
@@ -67,6 +67,7 @@
 #include "nmfwastoremessageoperation.h"
 #include "nmmailboxsearchobserver.h"
 #include "nmfwaremovedraftmessageoperation.h"
+#include "nmfwadeletemailboxoperation.h"
 
 // fs email
 #include <CFSMailCommon.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmframeworkadapter/inc/nmfwadeletemailboxoperation.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,58 @@
+/*
+ * 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 NMFWADELETEMAILBOXOPERATION_H_
+#define NMFWADELETEMAILBOXOPERATION_H_
+
+#include <QPointer>
+#include <nmoperation.h>
+#include <nmcommon.h>
+#include <CFSMailCommon.h>
+#include <MFSMailRequestObserver.h>
+
+class NmId;
+class NmDataPluginInterface;
+class CFSMailClient;
+
+class NmFwaDeleteMailboxOperation : public NmOperation,
+                                         public MFSMailRequestObserver
+{
+    Q_OBJECT
+public:
+    NmFwaDeleteMailboxOperation(const NmId &mailboxId,
+                                CFSMailClient &mailClient);
+    
+    // from MFSMailRequestObserver
+    void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
+
+protected:
+    void doRunAsyncOperation();
+    void doCompleteOperation();
+    void doCancelOperation();
+
+private:
+    ~NmFwaDeleteMailboxOperation();
+
+    void deleteMailboxL();
+
+private:
+    const NmId &mMailboxId;    // Owned
+    CFSMailClient &mMailClient;
+    TInt mRequestId;
+};
+
+#endif /* NMFWADELETEMAILBOXOPERATION_H_ */
--- a/emailuis/nmframeworkadapter/nmframeworkadapter.pro	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmframeworkadapter/nmframeworkadapter.pro	Tue Jul 06 14:04:34 2010 +0300
@@ -13,7 +13,7 @@
 #
 # Description: 
 #
-# Version : %version: e003sa37#30 %
+# Version : %version: e002sa38#31 %
 TEMPLATE = lib
 TARGET = nmframeworkadapter
 
@@ -39,7 +39,8 @@
            inc/nmfwamessagepartfetchingoperation.h \
            inc/nmmailboxsearchobserver.h \
            inc/nmfwamessagepartsfetchingoperation.h \
-           inc/nmfwaremovedraftmessageoperation.h
+           inc/nmfwaremovedraftmessageoperation.h \
+           inc/nmfwadeletemailboxoperation.h
 
 SOURCES += src/nmframeworkadapter.cpp \
            src/nmfwamessagefetchingoperation.cpp \
@@ -54,7 +55,9 @@
            src/nmfwamessagepartfetchingoperation.cpp \
            src/nmmailboxsearchobserver.cpp \
            src/nmfwamessagepartsfetchingoperation.cpp \
-           src/nmfwaremovedraftmessageoperation.cpp
+           src/nmfwaremovedraftmessageoperation.cpp \
+           src/nmfwadeletemailboxoperation.cpp
+           
 
 RESOURCES +=
 
--- a/emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -40,7 +40,7 @@
 : mFSfw(NULL),
   mSearchObserver(NULL),
   mCurrentMailBox(NULL),
-  mEmailExtension(NULL)
+  mStateExtension(NULL)
 {
     NM_FUNCTION;
     
@@ -59,13 +59,10 @@
 {
     NM_FUNCTION;
     
-    if (mCurrentMailBox && mEmailExtension) {
-        mCurrentMailBox->ReleaseExtension( mEmailExtension );
-    }
     delete mCurrentMailBox;
     mCurrentMailBox = NULL;
     
-    mEmailExtension = NULL;    
+    mStateExtension = NULL;    
     
     if (mSearchObserver) {
         delete mSearchObserver;
@@ -167,17 +164,17 @@
 }
 
 /*!
-    Delete the mailbox with the given id. Not implemented yet.
+    Deletes the mailbox with the given id asynchronously.
 
-    \param id Id of the mailbox to be deleted.
+    \param mailboxId Id of the mailbox to be deleted.
 
     \return Error code.
  */
-int NmFrameworkAdapter::deleteMailboxById(const NmId& /*id*/)
+QPointer<NmOperation> NmFrameworkAdapter::deleteMailboxById(const NmId& mailboxId)
 {
     NM_FUNCTION;
-    
-    return 0;
+    QPointer<NmOperation> oper = new NmFwaDeleteMailboxOperation(mailboxId, *mFSfw);
+    return oper;
 }
 
 /*!
@@ -685,16 +682,15 @@
     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 = 
+    CMailboxStateExtension *stateExtension = 
         static_cast<CMailboxStateExtension*>(extension);        
-    if (boxExtension) {
-        boxExtension->NotifyActiveFolderChanged(mailboxId, folderId);    
+    if (stateExtension) {
+        stateExtension->NotifyActiveFolderChanged(mailboxId, folderId);    
     }
 }
 
@@ -703,11 +699,12 @@
  */
 CEmailExtension* NmFrameworkAdapter::getEMailStateExtensionL()
 {      
-    if (!mEmailExtension && mCurrentMailBox) {
-        mEmailExtension = 
-            mCurrentMailBox->ExtensionL(KEmailMailboxStateExtensionUid);
+    if (!mStateExtension && mCurrentMailBox) {
+        // This extension is owned and deleted by the plugin, so no need to
+        // use release unless the extension will be relocated into extensionbase.
+        mStateExtension =  mCurrentMailBox->ExtensionL(KEmailMailboxStateExtensionUid);
     }    
-    return mEmailExtension;
+    return mStateExtension;
 }
 
 /*!
@@ -1348,6 +1345,26 @@
 }
 
 /*!
+    Copy messages between folders from specific mailbox.
+
+    \param mailboxId Id of the mailbox containing messages.
+    \param messageIds The list of source message Ids.
+    \param newMessages The list of destination message Ids.
+    \param sourceFolderId Id of source folder.
+    \param destinationFolderId Id of destination folder.
+ */
+int NmFrameworkAdapter::copyMessages(
+    const NmId &mailboxId,
+    const QList<quint64>& messageIds,
+    const NmId& sourceFolderId,
+    const NmId& destinationFolderId)
+{
+    NM_FUNCTION;
+    TRAPD(error, copyMessagesL(mailboxId, messageIds, sourceFolderId, destinationFolderId));
+    return error;
+}
+
+/*!
     Subscribe to events from a mailbox.
 
     \param mailboxId Id of the mailbox.
@@ -1409,6 +1426,39 @@
     CleanupStack::PopAndDestroy(folder);
 }
 
+/*!
+    Leaving version of copyMessages
+*/
+void NmFrameworkAdapter::copyMessagesL(
+    const NmId &mailboxId,
+    const QList<quint64>& messageIds,
+    const NmId& sourceFolderId,
+    const NmId& destinationFolderId)
+{
+    NM_FUNCTION;
+
+    RArray<TFSMailMsgId> messages;
+    RArray<TFSMailMsgId> copiedMessages;
+    
+    CleanupClosePushL(messages);
+    CleanupClosePushL(copiedMessages);
+    
+    for (TInt i = 0; i < messageIds.count(); i++) {
+        NmId tmpId(messageIds[i]);
+        messages.AppendL(TFSMailMsgId(tmpId));
+    }
+    
+    CFSMailBox* mailBox = NULL;
+    mailBox = mFSfw->GetMailBoxByUidL(mailboxId);
+    if (mailBox) {
+        mailBox->CopyMessagesL(messages, copiedMessages, 
+            TFSMailMsgId(sourceFolderId), 
+            TFSMailMsgId(destinationFolderId));
+        delete mailBox;
+    }
+    
+    CleanupStack::PopAndDestroy(2,&messages);    
+}
 
 /*!
    Sends the given message.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmframeworkadapter/src/nmfwadeletemailboxoperation.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,125 @@
+/*
+ * 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 NmFwaDeleteMailboxOperation
+    
+    \brief NmFwaDeleteMailboxOperation is an async operation which deletes a mailbox.
+    
+    NmFwaDeleteMailboxOperation is an async operation which deletes a mailbox. 
+    \sa NmOperation
+ */
+
+/*!
+    Constructor
+    
+    \param mailboxId Mailbox id to be deleted.
+    \param mailClient Reference to mail client object.
+ */
+NmFwaDeleteMailboxOperation::NmFwaDeleteMailboxOperation(
+    const NmId &mailboxId,
+    CFSMailClient &mailClient) :
+        mMailboxId(mailboxId),
+        mMailClient(mailClient),
+        mRequestId(NmNotFoundError)
+{
+    NM_FUNCTION;
+    
+    mMailClient.IncReferenceCount();
+}
+
+/*!
+    Destructor
+ */
+NmFwaDeleteMailboxOperation::~NmFwaDeleteMailboxOperation()
+{
+    NM_FUNCTION;
+    
+    doCancelOperation();
+    mMailClient.Close(); // decrease ref count
+}
+
+/*!
+    Called after base object construction via timer event, runs the
+    async operation.
+    
+    \sa NmOperation
+ */
+void NmFwaDeleteMailboxOperation::doRunAsyncOperation()
+{
+    NM_FUNCTION;
+    
+    TRAPD(err, deleteMailboxL());
+        
+    if (err != KErrNone) {
+        completeOperation(NmGeneralError);
+    }
+}
+
+/*!
+    
+ */
+void NmFwaDeleteMailboxOperation::doCompleteOperation()
+{
+    NM_FUNCTION;
+    
+    mRequestId = NmNotFoundError;
+}
+
+/*!
+    
+ */
+void NmFwaDeleteMailboxOperation::doCancelOperation()
+{
+    NM_FUNCTION;
+
+    // delete mailbox operation is not cancellable
+}
+    
+/*!
+    Asynchronous request response message.
+    
+    \param aEvent Plugin event description.
+    \param aRequestId Request id of asyncronous operation.
+ */
+void NmFwaDeleteMailboxOperation::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 NmFwaDeleteMailboxOperation::deleteMailboxL()
+{
+    NM_FUNCTION;
+    const TFSMailMsgId mailboxId(mMailboxId);
+    mRequestId = mMailClient.DeleteMailBoxByUidL(mailboxId, *this);
+}
--- a/emailuis/nmframeworkadapter/src/nmfwaremovedraftmessageoperation.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwaremovedraftmessageoperation.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -139,6 +139,8 @@
             // async version not supported, use sync version
             folder->RemoveMessageL( messageId );
             completeOperation(NmNoError);
+        } else if (KErrNone != err) {
+            completeOperation(NmGeneralError);
         }
     }
     else {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmhswidget/conf/nmhswidget.docml	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.1">
+    <widget name="nmhswidgetContainer" type="HbWidget">
+        <widget name="mailRowContainer" type="HbWidget">
+            <widget name="noMailsLabel" type="HbLabel">
+                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+                <string locid="txt_mail_widget_info_no_messages" name="plainText" value="No mails!!!"/>
+                <string name="textColor" value="#000000"/>
+                <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+                <sizehint type="MAXIMUM" width="46un"/>
+                <sizehint height="0un" type="MINIMUM" width="0un"/>
+                <sizehint height="29.75un" type="PREFERRED" width="46un"/>
+            </widget>
+            <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+            <sizehint height="expr(3*9.75un )" type="PREFERRED" width="46un"/>
+            <sizehint height="0un" type="MINIMUM" width="0un"/>
+            <sizehint height="2504062.01158un" type="MAXIMUM" width="2504062.01158un"/>
+            <layout orientation="Vertical" spacing="0un" type="linear">
+                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                <linearitem itemname="noMailsLabel"/>
+            </layout>
+        </widget>
+        <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="expr(var(hb-param-text-height-secondary) )" type="PREFERRED" width="34.92537un"/>
+                <sizehint height="expr(var(hb-param-text-height-secondary) )" type="MINIMUM"/>
+                <sizehint height="expr(var(hb-param-text-height-secondary) )" type="MAXIMUM"/>
+                <string name="plainText" value="Mailbox gmail"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+            </widget>
+            <widget name="mailboxIcon" type="HbLabel">
+                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                <icon iconName="note_warning" name="icon"/>
+                <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="Expanding" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                <sizehint height="expr(var(hb-param-text-height-secondary) )" type="PREFERRED" width="6un"/>
+                <sizehint height="expr(var(hb-param-text-height-secondary) )" type="MINIMUM" width="3un"/>
+                <sizehint height="expr(var(hb-param-text-height-secondary) )" type="MAXIMUM" width="9un"/>
+                <string locid="txt_mail_widget_list_l1" name="plainText" value="(999)"/>
+                <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="7un" type="FIXED" width="7un"/>
+                <sizehint height="7un" type="MINIMUM" width="7un"/>
+                <sizehint height="7un" type="MAXIMUM" width="7un"/>
+                <string name="alignment" value="AlignVCenter|AlignHCenter"/>
+            </widget>
+            <real name="z" value="1"/>
+            <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="expr(var(hb-param-margin-gene-bottom) + var(hb-param-text-height-secondary)  + var(hb-param-margin-gene-top) )" type="PREFERRED" width="46un"/>
+            <sizehint height="expr(var(hb-param-margin-gene-bottom) + var(hb-param-text-height-secondary)  + var(hb-param-margin-gene-top) )" type="MINIMUM" width="expr(5*var(hb-param-margin-gene-middle-horizontal) + 27un )"/>
+            <sizehint height="expr(var(hb-param-margin-gene-bottom) + var(hb-param-text-height-secondary)  + var(hb-param-margin-gene-top) )" type="MAXIMUM" width="2504062.01158un"/>
+            <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="collapseExpandIcon" dstEdge="RIGHT" spacing="-0.25" 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"/>
+                <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"/>
+            </layout>
+        </widget>
+        <real name="z" value="1"/>
+        <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Expanding" verticalStretch="0"/>
+        <sizehint height="expr(3*9.75un + 7.5un )" type="PREFERRED" width="46un"/>
+        <sizehint height="0un" type="MINIMUM" width="46un"/>
+        <sizehint height="42un" type="MAXIMUM" width="46un"/>
+        <layout type="anchor">
+            <anchoritem dst="titleLayoutWidget" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+            <anchoritem dst="titleLayoutWidget" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+            <anchoritem dst="mailRowContainer" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+            <anchoritem dst="mailRowContainer" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-top) + var(hb-param-margin-gene-bottom)  + var(hb-param-text-height-secondary))" src="" srcEdge="TOP"/>
+            <anchoritem dst="mailRowContainer" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+            <anchoritem dst="mailRowContainer" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+        </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/nmhswidgetmail.docml	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/conf/nmhswidgetmail.docml	Tue Jul 06 14:04:34 2010 +0300
@@ -60,10 +60,10 @@
             <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"/>
+        <sizepolicy horizontalPolicy="Expanding" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+        <sizehint height="expr(1un + var(hb-param-text-height-secondary)  + var(hb-param-margin-gene-middle-vertical) + var(hb-param-text-height-secondary) + 1un )" type="PREFERRED" width="46un"/>
+        <sizehint height="expr(1un + var(hb-param-text-height-secondary)  + var(hb-param-margin-gene-middle-vertical) + var(hb-param-text-height-secondary) + 1un )" type="MINIMUM" width="expr(4*var(hb-param-margin-gene-middle-horizontal)  + 15un )"/>
+        <sizehint height="expr(1un + var(hb-param-text-height-secondary)  + var(hb-param-margin-gene-middle-vertical) + var(hb-param-text-height-secondary) + 1un )" type="MAXIMUM" width="2504062.01158un"/>
         <layout type="anchor">
             <anchoritem dst="iconSeparator" dstEdge="LEFT" spacing="2" src="" srcEdge="LEFT"/>
             <anchoritem dst="iconSeparator" dstEdge="TOP" spacing="0" src="" srcEdge="TOP"/>
@@ -79,11 +79,11 @@
             <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="RIGHT" spacing="-0.5un" 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="RIGHT" spacing="-0.5un" src="iconThree" srcEdge="LEFT"/>
             <anchoritem dst="iconTwo" dstEdge="CENTERV" spacing="0un" src="iconOne" srcEdge="CENTERV"/>
         </layout>
     </widget>
--- a/emailuis/nmhswidget/conf/nmhswidgettitle.docml	Wed Jun 23 18:00:21 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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-secondary)" type="PREFERRED" width="34.92537un"/>
-            <string name="plainText" value="Mailbox gmail"/>
-            <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
-        </widget>
-        <widget name="mailboxIcon" type="HbLabel">
-            <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
-            <icon iconName="note_warning" name="icon"/>
-            <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-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-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="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="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/nmhswidget.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidget.h	Tue Jul 06 14:04:34 2010 +0300
@@ -28,6 +28,8 @@
 class QTranslator;
 class HbFrameDrawer;
 class NmHsWidgetDateTimeObserver;
+class HbLabel;
+class HbDocumentLoader;
 
 class NmHsWidget : public HbWidget
 {
@@ -40,13 +42,14 @@
 public:
     NmHsWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
     ~NmHsWidget();
+
+    QPainterPath shape() const;
     
 public slots:
     //from home screen fw
     void onInitialize();
     void onShow();
     void onHide();
-    void onUninitialize();
     //engine
     void updateMailData();
     void onEngineException(const int& exc);
@@ -65,26 +68,34 @@
     void setPreferences(const QStringList &names);
     void error();
 private:
-    bool setupLocalization();
+    void setupLocalization();
     void setupUi();
+    bool loadDocML(HbDocumentLoader &loader);
     void updateMailRowsVisibility(const int visibleCount);
+    void addNoMailsLabelToLayout();
+    void removeNoMailsLabelFromLayout();
+    void addEmailRowsToLayout();
+    void removeEmailRowsFromLayout();
+    void updateLayout(const int visibleCount);
     void toggleExpansionState();  
 
 protected:
-    void updateMailRowsList(const int mailCount);
+    void createMailRowsList();
     
 private:
     NmHsWidgetEmailEngine* mEngine;
-    QGraphicsLinearLayout *mRowLayout;
-    NmHsWidgetTitleRow* mTitleRow;
-    QList<NmHsWidgetEmailRow*> mMailRows;
-    NmId mAccountId;
-    QString mAccountIconName;
-    QTranslator *mTranslator;
-    HbFrameDrawer* mBackgroundFrameDrawer;
-    bool mIsExpanded;
-    bool mStaticWidget;
-    NmHsWidgetDateTimeObserver* mDateObserver;
+    NmHsWidgetTitleRow* mTitleRow;          
+    QList<NmHsWidgetEmailRow*> mMailRows;   //list including mail row instances
+    NmId mAccountId;                        //mail account id widget is monitoring
+    QString mAccountIconName;               //name of mailbox icon shown in titlerow
+    QTranslator* mTranslator;
+    HbFrameDrawer* mBackgroundFrameDrawer;  //drawer for widget backgound
+    bool mIsExpanded;                       //true when widget expanded, false when collapsed
+    NmHsWidgetDateTimeObserver* mDateObserver;  //observer for time/locale changes
+    HbLabel* mNoMailsLabel;                 //label shown in widget when no mails in inbox
+    HbWidget* mWidgetContainer;             //container including title row and content container
+    HbWidget* mContentContainer;            //container including mail rows and mNoMailsLabel
+    QGraphicsLinearLayout* mContentLayout;  //layout for mail rows
     
 public:    
     friend class TestNmHsWidget;     
--- a/emailuis/nmhswidget/inc/nmhswidgetconsts.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidgetconsts.h	Tue Jul 06 14:04:34 2010 +0300
@@ -23,13 +23,21 @@
  *************************************************/
 //Maximum amount of envelopes that can be provided to client in getData function
 //This is also the amount of envelopes that is kept in mData all the time
-const int KMaxNumberOfEnvelopesProvided = 2;
+const int KMaxNumberOfEnvelopesProvided = 3;
 //Maximum value for unread count
 const int KMaxUnreadCount = 999; 
 
 /**************************************************
  * nmhswidget
  *************************************************/
+/**  docml file including UI definitions */
+const QString KNmHsWidgetDocML = ":/docml/nmhswidget.docml";
+/** container widget including all UI components */
+const QString KNmHsWidgetContainer = "nmhswidgetContainer";
+/** container widget including content (mail rows / no mails label */
+const QString KNmHsWidgetContentContainer = "mailRowContainer";
+/** no mails label - shown when inbox is empty */
+const QString KNmHsWidgetNoMailsLabel = "noMailsLabel";
 /** contents margin/spacing in all layouts / container widgets */
 const int KNmHsWidgetContentsMargin = 0;
 /** Widget's background image*/
@@ -48,41 +56,41 @@
  * Title row widget
  *************************************************/
 /**  docml file including title row UI definitions */
-#define KNmHsWidgetTitleRowDocML ":/docml/nmhswidgettitle.docml"
+/**#define KNmHsWidgetTitleRowDocML ":/docml/nmhswidgettitle.docml" */
 /**  docml file including title row UI definitions */
-#define KNmHsWidgetTitleRowContainer  "titleLayoutWidget"
+const QString KNmHsWidgetTitleRowContainer = "titleLayoutWidget";
 /** mailbox icon */
-#define KNmHsWidgetTitleRowMailboxIcon  "mailboxIcon"
+const QString KNmHsWidgetTitleRowMailboxIcon = "mailboxIcon";
 /** mailbox name label */
-#define KNmHsWidgetTitleRowMailboxNameLabel "mailboxNameLabel"
+const QString KNmHsWidgetTitleRowMailboxNameLabel = "mailboxNameLabel";
 /** unread count label */
-#define KNmHsWidgetTitleRowUnreadCountLabel  "unreadCountLabel"
+const QString KNmHsWidgetTitleRowUnreadCountLabel = "unreadCountLabel";
 /** expand collapse icon */
-#define KNmHsWidgetTitleRowCollapseExpandIconLabel "collapseExpandIcon"
+const QString KNmHsWidgetTitleRowCollapseExpandIconLabel = "collapseExpandIcon";
 
 /**************************************************
  * Mail row widget
  *************************************************/
 /**  docml file including mail row UI definitions */
-#define KNmHsWidgetMailRowDocML   ":/docml/nmhswidgetmail.docml"
+const QString KNmHsWidgetMailRowDocML = ":/docml/nmhswidgetmail.docml";
 /** container widget name for mail row UI items */
-#define KNmHsWidgetMailRowContainer   "emailLayoutWidget"
+const QString KNmHsWidgetMailRowContainer  = "emailLayoutWidget";
 /** sender label */
-#define KNmHsWidgetMailRowSenderLabel   "labelSender"
+const QString KNmHsWidgetMailRowSenderLabel = "labelSender";
 /** time label */
-#define KNmHsWidgetMailRowTimeLabel   "labelTime"
+const QString KNmHsWidgetMailRowTimeLabel = "labelTime";
 /** subject label */
-#define KNmHsWidgetMailRowSubjectLabel   "labelSubject"
+const QString KNmHsWidgetMailRowSubjectLabel = "labelSubject";
 /** new mail icon */
-#define KNmHsWidgetMailRowNewMailIcon   "iconNewMail"
+const QString KNmHsWidgetMailRowNewMailIcon = "iconNewMail";
 /** left status icon */
-#define KNmHsWidgetMailRowLeftIcon   "iconOne"
+const QString KNmHsWidgetMailRowLeftIcon = "iconOne";
 /** middle status icon */
-#define KNmHsWidgetMailRowMiddleIcon   "iconTwo"
+const QString KNmHsWidgetMailRowMiddleIcon = "iconTwo";
 /** right status icon */
-#define KNmHsWidgetMailRowRightIcon   "iconThree"
+const QString KNmHsWidgetMailRowRightIcon = "iconThree";
 /** separator icon */
-#define KNmHsWidgetMailSeparatorIcon   "iconSeparator"
+const QString KNmHsWidgetMailSeparatorIcon = "iconSeparator";
 
 
 #endif  // NMHSWIDGETCONSTS_H
--- a/emailuis/nmhswidget/inc/nmhswidgetemailengine.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidgetemailengine.h	Tue Jul 06 14:04:34 2010 +0300
@@ -26,6 +26,7 @@
 class NmDataPluginInterface;
 class QPluginLoader;
 class QTimer;
+class XQAiwRequest;
 
 //Three seconds
 const int NmHsWidgetEmailEngineUpdateTimerValue = 3000;
@@ -48,6 +49,7 @@
     int getEnvelopes(QList<NmMessageEnvelope> &list, int maxEnvelopeAmount);
     int unreadCount();
     QString accountName();
+    void deleteAiwRequest();
         
 public slots:
     void handleMessageEvent( 
@@ -65,6 +67,9 @@
     void launchMailAppMailViewer(const NmId &messageId);
     void handleUpdateTimeout();
     
+    void aiwRequestOk(const QVariant& result);
+    void aiwRequestError(int errorCode, const QString& errorMessage);
+    
 signals:
     void mailDataChanged();    
     void accountNameChanged(const QString& accountName);
@@ -90,6 +95,7 @@
     bool mMessageEventReceivedWhenSuspended;
     bool mSuspended; 
     QTimer* mUpdateTimer;
+    XQAiwRequest* mAiwRequest;
     };
 
 #endif /* NMHSWIDGETEMAILENGINE_H_ */
--- a/emailuis/nmhswidget/inc/nmhswidgetemailrow.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidgetemailrow.h	Tue Jul 06 14:04:34 2010 +0300
@@ -26,6 +26,7 @@
 
 //FORWARD DECLARATIONS:
 class HbLabel;
+class HbFrameItem;
 
 class NmHsWidgetEmailRow : public HbWidget
 {
@@ -35,9 +36,7 @@
     NmHsWidgetEmailRow(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
     ~NmHsWidgetEmailRow();
     NmId messageId();
-    bool loadDocML();
-    void setFontsSize( bool read );
-    void setFontsColor( bool pressed );
+    bool setupUI();
 
 public slots:
     void updateMailData( const NmMessageEnvelope& envelope );
@@ -49,6 +48,11 @@
 private:
     void setIconsToWidget( const NmMessageEnvelope& envelope );
     void hideIcons();
+    bool loadDocML();
+    bool setupGraphics();
+    void setFontsSize( bool read );
+    void setHighlighedFontsColor( bool pressed );
+    void showHighlight( bool pressed );
     
 protected:
     void mousePressEvent(QGraphicsSceneMouseEvent *event);
@@ -65,6 +69,7 @@
     QDateTime mMessageSentTime;
     QList <HbLabel*> mStatusIcons;  
     NmMessageEnvelope mEnvelope;
+    HbFrameItem* mBackgroundLayoutItem;
     
 };
 
--- a/emailuis/nmhswidget/inc/nmhswidgettitlerow.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidgettitlerow.h	Tue Jul 06 14:04:34 2010 +0300
@@ -23,6 +23,8 @@
 //FORWARD DECLARATIONS:
 class HbLabel;
 class HbPushButton;
+class HbFrameItem;
+class HbDocumentLoader;
 
 class NmHsWidgetTitleRow : public HbWidget
 {
@@ -31,15 +33,17 @@
 public:
     NmHsWidgetTitleRow(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
     ~NmHsWidgetTitleRow();
-    bool loadDocML();
-    
+    QPainterPath shape() const;
+    bool setupUI(HbDocumentLoader &loader); 
     void setAccountIcon(const QString& accountIconName );
     void setExpandCollapseIcon(const bool& expand);
-    void setFontsColor( bool pressed );
     
 private:
-
+    bool loadDocML(HbDocumentLoader &loader);
+    bool setupGraphics();
     void updateData();
+    void setHighlighedFontsColor( bool pressed );
+    void showHighlight( bool pressed );
     
 public slots: 
     void updateAccountName(const QString& accountName );
@@ -61,6 +65,7 @@
     HbPushButton *mCollapseExpIconLabel;
     QString mAccountName;
     int mUnreadCount;
+    HbFrameItem* mBackgroundLayoutItem;
 };
 
 #endif // NMHSWIDGETTITLEROW_H_
--- a/emailuis/nmhswidget/nmhswidget.qrc	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/nmhswidget.qrc	Tue Jul 06 14:04:34 2010 +0300
@@ -1,6 +1,6 @@
 <RCC>
     <qresource prefix="/docml">
-        <file alias="nmhswidgettitle.docml">conf/nmhswidgettitle.docml</file>
         <file alias="nmhswidgetmail.docml">conf/nmhswidgetmail.docml</file>
+        <file alias="nmhswidget.docml">conf/nmhswidget.docml</file>
     </qresource>
 </RCC>
--- a/emailuis/nmhswidget/src/nmhswidget.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidget.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -17,9 +17,11 @@
 #include <QtGui>
 #include <QGraphicsLinearLayout>
 #include <hbcolorscheme.h>
+#include <hbdocumentloader.h>
 #include <QTranslator>
 #include <hbframedrawer.h>
 #include <hbframeitem.h>
+#include <hblabel.h>
 #include "nmcommon.h"
 #include "nmhswidget.h"
 #include "nmhswidgetemailengine.h"
@@ -33,22 +35,24 @@
 NmHsWidget::NmHsWidget(QGraphicsItem *parent, Qt::WindowFlags flags)
     : HbWidget(parent, flags), 
       mEngine(0),
-      mRowLayout(0),
       mTitleRow(0),
       mAccountId(0),
       mAccountIconName(),
       mTranslator(0),
       mBackgroundFrameDrawer(0),
       mIsExpanded(false),
-      mStaticWidget(true),
-      mDateObserver(0)
+      mDateObserver(0),
+      mNoMailsLabel(0),
+      mWidgetContainer(0),
+      mContentContainer(0),
+      mContentLayout(0)
 {
     NM_FUNCTION;
 }
 
 /*!
-    Destructor
-*/
+ Destructor
+ */
 NmHsWidget::~NmHsWidget()
 {
     NM_FUNCTION;
@@ -67,134 +71,195 @@
 }
 
 /*!
-    \fn void NmHsWidget::onShow()
+ \fn QPainterPath NmHsWidget::shape()
 
-    called by home screen fw when widget gets visible
-*/
+ Called by home screen fw to check widget boundaries, needed to draw
+ outside widget boundingRect.
+ /return QPainterPath path describing actual boundaries of widget 
+  including child items
+ */
+QPainterPath NmHsWidget::shape() const
+{
+    NM_FUNCTION;
+    
+    QPainterPath path;
+    path.setFillRule(Qt::WindingFill);
+    
+    path.addRect(this->rect());
+    if (mTitleRow){
+        path.addPath(mTitleRow->shape());
+    }
+    return path.simplified();
+}
+
+/*!
+ \fn void NmHsWidget::onShow()
+
+ called by home screen fw when widget gets visible
+ */
 void NmHsWidget::onShow()
 {
     NM_FUNCTION;
-    if (mEngine)
-        {
+    if (mEngine) {
         mEngine->activate();
-        }
+    }
 }
 
 /*!
-    \fn void NmHsWidget::onHide()
+ \fn void NmHsWidget::onHide()
 
-    called by home screen fw when widget gets hidden
-*/
+ called by home screen fw when widget gets hidden
+ */
 void NmHsWidget::onHide()
 {
     NM_FUNCTION;
-    if (mEngine)
-        {
+    if (mEngine) {
         mEngine->suspend();
-        }
+    }
 }
 
 /*!
-    Initializes Localization.
-    /post mTranslator constructed & localization file loaded
-    returns false in failure, otherwise true
-*/
-bool NmHsWidget::setupLocalization()
-{
-    NM_FUNCTION;
-    
-    //Use correct localisation
-    bool ret(false); 
-    mTranslator = new QTranslator();
-    QString lang = QLocale::system().name();
-    ret = mTranslator->load(KNmHsWidgetLocFileName + lang, KNmHsWidgetLocLocation);
-    QCoreApplication::installTranslator(mTranslator);
-
-    return ret;
-}
-
-/*!
-    Initializes UI. Everything that is not done in docml files should be here.
-    return true if ok, in error false.
-*/
-void NmHsWidget::setupUi()
+ \fn bool NmHsWidget::loadDocML(HbDocumentLoader &loader)
+ 
+ loads layout data and child items from docml file. Must be called after constructor.
+ /return true if loading succeeded, otherwise false. False indicates that object is unusable
+ */
+bool NmHsWidget::loadDocML(HbDocumentLoader &loader)
 {
     NM_FUNCTION;
     
-    setContentsMargins( KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
-            KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
+    bool ok(false);
+    loader.load(KNmHsWidgetDocML, &ok);
     
-    //Setup layout
-    mRowLayout = new QGraphicsLinearLayout(Qt::Vertical);
+    if(ok) {
+        mWidgetContainer = static_cast<HbWidget*> (loader.findWidget(KNmHsWidgetContainer));        
+        mContentContainer = static_cast<HbWidget*> (loader.findWidget(KNmHsWidgetContentContainer));
+        mNoMailsLabel = static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetNoMailsLabel));
+        if (!mWidgetContainer || !mContentContainer || !mNoMailsLabel) {
+            //something failed in documentloader, no point to continue
+            NM_ERROR(1,"NmHsWidget::loadDocML fail @ containers or label");
+            ok = false;
+        }
+    }
+    return ok;
+}
 
-    mRowLayout->setContentsMargins(KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
-            KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
-    mRowLayout->setSpacing(KNmHsWidgetContentsMargin);
-    setLayout(mRowLayout);
-   
-   //background
-   mBackgroundFrameDrawer = new HbFrameDrawer( KNmHsWidgetBackgroundImage, HbFrameDrawer::NinePieces );
-   HbFrameItem* backgroundLayoutItem = new HbFrameItem( mBackgroundFrameDrawer );
-   //set to NULL to indicate that ownership transferred
-   mBackgroundFrameDrawer = NULL;
-   setBackgroundItem( backgroundLayoutItem );
+/*!
+ Initializes Localization.
+ /post mTranslator constructed & localization file loaded
+ */
+void NmHsWidget::setupLocalization()
+{
+    NM_FUNCTION;
+
+    //Use correct localisation
+    mTranslator = new QTranslator();
+    QString lang = QLocale::system().name();
+    mTranslator->load(KNmHsWidgetLocFileName + lang, KNmHsWidgetLocLocation);
+    QCoreApplication::installTranslator(mTranslator);
 }
 
 /*!
-    Initializes the widget.
+ Initializes UI. Everything that is not done in docml files should be here.
+ return true if ok, in error false.
+ */
+void NmHsWidget::setupUi()
+{
+    NM_FUNCTION;
+
+    //main level layout needed to control docml objects
+    QGraphicsLinearLayout *widgetLayout = new QGraphicsLinearLayout(Qt::Vertical);
+    widgetLayout->setContentsMargins(KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin,
+            KNmHsWidgetContentsMargin, KNmHsWidgetContentsMargin);
+    widgetLayout->setSpacing(KNmHsWidgetContentsMargin);
+    widgetLayout->addItem(mWidgetContainer);
+    this->setLayout(widgetLayout);
+
+    //fetch pointer to content container layout
+    //to be able to add/remove email rows and no mails label
+    mContentLayout = (QGraphicsLinearLayout*) mContentContainer->layout();
     
-    called by home screen fw when widget is added to home screen
-*/
+    //set noMailsLabel properties not supported by doc loader 
+    QColor newFontColor;
+    newFontColor = HbColorScheme::color("qtc_hs_list_item_content_normal");
+    mNoMailsLabel->setTextColor(newFontColor);
+    mNoMailsLabel->setVisible(true);   
+    
+    mContentLayout->removeItem(mNoMailsLabel);
+    
+    //widget background
+    mBackgroundFrameDrawer = new HbFrameDrawer(KNmHsWidgetBackgroundImage,
+        HbFrameDrawer::NinePieces);
+    HbFrameItem* backgroundLayoutItem = new HbFrameItem(mBackgroundFrameDrawer);
+    //set to NULL to indicate that ownership transferred
+    mBackgroundFrameDrawer = NULL;
+    setBackgroundItem(backgroundLayoutItem);   
+}
+
+
+/*!
+ Initializes the widget.
+ 
+ called by home screen fw when widget is added to home screen
+ */
 void NmHsWidget::onInitialize()
 {
     NM_FUNCTION;
-    
-    QT_TRY{       
+
+    QT_TRY {
+        
+	    // Use document loader to load the contents
+	    HbDocumentLoader loader;
+		
+	    //load containers and mNoMailsLabel
+        if (!loadDocML(loader)) {
+            NM_ERROR(1,"NmHsWidget::onInitialize Fail @ loader");
+            emit error(); //failure, no point to continue
+            return;
+        }
+
+        //construct title row
+        mTitleRow = new NmHsWidgetTitleRow(this);
+        if (!mTitleRow->setupUI(loader)) {
+            //title row creation failed
+            NM_ERROR(1,"NmHsWidget::onInitialize fail @ titlerow");
+            emit error(); //failure, no point to continue
+            return;            
+        }
+				
         setupUi();
-        //emit error if localization fails
-        if(!setupLocalization()){
+        setupLocalization();
+
+        //Engine construction is 2 phased. 
+        mEngine = new NmHsWidgetEmailEngine(mAccountId);
+        //Client must connect to exception signals before calling the initialize function
+        //because we don't want to miss any signals.
+        connect(mEngine, SIGNAL( exceptionOccured(const int&) ), this,
+            SLOT( onEngineException(const int&) ));
+        if (!mEngine->initialize()) {
+            //engine construction failed. Give up.
+            NM_ERROR(1,"NmHsWidget::onInitialize fail @ engine");
             emit error();
             return;
         }
-        
-        //Engine construction is 2 phased. 
-        mEngine = new NmHsWidgetEmailEngine( mAccountId );
-        //Client must connect to exception signals before calling the initialize function
-        //because we don't want to miss any signals.
-        connect(mEngine, SIGNAL( exceptionOccured(const int&) )
-                ,this, SLOT( onEngineException(const int&) ) );
-        if(!mEngine->initialize())
-            {
-            //engine construction failed. Give up.
-            emit error();
-            return;
-            }
+
+
+        mTitleRow->updateAccountName(mEngine->accountName());
 
-        //construct and load docml for title row
-        mTitleRow = new NmHsWidgetTitleRow(); 
-        if( !mTitleRow->loadDocML()){
-            //if docml loading fails no point to proceed
-            //but memoryleak must be prevented
-            delete mTitleRow;
-            mTitleRow = NULL;
-            emit error();
-            return;
-        }
-        mRowLayout->addItem(mTitleRow);
-        mTitleRow->updateAccountName(mEngine->accountName());
-    
-	    //create observer for date/time change events
-	    mDateObserver = new NmHsWidgetDateTimeObserver();
-    
+        //create observer for date/time change events
+        mDateObserver = new NmHsWidgetDateTimeObserver();
+
+        //Crete MailRows and associated connections
+        createMailRowsList();
+
         updateMailData();
         mTitleRow->updateUnreadCount(mEngine->unreadCount());
         mTitleRow->setAccountIcon(mAccountIconName);
         mTitleRow->setExpandCollapseIcon(mIsExpanded);
-        
+
         //Get signals about changes in mail data
-        connect(mEngine, SIGNAL( mailDataChanged() )
-                ,this, SLOT( updateMailData() ) );
-        
+        connect(mEngine, SIGNAL( mailDataChanged() ), this, SLOT( updateMailData() ));
+
         //Get Signals about changes in unread count
         connect(mEngine, SIGNAL( unreadCountChanged(const int&) )
                 ,mTitleRow, SLOT( updateUnreadCount(const int&) ) );
@@ -208,77 +273,60 @@
 	            ,mEngine, SLOT( launchMailAppInboxView() ) );
 	    connect(mTitleRow, SIGNAL( expandCollapseButtonPressed() )
 	            ,this, SLOT( handleExpandCollapseEvent() ) );
-
-	    //resize here so homescreen will place widget correctly on screen
-	    setPreferredSize( mRowLayout->preferredSize() );
-	    if (parentWidget()) {
-	        //to place widget properly after adding to homescreen
-	        parentWidget()->resize(preferredSize()); 
-		}
+	    
+	    setMinimumSize(mTitleRow->minimumSize());
     }
-    QT_CATCH(...){
+    QT_CATCH(...) {
+        NM_ERROR(1,"NmHsWidget::onInitialize fail @ catch");
         emit error();
     }
-
 }
 
-/*!
-    Uninitializes the widget.
-    
-    called by home screen fw when widget is removed from home screen
-*/
-void NmHsWidget::onUninitialize()
-{
-    NM_FUNCTION;
-}
 
 /*!
-    updateMailData slot
-*/
+ updateMailData slot
+ */
 void NmHsWidget::updateMailData()
 {
     NM_FUNCTION;
-    
+
     QList<NmMessageEnvelope> envelopes;
     int count = 0;
     if (mIsExpanded) {
         count = mEngine->getEnvelopes(envelopes, KMaxNumberOfMailsShown);
-        }
+    }
 
-    updateMailRowsList(count);
-    
-    for(int i=0; i<envelopes.count(); i++)
-        {
-        mMailRows[i]->updateMailData( envelopes[i] );
-        }
+    updateLayout(count);
+    //count is safe for envelopes and mMailRows
+    for (int i = 0; i < count; i++) {
+        mMailRows.at(i)->updateMailData(envelopes.at(i));
+    }
 }
 
 /*!
-    Sets monitored account id from given string
-    Needed for home screen framework which supports only QString type properties
-*/
+ Sets monitored account id from given string
+ Needed for home screen framework which supports only QString type properties
+ */
 void NmHsWidget::setAccountId(const QString &text)
 {
     NM_FUNCTION;
-    
+
     bool ok;
     quint64 id = text.toULongLong(&ok);
-    if (!ok)
-        {
-        NM_ERROR(1,"NmHsWidget::setAccountId: invalid account ID data, signal finished()!!!"); 
+    if (!ok) {
+        NM_ERROR(1, "NmHsWidget::setAccountId: invalid account ID data, signal finished()!!!");
         //No valid account id so give up
         emit finished();
-        }
-    else
-        {
-        mAccountId.setId(id);
-        }
+        return;
+    }
+
+    mAccountId.setId(id);
 }
 
 /*!
-    Returns monitored account id as a string
-    Needed for home screen framework which supports only QString type properties
-*/
+ Returns monitored account id as a string
+ Needed for home screen framework which supports only QString type properties
+ */
 QString NmHsWidget::accountId() const
 {
     NM_FUNCTION;
@@ -286,8 +334,8 @@
 }
 
 /*!
-    Sets monitored account icon name from given string
-*/
+ Sets monitored account icon name from given string
+ */
 void NmHsWidget::setAccountIconName(const QString &text)
 {
     NM_FUNCTION;
@@ -295,8 +343,8 @@
 }
 
 /*!
-    Returns monitored account icon name
-*/
+ Returns monitored account icon name
+ */
 QString NmHsWidget::accountIconName() const
 {
     NM_FUNCTION;
@@ -304,8 +352,8 @@
 }
 
 /*!
-    Slot to handle expand/collapse trigger event
-*/
+ Slot to handle expand/collapse trigger event
+ */
 void NmHsWidget::handleExpandCollapseEvent()
 {
     NM_FUNCTION;
@@ -313,153 +361,219 @@
 }
 
 /*!
-    Sets widget expand/collapse state
-    /post widget expansion state is changed
-*/
+ Sets widget expand/collapse state
+ /post widget expansion state is changed
+ */
 void NmHsWidget::toggleExpansionState()
 {
     NM_FUNCTION;
 
     mIsExpanded = !mIsExpanded;
-    
+
     //save new state to home screen
     QStringList propertiesList;
     propertiesList.append("widgetState");
     emit setPreferences(propertiesList);
-    
+
     //handle state change drawing
     updateMailData();
-    
+
     mTitleRow->setExpandCollapseIcon(mIsExpanded);
 }
 
 /*!
-    Sets expand/collapse state from given string (needed by homescreen)
-*/
+ Sets expand/collapse state from given string (needed by homescreen)
+ */
 void NmHsWidget::setWidgetStateProperty(QString value)
 {
     NM_FUNCTION;
-    if (value == KNmHsWidgetStateCollapsed)
-        {
+    if (value == KNmHsWidgetStateCollapsed) {
         mIsExpanded = false;
+    }
+    else {
+        mIsExpanded = true;
+    }
+}
+
+/*!
+ Returns widget expand/collapse state as string (needed by homescreen) 
+ */
+QString NmHsWidget::widgetStateProperty()
+{
+    NM_FUNCTION;
+    if (mIsExpanded) {
+        return KNmHsWidgetStateExpanded;
+    }
+    else {
+        return KNmHsWidgetStateCollapsed;
+    }
+}
+
+/*!
+ Updates mMailRows list to include KMaxNumberOfMailsShown mail row widgets
+ /post mMailRows contains KMaxNumberOfMailsShown mailRows 
+ */
+void NmHsWidget::createMailRowsList()
+{
+    NM_FUNCTION;
+
+    //make sure that there are as many email rows as needed
+    while (mMailRows.count() < KMaxNumberOfMailsShown) {
+        NmHsWidgetEmailRow *row = new NmHsWidgetEmailRow(this);
+        if (!row->setupUI()) {
+            NM_ERROR(1, "NmHsWidget::createMailRowsList row->setUpUI() fails");
+            //if setupUI fails no point to proceed
+            emit error();
+            return;
         }
-    else
-        {
-        mIsExpanded = true;
-        }
+        connect(row, SIGNAL(mailViewerLaunchTriggered(const NmId&)), mEngine,
+            SLOT(launchMailAppMailViewer(const NmId&)));
+        connect(mDateObserver, SIGNAL(dateTimeChanged()), row, SLOT(updateDateTime()));
+        mMailRows.append(row);
+    }
+
 }
 
 /*!
-    Returns widget expand/collapse state as string (needed by homescreen) 
-*/
-QString NmHsWidget::widgetStateProperty()
+ Updates the Layout to contain the right items
+ /param mailCount defines how many emails is to be shown
+ /post If widget is collapsed, the layout contains only titleRow widget.
+ If widget is expanded and mailCount is 0 layout will contain
+ titlerow & noMailsLabel. 
+ If widget is expanded and mailCount is greter
+ than zero, layout will contain titlerow and KMaxNumberOfMailsShown times
+ emailrow(s)
+ */
+void NmHsWidget::updateLayout(const int mailCount)
 {
     NM_FUNCTION;
-    if (mIsExpanded)
-        {
-        return KNmHsWidgetStateExpanded;
+
+    if (mIsExpanded) {
+        //set container height to content height 
+        qreal contentHeight = KMaxNumberOfMailsShown
+                * mMailRows.first()->maximumHeight();
+        mContentContainer->setMaximumHeight(contentHeight);
+        mContentContainer->setVisible(true);
+        if (mailCount == 0) {
+            addNoMailsLabelToLayout();
+            removeEmailRowsFromLayout();
+        }
+        else {
+            removeNoMailsLabelFromLayout();
+            addEmailRowsToLayout();
         }
-    else
+    }
+    else {
+        removeNoMailsLabelFromLayout();
+        removeEmailRowsFromLayout();
+        mContentContainer->setVisible(false);
+        mContentContainer->setMaximumHeight(0);        
+    }
+
+    //resize the widget to new layout size
+    qreal totalHeight = mTitleRow->preferredHeight() + mContentContainer->maximumHeight();
+    //set maximum size, otherwise widget will stay huge also when collapsed
+    this->setMaximumHeight(totalHeight);
+    //resize here or widget cannot draw mail rows when expanding
+    this->resize(mTitleRow->preferredWidth(), totalHeight);
+
+    updateMailRowsVisibility(mailCount);
+}
+
+/*!
+ Updates mNoMailsLabel visibility based on widget state
+ /param mailCount defines how many mail rows is needed
+ /post if mail count is 0 and mIsExpanded equals true, then
+ the mNoMailLabel is added to the mContentLayout. 
+ */
+void NmHsWidget::addNoMailsLabelToLayout()
+{
+    NM_FUNCTION;
+
+    if (mNoMailsLabel->isVisible() || mMailRows.isEmpty()) {
+        return;
+    }
+    //Add mNoMailsLabel to layout if not yet there and show it
+    mContentLayout->addItem(mNoMailsLabel);
+    //resize the widget to new layout size
+    mNoMailsLabel->show();
+}
+
+/*!
+ removeNoMailsLabelFromLayout removes mNoMailsLabel from the layout
+ /post mNoMailsLabel is not in mContentLayout
+ */
+void NmHsWidget::removeNoMailsLabelFromLayout()
+{
+    NM_FUNCTION;
+    //remove mNoMailsLabel from Layout and hide it
+    mContentLayout->removeItem(mNoMailsLabel);
+    mNoMailsLabel->hide();
+}
+
+/*!
+ addEmailRowsToLayout adds every emailrow to the layout
+ /post all elements in mMailRows are added to mContentLayout
+ */
+void NmHsWidget::addEmailRowsToLayout()
+{
+    NM_FUNCTION;
+    foreach(NmHsWidgetEmailRow *row, mMailRows)
         {
-        return KNmHsWidgetStateCollapsed;
+            mContentLayout->addItem(row);
         }
 }
 
 /*!
-    Updates mMailRows list to include correct amount of mail row widgets
-    /param mailCount defines how many mail rows is needed
-    /post mMailRows list includes NmHsWidgetEmailRow for each mail item 
-*/
-void NmHsWidget::updateMailRowsList(const int mailCount)
+ removeEmailRowsFromLayout removes every emailrow from the layout
+ /post none of the elements in mMailRows are in mContentLayout
+ */
+void NmHsWidget::removeEmailRowsFromLayout()
 {
     NM_FUNCTION;
-    
-    int neededRowsCount = mailCount;
-    //force size when static and expanded
-    if (mStaticWidget && mIsExpanded)
-        {
-        neededRowsCount = KMaxNumberOfMailsShown;
-        }
-    
-    while (mMailRows.count() != neededRowsCount)
+    foreach(NmHsWidgetEmailRow *row, mMailRows)
         {
-        //more mails to show than rows
-        if (mMailRows.count() < neededRowsCount)
-            {
-            NmHsWidgetEmailRow *row = new NmHsWidgetEmailRow();
-            if( !row->loadDocML()){
-                NM_ERROR(1,"NmHsWidget::updateMailRowsList row->loadDocML() fails");
-                //if docml loading fails no point to proceed
-                //but memoryleak must be prevented
-                delete row;
-                row = NULL;
-                emit error();
-                return;
-            }
-            connect(row, SIGNAL(mailViewerLaunchTriggered(const NmId&))
-                    ,mEngine, SLOT(launchMailAppMailViewer(const NmId&)));
-            connect( mDateObserver, SIGNAL(dateTimeChanged())
-                    ,row, SLOT(updateDateTime()) );
-            mMailRows.append(row);
-            mRowLayout->addItem(row);            
-            }
-        //too many rows
-        else if (mMailRows.count() > neededRowsCount)
-            {
-            mRowLayout->removeItem(mMailRows.last());
-            delete mMailRows.takeLast();
-            }
-        }
-    __ASSERT_ALWAYS( mMailRows.count() == neededRowsCount, User::Panic(_L("Invalid"), 500) );
-    
-    //resize the widget to new layout size
-    setPreferredSize( mRowLayout->preferredSize() );
-    
-    if (mStaticWidget)
-        {
-        this->updateMailRowsVisibility(mailCount);
+            mContentLayout->removeItem(row);
         }
 }
 
 /*!
-    Updates mail row visibilities in static widget
-    /param visibleCount defines how many items do have mail data
-    /post all row items having mail data are visible, other rows are hidden
-*/
+ Updates mail row visibilities in static widget
+ /param visibleCount defines how many items do have mail data
+ /post all row items having mail data are visible, other rows are hidden
+ */
 void NmHsWidget::updateMailRowsVisibility(const int visibleCount)
 {
     NM_FUNCTION;
-  
+
     // set visible as many rows as requested by visibleCount param
     bool isVisible;
-    for (int i=0; i < mMailRows.count(); i++) 
-        {
+
+    for (int i = 0; i < mMailRows.count(); i++) {
         isVisible = false;
-        if ((mIsExpanded) && (i < visibleCount)) 
-            {
+        if ((mIsExpanded) && (i < visibleCount)) {
             isVisible = true;
-            }
+        }
         mMailRows.at(i)->setVisible(isVisible);
-        }
+    }
 }
 
 /*!
-    onEngineException (NmHsWidgetEmailEngineExceptionCode exc)
-    signals widget to be finalized
-    /param exc exception type
-*/
+ onEngineException (NmHsWidgetEmailEngineExceptionCode exc)
+ signals widget to be finalized
+ /param exc exception type
+ */
 void NmHsWidget::onEngineException(const int& exc)
-    {
+{
     NM_FUNCTION;
-    switch (exc)
-        {
+    switch (exc) {
         case (NmEngineExcAccountDeleted):
-             emit finished(); //succesful ending
-             break;
+            emit finished(); //succesful ending
+            break;
         case (NmEngineExcFailure):
-             emit error(); //failure
-             break;
-        default: 
-            break; 
-        }
+            emit error(); //failure
+            break;
+        default:
+            break;
     }
+}
--- a/emailuis/nmhswidget/src/nmhswidgetdatetimeobserver_p.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidgetdatetimeobserver_p.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -31,8 +31,12 @@
 {
     NM_FUNCTION;
     TCallBack callback( LocaleChangeCallback, this );
-    //TODO: Handle leave properly
-    TRAP_IGNORE(iLocaleNotifier = CEnvironmentChangeNotifier::NewL( CActive::EPriorityStandard, callback ));
+    
+    //CTC skipped as last else of macro QT_TRAP_THROWING cannot be tested (panics on purpose)
+#pragma CTC SKIP
+    QT_TRAP_THROWING(iLocaleNotifier = CEnvironmentChangeNotifier::NewL( CActive::EPriorityStandard, callback ));
+#pragma CTC ENDSKIP
+    
     iLocaleNotifier->Start();
 }
 
--- a/emailuis/nmhswidget/src/nmhswidgetemailengine.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidgetemailengine.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -43,7 +43,8 @@
     mAccountEventReceivedWhenSuspended(false),
     mMessageEventReceivedWhenSuspended(false), 
     mSuspended(false),
-    mUpdateTimer(0)
+    mUpdateTimer(0),
+    mAiwRequest(0)
 {
     NM_FUNCTION;
 }
@@ -180,7 +181,7 @@
     list.clear(); //Reset the parameter list to avoid side effects
     int i = 0;
     for (; i < mEnvelopeList.count() && i < maxEnvelopeAmount; i++) {
-        NmMessageEnvelope env(*mEnvelopeList[i]);
+        NmMessageEnvelope env(*mEnvelopeList.at(i));
         list.append(env);
     }
     return i;
@@ -408,17 +409,31 @@
 {
     NM_FUNCTION;
     
-    XQApplicationManager appManager;
-    XQAiwRequest* request = appManager.create(
-            XQI_EMAIL_INBOX_VIEW, XQOP_EMAIL_INBOX_VIEW,
-            false);
-    
-    if (request) {
-        QList<QVariant> list;
-        list.append(QVariant(mMailboxId.id()));
-    
-        request->setArguments(list);
-        request->send();
+    QT_TRY{ 
+        if (!mAiwRequest) {
+            XQApplicationManager appManager;
+            mAiwRequest = appManager.create(
+                    XQI_EMAIL_INBOX_VIEW, XQOP_EMAIL_INBOX_VIEW,
+                    false);
+            
+            if (mAiwRequest) {
+                connect(mAiwRequest, SIGNAL( requestError(int, const QString&) ), 
+                        this, SLOT( aiwRequestError(int, const QString&) ));
+                connect(mAiwRequest, SIGNAL( requestOk(const QVariant&) ), 
+                        this, SLOT( aiwRequestOk(const QVariant&) ));
+                QList<QVariant> list;
+                list.append(QVariant(mMailboxId.id()));
+            
+                mAiwRequest->setSynchronous(false);
+                mAiwRequest->setArguments(list);
+                mAiwRequest->send();
+            }
+        }
+    }
+    QT_CATCH(...){
+        // no actions taken.
+        // try-catch mechanism added to avoid crashing widget, in case XQAiwRequest
+        // creation raise exception.
     }
 }
 
@@ -431,18 +446,69 @@
 {
     NM_FUNCTION;
 
-    XQApplicationManager appManager;
-    XQAiwRequest* request = appManager.create(
-            XQI_EMAIL_MESSAGE_VIEW, XQOP_EMAIL_MESSAGE_VIEW,
-            false);
-    
-    if (request) {
-        QList<QVariant> list;
-        list.append(QVariant(mMailboxId.id()));
-        list.append(QVariant(mFolderId.id()));
-        list.append(QVariant(messageId.id()));
-    
-        request->setArguments(list);
-        request->send();
+    QT_TRY{
+        if (!mAiwRequest) {
+            XQApplicationManager appManager;
+            mAiwRequest = appManager.create(
+                    XQI_EMAIL_MESSAGE_VIEW, XQOP_EMAIL_MESSAGE_VIEW,
+                    false);
+            
+            if (mAiwRequest) {
+                connect(mAiwRequest, SIGNAL( requestError(int, const QString&) ), 
+                        this, SLOT( aiwRequestError(int, const QString&) ));
+                connect(mAiwRequest, SIGNAL( requestOk(const QVariant&) ), 
+                        this, SLOT( aiwRequestOk(const QVariant&) ));
+                QList<QVariant> list;
+                list.append(QVariant(mMailboxId.id()));
+                list.append(QVariant(mFolderId.id()));
+                list.append(QVariant(messageId.id()));
+            
+                mAiwRequest->setSynchronous(false);
+                mAiwRequest->setArguments(list);
+                mAiwRequest->send();
+            }
+        }
+    }
+    QT_CATCH(...){
+        // no actions taken.
+        // try-catch mechanism added to avoid crashing widget, in case XQAiwRequest
+        // creation raise exception.
     }
 }
+
+/*!
+ aiwRequestOk slot.
+ */
+void NmHsWidgetEmailEngine::aiwRequestOk(const QVariant& result)
+{
+    NM_FUNCTION;
+
+    Q_UNUSED(result);
+    
+    deleteAiwRequest();
+}
+
+/*!
+ aiwRequestError slot.
+ */
+void NmHsWidgetEmailEngine::aiwRequestError(int errorCode, const QString& errorMessage)
+{
+    NM_FUNCTION;
+
+    Q_UNUSED(errorCode);
+    Q_UNUSED(errorMessage);
+    
+    deleteAiwRequest();
+}
+
+/*!
+ deleteAiwRequest function.
+ */
+void NmHsWidgetEmailEngine::deleteAiwRequest()
+{
+    NM_FUNCTION;
+
+    delete mAiwRequest;
+    mAiwRequest = NULL;    
+}
+
--- a/emailuis/nmhswidget/src/nmhswidgetemailrow.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidgetemailrow.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -19,10 +19,10 @@
 #include <hbdocumentloader.h>
 #include <hblabel.h>
 #include <hbextendedlocale.h>
-#include <HbFrameDrawer>
-#include <HbFrameItem>
-#include <HbColorScheme>
-#include <HbEvent>
+#include <hbframedrawer.h>
+#include <hbframeitem.h>
+#include <hbcolorscheme.h>
+#include <hbevent.h>
 #include "nmicons.h"
 #include "nmcommon.h"
 #include "nmhswidgetemailrow.h"
@@ -36,7 +36,8 @@
     mTimeLabel(0), 
     mNewMailIcon(0),
     mSeparatorIcon(0), 
-    mMessageId(0)
+    mMessageId(0),
+    mBackgroundLayoutItem(0)
 {
     NM_FUNCTION;
 }
@@ -59,17 +60,31 @@
 
 }
 
+/*
+ Setup email row ui
+  Must be called after constructor.
+   /return true if loading succeeded, otherwise false. False indicates that object is unusable.
+ */
+bool NmHsWidgetEmailRow::setupUI()
+    {
+    NM_FUNCTION;
+    
+    if(!loadDocML() || !setupGraphics()){
+        return false;
+    }
+    return true;
+    }
+
+
+
 /*!
- Loads layout data and child items from docml file
- Must be called after constructor.
+ Loads layout data and child items from docml file 
   /return true if loading succeeded, otherwise false. False indicates that object is unusable.
  */
 bool NmHsWidgetEmailRow::loadDocML()
 {
     NM_FUNCTION;
-    
-    HbFrameDrawer* backgroundFrameDrawer = 0;
-    HbFrameItem* backgroundLayoutItem = 0;
+
     QT_TRY{   
         // Use document loader to load the contents
         HbDocumentLoader loader;
@@ -120,28 +135,57 @@
         }
         //Verify all mStatusIcons
         for (int i = 0; i < mStatusIcons.length(); i++) {
-            if (!mStatusIcons[i]) {
+            if (!mStatusIcons.at(i)) {
                 return false;
             }
         }
+        
+        return true;
+    }
+    QT_CATCH(...){
+        return false;
+    }
+}
+
+/*
+ Setup graphics that cannot be loaded from docml.
+  /return true if loading succeeded, otherwise false. False indicates that object is unusable.
+ */
+bool NmHsWidgetEmailRow::setupGraphics()
+    {
+    NM_FUNCTION;
     
+    HbFrameDrawer* newMailIconFrameDrawer = 0;
+    HbFrameItem* newMailIconFrameItem = 0;
+    HbFrameDrawer* backgroundFrameDrawer = 0;
+    QT_TRY{ 
         //separator icon
         HbIcon separatorIcon("qtg_graf_divider_h_thin");
         mSeparatorIcon->setIcon(separatorIcon);
         
         //new email icon
-        backgroundFrameDrawer = new HbFrameDrawer("qtg_fr_list_new_item",
+        newMailIconFrameDrawer = new HbFrameDrawer("qtg_fr_list_new_item",
             HbFrameDrawer::ThreePiecesVertical);
-        backgroundLayoutItem = new HbFrameItem(backgroundFrameDrawer);
-        mNewMailIcon->setBackgroundItem(backgroundLayoutItem);
-    
+        newMailIconFrameItem = new HbFrameItem(newMailIconFrameDrawer);
+        mNewMailIcon->setBackgroundItem(newMailIconFrameItem);
+        
         //hide all the icons first to avoid blinking
         hideIcons();
     
+        //pressed background
+        backgroundFrameDrawer = new HbFrameDrawer("qtg_fr_hsitems_pressed", HbFrameDrawer::NinePieces);
+        mBackgroundLayoutItem = new HbFrameItem( backgroundFrameDrawer );
+        setBackgroundItem( mBackgroundLayoutItem );
+        mBackgroundLayoutItem->hide();
+            
         return true;
     }
     QT_CATCH(...){
-        if(!backgroundLayoutItem && backgroundFrameDrawer){
+        if(!newMailIconFrameItem && newMailIconFrameDrawer){
+            delete newMailIconFrameDrawer;
+            newMailIconFrameDrawer = NULL;
+        }
+        if(!mBackgroundLayoutItem && backgroundFrameDrawer){
             delete backgroundFrameDrawer;
             backgroundFrameDrawer = NULL;
         }
@@ -183,7 +227,7 @@
     
     //set fonts color and size
     setFontsSize(mEnvelope.isRead());
-    setFontsColor(false);
+    setHighlighedFontsColor(false);
     }
 
 /*!
@@ -216,7 +260,7 @@
 {
     NM_FUNCTION;
     for (int i = 0; i < mStatusIcons.count(); i++) {
-        mStatusIcons[i]->hide();
+        mStatusIcons.at(i)->hide();
     }
     mNewMailIcon->hide();
 }
@@ -262,8 +306,8 @@
 
     // Here we show icons added to the iconList in the order they have been added.
     for (int count = 0; count < iconList.count(); count++) {
-        mStatusIcons[count]->setIcon(iconList[count]);
-        mStatusIcons[count]->show();
+        mStatusIcons.at(count)->setIcon(iconList.at(count));
+        mStatusIcons.at(count)->show();
     }
 }
 
@@ -298,10 +342,11 @@
 
 /*!
     sets fonts color.
+    /param bool pressed indicates if row is pressed down or not
 */
-void NmHsWidgetEmailRow::setFontsColor( bool pressed )
+void NmHsWidgetEmailRow::setHighlighedFontsColor( bool pressed )
     {
-    NM_FUNCTION;;
+    NM_FUNCTION;
     QColor newFontColor;
     
     if(pressed){
@@ -319,6 +364,21 @@
     mTimeLabel->setTextColor(newFontColor);
     }
 
+/*!
+    change background highlight
+    /param bool show if true then shown, false hide
+*/
+void NmHsWidgetEmailRow::showHighlight( bool show )
+    {
+    NM_FUNCTION;
+    
+    if(show){
+        mBackgroundLayoutItem->show();
+    }
+    else{
+        mBackgroundLayoutItem->hide();
+    }
+    }
 
 /*!
  mousePressEvent(QGraphicsSceneMouseEvent *event)
@@ -327,7 +387,8 @@
 {
     NM_FUNCTION;
     Q_UNUSED(event); 
-    setFontsColor(true);
+    setHighlighedFontsColor(true);
+    showHighlight(true);
 }
 
 /*!
@@ -337,7 +398,8 @@
 {
     NM_FUNCTION;
     Q_UNUSED(event);
-    setFontsColor(false);
+    setHighlighedFontsColor(false);
+    showHighlight(false);
     emit mailViewerLaunchTriggered(mMessageId);
 }
 
@@ -349,7 +411,7 @@
     NM_FUNCTION;
     QEvent::Type eventType = event->type();
     if( eventType == HbEvent::ThemeChanged ){
-        setFontsColor(false);
+        setHighlighedFontsColor(false);
         return true;
     }
     return HbWidget::event(event);
--- a/emailuis/nmhswidget/src/nmhswidgettitlerow.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidgettitlerow.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -15,13 +15,15 @@
  *
  */
 
+#include <qgraphicslinearlayout.h>
 #include <QtGui>
-#include <QGraphicsLinearLayout>
 #include <hbdocumentloader.h>
 #include <hblabel.h>
-#include <HbPushButton>
-#include <HbColorScheme>
-#include <HbEvent>
+#include <hbpushbutton.h>
+#include <hbcolorscheme.h>
+#include <hbevent.h>
+#include <hbframedrawer.h>
+#include <hbframeitem.h>
 #include "nmicons.h"
 #include "nmhswidgettitlerow.h"
 #include "nmhswidgetconsts.h"
@@ -34,7 +36,8 @@
     mUnreadCountLabel(0),
     mCollapseExpIconLabel(0), 
     mAccountName(),
-    mUnreadCount(0)
+    mUnreadCount(0),
+    mBackgroundLayoutItem(0)
 {
     NM_FUNCTION;
 }
@@ -44,26 +47,54 @@
  */
 NmHsWidgetTitleRow::~NmHsWidgetTitleRow()
 {
+    NM_FUNCTION; 
+}
+
+/*!
+ \fn QPainterPath NmHsWidgetTitleRow::shape()
+
+ Called by home screen fw to check widget boundaries, needed to draw
+ outside widget boundingRect.
+ /return QPainterPath path describing actual boundaries of widget 
+  including child items
+ */
+QPainterPath NmHsWidgetTitleRow::shape() const
+{
     NM_FUNCTION;
+    
+    QPainterPath path;
+    path.setFillRule(Qt::WindingFill);
+    
+    path.addRect(this->geometry());
+    if (mMailboxIcon){
+        path.addRect(mMailboxIcon->geometry());
+    }    
+    return path.simplified();
 }
 
+/*
+ Setup email row ui
+  Must be called after constructor.
+   /return true if loading succeeded, otherwise false. False indicates that object is unusable.
+ */
+bool NmHsWidgetTitleRow::setupUI(HbDocumentLoader &loader)
+    {
+    NM_FUNCTION;
+
+    if(!loadDocML(loader) || !setupGraphics()){
+        return false;
+    }
+    return true;
+    }
+
 /*!
  Loads layout data and child items from docml file. Must be called after constructor.
  /return true if loading succeeded, otherwise false. False indicates that object is unusable
  */
-bool NmHsWidgetTitleRow::loadDocML()
+bool NmHsWidgetTitleRow::loadDocML(HbDocumentLoader &loader)
 {
     NM_FUNCTION;
     QT_TRY{
-        // Use document loader to load the contents
-        HbDocumentLoader loader;
-        bool ok(false);
-        loader.load(KNmHsWidgetTitleRowDocML, &ok);
-        if (!ok) {
-            NM_ERROR(1,"NmHsWidgetTitleRow::loadDocML Fail @ loader");
-            return false; //failure
-        }
-    
         //Create layout
         QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical);
     
@@ -92,13 +123,10 @@
             NM_ERROR(1,"NmHsWidgetTitleRow::loadDocML Fail @ icons & labels");
             return false;
         }
-    
-        //Expand collapse button
+		
+		//Expand collapse button
         connect(mCollapseExpIconLabel, SIGNAL(clicked()), this, SIGNAL(expandCollapseButtonPressed()));
-        
-        //set fonts color
-        setFontsColor(false);
-
+		
         return true;
     }
     QT_CATCH(...){
@@ -106,6 +134,39 @@
     }
 }
 
+/*
+ Setup graphics that cannot be loaded from docml.
+  /return true if loading succeeded, otherwise false. False indicates that object is unusable.
+ */
+bool NmHsWidgetTitleRow::setupGraphics()
+{
+    NM_FUNCTION;
+    
+    HbFrameDrawer* backgroundFrameDrawer = 0;
+    QT_TRY{
+        //pressed background
+        backgroundFrameDrawer = new HbFrameDrawer("qtg_fr_hsitems_pressed", HbFrameDrawer::NinePieces);
+        mBackgroundLayoutItem = new HbFrameItem( backgroundFrameDrawer );
+        setBackgroundItem( mBackgroundLayoutItem );
+		mBackgroundLayoutItem->hide();
+        
+        //set fonts color
+		setHighlighedFontsColor(false);
+
+        return true;
+    }
+    QT_CATCH(...){
+        if(!mBackgroundLayoutItem && backgroundFrameDrawer){
+            delete backgroundFrameDrawer;
+            backgroundFrameDrawer = NULL;
+        }
+
+        return false;
+    }
+    
+}
+
+
 /*!
  Slot for updating account name, calls updateData to update ui.
  */
@@ -161,21 +222,23 @@
     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)
-    if (mUnreadCount != -1) {
+    if (mUnreadCount >= 0) {
         QString unreadCount(hbTrId("txt_mail_widget_list_l1").arg(mUnreadCount));
         mUnreadCountLabel->setPlainText(unreadCount);
-        mUnreadCountLabel->setVisible(true);
+        QFontMetrics fm(mUnreadCountLabel->font());
+        qreal textWidth = fm.width(unreadCount);
+        mUnreadCountLabel->setMaximumWidth(textWidth);
     }
     else {
-        mUnreadCountLabel->setVisible(false);
+        mUnreadCountLabel->setMaximumWidth(0);
     }
 }
 
 /*!
     sets fonts color.
-    param bool pressed indicates if row is pressed down or not
+    /param bool pressed indicates if row is pressed down or not
 */
-void NmHsWidgetTitleRow::setFontsColor( bool pressed )
+void NmHsWidgetTitleRow::setHighlighedFontsColor( bool pressed )
     {
     NM_FUNCTION;
     QColor newFontColor;
@@ -191,6 +254,21 @@
     mUnreadCountLabel->setTextColor(newFontColor);
     }
 
+/*!
+    change background pressed state
+    /param bool show if true then shown, false hide
+*/
+void NmHsWidgetTitleRow::showHighlight( bool show )
+    {
+    NM_FUNCTION;;
+    
+    if(show){
+        mBackgroundLayoutItem->show();
+    }
+    else{
+        mBackgroundLayoutItem->hide();
+    }
+    }
 
 /*!
  mousePressEvent(QGraphicsSceneMouseEvent *event)
@@ -198,8 +276,14 @@
 void NmHsWidgetTitleRow::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
     NM_FUNCTION;
-    Q_UNUSED(event); 
-    setFontsColor(true);
+	
+	//to avoid opening email account mistakenly  when tabbing expand/collapse button
+	//we dont handle events that are on the top, down or right side of the button
+    if(event->pos().x() < mUnreadCountLabel->geometry().right())
+        {
+        setHighlighedFontsColor(true);
+        showHighlight(true);
+        }
 }
 
 /*!
@@ -208,9 +292,15 @@
 void NmHsWidgetTitleRow::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
 {
     NM_FUNCTION;
-    Q_UNUSED(event);
-    setFontsColor(false);
-    emit mailboxLaunchTriggered();
+	
+	//to avoid opening email account mistakenly when tabbing expand/collapse button
+	//we dont handle events that are on the top, down or right side of the button
+    if(event->pos().x() < mUnreadCountLabel->geometry().right())
+        {
+        setHighlighedFontsColor(false);
+        showHighlight(false);
+        emit mailboxLaunchTriggered();
+        }
 }
 
 /*
@@ -221,7 +311,7 @@
     NM_FUNCTION;
     QEvent::Type eventType = event->type();
     if( eventType == HbEvent::ThemeChanged ){
-        setFontsColor(false);
+        setHighlighedFontsColor(false);
         return true;
     }
     return HbWidget::event(event);
--- a/emailuis/nmhswidget/translations/mailwidget.ts	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmhswidget/translations/mailwidget.ts	Tue Jul 06 14:04:34 2010 +0300
@@ -2,14 +2,24 @@
 <!DOCTYPE TS>
 <TS version="3.0" sourcelanguage="en_GB">
 <context>
+<message numerus="no" id="txt_mail_widget_info_no_messages">
+    <comment>Layout ID parent (no children). Same text than in Mail client when mailbox is empty. Informs user that she does not have mail in the Inbox.</comment>        
+    <source>(No messages)</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>txt_mail_widget_info_no_messages</extra-loc-layout_id>    
+    <extra-loc-viewid>Mail widget_04, Mail widget_P04, Mail widget_L04</extra-loc-viewid>
+    <extra-loc-positionid>info</extra-loc-positionid>
+    <extra-loc-feature>Ma</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mail_widget_list_l1">
-    <comment>New mail count in parenthesis after the Mail box name which is the title of the widget. Max number shown 999.</comment>        
+    <comment>Layout ID parent (No children). New mail count in parenthesis after the Mail box name which is the title of the widget. Min number 1 and max number shown 999. Number or brackets are not shown at all if mailbox do not have any new mail. Example in Mail widget_L08.</comment>        
     <source>(%L1)</source>
     <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_list_tiny</extra-loc-layout_id>    
+    <extra-loc-layout_id>txt_mail_widget_list_l1</extra-loc-layout_id>    
     <extra-loc-viewid>Mail Widget</extra-loc-viewid>
     <extra-loc-positionid>List</extra-loc-positionid>
-    <extra-loc-feature>Mail Widget</extra-loc-feature>
+    <extra-loc-feature>Ma</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 </context>
--- a/emailuis/nmindicatorplugin/src/nmsendingindicator.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmindicatorplugin/src/nmsendingindicator.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -49,7 +49,7 @@
 */
 QVariant NmSendingIndicator::indicatorData(int role) const
 {
-    if (role==MonoDecorationNameRole) {
+    if (role==DecorationNameRole) {
 		// Must return non-empty to make the indicator visible
 		return " ";
 	}
--- a/emailuis/nmindicatorplugin/src/nmsyncindicator.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmindicatorplugin/src/nmsyncindicator.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -30,7 +30,7 @@
 
 QVariant NmSyncIndicator::indicatorData(int role) const
 {
-    if (role == MonoDecorationNameRole ) {
+    if (role == DecorationNameRole ) {
         // Must return non-empty to make the indicator visible
         return " ";
     }
--- a/emailuis/nmsettingui/inc/nmmailboxsettingview.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmsettingui/inc/nmmailboxsettingview.h	Tue Jul 06 14:04:34 2010 +0300
@@ -42,6 +42,7 @@
 
     ~NmMailboxSettingView();
 
+    NmId mailboxId();
 
 private slots:
 
--- a/emailuis/nmsettingui/src/nmmailboxsettingsmanager.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmsettingui/src/nmmailboxsettingsmanager.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -152,7 +152,7 @@
             pluginInstance->disconnect(SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
             pluginInstance->disconnect(SIGNAL(goOnline(const NmId &)));
             pluginInstance->disconnect(SIGNAL(goOffline(const NmId &)));
-            pluginInstance->disconnect(SIGNAL(aboutToClose()));
+            pluginInstance->disconnect(this, SIGNAL(aboutToClose()), pluginInstance, SLOT(aboutToClose()));
 
             connect(pluginInstance, SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)),
                 this, SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)));
--- a/emailuis/nmsettingui/src/nmmailboxsettingview.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmsettingui/src/nmmailboxsettingview.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -103,11 +103,7 @@
 {
     NM_FUNCTION;
     
-    if (mForm) {
-        mForm->removeAllConnection();
-        delete mForm;
-    }
-
+    delete mForm;
     delete mModel;
 }
 
@@ -159,5 +155,12 @@
     }
 }
 
+/*!
+    Returns the mailbox id for this mailbox setting view.    
+*/
+NmId NmMailboxSettingView::mailboxId()
+{
+    return mMailboxId;
+}
 
 // End of file.
--- a/emailuis/nmsettingui/src/nmsettingsviewfactory.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/emailuis/nmsettingui/src/nmsettingsviewfactory.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -180,68 +180,74 @@
     // There's always at least one valid main window available.
     HbMainWindow *mainWindow = hbInstance->allMainWindows().takeFirst();
 
-    CpBaseSettingView *view =
-        new NmMailboxSettingView(mailboxId, mailboxName, *mSettingsManager);
-
-    connect(mSettingsManager,
-            SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)),
-            view, SLOT(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)));
-
-    connect(mSettingsManager,
-            SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)),
-            view, SLOT(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
-
-    // Disconnect mSettingsViewLauncher's previous connections to be sure that signals which are
-    // offered out will be sent last.
-    mSettingsManager->disconnect(
-        SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)),
-        mSettingsViewLauncher,
-        SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)));
-
-    mSettingsManager->disconnect(
-        SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)),
-        mSettingsViewLauncher,
-        SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
-
-
-    // Reconnect mSettingsViewLauncher.
-    connect(mSettingsManager,
-            SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)),
-            mSettingsViewLauncher,
-            SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)));
-
-    connect(mSettingsManager,
-            SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)),
-            mSettingsViewLauncher,
-            SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
-
-    connect(mSettingsManager,
-            SIGNAL(goOnline(const NmId &)),
-            mSettingsViewLauncher,
-            SIGNAL(goOnline(const NmId &)), Qt::UniqueConnection);
-
-    connect(mSettingsManager,
-            SIGNAL(goOffline(const NmId &)),
-            mSettingsViewLauncher,
-            SIGNAL(goOffline(const NmId &)), Qt::UniqueConnection);
-
-    connect(this,
-            SIGNAL(aboutToClose()),
-            mSettingsManager,
-            SIGNAL(aboutToClose()), Qt::UniqueConnection);
-
-    // Create back navigation action for a view.
-    HbAction *action = new HbAction(Hb::BackNaviAction, view);
-    connect(action, SIGNAL(triggered()), this, SLOT(backPress()));
-    view->setNavigationAction(action);
-    mPrevView = mainWindow->currentView();
-    mainWindow->addView(view);
-    mainWindow->setCurrentView(view);
+    NmMailboxSettingView *currentSettingsView = 
+        qobject_cast<NmMailboxSettingView*>(mainWindow->currentView());
+    
+    // Let's have only one same settings view at a time open, 
+    // but if some other mailboxes settings view want's to open while 
+    // there is a settings view open let's open it also.
+    if (!currentSettingsView || (currentSettingsView->mailboxId().id() != mailboxId.id())) {
+        CpBaseSettingView *view =
+             new NmMailboxSettingView(mailboxId, mailboxName, *mSettingsManager);
+         
+         connect(mSettingsManager,
+                 SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)),
+                 view, SLOT(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)));
+     
+         connect(mSettingsManager,
+                 SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)),
+                 view, SLOT(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
+     
+         // Disconnect mSettingsViewLauncher's previous connections to 
+         // be sure that signals which are offered out will be sent last.
+         mSettingsManager->disconnect(
+             SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)),
+             mSettingsViewLauncher,
+             SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)));
+     
+         mSettingsManager->disconnect(
+             SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)),
+             mSettingsViewLauncher,
+             SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
+     
+         // Reconnect mSettingsViewLauncher.
+         connect(mSettingsManager,
+                 SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)),
+                 mSettingsViewLauncher,
+                 SIGNAL(mailboxListChanged(const NmId &, NmSettings::MailboxEventType)));
+     
+         connect(mSettingsManager,
+                 SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)),
+                 mSettingsViewLauncher,
+                 SIGNAL(mailboxPropertyChanged(const NmId &, QVariant, QVariant)));
+     
+         connect(mSettingsManager,
+                 SIGNAL(goOnline(const NmId &)),
+                 mSettingsViewLauncher,
+                 SIGNAL(goOnline(const NmId &)), Qt::UniqueConnection);
+     
+         connect(mSettingsManager,
+                 SIGNAL(goOffline(const NmId &)),
+                 mSettingsViewLauncher,
+                 SIGNAL(goOffline(const NmId &)), Qt::UniqueConnection);
+     
+         connect(this,
+                 SIGNAL(aboutToClose()),
+                 mSettingsManager,
+                 SIGNAL(aboutToClose()), Qt::UniqueConnection);
+     
+         // Create back navigation action for a view.
+         HbAction *action = new HbAction(Hb::BackNaviAction, view);
+         connect(action, SIGNAL(triggered()), this, SLOT(backPress()));
+         view->setNavigationAction(action);
+         mPrevView = mainWindow->currentView();
+         mainWindow->addView(view);
+         mainWindow->setCurrentView(view);
+    }    
 }
 
-
 /*!
-   Handles back button press.
+   Handels back button press.
    Removes the current view from the main window and activates the previous view.
    Destroys removed view.
 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/emailshutdownconst.h	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,79 @@
+/*
+* 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/emailshutdownconst.hrh	Tue Jul 06 14:04:34 2010 +0300
@@ -0,0 +1,31 @@
+/*
+* 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/ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOImapAgent.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -33,7 +33,7 @@
 //<QMail>
 #include "IpsSosAOSettingsHandler.h"
 
-const TInt KIpsSetDataHeadersOnly           = -2;
+//<qmail> removed
 //</QMail>
 
 // from ipsplugin
@@ -368,10 +368,16 @@
 void CIpsSosAOImapAgent::CancelAllAndDisconnectL()
     {
     FUNC_LOG;
+    // if we are already idle state, do nothing,
+    // completing in idle state might cause unvanted events to ui
+    if (iState == EStateIdle) 
+        {
+        return;
+        }
+    
     iDoNotDisconnect = EFalse;
     iState = EStateCompleted;
     iFoldersArray.Reset();
-
     if ( IsActive() )
         {
         Cancel();
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOPopAgent.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOPopAgent.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -302,6 +302,13 @@
 void CIpsSosAOPopAgent::CancelAllAndDisconnectL()
     {
     FUNC_LOG;
+    // if we are already idle state, do nothing
+    // completing in idle state might cause unvanted events to ui
+    if (iState == EStateIdle) 
+        {
+        return;
+        }
+    
     iDoNotDisconnect = EFalse;
     iState = EStateCompleted;
     if ( IsActive() )
--- a/ipsservices/ipssosplugin/inc/ipsplgcommon.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgcommon.h	Tue Jul 06 14:04:34 2010 +0300
@@ -35,7 +35,11 @@
 const TUid KIpsPlgPropertyCatUid  = { IPS_PROPERTY_CAT_UID };
 
 const TInt KIpsPlgMaxPhoneIdLength  = 50;
-
+//<qmail>
+const TInt KIpsSetDataHeadersOnly           = -2;
+const TInt KIpsSetDataFullBodyAndAttas      = -1;
+const TInt KIpsSetDataFullBodyOnly          = -3;
+//</qmail>
 const TInt KContinueInterval = 3000000; // 3 sec
 
 static _LIT_SECURITY_POLICY_PASS( KAllowAllPolicy );
--- a/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgimap4connectop.h	Tue Jul 06 14:04:34 2010 +0300
@@ -91,6 +91,17 @@
      * Returns operation type
      */
     TIpsOpType IpsOpType() const;
+    
+    //<qmail> moved from private to public and changed to static
+    /**
+     * 
+     * @param aInfo is filled correctly in this function
+     * @param aImap4Settings info is filled partly based on settings
+     */
+    static void ConstructImapPartialFetchInfo(
+        TImImap4GetPartialMailInfo& aInfo, 
+        const CImImap4Settings& aImap4Settings );
+    //</qmail>
         
     // <qmail> HandleImapConnectionEvent() not used any more
 
@@ -156,15 +167,7 @@
      */
     void SignalSyncCompleted( TInt aError );
     
-    // <qmail>
-    /**
-     * 
-     * @param aInfo is filled corretcly in this function
-     * @param aImap4Settings info is filled partly based on settings
-     */
-    void ConstructImapPartialFetchInfo(
-        TImImap4GetPartialMailInfo& aInfo, 
-        const CImImap4Settings& aImap4Settings );
+    // <qmail> moved to public
 
     /**
      * GetImapSettingsLC()
--- a/ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4connectop.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -19,11 +19,7 @@
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
-// <qmail>
-const TInt KIpsSetDataHeadersOnly           = -2;
-const TInt KIpsSetDataFullBodyAndAttas      = -1;
-const TInt KIpsSetDataFullBodyOnly          = -3;
-// </qmail>
+// <qmail> removed
 
 // <qmail> KIpsPlgIpsConnPanic removed
 
@@ -488,12 +484,14 @@
         }
     else
         {
+    //<qmail> include html in body
         aInfo.iTotalSizeLimit = sizeLimit*1024; 
         aInfo.iAttachmentSizeLimit = 0;
         aInfo.iMaxEmailSize = sizeLimit*1024;
         aInfo.iBodyTextSizeLimit = sizeLimit*1024;
         aInfo.iPartialMailOptions = EBodyAlternativeText;
         aInfo.iGetMailBodyParts = EGetImap4EmailBodyAlternativeText;
+    // </qmail>    
         }
     }
 
--- a/ipsservices/ipssosplugin/src/ipsplgimap4plugin.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgimap4plugin.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -578,15 +578,14 @@
     accounts->GetImapAccountL( aMailboxId.Id(), imapAcc );
     accounts->LoadImapSettingsL( imapAcc, *settings );
     TImImap4GetPartialMailInfo info;
-// <qmail>	
-    info.iPartialMailOptions = ENoSizeLimits;
-    //CIpsSetDataApi::ConstructImapPartialFetchInfo( info, *settings );
+// <qmail> Get TImImap4GetPartialMailInfo based on settings
+    CIpsPlgImap4ConnectOp::ConstructImapPartialFetchInfo( info, *settings );
     CleanupStack::PopAndDestroy( 2, settings );
-    /*
+
     if ( info.iTotalSizeLimit == KIpsSetDataHeadersOnly )
         {
         return;
-        }*/
+        }
 // </qmail>
     
     TPckgBuf<TImImap4GetPartialMailInfo> package(info);
--- a/ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgmsgmapper.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -408,15 +408,14 @@
 
     TMsvEmailEntry tEntry( cEntry->Entry() );
     TBool isModified = ChangeTEntryFlagsL( tEntry, aMessage );
-
+    // <qmail>
     if ( isModified )
         {
-// <qmail> Function called sync in Qmail
         cEntry->ChangeL( tEntry );
-// </qmail>
         }
 
     CleanupStack::PopAndDestroy( cEntry );
+    // </qmail>
     }
 
 // ---------------------------------------------------------------------------
@@ -1509,24 +1508,21 @@
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 // <cmail>
-void CIpsPlgMsgMapper::SetAttachmentFlagL( const TMsvEmailEntry& aEntry,
-										   TBool aHasAttachment )
+void CIpsPlgMsgMapper::SetAttachmentFlagL( const TMsvEmailEntry& /*aEntry*/,
+										   TBool /*aHasAttachment*/ )
 	{
 	FUNC_LOG;
-	CMsvEntry* cEntry = iSession.GetEntryL( aEntry.Id() );
+	// <qmail> commented out, causing freeze in message list
+	/*CMsvEntry* cEntry = iSession.GetEntryL( aEntry.Id() );
 	CleanupStack::PushL( cEntry );
 	// Only text/calendar part included as attachment
 	TMsvEmailEntry entryToBeChanged( aEntry );
 	entryToBeChanged.SetAttachment( aHasAttachment );
 
-// <qmail> Function called sync in Qmail
 	cEntry->ChangeL( entryToBeChanged );
-	CleanupStack::PopAndDestroy( cEntry );
+	CleanupStack::PopAndDestroy( cEntry );*/
 // </qmail>
 	}
-// </cmail>
-
-// <cmail>
 // ---------------------------------------------------------------------------
 // ---------------------------------------------------------------------------
 void CIpsPlgMsgMapper::GetCharsetParameterL(
--- a/ipsservices/ipssosplugin/src/ipsplgpop3plugin.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgpop3plugin.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -19,6 +19,7 @@
 #include "emailtrace.h"
 #include "ipsplgheaders.h"
 
+//<qmail> removed
 
 // ---------------------------------------------------------------------------
 // CIpsPlgPop3Plugin::CIpsPlgPop3Plugin
@@ -164,12 +165,11 @@
     TInt populationLimit( settings->PopulationLimit() );
     CleanupStack::PopAndDestroy( 2, settings );   // >>> settings, accounts
     TBool forcePopulate( EFalse );
-// <qmail>
-    /*
+// <qmail> back to use
     if( populationLimit != KIpsSetDataHeadersOnly )
         {
         forcePopulate = ETrue;
-        }*/
+        }
 // </qmail>
     
     CIpsPlgBaseOperation* op = CIpsPlgPop3ConnectOp::NewL( 
--- a/ipsservices/nmipssettings/inc/nmipssettingshelper.h	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/nmipssettings/inc/nmipssettingshelper.h	Tue Jul 06 14:04:34 2010 +0300
@@ -104,7 +104,6 @@
     void incomingMailServerTextChange(const QString &text);
     void saveOutgoingMailServer();
     void outgoingMailServerTextChange(const QString &text);
-    void handleModelDataChange(QModelIndex startIn, QModelIndex endIn);
     void incomingPortChange(int index);
     void incomingSecureConnectionItemChange(int index);
     void folderPathChange(int index);
--- a/ipsservices/nmipssettings/src/nmipssettingshelper.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/nmipssettings/src/nmipssettingshelper.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -312,9 +312,9 @@
                     // 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");
+                                     << HbStringUtil::convertDigits(hbTrId("txt_mailips_setlabel_val_every_15_minutes"))
+                                     << HbStringUtil::convertDigits(hbTrId("txt_mailips_setlabel_val_every_1_hour"))
+                                     << HbStringUtil::convertDigits(hbTrId("txt_mailips_setlabel_val_every_4_hours"));
                     formItemData->setContentWidgetData("items", refreshMailItems);
                     mDataForm.addConnection(
                         formItemData, SIGNAL(valueChanged(QPersistentModelIndex, QVariant)),
@@ -816,37 +816,6 @@
     mCurrentLineEditChanged = true;
 }
 
-void NmIpsSettingsHelper::handleModelDataChange(QModelIndex startIn, QModelIndex endIn)
-{
-    Q_UNUSED(endIn);
-    HbDataFormModelItem *item = mDataFormModel.itemFromIndex(startIn);
-    
-    if(item == mContentItems.value(IpsServices::IncomingSecureSockets)) {
-        QVariant data = item->contentWidgetData("selected");
-        incomingSecureConnectionItemChange(data.toInt());
-    }
-    else if(item == mContentItems.value(IpsServices::IncomingPort)) {
-        QVariant data = item->contentWidgetData("selected");
-        incomingPortChange(data.toInt());
-    }
-    else if(item == mContentItems.value(IpsServices::OutgoingSecureSockets)) {
-        QVariant data = item->contentWidgetData("selected");
-        outgoingSecureConnectionItemChange(data.toInt());
-    }
-    else if(item == mContentItems.value(IpsServices::OutgoingPort)) {
-        QVariant data = item->contentWidgetData("selected");
-        outgoingPortChange(data.toInt());
-    }
-    else if(item == mContentItems.value(IpsServices::SMTPAuthentication)) {
-        QVariant data = item->contentWidgetData("selected");
-        outgoingAuthenticationChange(data.toInt());
-    }
-    else if(item == mContentItems.value(IpsServices::FolderPath)) {
-        QVariant data = item->contentWidgetData("selected");
-        folderPathChange(data.toInt());
-    }
-}
-
 /*!
     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.
@@ -856,15 +825,15 @@
 {
     int previousindex = getCorrectIncomingPortRadioButtonIndex();
     
-    if (previousindex != index ) {
-        if (index == IpsServices::NmIpsSettingsDefault) {
+    if (index == IpsServices::NmIpsSettingsDefault) {
+        if (index != previousindex) {
             emit goOffline(mSettingsManager.mailboxId());
             mEmitOnline = true;
             int port = mSettingsManager.determineDefaultIncomingPort();
-            mSettingsManager.writeSetting(IpsServices::IncomingPort, port);
-        } else if (index == IpsServices::NmIpsSettingsUserDefined) {
-            showIncomingPortInputDialog();
-        }  
+            mSettingsManager.writeSetting(IpsServices::IncomingPort, port);    
+        }
+    } else if (index == IpsServices::NmIpsSettingsUserDefined) {
+        showIncomingPortInputDialog();
     }
 }
 
@@ -1030,14 +999,14 @@
 void NmIpsSettingsHelper::folderPathChange(int index)
 {
     int previousindex = getCorrectFolderPathRadioButtonIndex();
-    
-    if (previousindex != index ) {
-        if (index == IpsServices::NmIpsSettingsDefault) {
+        
+    if (index == IpsServices::NmIpsSettingsDefault) {
+        if (index != previousindex ) {
             // Empty string sets the folder path to default.
-            mSettingsManager.writeSetting(IpsServices::FolderPath, "");
-        } else if (index == IpsServices::NmIpsSettingsUserDefined) {
-            showFolderPathInputDialog();       
+            mSettingsManager.writeSetting(IpsServices::FolderPath, "");    
         }
+    } else if (index == IpsServices::NmIpsSettingsUserDefined) {
+        showFolderPathInputDialog();       
     }
 }
 
@@ -1136,10 +1105,10 @@
 void NmIpsSettingsHelper::refreshPeriodModified(QPersistentModelIndex, QVariant value)
 {
     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;
+    conversionTable[HbStringUtil::convertDigits(hbTrId("txt_mailips_setlabel_val_keep_uptodate"))] = 5;
+    conversionTable[HbStringUtil::convertDigits(hbTrId("txt_mailips_setlabel_val_every_15_minutes"))] = 15;
+    conversionTable[HbStringUtil::convertDigits(hbTrId("txt_mailips_setlabel_val_every_1_hour"))] = 60;
+    conversionTable[HbStringUtil::convertDigits(hbTrId("txt_mailips_setlabel_val_every_4_hours"))] = 240;
 
     int selectedValue(conversionTable.value(value.toString()));
     QVariant previouslySelectedValue;
@@ -1314,15 +1283,15 @@
 {
     int previousindex = getCorrectOutgoingPortRadioButtonIndex();
     
-    if (previousindex != index) {
-        if (index == IpsServices::NmIpsSettingsDefault) {
+    if (index == IpsServices::NmIpsSettingsDefault) {
+        if (index != previousindex) {
             emit goOffline(mSettingsManager.mailboxId());
             mEmitOnline = true;
             int port = mSettingsManager.determineDefaultOutgoingPort();
-            mSettingsManager.writeSetting(IpsServices::OutgoingPort, port);
-        } else if (index == IpsServices::NmIpsSettingsUserDefined) {
-            showOutgoingPortInputDialog();
+            mSettingsManager.writeSetting(IpsServices::OutgoingPort, port);    
         }
+    } else if (index == IpsServices::NmIpsSettingsUserDefined) {
+        showOutgoingPortInputDialog();
     }
 }
 
--- a/ipsservices/nmipssettings/src/nmipssettingsplugin.cpp	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/nmipssettings/src/nmipssettingsplugin.cpp	Tue Jul 06 14:04:34 2010 +0300
@@ -99,13 +99,6 @@
 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;
-
     // populateModel is called each time when a new settings view is created and this
     // plugin is destructed only after the mail settings is exited, so
     // SettingsManager and SettingsHelper needs to be deleted.
@@ -119,6 +112,13 @@
     // This plugin is only used when the mailbox is a IMAP or POP3 account.
     // Settings manager object is valid if the mailboxId is IMAP or POP3 account.
     if (mSettingsManager) {
+        // Turns AlwaysOnline OFF
+        setAlwaysOnlineState(EServerAPIEmailTurnOff, mailboxId);
+        
+        // Store model and form pointers.
+        mModel = &model;
+        mForm = &form;
+        
         // Create settings helper.
         mSettingsHelper = new NmIpsSettingsHelper(*mSettingsManager, form, model);
 
@@ -134,9 +134,6 @@
 
         connect(mSettingsHelper, SIGNAL(createUserDefinedMode()),
                 this, SLOT(createUserDefinedMode()));
-
-        connect(mModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), 
-                mSettingsHelper, SLOT(handleModelDataChange(QModelIndex, QModelIndex)));
         
         // Get the value if some ui items need to be hidden.
         QVariant data;
@@ -452,6 +449,8 @@
         mSettingsHelper->getCorrectIncomingSecureRadioButtonIndex();
     incomingSecureConnectionItem->setContentWidgetData(QString("selected"), 
                                                        incomingSecureConnectionItemIndex);
+    mForm->addConnection(incomingSecureConnectionItem, SIGNAL(itemSelected(int)),             
+            mSettingsHelper, SLOT(incomingSecureConnectionItemChange(int)));
     if (mHiddenItem) {
         incomingSecureConnectionItem->setEnabled(false);
     }
@@ -468,6 +467,8 @@
     incomingPortItem->setContentWidgetData(QString("items"), incomingPortItems);
     int incomingPortItemIndex = mSettingsHelper->getCorrectIncomingPortRadioButtonIndex(); 
     incomingPortItem->setContentWidgetData(QString("selected"), incomingPortItemIndex);
+    mForm->addConnection(incomingPortItem, SIGNAL(itemSelected(int)),
+        mSettingsHelper, SLOT(incomingPortChange(int)));
     if (mHiddenItem) {
         incomingPortItem->setEnabled(false);
     }
@@ -504,6 +505,8 @@
         mSettingsHelper->getCorrectOutgoingSecureRadioButtonIndex();
     outgoingSecureConnectionItem->setContentWidgetData(QString("selected"), 
                                                        outgoingSecureConnectionItemIndex);
+    mForm->addConnection(outgoingSecureConnectionItem, SIGNAL(itemSelected(int)),             
+            mSettingsHelper, SLOT(outgoingSecureConnectionItemChange(int)));
     if (mHiddenItem) {
         outgoingSecureConnectionItem->setEnabled(false);
     }
@@ -520,6 +523,8 @@
     outgoingPortItem->setContentWidgetData(QString("items"), outgoingPortItems);
     int outgoingPortItemIndex = mSettingsHelper->getCorrectOutgoingPortRadioButtonIndex(); 
     outgoingPortItem->setContentWidgetData(QString("selected"), outgoingPortItemIndex);
+    mForm->addConnection(outgoingPortItem, SIGNAL(itemSelected(int)),
+        mSettingsHelper, SLOT(outgoingPortChange(int)));
     if (mHiddenItem) {
         outgoingPortItem->setEnabled(false);
     }
@@ -538,6 +543,8 @@
     int outgoingAuthenticationIndex = 
         mSettingsHelper->getCorrectOutgoingAuthenticationRadioButtonIndex(); 
     outgoingAuthenticationItem->setContentWidgetData(QString("selected"), outgoingAuthenticationIndex);
+    mForm->addConnection(outgoingAuthenticationItem, SIGNAL(itemSelected(int)),
+        mSettingsHelper, SLOT(outgoingAuthenticationChange(int)));
     item.appendChild(outgoingAuthenticationItem);
     if (mHiddenItem) {
         outgoingAuthenticationItem->setEnabled(false);
@@ -559,6 +566,8 @@
         folderPathItem->setContentWidgetData(QString("items"), folderPathItems);
         int folderPathItemIndex = mSettingsHelper->getCorrectFolderPathRadioButtonIndex();
         folderPathItem->setContentWidgetData(QString("selected"), folderPathItemIndex);
+        mForm->addConnection(folderPathItem, SIGNAL(itemSelected(int)),
+            mSettingsHelper, SLOT(folderPathChange(int)));
         item.appendChild(folderPathItem);
     }
 }
Binary file ipsservices/nmipssettings/translations/mailips.qm has changed
--- a/ipsservices/nmipssettings/translations/mailips.ts	Wed Jun 23 18:00:21 2010 +0300
+++ b/ipsservices/nmipssettings/translations/mailips.ts	Tue Jul 06 14:04:34 2010 +0300
@@ -7,27 +7,27 @@
     <source>On (StartTLS)</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_11_12_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_list_popup_sec_off">
-    <comment>Option item for txt_mailips_dialog_heading_incoming_connection and txt_mailips_dialog_heading_outgoing_connection.</comment>        
+    <comment>Option item for txt_mailips_dialog_heading_incoming_connection and txt_mailips_dialog_heading_outgoing_connection. For defining that the setting for securing incoming/outgoing mail is off. Example flow in settings.ppt, slide 18</comment>        
     <source>Off</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_12_13</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_a, mail_006_d_b</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_mailips_dialog_heading_refresh_mail">
-    <comment>Title text in setting dialog opened from txt_mailips_setlabel_refresh_mail</comment>        
+    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog. Option for defining that the mailbox gets refreshed from server according to a default refreshing schedule.</comment>        
     <source>Refresh mail</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_11</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -37,7 +37,7 @@
     <source>Outgoing mail authentication</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_10</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -47,37 +47,37 @@
     <source>Reply to address</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_4</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_setlabel_folder_path_val_default">
-    <comment>Value for txt_mailips_setlabel_folder_path. Default folder path will be used.</comment>        
+    <comment>Value for txt_mailips_setlabel_folder_path. Default folder path will be used. Refers to all folders. </comment>        
     <source>Default</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_9_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_dialog_heading_connection">
-    <comment>Title text in setting dialog opened from txt_mailips_setlabel_connection</comment>        
+    <comment>Title text in setting radio button dialog opened from txt_mailips_setlabel_connection. Example of the dialog can be found from settings.ppt, slide 18</comment>        
     <source>Connection</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_15</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_a_a</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_dialog_heading_show_in_inbox">
-    <comment>Title text in setting dialog opened from txt_mailips_setlabel_show_mail_in_inbox</comment>        
+    <comment>Title text in setting dialog opened from txt_mailips_setlabel_show_mail_in_inbox. Example flow can be found from 10.2settings.ptt, slide 16</comment>        
     <source>Show mail in inbox</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_16</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_a</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -87,7 +87,7 @@
     <source>Every day</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -97,7 +97,7 @@
     <source>Tue</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -107,7 +107,7 @@
     <source>Outgoing port</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_14</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -117,7 +117,7 @@
     <source>Every 1 hour</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>setlabel_6_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -127,7 +127,7 @@
     <source>Thu</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_10</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_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>
@@ -137,7 +137,7 @@
     <source>Outgoing mail server</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -147,17 +147,27 @@
     <source>The mailbox is refreshed as defined by the user</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_description_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</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_mailips_list_popup_sec_on_ssltls">
-    <comment>Option item for txt_mailips_dialog_heading_incoming_connection and txt_mailips_dialog_heading_outgoing_connection.</comment>        
+    <comment>Option item for txt_mailips_dialog_heading_incoming_connection and txt_mailips_dialog_heading_outgoing_connection. For defining that the setting for securing incoming/outgoing mail is on with SSL/TLS protocol. Example flow in settings.ppt, slide 18</comment>        
     <source>On (SSL/TLS)</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_12_13</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_a, mail_006_d_b</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_mailips_list_the_mailbox_is_refreshed_every_hour">
+    <comment>info text to explain the profile (txt_mailmfe_setlabel_selected_mode_val_save_energy)</comment>        
+    <source>The mailbox is refreshed every hour during daytime</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_description_sec</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -167,7 +177,7 @@
     <source>Sun</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -177,7 +187,7 @@
     <source>User defined</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_9_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -187,27 +197,17 @@
     <source>Folder path</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_9</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mailips_dialog_heading_signature">
-    <comment>Title text in setting dialog opened from txt_mailnips_setlabel_signature</comment>        
-    <source>Signature</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_g</extra-loc-viewid>
-    <extra-loc-positionid>title</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mailips_list_popup_sec_every_4_hours">
-    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog.</comment>        
+    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog. Option for defining that the mailbox gets refreshed from server every 4 hours.</comment>        
     <source>Every 4 hours</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_11</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -217,7 +217,7 @@
     <source>Username</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_2</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -227,7 +227,7 @@
     <source>Receiving days</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -237,17 +237,17 @@
     <source>Mailbox name</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_a</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_a_e</extra-loc-viewid>
     <extra-loc-positionid>setlabel_2</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_list_popup_sec_every_15_minutes">
-    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog.</comment>        
+    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog. Option for defining that the mailbox gets refreshed from server every 15 minutes.</comment>        
     <source>Every 15 minutes</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_11</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -257,47 +257,27 @@
     <source>Wed</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_10</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_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_mailips_setlabel_signature">
-    <comment>Setting item in preferences.</comment>        
-    <source>Signature</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_a</extra-loc-viewid>
-    <extra-loc-positionid>setlabel_10</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mailips_setlabel_download_images_val_mon">
     <comment>One of the values for txt_mailips_setlabel_receiving_weekdays. Monday setting item</comment>        
     <source>Mon</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_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_mailips_list_popup_sec_signature_on">
-    <comment>Radio button value in the txt_mailips_dialog_heading_signature dialog.</comment>        
-    <source>On</source>
-    <translation variants="yes" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_g</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_mailips_setlabel_outgoing_authentication_same">
     <comment>Value for txt_mailips_setlabel_outgoing_mail_authentication. Same authentication as for incoming mail</comment>        
     <source>Same as for incoming</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_10_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -307,7 +287,7 @@
     <source>Incoming secure connection</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_a</extra-loc-viewid>
     <extra-loc-positionid>setlabel_11</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -317,7 +297,7 @@
     <source>The mailbox is refreshed every 15 minutes during daytime</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_description_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -327,7 +307,7 @@
     <source>All</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -337,7 +317,7 @@
     <source>Sat</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_10</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_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>
@@ -347,7 +327,7 @@
     <source>Keep up-to-date</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>setlabel_6_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -357,17 +337,17 @@
     <source>The mailbox is up-to-date during daytime</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_description_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</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_mailips_dialog_heading_outgoing_authentication">
-    <comment>Title text in setting dialog opened from txt_mailips_setlabel_refresh_mail</comment>        
+    <comment>Title text in setting dialog opened from txt_mailips_setlabel_refresh_mail. For defining the settings for outgoing mail authentication. Radio button list. Example flow in settings.ppt, slide 18</comment>        
     <source>Outgoing mail authentication</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_14</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_c</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -377,7 +357,7 @@
     <source>On (SLL/TLS)</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_11_12_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -387,27 +367,27 @@
     <source>Outgoing secure connection</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_b</extra-loc-viewid>
     <extra-loc-positionid>setlabel_12</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_setlabel_selected_mode_val_fetch_manua">
-    <comment>Under Receiving schedule &gt; Selected mode. Mode drop down: fetch manually mode. The mailbox is refreshed only by user request.</comment>        
+    <comment>Under Receiving schedule &gt; Selected mode. Mode drop down: fetch manually mode. The mailbox is refreshed only by user request. Example flow in settings.ppt, slide 14.</comment>        
     <source>Fetch manually</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_combobox_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>setlabel_20_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_list_popup_sec_no_authentication">
-    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog.</comment>        
+    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog. Radio button list. Example flow in settings.ppt, slide 18</comment>        
     <source>No authentication</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_14</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_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>
@@ -417,17 +397,17 @@
     <source>Day start time</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_4</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_list_popup_sec_keep_up_to_date">
-    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog.</comment>        
+    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog. Option for defining that the mailbox gets refreshed from server according to a default refreshing schedule.</comment>        
     <source>Keep up-to-date</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_11</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -437,7 +417,7 @@
     <source>All</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>setlabel_1_2_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -447,17 +427,17 @@
     <source>Version: %[]1</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06</extra-loc-viewid>
+    <extra-loc-viewid>mail_006</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_mailips_list_popup_sec_user_authentication">
-    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog.</comment>        
+    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog. Radio button list. Example flow in settings.ppt, slide 18</comment>        
     <source>User authentication</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_14</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_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>
@@ -467,7 +447,7 @@
     <source>None</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_10_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -487,17 +467,17 @@
     <source>Incoming port</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_13</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_dialog_heading_end_time">
-    <comment>Title text in setting dialog opened from txt_mailips_setlabel_day_end_time</comment>        
+    <comment>Title text in setting dialog opened from txt_mailips_setlabel_day_end_time. Day here refers to the peak time for synchronization within one day ie. during which hours wihtin one day the user wants the mailbox refreshed from the server most often. Typically for example during business hours but not in the evening in which case the day start time could be 9 am when the user comes to office and the day end time could be 5 pm when the user leaves office. Example flow can be found from 10.2settings.ptt, slide 17</comment>        
     <source>Day end time</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_13</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_e</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -507,27 +487,27 @@
     <source>Default</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_13_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_dialog_heading_outgoing_connection">
-    <comment>Title text in setting dialog opened from txt_mailips_setlabel_outgoing_security</comment>        
+    <comment>Title text in setting dialog opened from txt_mailips_setlabel_outgoing_security. Radio button list. Example flow in settings.ppt, slide 18</comment>        
     <source>Outgoing secure connection</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_13</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_b</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_list_popup_sec_every_hour">
-    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog.</comment>        
+    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog. Option for defining that the mailbox gets refreshed from server every hour.</comment>        
     <source>Every hour</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_11</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -537,7 +517,7 @@
     <source>Fri</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_10</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_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>
@@ -547,17 +527,17 @@
     <source>Incoming mail server</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_2</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_list_popup_sec_on_starttls">
-    <comment>Option item for txt_mailips_dialog_heading_incoming_connection and txt_mailips_dialog_heading_outgoing_connection.</comment>        
+    <comment>Option item for txt_mailips_dialog_heading_incoming_connection and txt_mailips_dialog_heading_outgoing_connection. For defining that the setting for securing incoming/outgoing mail is on with StartTLS protocol. Example flow in settings.ppt, slide 18</comment>        
     <source>On (StartTLS)</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_12_13</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_a, mail_006_d_b</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -567,7 +547,7 @@
     <source>My name</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_a</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_a_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_1</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -577,37 +557,37 @@
     <source>Preferences</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_group_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_a</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_a</extra-loc-viewid>
     <extra-loc-positionid>subhead</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_setlabel_day_end_time">
-    <comment>Setting label under Receiving schedule &gt; Selected mode &gt; Save energy  (txt_mailips_setlabel_selected_mode_val_save_energy). Label for selecting the end time of of the day</comment>        
+    <comment>Setting label under Receiving schedule &gt; Selected mode &gt; Save energy  (txt_mailips_setlabel_selected_mode_val_save_energy). Label for selecting the end time of of the day. Day here refers to the peak time for synchronization within one day ie. during which hours wihtin one day the user wants the mailbox refreshed from the server most often. Typically for example during business hours but not in the evening in which case the day start time could be 9 am when the user comes to office and the day end time could be 5 pm when the user leaves office.</comment>        
     <source>Day end time</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_e</extra-loc-viewid>
     <extra-loc-positionid>setlabel_5</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mailips_list_popup_sec_signature_off">
-    <comment>Radio button value in the txt_mailips_dialog_heading_signature dialog.</comment>        
-    <source>Off</source>
+<message numerus="no" id="txt_mailips_list_popup_sec_folder_path_val_default">
+    <comment>Option item in txt_mailips_setlabel_folder_path. Default folder path will be used. See example image from settings.ppt, slide 19</comment>        
+    <source>Default</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_g</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_d</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_mailips_setlabel_selected_mode_val_save_energy">
-    <comment>Under Receiving schedule &gt; Selected mode. Mode drop down:Save energy mode. The mailbox is refreshed every 15 minutes during daytime</comment>        
+    <comment>Under Receiving schedule &gt; Selected mode. Mode drop down:Save energy mode. The mailbox is refreshed every 15 minutes during daytime. Example flow in settings.ppt, slide 14.</comment>        
     <source>Save energy</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_combobox_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>setlabel_20_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -617,7 +597,7 @@
     <source>Wed</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -627,7 +607,7 @@
     <source>Sat</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -637,7 +617,7 @@
     <source>Sun</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_10</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_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>
@@ -647,7 +627,7 @@
     <source>Off</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_11_12_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -657,17 +637,27 @@
     <source>Show mail in other folders</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_b</extra-loc-viewid>
     <extra-loc-positionid>setlabel_2</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mailips_list_popup_sec_folder_path_user_defined">
+    <comment>Option item in txt_mailips_setlabel_folder_path. User is able to define the folder path. See example image from settings.ppt, slide 19</comment>        
+    <source>User defined</source>
+    <translation variants="yes" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_006_d_d</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_mailips_setlabel_download_images_val_none">
     <comment>One of the values for txt_mailips_setlabel_receiving_weekdays. Shown if none of the days are selected.</comment>        
     <source>None</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -677,7 +667,7 @@
     <source>Tue</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_10</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_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>
@@ -687,7 +677,7 @@
     <source>Refresh mail</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>setlabel_6</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -697,27 +687,27 @@
     <source>Mail address</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_1</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_setlabel_connection">
-    <comment>Setting label under Server info txt_mailips_subhead_server_info for defining the type of connection used for fetching mail. Setting item in server info</comment>        
+    <comment>Setting label under Preferences for defining the type of connection used for fetching mail. Opens a radio button dialog, see example from settings.ppt, slide 18</comment>        
     <source>Connection</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_a_a</extra-loc-viewid>
     <extra-loc-positionid>setlabel_8</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_list_popup_sec_same_as_for_incoming">
-    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog.</comment>        
+    <comment>Option item in txt_mailips_dialog_heading_refresh_mail setting dialog. Radio button list. Example flow in settings.ppt, slide 18</comment>        
     <source>Same as for incoming</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_14</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_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>
@@ -727,7 +717,7 @@
     <source>Thu</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -737,7 +727,7 @@
     <source>Receiving Schedule</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_group_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>subhead</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -747,7 +737,7 @@
     <source>Server info</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_group_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>subhead</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -757,37 +747,47 @@
     <source>Mon</source>
     <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_list_popup_sec_add</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_10</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_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_mailips_dialog_heading_folder_path">
+    <comment>Title text in setting dialog opened from Server info txt_mailips_subhead_server_info for defining the folder path. See example image from settings.ppt, slide 19</comment>        
+    <source>Folder path</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_006_d_d</extra-loc-viewid>
+    <extra-loc-positionid>title</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mailips_setlabel_val_when_i_open_mailbox">
     <comment>Value for txt_mailips_setlabel_refresh_mail. The mailbox is refreshed only and always when the user opens the mailbox</comment>        
     <source>When I open mailbox</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>setlabel_6_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_setlabel_selected_mode_val_user_define">
-    <comment>Under Receiving schedule &gt; Selected mode. Mode drop down:User defined mode. The mailbox is refreshed as defined by the user.</comment>        
+    <comment>Under Receiving schedule &gt; Selected mode. Mode drop down:User defined mode. The mailbox is refreshed as defined by the user. Example flow in settings.ppt, slide 14.</comment>        
     <source>User defined</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_combobox_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>setlabel_20_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_dialog_heading_show_in_folders">
-    <comment>Title text in setting dialog opened from txt_mailips_setlabel_show_mail_in_other_folders</comment>        
+    <comment>Title text in setting dialog opened from txt_mailips_setlabel_show_mail_in_other_folders. Example flow can be found from 10.2settings.ptt, slide 16</comment>        
     <source>Show mail in other folders</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_17</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_b</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -797,7 +797,7 @@
     <source>Fri</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -807,7 +807,7 @@
     <source>Every 4 hours</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>setlabel_6_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -817,27 +817,27 @@
     <source>User defined</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_13_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_setlabel_selected_mode_val_keep_upto">
-    <comment>Under Receiving schedule &gt; Selected mode. Mode drop down: keep up to date mode. The mailbox is up-to-date during daytime</comment>        
+    <comment>Under Receiving schedule &gt; Selected mode. Mode drop down: keep up to date mode. The mailbox is up-to-date during daytime. Example flow in settings.ppt, slide 14.</comment>        
     <source>Keep up-to-date</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_combobox_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>setlabel_20_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_dialog_heading_incoming_connection">
-    <comment>Title text in setting dialog opened from txt_mailips_setlabel_incoming_security</comment>        
+    <comment>Title text in setting dialog opened from txt_mailips_setlabel_incoming_security for defining the secure connection usage for incoming mail. Radio button list. Example flow in settings.ppt, slide 18</comment>        
     <source>Incoming secure connection</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_12</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d_a</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -847,17 +847,17 @@
     <source>User authentication</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_d</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_d</extra-loc-viewid>
     <extra-loc-positionid>setlabel_10_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_dialog_heading_receiving_days">
-    <comment>Title text in setting dialog opened from txt_mailips_setlabel_receiving_weekdays</comment>        
+    <comment>Title text in setting dialog opened from txt_mailips_setlabel_receiving_weekdays. Allows the user to define the weekdays when mail is refreshed to mailbox from server. Example flow can be found from 10.2settings.ptt, slide 19</comment>        
     <source>Receiving days</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_10</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -867,7 +867,7 @@
     <source>Password</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_c</extra-loc-viewid>
     <extra-loc-positionid>setlabel_3</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -877,7 +877,7 @@
     <source>Every 15 minutes</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>setlabel_6_val</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -887,7 +887,7 @@
     <source>The mailbox is refreshed only by user request</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_description_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
@@ -897,47 +897,47 @@
     <source>User info</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_group_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_c</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_c</extra-loc-viewid>
     <extra-loc-positionid>subhead</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_dialog_heading_start_time">
-    <comment>Title text in setting dialog opened from txt_mailips_setlabel_day_start_time</comment>        
+    <comment>Title text in setting dialog opened from txt_mailips_setlabel_day_start_time. Day here refers to the peak time for synchronization within one day ie. during which hours wihtin one day the user wants the mailbox refreshed from the server most often. Typically for example during business hours but not in the evening in which case the day start time could be 9 am when the user comes to office and the day end time could be 5 pm when the user leaves office. Example flow can be found from 10.2settings.ptt, slide 17</comment>        
     <source>Day start time</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_12</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_d</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mailips_setlabel_selected_mode">
+    <comment>Under Receiving schedule. Label text for mode drop down. User can define how often the mailbox is refreshed with the server content. Options Keep-up-to-date, Save energy, Fetch manually.</comment>        
+    <source>Selected mode</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_006_b</extra-loc-viewid>
+    <extra-loc-positionid>setlabel_20</extra-loc-positionid>
+    <extra-loc-feature>mail</extra-loc-feature>
+    <extra-loc-blank>False</extra-loc-blank>
+</message>
 <message numerus="no" id="txt_mailips_setlabel_show_mail_in_inbox">
     <comment>Setting label under Receiving schedule &gt; Selected mode &gt; Save energy  (txt_mailips_setlabel_selected_mode_val_save_energy). Allows the user to define how many mails are synchronized to Inbox from server (50, 100, 200 or All).</comment>        
     <source>Show mail in inbox</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
+    <extra-loc-viewid>mail_006_b_a</extra-loc-viewid>
     <extra-loc-positionid>setlabel_1</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
-<message numerus="no" id="txt_mailips_setlabel_selected_mode">
-    <comment>Under Receiving schedule. Label text for mode drop down. User can define how often the mailbox is refreshed with the server content. Options Keep-up-to-date, Save energy, Fetch manually.</comment>        
-    <source>Selected mode</source>
-    <translation variants="no" type="unfinished"></translation>
-    <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06_b</extra-loc-viewid>
-    <extra-loc-positionid>setlabel_20</extra-loc-positionid>
-    <extra-loc-feature>mail</extra-loc-feature>
-    <extra-loc-blank>False</extra-loc-blank>
-</message>
 <message numerus="no" id="txt_mailips_button_delete_mailbox">
     <comment>Button for deleting the mailbox. </comment>        
     <source>Delete mailbox</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_button_sec</extra-loc-layout_id>    
-    <extra-loc-viewid>mail_06</extra-loc-viewid>
+    <extra-loc-viewid>mail_006</extra-loc-viewid>
     <extra-loc-positionid>Button</extra-loc-positionid>
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
--- a/nmail.pro	Wed Jun 23 18:00:21 2010 +0300
+++ b/nmail.pro	Tue Jul 06 14:04:34 2010 +0300
@@ -17,19 +17,9 @@
 
 TEMPLATE = subdirs
 
-win32: { 
-    SUBDIRS = \
-        emailservices/nmailbase \
-        emailuis/nmailuiengine  \
-        emailuis/nmailuiwidgets \
-        emailuis/nmailuiwidgetsplugin \
-        emailuis/nmailuiengine/tsrc/nmtestplugin \
-        emailuis/nmailuiengine/tsrc/nmtestpluginextension \
-        emailuis/nmailui
-}
-
 symbian*: { 
     SUBDIRS = \
+        email_plat \
         emailservices/nmailbase \
         emailuis/nmailuiengine \
         emailuis/nmailuiwidgets \
@@ -41,11 +31,11 @@
         emailservices/emailcommon \
         emailservices/emailframework \
         emailservices/emailstore \
+        emailservices/emailclientapi \
         ipsservices \
         emailuis/nmframeworkadapter \
         emailservices/nmclientapi \
         emailservices/nmailagent \
-        email_plat \
         emailservices/nmregister \
         emailuis/nmhswidget \
         emailuis/nmhswidget/tsrc/nmhswidgettestapp \