201039 PDK_4.0.a
authorhgs
Thu, 30 Sep 2010 11:43:07 +0300
changeset 74 6c59112cfd31
parent 69 4e54af54a4a1
child 76 38bf5461e270
201039
email_plat/contact_history_model_api/inc/nmcontacthistorymodel.h
email_plat/contact_history_model_api/inc/nmcontacthistorymodelcommon.h
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/inc/emailapidefs.h
email_plat/email_client_api/inc/emailclientapi.hrh
email_plat/email_client_api/inc/emailinterfacefactory.h
email_plat/email_client_api/inc/emailinterfacefactory.inl
email_plat/email_client_api/inc/emailsorting.h
email_plat/email_client_api/inc/memailaddress.h
email_plat/email_client_api/inc/memailclientapi.h
email_plat/email_client_api/inc/memailcontent.h
email_plat/email_client_api/inc/memailfolder.h
email_plat/email_client_api/inc/memailmailbox.h
email_plat/email_client_api/inc/memailmessage.h
email_plat/email_client_api/inc/memailmessagesearch.h
email_plat/email_client_api/inc/mmailboxcontentobserver.h
email_plat/email_client_api/inc/mmailboxsyncobserver.h
email_plat/email_client_api/inc/mmessageiterator.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_services_api/email_services_api.h
email_plat/email_services_api/email_services_api.pri
email_plat/email_services_api/inc/email_services_api.h
email_plat/nmail_client_api/inc/nmapiattachment.h
email_plat/nmail_client_api/inc/nmapicommon.h
email_plat/nmail_client_api/inc/nmapidef.h
email_plat/nmail_client_api/inc/nmapiemailaddress.h
email_plat/nmail_client_api/inc/nmapiemailservice.h
email_plat/nmail_client_api/inc/nmapienvelopelisting.h
email_plat/nmail_client_api/inc/nmapieventnotifier.h
email_plat/nmail_client_api/inc/nmapifolder.h
email_plat/nmail_client_api/inc/nmapifolderlisting.h
email_plat/nmail_client_api/inc/nmapimailbox.h
email_plat/nmail_client_api/inc/nmapimailboxlisting.h
email_plat/nmail_client_api/inc/nmapimessage.h
email_plat/nmail_client_api/inc/nmapimessagebody.h
email_plat/nmail_client_api/inc/nmapimessagecontent.h
email_plat/nmail_client_api/inc/nmapimessageenvelope.h
email_plat/nmail_client_api/inc/nmapimessagemanager.h
email_plat/nmail_client_api/inc/nmapimessagesearch.h
email_plat/nmail_client_api/inc/nmapimessagetask.h
email_plat/nmail_client_api/inc/nmapioperation.h
email_plat/nmail_client_api/inc/nmapitextcontent.h
email_plat/nmail_client_api/nmail_client_api.pri
email_plat/nmail_client_api/nmapiattachment.h
email_plat/nmail_client_api/nmapicommon.h
email_plat/nmail_client_api/nmapidef.h
email_plat/nmail_client_api/nmapiemailaddress.h
email_plat/nmail_client_api/nmapiemailservice.h
email_plat/nmail_client_api/nmapienvelopelisting.h
email_plat/nmail_client_api/nmapieventnotifier.h
email_plat/nmail_client_api/nmapifolder.h
email_plat/nmail_client_api/nmapifolderlisting.h
email_plat/nmail_client_api/nmapimailbox.h
email_plat/nmail_client_api/nmapimailboxlisting.h
email_plat/nmail_client_api/nmapimessage.h
email_plat/nmail_client_api/nmapimessagebody.h
email_plat/nmail_client_api/nmapimessagecontent.h
email_plat/nmail_client_api/nmapimessageenvelope.h
email_plat/nmail_client_api/nmapimessagemanager.h
email_plat/nmail_client_api/nmapimessagesearch.h
email_plat/nmail_client_api/nmapimessagetask.h
email_plat/nmail_client_api/nmapitextcontent.h
email_plat/nmail_settings_api/inc/nmapimailboxsettings.h
email_plat/nmail_settings_api/inc/nmapimailboxsettingsdata.h
email_plat/nmail_settings_api/inc/nmapisettingsmanager.h
email_plat/nmail_settings_api/nmail_settings_api.pri
email_plat/nmail_settings_api/nmapimailboxsettings.h
email_plat/nmail_settings_api/nmapimailboxsettingsdata.h
email_plat/nmail_settings_api/nmapisettingsmanager.h
emailservices/emailclientapi/inc/emailmessagesearch.h
emailservices/emailclientapi/src/emailmessage.cpp
emailservices/emailclientapi/src/emailmessagesearch.cpp
emailservices/emailcommon/inc/CFSMailBox.h
emailservices/emailcommon/src/CFSMailBox.cpp
emailservices/emailcommon/src/CFSMailMessageBase.cpp
emailservices/emailcommon/src/CFSMailRequestHandler.cpp
emailservices/emaildebug/inc/emailtrace.h
emailservices/emailframework/inc/CFSMailPlugin.h
emailservices/emailframework/inc/CFSMailPlugin.inl
emailservices/emailstore/base_plugin/bwins/basepluginu.def
emailservices/emailstore/base_plugin/eabi/basepluginu.def
emailservices/emailstore/base_plugin/inc/BasePlugin.h
emailservices/emailstore/base_plugin/src/BasePlugin.cpp
emailservices/emailstore/base_plugin/src/basepluginmisc.cpp
emailservices/emailstore/message_store/debuglog/src/DebugLog.cpp
emailservices/nmailagent/inc/nmmailagent.h
emailservices/nmailagent/src/nmmailagent.cpp
emailservices/nmailbase/inc/nmcommon.h
emailservices/nmclientapi/bwins/nmailclientapiu.def
emailservices/nmclientapi/eabi/nmailclientapiu.def
emailservices/nmclientapi/inc/nmapiattachment_p.h
emailservices/nmclientapi/inc/nmapiengine.h
emailservices/nmclientapi/inc/nmapiheaders.h
emailservices/nmclientapi/inc/nmapimailboxsettings_p.h
emailservices/nmclientapi/inc/nmapimessage_p.h
emailservices/nmclientapi/inc/nmapimessagecontent_p.h
emailservices/nmclientapi/inc/nmapimessagemanager_p.h
emailservices/nmclientapi/inc/nmapioperationcreatedraftmessage.h
emailservices/nmclientapi/inc/nmapioperationsendmessage.h
emailservices/nmclientapi/inc/nmapipopimapsettingsmanager.h
emailservices/nmclientapi/inc/nmapisettingsmanager_p.h
emailservices/nmclientapi/inc/nmapitextcontent_p.h
emailservices/nmclientapi/nmclientapi.pro
emailservices/nmclientapi/src/nmapiattachment.cpp
emailservices/nmclientapi/src/nmapiattachment_p.cpp
emailservices/nmclientapi/src/nmapiemailservice.cpp
emailservices/nmclientapi/src/nmapiengine.cpp
emailservices/nmclientapi/src/nmapimailboxsettings.cpp
emailservices/nmclientapi/src/nmapimailboxsettings_p.cpp
emailservices/nmclientapi/src/nmapimessage.cpp
emailservices/nmclientapi/src/nmapimessage_p.cpp
emailservices/nmclientapi/src/nmapimessagecontent.cpp
emailservices/nmclientapi/src/nmapimessagecontent_p.cpp
emailservices/nmclientapi/src/nmapimessagemanager.cpp
emailservices/nmclientapi/src/nmapimessagemanager_p.cpp
emailservices/nmclientapi/src/nmapimessagesearch_p.cpp
emailservices/nmclientapi/src/nmapioperation.cpp
emailservices/nmclientapi/src/nmapioperationcreatedraftmessage.cpp
emailservices/nmclientapi/src/nmapioperationsendmessage.cpp
emailservices/nmclientapi/src/nmapipopimapsettingsmanager.cpp
emailservices/nmclientapi/src/nmapisettingsmanager.cpp
emailservices/nmclientapi/src/nmapisettingsmanager_p.cpp
emailservices/nmclientapi/src/nmapitextcontent.cpp
emailservices/nmclientapi/src/nmapitextcontent_p.cpp
emailservices/nmclientapi/src/nmapitypesconverter.cpp
emailservices/nmutilities/bwins/nmutilitiesu.def
emailservices/nmutilities/conf/2001E277.txt
emailservices/nmutilities/conf/2003EA97.txt
emailservices/nmutilities/conf/nmutilities.confml
emailservices/nmutilities/conf/nmutilities_200255BA.crml
emailservices/nmutilities/data/2001E277.txt
emailservices/nmutilities/data/2003EA97.txt
emailservices/nmutilities/data/aol.svg
emailservices/nmutilities/data/email_brand.qrc
emailservices/nmutilities/data/gmail.svg
emailservices/nmutilities/data/icons/aol.svg
emailservices/nmutilities/data/icons/gmail.svg
emailservices/nmutilities/data/icons/microsoft.svg
emailservices/nmutilities/data/icons/ovi.svg
emailservices/nmutilities/data/icons/yahoo.svg
emailservices/nmutilities/data/microsoft.svg
emailservices/nmutilities/data/nmutilities.confml
emailservices/nmutilities/data/nmutilities_200255BA.crml
emailservices/nmutilities/data/ovi.svg
emailservices/nmutilities/data/yahoo.svg
emailservices/nmutilities/eabi/nmutilitiesu.def
emailservices/nmutilities/inc/emailmailboxinfo.h
emailservices/nmutilities/inc/emailmailboxinfo_p.h
emailservices/nmutilities/inc/emailmru.h
emailservices/nmutilities/inc/nmcenrepkeys.h
emailservices/nmutilities/inc/nmcontacthistorymodel_p.h
emailservices/nmutilities/inc/nmuriparser.h
emailservices/nmutilities/inc/nmutilitiescommonheaders.h
emailservices/nmutilities/nmutilities.pro
emailservices/nmutilities/src/emailmailboxinfo.cpp
emailservices/nmutilities/src/emailmailboxinfo_p.cpp
emailservices/nmutilities/src/emailmru.cpp
emailservices/nmutilities/src/nmcontacthistorymodel.cpp
emailservices/nmutilities/src/nmcontacthistorymodel_p.cpp
emailservices/nmutilities/src/nmuriparser.cpp
emailservices/nmutilities/tsrc/unittests/unittest_emailmru/emailtrace.h
emailservices/nmutilities/tsrc/unittests/unittest_emailmru/unittest_emailmru.cpp
emailservices/nmutilities/tsrc/unittests/unittest_emailmru/unittest_emailmru.h
emailservices/nmutilities/tsrc/unittests/unittest_emailmru/unittest_emailmru.pro
emailservices/nmutilities/tsrc/unittests/unittest_emailmru/xqstubs.cpp
emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel/nmcnthistorystub.cpp
emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel/nmcontacthistorymodel_p.h
emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel/unittest_nmcontacthistorymodel.cpp
emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel/unittest_nmcontacthistorymodel.h
emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel/unittest_nmcontacthistorymodel.pro
emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/emailmru_stub.cpp
emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/unittest_nmcontacthistorymodel_p.cpp
emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/unittest_nmcontacthistorymodel_p.h
emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/unittest_nmcontacthistorymodel_p.pro
emailuis/nmailui/conf/nmeditorview.docml
emailuis/nmailui/inc/nmeditorcontent.h
emailuis/nmailui/inc/nmeditorheader.h
emailuis/nmailui/inc/nmeditorview.h
emailuis/nmailui/inc/nmmessagelistview.h
emailuis/nmailui/inc/nmrecipientfield.h
emailuis/nmailui/inc/nmuiheaders.h
emailuis/nmailui/inc/nmutilities.h
emailuis/nmailui/inc/nmviewerserviceinterface.h
emailuis/nmailui/inc/nmviewerview.h
emailuis/nmailui/src/nmapplication.cpp
emailuis/nmailui/src/nmeditorcontent.cpp
emailuis/nmailui/src/nmeditorheader.cpp
emailuis/nmailui/src/nmeditorview.cpp
emailuis/nmailui/src/nmmailboxserviceinterface.cpp
emailuis/nmailui/src/nmmessagelistview.cpp
emailuis/nmailui/src/nmmessagelistviewitem.cpp
emailuis/nmailui/src/nmrecipientfield.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/translations/mail.qm
emailuis/nmailui/translations/mail.ts
emailuis/nmailuiengine/bwins/nmailuiengineu.def
emailuis/nmailuiengine/eabi/nmailuiengineu.def
emailuis/nmailuiengine/src/nmuiengine.cpp
emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def
emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def
emailuis/nmailuiwidgets/inc/nmailuiwidgetsheaders.h
emailuis/nmailuiwidgets/inc/nmautofilllistview.h
emailuis/nmailuiwidgets/inc/nmautofilllistviewitem.h
emailuis/nmailuiwidgets/inc/nmeditortextedit.h
emailuis/nmailuiwidgets/inc/nmhtmllineedit.h
emailuis/nmailuiwidgets/inc/nmrecipientlineedit.h
emailuis/nmailuiwidgets/nmailuiwidgets.pro
emailuis/nmailuiwidgets/nmailuiwidgets.qrc
emailuis/nmailuiwidgets/resources/nmautofilllistview.docml
emailuis/nmailuiwidgets/resources/nmautofilllistviewitem.css
emailuis/nmailuiwidgets/resources/nmautofilllistviewitem.widgetml
emailuis/nmailuiwidgets/resources/nmrecipientlineedit.css
emailuis/nmailuiwidgets/resources/nmrecipientlineedit.widgetml
emailuis/nmailuiwidgets/src/nmautofilllistview.cpp
emailuis/nmailuiwidgets/src/nmautofilllistviewitem.cpp
emailuis/nmailuiwidgets/src/nmeditortextedit.cpp
emailuis/nmailuiwidgets/src/nmhtmllineedit.cpp
emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp
emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp
emailuis/nmframeworkadapter/src/nmfwamessagepartfetchingoperation.cpp
emailuis/nmframeworkadapter/src/nmmailboxsearchobserver.cpp
emailuis/nmhswidget/conf/nmhswidget.docml
emailuis/nmhswidget/inc/nmhswidget.h
emailuis/nmhswidget/inc/nmhswidgetconsts.h
emailuis/nmhswidget/inc/nmhswidgetlistviewitem.h
emailuis/nmhswidget/src/nmhswidget.cpp
emailuis/nmhswidget/src/nmhswidgetemailengine.cpp
emailuis/nmhswidget/src/nmhswidgetlistviewitem.cpp
emailuis/nmhswidget/src/nmhswidgettitlerow.cpp
emailuis/nmsettingui/inc/nmmailboxsettingview.h
emailuis/nmsettingui/src/nmmailboxsettingview.cpp
ipsservices/ipssosaoplugin/src/IpsSosAOPopAgent.cpp
ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h
ipsservices/ipssosplugin/ipssosplugin.pro
ipsservices/ipssosplugin/src/ipsplgsearch.cpp
ipsservices/ipssosplugin/src/ipsplgsearchop.cpp
ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp
ipsservices/ipssosplugin/src/ipsplgsyncstatehandler.cpp
ipsservices/nmipssettings/inc/nmipssettingshelper.h
ipsservices/nmipssettings/inc/nmipssettingsplugin.h
ipsservices/nmipssettings/src/nmipssettingshelper.cpp
ipsservices/nmipssettings/src/nmipssettingsplugin.cpp
ipsservices/nmipssettings/translations/mailips.qm
ipsservices/nmipssettings/translations/mailips.ts
--- a/email_plat/contact_history_model_api/inc/nmcontacthistorymodel.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/email_plat/contact_history_model_api/inc/nmcontacthistorymodel.h	Thu Sep 30 11:43:07 2010 +0300
@@ -17,6 +17,7 @@
 #ifndef NMCONTACTHISTORYMODEL_H
 #define NMCONTACTHISTORYMODEL_H
 
+#include <QMetaType>
 #include <QAbstractListModel>
 #include <QSharedDataPointer>
 
@@ -50,7 +51,7 @@
 public:
     NmContactHistoryModelItem();
     NmContactHistoryModelItem(const NmContactHistoryModelItem &other);
-    ~NmContactHistoryModelItem();
+    virtual ~NmContactHistoryModelItem();
 
 public:
     // contact id is 0xDEAD if not associated with a contact item
@@ -93,7 +94,7 @@
     /**
      * Destructor
      */
-    ~NmContactHistoryModel();
+    virtual ~NmContactHistoryModel();
 
 public: // From QAbstractItemModel
 
@@ -101,13 +102,13 @@
      * Get number of rows currently in the model.
      * @return number of rows
      */
-    virtual int rowCount(const QModelIndex &parent) const;
+    int rowCount(const QModelIndex &parent) const;
 
     /**
      * Get various data from the model. Fetched data type is defined
      * by role input parameter. Only Qt::DisplayRole is supported.
      */
-    virtual QVariant data(const QModelIndex &index, int role) const;
+    QVariant data(const QModelIndex &index, int role) const;
 
 signals:
 
@@ -137,6 +138,9 @@
      */
     NmContactHistoryModelPrivate *d_ptr;
 
+private:
+
+    friend class TestNmContactHistoryModel;
 };
 
 #endif //NMCONTACTHISTORYMODEL_H
--- a/email_plat/contact_history_model_api/inc/nmcontacthistorymodelcommon.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/email_plat/contact_history_model_api/inc/nmcontacthistorymodelcommon.h	Thu Sep 30 11:43:07 2010 +0300
@@ -23,10 +23,14 @@
         PhoneNumberModel
     };
 
- #if defined(NMCHMAPI_LIBRARY)
- #define NMCHMAPI_EXPORT Q_DECL_EXPORT
- #else
- #define NMCHMAPI_EXPORT Q_DECL_IMPORT
- #endif
+#if defined(NMCHMAPI_LIBRARY)
+#  define  NMCHMAPI_EXPORT Q_DECL_EXPORT
+#else
+#  if defined(NMCHMAPI_LIBRARY_NO_LIBRARY)
+#    define NMCHMAPI_EXPORT
+#  else
+#    define NMCHMAPI_EXPORT Q_DECL_IMPORT
+#  endif
+#endif
 
 #endif /* NMCONTACTHISTORYMODELCOMMONHEADERS_H_ */
--- a/email_plat/email_client_api/email_client_api.pri	Wed Sep 15 17:47:19 2010 +0300
+++ b/email_plat/email_client_api/email_client_api.pri	Thu Sep 30 11:43:07 2010 +0300
@@ -17,19 +17,19 @@
 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)"
+            "email_client_api/inc/emailinterfacefactory.h       APP_LAYER_PLATFORM_EXPORT_PATH(emailinterfacefactory.h)" \
+            "email_client_api/inc/emailinterfacefactory.inl     APP_LAYER_PLATFORM_EXPORT_PATH(emailinterfacefactory.inl)" \
+            "email_client_api/inc/emailclientapi.hrh            APP_LAYER_PLATFORM_EXPORT_PATH(emailclientapi.hrh)" \
+            "email_client_api/inc/emailapidefs.h                APP_LAYER_PLATFORM_EXPORT_PATH(emailapidefs.h)" \
+            "email_client_api/inc/emailsorting.h                APP_LAYER_PLATFORM_EXPORT_PATH(emailsorting.h)" \
+            "email_client_api/inc/mmessageiterator.h            APP_LAYER_PLATFORM_EXPORT_PATH(mmessageiterator.h)" \
+            "email_client_api/inc/memailclientapi.h             APP_LAYER_PLATFORM_EXPORT_PATH(memailclientapi.h)" \
+            "email_client_api/inc/memailmailbox.h               APP_LAYER_PLATFORM_EXPORT_PATH(memailmailbox.h)" \
+            "email_client_api/inc/memailmessage.h               APP_LAYER_PLATFORM_EXPORT_PATH(memailmessage.h)" \
+            "email_client_api/inc/memailfolder.h                APP_LAYER_PLATFORM_EXPORT_PATH(memailfolder.h)" \
+            "email_client_api/inc/memailaddress.h               APP_LAYER_PLATFORM_EXPORT_PATH(memailaddress.h)" \
+            "email_client_api/inc/memailcontent.h               APP_LAYER_PLATFORM_EXPORT_PATH(memailcontent.h)" \
+            "email_client_api/inc/memailmessagesearch.h         APP_LAYER_PLATFORM_EXPORT_PATH(memailmessagesearch.h)" \
+            "email_client_api/inc/mmailboxsyncobserver.h        APP_LAYER_PLATFORM_EXPORT_PATH(mmailboxsyncobserver.h)" \
+            "email_client_api/inc/mmailboxcontentobserver.h     APP_LAYER_PLATFORM_EXPORT_PATH(mmailboxcontentobserver.h)"
 }
--- a/email_plat/email_client_api/emailapidefs.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/emailclientapi.hrh	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/emailinterfacefactory.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/emailinterfacefactory.inl	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  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
--- a/email_plat/email_client_api/emailsorting.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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/inc/emailapidefs.h	Thu Sep 30 11:43:07 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/inc/emailclientapi.hrh	Thu Sep 30 11:43:07 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/inc/emailinterfacefactory.h	Thu Sep 30 11:43:07 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/inc/emailinterfacefactory.inl	Thu Sep 30 11:43:07 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/inc/emailsorting.h	Thu Sep 30 11:43:07 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/inc/memailaddress.h	Thu Sep 30 11:43:07 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/inc/memailclientapi.h	Thu Sep 30 11:43:07 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/inc/memailcontent.h	Thu Sep 30 11:43:07 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/inc/memailfolder.h	Thu Sep 30 11:43:07 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/inc/memailmailbox.h	Thu Sep 30 11:43:07 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/inc/memailmessage.h	Thu Sep 30 11:43:07 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/inc/memailmessagesearch.h	Thu Sep 30 11:43:07 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/inc/mmailboxcontentobserver.h	Thu Sep 30 11:43:07 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/inc/mmailboxsyncobserver.h	Thu Sep 30 11:43:07 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/inc/mmessageiterator.h	Thu Sep 30 11:43:07 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_client_api/memailaddress.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/memailclientapi.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/memailcontent.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,289 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/memailfolder.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/memailmailbox.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/memailmessage.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,262 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/memailmessagesearch.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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.
--- a/email_plat/email_client_api/mmailboxcontentobserver.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/mmailboxsyncobserver.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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
--- a/email_plat/email_client_api/mmessageiterator.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: 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_services_api/email_services_api.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Email services API to be used through Qt Highway.
-*
-*/
-
-#ifndef EMAIL_SERVICES_API_H
-#define EMAIL_SERVICES_API_H
-
-// Qt
-#include <QMetaType>
-#include <QString>
-
-// Platform
-#include <xqaiwdeclplat.h>
-
-
-/*!
-    The flags which can be used with the service interfaces.
-*/
-enum EmailServiceInterfaceFlags {
-    EmailNoFlags = 0x0,
-    EmailBackReturnsToMessageList = 0x1
-};
-
-Q_DECLARE_METATYPE(EmailServiceInterfaceFlags)
-
-
-/*!
-    Keys for mail send service data.
-*/
-static const QString emailSendSubjectKey = "subject";
-static const QString emailSendToKey = "to";
-static const QString emailSendCcKey = "cc";
-static const QString emailSendBccKey = "bcc";
-
-// MIME type for body text, e.g. "text/html". If this key is not defined,
-// emailSendBodyValueKey is treated as "text/plain".
-static const QString emailSendBodyMimeTypeKey = "mimeType";
-
-static const QString emailSendBodyTextKey = "body";
-static const QString emailSendAttachmentKey = "attachment";
-
-/*!
-    Mail service name
-*/
-static const QString emailServiceName("nmail");
-
-/*!
-    Mail send service interface name.
-*/
-static const QString emailFullServiceNameSend = emailServiceName + "." + XQI_EMAIL_MESSAGE_SEND;
-
-/*!
-    Mailbox service full name.
-*/
-static const QString emailFullServiceNameMailbox = emailServiceName + "." + XQI_EMAIL_INBOX_VIEW;
-
-
-/*!
-    Message service full name.
-*/
-static const QString emailFullServiceNameMessage = emailServiceName + "." + XQI_EMAIL_MESSAGE_VIEW;
-
-
-/*!
-    \fn send(QVariant data)
-    \param data The email message data e.g. recipients.
-    \return 1 if success, 0 otherwise.
-
-    The method opens the mail editor view and adds the given data into the view.
-
-    The data is of type QMap<QString, QVariant> where the keys define the type
-    of the data (e.g. recipient or mail subject). The values in the map for
-    recipients (to, cc and bcc) may contain either strings (for a single
-    recipient) or string lists (for multiple recipients).
-
-    The method supports the following mail data:
-        - recipients (to, cc and bcc) and
-        - mail subject.
-
-    This service is used via Qt Highway.
-
-    Usage example:
-
-        bool syncronous;
-
-        XQServiceRequest request(emailFullServiceNameSend,
-                                 XQOP_EMAIL_MESSAGE_SEND,
-                                 syncronous);
-
-        QMap<QString, QVariant> map;
-
-        QStringList recipients;
-        QString subject;
-
-        ...
-
-        map.insert(emailSendToKey, QVariant::fromValue(recipients));
-        map.insert(emailSendSubjectKey, QVariant(subject));
-
-        QList<QVariant> data;
-        data.append(map);
-        request.setArguments(data);
-
-        QVariant returnValue;
-        bool retVal = request.send(returnValue);
-*/
-
-
-/*!
-    \fn displayInboxByMailboxId(QVariant data)
-    \param data The ID of the mailbox to open
-    \return 1 if mailbox opened. 0 if mailbox ID was incorrect.
-
-    This method opens a view for displaying the inbox of the given mailbox.
-    It is intended to be used via Qt Highway.
-
-    Usage example:
-
-    XQServiceRequest request(
-        emailFullServiceNameMailbox,
-        XQOP_EMAIL_INBOX_VIEW,
-        syncronous);
-
-    QList<QVariant> list;
-    list.append(QVariant(id));
-    request.setArguments(list);
-
-    QVariant returnValue;
-    bool rval = request.send(returnValue);
-*/
-
-
-/*!
-    \fn viewMessage(QVariant idList, QVariant flags)
-
-    This method opens the mail viewer view containing the specific message.
-    It is intended to be used via Qt Highway.
-
-
-    \param idList A list containing the required IDs for locating the wanted
-                  message. The ID are the following (and should be placed in
-                  the following order): mailbox ID, folder ID and message ID.
-
-    \param flags The flags which can contain any values defined by
-                 EmailServiceInterfaceFlags enumeration. The only flag
-                 acknowledged by this interface is EmailBackReturnsToMessageList,
-                 which, if given, will add the message list (according to the
-                 given mailbox and folder IDs) into the view stack. This means
-                 that when the back button is pressed from the viewer view, the
-                 message list view will be shown.
-
-    \return 1 if message was opened. 0 if one of the IDs was incorrect.
-
-
-    Usage example:
-
-    XQServiceRequest request(
-       emailFullServiceNameMessage,
-       XQOP_EMAIL_MESSAGE_VIEW,
-       synchronous);
-
-    QVariantList idList;
-    idList.append(mailboxId);
-    idList.append(folderId);
-    idList.append(messageId);
-    QVariant idListAsVariant = QVariant::fromValue(idList);
-
-    // Add the message list view into the view stack. If the list view should
-    // not be added into the stack, use "quint64 flags(EmailNoFlags);" instead.
-    quint64 flags(EmailBackReturnsToMessageList);
-
-    QList<QVariant> argumentList;
-    argumentList.append(idListAsVariant);
-    argumentList.append(flags);
-
-    request.setArguments(argumentList);
-
-    QVariant returnValue;
-
-    bool rval = request.send(returnValue);
-*/
-
-
-#endif // EMAIL_SERVICES_API_H
--- a/email_plat/email_services_api/email_services_api.pri	Wed Sep 15 17:47:19 2010 +0300
+++ b/email_plat/email_services_api/email_services_api.pri	Thu Sep 30 11:43:07 2010 +0300
@@ -18,5 +18,5 @@
 symbian*: { 
     # Build.inf rules
     BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
-     "email_services_api/email_services_api.h APP_LAYER_PLATFORM_EXPORT_PATH(email_services_api.h)"
+     "email_services_api/inc/email_services_api.h APP_LAYER_PLATFORM_EXPORT_PATH(email_services_api.h)"
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/email_services_api/inc/email_services_api.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,197 @@
+/*
+* 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 services API to be used through Qt Highway.
+*
+*/
+
+#ifndef EMAIL_SERVICES_API_H
+#define EMAIL_SERVICES_API_H
+
+// Qt
+#include <QMetaType>
+#include <QString>
+
+// Platform
+#include <xqaiwdeclplat.h>
+
+
+/*!
+    The flags which can be used with the service interfaces.
+*/
+enum EmailServiceInterfaceFlags {
+    EmailNoFlags = 0x0,
+    EmailBackReturnsToMessageList = 0x1
+};
+
+Q_DECLARE_METATYPE(EmailServiceInterfaceFlags)
+
+
+/*!
+    Keys for mail send service data.
+*/
+static const QString emailSendSubjectKey = "subject";
+static const QString emailSendToKey = "to";
+static const QString emailSendCcKey = "cc";
+static const QString emailSendBccKey = "bcc";
+
+// MIME type for body text, e.g. "text/html". If this key is not defined,
+// emailSendBodyValueKey is treated as "text/plain".
+static const QString emailSendBodyMimeTypeKey = "mimeType";
+
+static const QString emailSendBodyTextKey = "body";
+static const QString emailSendAttachmentKey = "attachment";
+
+/*!
+    Mail service name
+*/
+static const QString emailServiceName("nmail");
+
+/*!
+    Mail send service interface name.
+*/
+static const QString emailFullServiceNameSend = emailServiceName + "." + XQI_EMAIL_MESSAGE_SEND;
+
+/*!
+    Mailbox service full name.
+*/
+static const QString emailFullServiceNameMailbox = emailServiceName + "." + XQI_EMAIL_INBOX_VIEW;
+
+
+/*!
+    Message service full name.
+*/
+static const QString emailFullServiceNameMessage = emailServiceName + "." + XQI_EMAIL_MESSAGE_VIEW;
+
+
+/*!
+    \fn send(QVariant data)
+    \param data The email message data e.g. recipients.
+    \return 1 if success, 0 otherwise.
+
+    The method opens the mail editor view and adds the given data into the view.
+
+    The data is of type QMap<QString, QVariant> where the keys define the type
+    of the data (e.g. recipient or mail subject). The values in the map for
+    recipients (to, cc and bcc) may contain either strings (for a single
+    recipient) or string lists (for multiple recipients).
+
+    The method supports the following mail data:
+        - recipients (to, cc and bcc) and
+        - mail subject.
+
+    This service is used via Qt Highway.
+
+    Usage example:
+
+        bool syncronous;
+
+        XQServiceRequest request(XQI_EMAIL_MESSAGE_SEND,
+                                 XQOP_EMAIL_MESSAGE_SEND,
+                                 syncronous);
+
+        QMap<QString, QVariant> map;
+
+        QStringList recipients;
+        QString subject;
+
+        ...
+
+        map.insert(emailSendToKey, QVariant::fromValue(recipients));
+        map.insert(emailSendSubjectKey, QVariant(subject));
+
+        QList<QVariant> data;
+        data.append(map);
+        request.setArguments(data);
+
+        QVariant returnValue;
+        bool retVal = request.send(returnValue);
+*/
+
+
+/*!
+    \fn displayInboxByMailboxId(QVariant data)
+    \param data The ID of the mailbox to open
+    \return 1 if mailbox opened. 0 if mailbox ID was incorrect.
+
+    This method opens a view for displaying the inbox of the given mailbox.
+    It is intended to be used via Qt Highway.
+
+    Usage example:
+
+    XQServiceRequest request(
+        XQI_EMAIL_INBOX_VIEW,
+        XQOP_EMAIL_INBOX_VIEW,
+        syncronous);
+
+    QList<QVariant> list;
+    list.append(QVariant(id));
+    request.setArguments(list);
+
+    QVariant returnValue;
+    bool rval = request.send(returnValue);
+*/
+
+
+/*!
+    \fn viewMessage(QVariant idList, QVariant flags)
+
+    This method opens the mail viewer view containing the specific message.
+    It is intended to be used via Qt Highway.
+
+
+    \param idList A list containing the required IDs for locating the wanted
+                  message. The ID are the following (and should be placed in
+                  the following order): mailbox ID, folder ID and message ID.
+
+    \param flags The flags which can contain any values defined by
+                 EmailServiceInterfaceFlags enumeration. The only flag
+                 acknowledged by this interface is EmailBackReturnsToMessageList,
+                 which, if given, will add the message list (according to the
+                 given mailbox and folder IDs) into the view stack. This means
+                 that when the back button is pressed from the viewer view, the
+                 message list view will be shown.
+
+    \return 1 if message was opened. 0 if one of the IDs was incorrect.
+
+
+    Usage example:
+
+    XQServiceRequest request(
+       XQI_EMAIL_MESSAGE_VIEW,
+       XQOP_EMAIL_MESSAGE_VIEW,
+       synchronous);
+
+    QVariantList idList;
+    idList.append(mailboxId);
+    idList.append(folderId);
+    idList.append(messageId);
+    QVariant idListAsVariant = QVariant::fromValue(idList);
+
+    // Add the message list view into the view stack. If the list view should
+    // not be added into the stack, use "quint64 flags(EmailNoFlags);" instead.
+    quint64 flags(EmailBackReturnsToMessageList);
+
+    QList<QVariant> argumentList;
+    argumentList.append(idListAsVariant);
+    argumentList.append(flags);
+
+    request.setArguments(argumentList);
+
+    QVariant returnValue;
+
+    bool rval = request.send(returnValue);
+*/
+
+
+#endif // EMAIL_SERVICES_API_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapiattachment.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,51 @@
+/*
+ * 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 attachment public header.
+ */
+
+#ifndef NMAPIATTACHMENT_H_
+#define NMAPIATTACHMENT_H_
+
+#include <QString>
+#include <QSharedDataPointer>
+#include <xqsharablefile.h>
+#include <nmapimessagecontent.h>
+#include <nmapidef.h>
+
+namespace EmailClientApi
+{
+class NmApiAttachmentPrivate;
+
+class NMAPI_EXPORT NmApiAttachment : public NmApiMessageContent
+{
+public:
+    NmApiAttachment();
+    NmApiAttachment(const NmApiAttachment &attachment);
+    virtual ~NmApiAttachment();
+
+    NmApiAttachment& operator=(const NmApiAttachment &attachment);    
+
+    QString fileName();
+    XQSharableFile file();
+
+    void setFileName(const QString &fileName);
+
+private:
+    
+    QSharedDataPointer<NmApiAttachmentPrivate> d;
+};
+}
+
+#endif /* NMAPIATTACHMENT_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapicommon.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,178 @@
+/*
+ * 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 NMAPICOMMON_H_
+#define NMAPICOMMON_H_
+
+#include <QMetaType>
+
+namespace EmailClientApi
+{
+    /*!
+       Enum to describe mailbox events
+     */
+    enum NmApiMailboxEvent
+    {
+        MailboxCreated, MailboxDeleted
+    };
+
+    /*!
+        Email to message priority
+     */
+    enum NmApiMessagePriority
+    {
+        NmApiMessagePriorityLow,
+        NmApiMessagePriorityNormal,
+        NmApiMessagePriorityHigh
+    };
+
+    /*!
+        Enum to message flags
+     */
+    enum NmApiMessageFlag 
+    {
+        NmApiMessageFlagRead = 1,
+        NmApiMessageFlagReadLocally = 2,
+        NmApiMessageFlagLow = 4,
+        NmApiMessageFlagImportant = 8,
+        NmApiMessageFlagFollowUpComplete = 16,
+        NmApiMessageFlagFollowUp = 32,
+        NmApiMessageFlagAttachments = 64,
+        NmApiMessageFlagMultiple = 128,
+        NmApiMessageFlagCalendarMsg = 256,
+        NmApiMessageFlagAnswered = 512,
+        NmApiMessageFlagForwarded = 1024,
+        NmApiMessageFlagOnlyToMe = 2048,
+        NmApiMessageFlagRemoteDeleted = 4096,
+        NmApiMessageFlagHasMsgSender = 8192
+    };
+    Q_DECLARE_FLAGS(NmApiMessageFlags, NmApiMessageFlag)
+    Q_DECLARE_OPERATORS_FOR_FLAGS(NmApiMessageFlags)
+
+    /*!
+       Enum to describe message events.
+     */
+    enum NmApiMessageEvent 
+    {
+        MessageCreated,
+        MessageDeleted,
+        MessageChanged
+    };
+    
+    /*!
+       Enum to describe type of email folder 
+     */
+    enum NmApiEmailFolderType
+    {
+        Inbox, Drafts, Outbox, Sent, Deleted, EOther
+    };
+
+    /*!
+        Email list sorting options
+     */
+    enum NmApiMailSortField
+        {
+        MailDontCare,            // user accepts any sort order
+        MailSortByDate,          // sorting is done by date
+        MailSortBySender,        // sorting is done by sender
+        MailSortByRecipient,     // sorting is done by recipients
+        MailSortBySubject,       // sorting is done by subject
+        MailSortByPriority,      // sorting is done by priority
+        MailSortByFlagStatus,    // follow up and completed   
+        MailSortByUnread,        // sorting is based on unread
+        MailSortBySize,          // sorting is done by size
+        MailSortByAttachment     // sorting is based on if message has attachments
+        };
+
+    /*!
+        Email list sort order
+     */
+    enum NmApiMailSortOrder
+        {
+        MailDescending,
+        MailAscending    
+        };
+
+
+    /*!
+        List of message related operations status
+     */
+    enum NmApiOperationStatus 
+    {
+        NotStarted,
+        Pending,
+        Succeeded,
+        Failed,
+        Canceled
+    };
+    
+    /*!
+        List of message related operations
+     */
+    enum NmApiOperationType
+    {
+        CreateDraftMessage,
+        CreateForwardMessage,
+        CreateReplyMessage,
+        MoveMessages,
+        SaveMessage,
+        DeleteMessages,
+        FetchMessage,
+        SendMessage,
+        CreateAttachment,
+        RemoveAttachment,
+        FetchAttachment
+    };    
+    
+    
+    /*!
+        Sort criteria definion Class for searching email messages
+     */
+    class NmApiMailSortCriteria 
+        {
+        public:
+            NmApiMailSortField iField;
+            NmApiMailSortOrder iOrder;
+        };
+    
+    /*!
+        NmApi error codes
+    */
+    const int NmApiNoError = 0;
+    const int NmApiNotFoundError = -1;
+    const int NmApiGeneralError = -2;
+    const int NmApiCancelError = -3;
+    
+    /*!
+        NmApi predefined constants for ContentTypes
+    */
+    const QString NmApiContentTypeMultipartMixed = "multipart/mixed";
+    const QString NmApiContentTypeMultipartAlternative = "multipart/alternative";
+    const QString NmApiContentTypeMultipartDigest = "multipart/digest";
+    const QString NmApiContentTypeMultipartParallel = "multipart/parallel";
+    const QString NmApiContentTypeMultipartRelated =  "multipart/related";
+    const QString NmApiContentTypeTextPlain = "text/plain";
+    const QString NmApiContentTypeTextHtml = "text/html";
+    const QString NmApiContentTypeTypeMessage = "message/rfc822";
+    const QString NmApiContentTypeParamName = " name=";
+    const QString NmApiContentTypeParamCharset = " charset=";
+}
+Q_DECLARE_METATYPE (EmailClientApi::NmApiMailboxEvent)
+Q_DECLARE_METATYPE(EmailClientApi::NmApiMessageEvent)
+Q_DECLARE_METATYPE (EmailClientApi::NmApiEmailFolderType)
+
+#endif /* NMAPICOMMON_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapidef.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,35 @@
+/*
+ * 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 NMAPIENGINEDEF_H_
+#define NMAPIENGINEDEF_H_
+
+#include <QtGlobal>
+
+#if defined(Q_OS_WIN)
+#define NMAPI_EXPORT __declspec(dllexport)
+#else
+
+#if defined(BUILD_EMAIL_API_DLL)
+#define NMAPI_EXPORT Q_DECL_EXPORT
+#else
+#define NMAPI_EXPORT Q_DECL_IMPORT
+#endif
+
+#endif
+
+#endif /* NMAPIENGINEDEF_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapiemailaddress.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,83 @@
+/*
+ * 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: 
+ *
+ */
+
+#ifndef NMAPIEMAILADDRESS_H
+#define NMAPIEMAILADDRESS_H
+
+#include <QExplicitlySharedDataPointer>
+#include <nmapidef.h>
+
+/*!
+   Email address
+ */
+
+class QString;
+
+namespace EmailClientApi
+{
+
+class NmApiEmailAddressPrivate;
+
+class NMAPI_EXPORT NmApiEmailAddress
+{
+public:
+    /*!
+       Constructor for NmApiEmailAddress class
+     */
+    NmApiEmailAddress();
+    virtual ~NmApiEmailAddress();
+
+    /*!
+       copying constructor for NmApiEmailAddress
+     */
+    NmApiEmailAddress(const NmApiEmailAddress &addr);
+
+    /*!
+       Assignment operator
+     */
+    NmApiEmailAddress &operator=(const NmApiEmailAddress &addr);
+
+    /*!
+       Compares data from \a addr
+     */
+    bool operator==(const NmApiEmailAddress &addr);
+
+    /*
+       getter for displayname
+     */
+    QString displayName() const;
+
+    /*!
+       getter for address
+     */
+    QString address() const;
+
+    /*!
+       setter for displayname 
+     */
+    void setDisplayName(const QString &displayName);
+
+    /*!
+       setter for address
+     */
+    void setAddress(const QString &address);
+private:
+    QExplicitlySharedDataPointer<NmApiEmailAddressPrivate> d;
+};
+}
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapiemailservice.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,111 @@
+/*
+ * 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 NMAPIEMAILSERVICE_H
+#define NMAPIEMAILSERVICE_H
+
+#include <nmapidef.h>
+#include <QObject>
+
+class NmApiEngine;
+
+/*!
+   Client that wants to access mailboxes, messages and receive related events
+   use this class as "entry point". 
+ */
+
+namespace EmailClientApi
+{
+
+class NmApiFolder;
+class NmApiMessageEnvelope;
+class NmApiMailbox;
+class NmApiMessage;
+
+class NMAPI_EXPORT NmApiEmailService : public QObject
+{
+    Q_OBJECT
+public:
+
+    /*!
+       constructor for NmApiEmailService
+     */
+    NmApiEmailService(QObject* parent);
+
+    /*!
+       destructor for NmApiEmailService
+     */
+    virtual ~NmApiEmailService();
+
+    /*!
+       Initialises email service. this must be called and initialised signal received 
+       before services of the library are used.
+     */
+    void initialise();
+
+    /*!
+        frees resources.
+     */
+    void uninitialise();
+
+    /*!
+       gets mail message envelope by id (see also NmApiEventNotifier)
+     */
+    bool getEnvelope(const quint64 mailboxId, 
+                     const quint64 folderId, 
+                     const quint64 envelopeId, 
+                     EmailClientApi::NmApiMessageEnvelope &envelope);
+
+    /*!
+        gets mailbox folder by id (see also NmApiEventNotifier)
+     */
+    bool getFolder(const quint64 mailboxId,
+                    const quint64 folderId,
+                    EmailClientApi::NmApiFolder &mailboxFolder);
+
+    /*!
+        gets mailbox info by id (see also NmApiEventNotifier)
+     */
+    bool getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo);
+
+    /*!
+       gets mail message by id (see also NmApiEventNotifier)
+     */
+    bool getMessage(const quint64 mailboxId, 
+                     const quint64 folderId, 
+                     const quint64 messageId, 
+                     EmailClientApi::NmApiMessage &message);
+
+
+    
+    /*!
+       returns isrunning flag value
+     */
+    bool isRunning() const;
+    signals:
+    /*!
+       this signal is emitted when initialisation is completed
+       boolean argument tells if initialisation succeeded
+     */
+    void initialized(bool);
+
+private:
+    NmApiEngine *mEngine;
+    bool mIsRunning;
+};
+}
+#endif /* NMAPIEMAILSERVICE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapienvelopelisting.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,105 @@
+/*
+ * 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 NMAPIENVELOPELISTING_H_
+#define NMAPIENVELOPELISTING_H_
+
+#include <QList>
+
+#include <nmapimessagetask.h>
+#include <nmapidef.h>
+
+class QObject;
+
+class NmApiEngine;
+
+// list messages in particular folder.
+namespace EmailClientApi
+{
+class NmApiEnvelopeListingPrivate;
+class NmApiMessageEnvelope;
+
+class NMAPI_EXPORT NmApiEnvelopeListing : public NmApiMessageTask
+{
+    Q_OBJECT
+public:
+    /*!
+       Constructor of class. It set start values.
+     */
+    NmApiEnvelopeListing(QObject *parent, const quint64 folderId, const quint64 mailboxId);
+
+    /*!
+       Destructor of class. It release engine to be safe if manual releasing won't work.
+     */
+    ~NmApiEnvelopeListing();
+
+    enum {EnvelopeListingFailed = -1};
+
+    /*! 
+       \brief Returns results after envelopesListed signal is received.
+       
+        Caller gets ownership of envelopes. Returns true if results were available.
+        Before calling this method, cancel and start should be called, 
+        because after second call it returns empty list.
+        It also at start clear inputlist of NmApiMessageEnvelope.
+        
+        \param envelopes envelopes
+     */
+    bool getEnvelopes(QList<EmailClientApi::NmApiMessageEnvelope> &envelopes);
+
+    /*!
+       \brief Return info if listing is running
+     */
+    bool isRunning() const;
+    signals:
+    /*!
+       Emitted when listing is available, count is number of envelopes found
+       or EnvelopeListingFailed if listing failed
+     */
+    void envelopesListed(qint32 count);
+
+public slots:
+    /*!
+       \brief Starts gathering envelopes list.
+       
+       In first turn it will get whole folderlist. 
+       If start works, it do nothing.
+       
+       To asynchronous operation ce be used \sa QTimer::singleShot on this method.
+       Example:
+       \code
+       QTimer::singleShot(0,nmEnvelopeListing,SLOT(start());
+       \endcode
+       
+     */
+    bool start();
+
+    /*!
+       \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.
+     */
+    void cancel();
+
+private:
+    NmApiEnvelopeListingPrivate *mListingPrivate;
+};
+}
+
+#endif /* NMAPIENVELOPELISTING_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapieventnotifier.h	Thu Sep 30 11:43:07 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:
+ *
+ */
+
+#ifndef NMAPIEVENTNOTIFIER_H
+#define NMAPIEVENTNOTIFIER_H
+
+#include <nmapimessagetask.h>
+#include <nmapidef.h>
+#include <nmapicommon.h>
+
+struct NmApiEvent;
+
+namespace EmailClientApi
+{
+class NmApiEventNotifierPrivate;
+
+/*!
+   Notifier for mailbox and message events
+   
+   Example of use:
+   \code
+   NmApiEventNotifier *notifier = new NmApiEventNotifier(this);
+   notifier->start();
+   connect(notifier,SIGNAL(messageEvent(MessageEvent,quint64,quint64,QList<quint64>)),this,
+                    SLOT(processMessage(MessageEvent,quint64,quint64,QList<quint64>)),Qt::QueuedConnection);
+   \endcode
+   And then when want to end need to do:
+   \code
+   notifier->cancel();
+   delete notifier; // or notifier->deleteLater();
+   \endcode
+ */
+class NMAPI_EXPORT NmApiEventNotifier : public NmApiMessageTask
+{
+    Q_OBJECT
+public:
+    /*!
+       Constructor
+     */
+    NmApiEventNotifier(QObject *parent);
+
+    /*!
+       Destructor
+     */
+    virtual ~NmApiEventNotifier();
+
+    /*!
+       Start monitoring email events
+       
+       Return value informs if monitoring system is up
+     */
+    virtual bool start();
+
+    /*!
+       Cancels monitoring.
+       
+       In user responsibility is to cancel monitoring.
+       On end it clear buffer events and emits \sa NmApiMessageTask::canceled() signal.
+     */
+    virtual void cancel();
+
+    /*!
+       Checks if event notifier is running.
+     */
+    bool isRunning() const;
+
+    signals:
+    /*!
+       This signal is emited when buffer of mailbox events is ready to send. Buffer is list of mailbox events with id.
+       
+       
+       It emits signals grouped by events. So there will be as much signals as much there are events.
+       For safety when connect it need to use \sa Qt::QueuedConnection.
+       After that use \sa EmailClientApi::NmEmailService::getMailbox to get object.
+       \param event Event of mailbox
+       \param id List of mailbox ids where event occur.
+     */
+    void mailboxEvent(EmailClientApi::NmApiMailboxEvent event, QList<quint64> id);
+
+    /*!
+       This signal is emited when buffer of messages events is ready to send. Buffer is list of messages events with id.
+     *
+       It emits signals grouped by events, mailbox and folder. So there will be as much signals as much there are events.
+       For safety when connect it need to use \sa Qt::QueuedConnection.
+       After that use \sa EmailClientApi::NmApiEmailService::getEnvelope to get object.
+       
+       \param event Event of messages
+       \param mailboxId Message mailbox
+       \param folderId Message folder
+       \param envelopeIdList List of messages ids where event occur
+     */
+    void messageEvent(EmailClientApi::NmApiMessageEvent event, quint64 mailboxId, quint64 folderId, QList<quint64> envelopeIdList);
+
+public slots:
+    /*!
+       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.
+     */
+    void sendEventsFromBuffer();
+
+private:
+    NmApiEventNotifierPrivate *mNmApiEventNotifierPrivate;
+};
+
+}
+
+Q_DECLARE_METATYPE(QList<quint64>)
+
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapifolder.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,119 @@
+/*
+ * 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 NMAPIFOLDERINFO_H
+#define NMAPIFOLDERINFO_H
+
+#include <QExplicitlySharedDataPointer>
+#include <QList>
+#include <nmapidef.h>
+#include <nmapicommon.h>
+
+/*!
+   Mailbox metadata class
+ */
+namespace EmailClientApi
+{
+
+class NmApiFolderPrivate;
+
+class NMAPI_EXPORT NmApiFolder
+{
+public:
+    /*!
+       constructor for NmApiFolder class
+     */
+    NmApiFolder();
+    
+    /*!
+        Copy constructor for NmApiFolder 
+     */
+    NmApiFolder(const NmApiFolder &nmApiFolder);
+    
+    /*!
+       destructor for NmApiFolder class
+     */
+    virtual ~NmApiFolder();
+
+    /*!
+       Assigns data from \a folder
+     */
+    NmApiFolder &operator=(const NmApiFolder &folder);
+    
+    /*!
+       Compares data from \a folder
+     */
+    bool operator==(const NmApiFolder &folder);
+    
+    /*!
+       getter for id
+     */
+    quint64 id() const;
+
+    /*!
+       getter for name 
+     */
+    QString name() const;
+
+    /*!
+       getter for foldertype
+     */
+    EmailClientApi::NmApiEmailFolderType folderType() const;
+
+    /*!
+       setter for id
+     */
+    void setId(quint64 id);
+
+    /*!
+       setter for name
+     */
+    void setName(const QString &name);
+
+    /*!
+       setter for foldertype
+     */
+    void setFolderType(EmailClientApi::NmApiEmailFolderType folderType);
+
+    /*!
+       setter for childfolder ids
+     */
+    void setChildFolderIds(QList<quint64> &childFolderIds);
+
+    /*!
+       setter for childfolder ids
+     */
+    void setParentFolderId(quint64 parentId);
+
+    /*!
+       returns child folder ids.
+       to be implemented later when nmail functionality is available
+     */
+    void getChildFolderIds(QList<quint64> &childFolderIds);
+
+    /*!
+       returns parent folder id.
+       
+     */
+    quint64 parentFolderId() const;
+
+private:
+    QExplicitlySharedDataPointer<NmApiFolderPrivate> d;
+};
+
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapifolderlisting.h	Thu Sep 30 11:43:07 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 NMAPIFOLDERLISTING_H_
+#define NMAPIFOLDERLISTING_H_
+
+#include <nmapimessagetask.h>
+#include <nmapidef.h>
+
+class NmApiEngine;
+
+namespace EmailClientApi
+{
+
+class NmApiFolderListingPrivate;
+class NmApiMailbox;
+class NmApiFolder;
+/*!
+   \class Class for creating list of all folders
+ */
+class NMAPI_EXPORT NmApiFolderListing : public NmApiMessageTask
+{
+    Q_OBJECT
+public:
+    /*!
+       Constructor of class. 
+     */
+    NmApiFolderListing(QObject *parent, const quint64 &mailboxId);
+    /*!
+       Destructor of class. 
+     */
+    ~NmApiFolderListing();
+
+    enum {FolderListingFailed = -1};
+
+    /*! 
+       \brief Returns results after foldersListed signal is received.
+       
+        Before calling this method, cancel and start should be called, 
+        because after second call it returns empty list..
+        It also at start clear inputlist of NmFolder.
+     */
+    bool getFolders(QList<EmailClientApi::NmApiFolder> &folders);
+
+    /*!
+       \brief Returns info if listing is running
+     */
+    bool isRunning() const;
+
+    signals:
+    /*!
+       emitted when listing is available, count is number of folders found
+       or FolderListingFailed if listing failed
+     */
+    void foldersListed(qint32 count);
+
+public slots:
+    /*!
+       \brief Starts gathering folders list.
+       
+       In first turn it will get whole folderlist. 
+       \todo After that it will wait for folder events.
+       If start works, it do nothing.
+       
+       To asynchronous operation ce be used \sa QTimer::singleShot on this method.
+       Example:
+       <code> 
+       QTimer::singleShot(0,nmFolderListing,SLOT(start());
+       </code>
+       
+     */
+    bool start();
+
+    /*!
+       \brief Stops gathering folder list.
+       
+       In first it change state of listing.
+       Then it release engine.
+       On end it clears list of folders and emits \sa NmApiMessageTask::canceled() signal.
+     */
+    void cancel();
+
+private:
+    NmApiFolderListingPrivate *mFolderListing;
+};
+}
+
+#endif /* NMAPIFOLDERLISTING_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapimailbox.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,96 @@
+/*
+ * 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 NMAPIMAILBOX_H
+#define NMAPIMAILBOX_H
+
+#include <QExplicitlySharedDataPointer>
+#include <nmapidef.h>
+
+class QString;
+
+/*!
+   Mailbox metadata class
+ */
+
+namespace EmailClientApi
+{
+
+class NmApiMailboxPrivate;
+
+class NMAPI_EXPORT NmApiMailbox
+{
+public:
+    /*!
+        constructor for NmApiMailbox 
+     */
+    NmApiMailbox();
+    
+    /*!
+        Copy constructor for NmApiMailbox 
+     */
+   NmApiMailbox(const NmApiMailbox &nmApiMailbox);
+    
+    /*!
+       destructor for NmApiMailbox
+     */
+    virtual ~NmApiMailbox();
+    
+    /*!
+       Assign data from \a mailbox
+     */
+    NmApiMailbox &operator=(const NmApiMailbox &mailbox);
+    
+    /*!
+       Compare data from \a mailbox
+     */
+    bool operator==(const NmApiMailbox &mailbox);
+    
+    /*!
+       getter for id
+     */
+    quint64 id() const;
+
+    /*!
+       getter for name
+     */
+    QString name() const;
+
+    /*!
+       getter for address
+     */
+    QString address() const;
+
+    /*!
+       setter for id
+     */
+    void setId(quint64 id);
+
+    /*! 
+       setter for name
+     */
+    void setName(const QString &name);
+
+    /*!
+       setter for address
+     */
+    void setAddress(const QString &address);
+private:
+    QExplicitlySharedDataPointer<NmApiMailboxPrivate> d;
+};
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapimailboxlisting.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,113 @@
+/*
+ * 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 NMAPIMAILBOXLISTING_H_
+#define NMAPIMAILBOXLISTING_H_
+
+
+#include <nmapimessagetask.h>
+#include <nmapidef.h>
+
+class QObject;
+
+namespace EmailClientApi
+{
+class NmApiMailboxListingPrivate;
+class NmApiMailbox;
+
+/*!
+   \class Class for creating list of all mailboxes
+ */
+class NMAPI_EXPORT NmApiMailboxListing : public NmApiMessageTask
+{
+    Q_OBJECT
+public:
+    /*!
+       Constructor of class. It set start values.
+     */
+    NmApiMailboxListing(QObject *parent);
+    /*!
+       Destructor of class. It release engine to be safe if manual releasing won't work.
+     */
+    ~NmApiMailboxListing();
+
+    enum {MailboxListingFailed = -1};
+
+    /*! 
+       \brief Returns results after mailboxesListed signal is received.
+       
+        Caller gets ownership of mailboxes. Returns true if results were available.
+        Before calling this method, cancel and start should be called, 
+        because after second call it returns empty list.
+        At start it clear inputlist of mailboxes.
+        
+        \return Return true if results were avaible
+        \param mailboxes List of mailboxes to filled. On start is cleared. 
+     */
+    bool getMailboxes(QList<EmailClientApi::NmApiMailbox> &mailboxes);
+
+    /*!
+       \brief Return info if listing is running
+       
+       \return Return true if listing is running
+     */
+    bool isRunning() const;
+
+    signals:
+    /*!
+       
+       emitted when listing is available, count is number of mailboxes found
+       or MailboxListingFailed if listing failed
+       
+       \param count Count of mailboxes inside class.
+     */
+    void mailboxesListed(qint32 count);
+
+public slots:
+    /*!
+       \brief Starts gathering mailbox list.
+       
+       In first turn it will get whole mailboxlist. 
+       Then it initialize core arguments and emits signal when ready.
+       
+       To asynchronous operation can be used \sa QTimer::singleShot on this method.
+       Example:
+       <code> 
+       QTimer::singleShot(0,nmMailboxListing,SLOT(start());
+       </code>
+       
+       \return Return true if everything go good and core of listing works good.
+       
+     */
+    bool start();
+
+    /*!
+       \brief Stop gathering mailbox list.
+       
+       In first it change state of listing.
+       Then it release engine.
+       On end it clears list of mailboxes and emits \sa NmApiMessageTask::canceled() signal.
+     */
+    void cancel();
+
+private:
+    NmApiMailboxListingPrivate *mNmApiMailboxListingPrivate;
+};
+
+}
+
+#endif /* NMAPIMAILBOXLISTING_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapimessage.h	Thu Sep 30 11:43:07 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:
+*		Api's email message class.
+*/
+
+#ifndef NMAPIMESSAGE_H_
+#define NMAPIMESSAGE_H_
+
+#include <nmapitextcontent.h>
+#include <nmapiattachment.h>
+#include <nmapimessageenvelope.h>
+#include <nmapidef.h>
+#include <QMetaType>
+
+namespace EmailClientApi
+{
+class NmApiMessagePrivate;
+class NmApiMessageEnvelope;
+
+class NMAPI_EXPORT NmApiMessage
+{
+public:
+    NmApiMessage();
+    NmApiMessage(const NmApiMessage &other);
+    virtual ~NmApiMessage();
+
+    NmApiMessage& operator=(const NmApiMessage &other);    
+
+    NmApiTextContent plainTextContent();
+    NmApiTextContent htmlContent();
+    bool isComplete();
+    QList<NmApiAttachment> attachments();
+    void addAttachment(NmApiAttachment &attachment);
+    NmApiMessageEnvelope& envelope();
+    void setPlainTextContent(NmApiTextContent &textContent);
+    void setHtmlContent(NmApiTextContent &textContent);
+    void setComplete(bool complete);
+    void setAttachments(QList<NmApiAttachment> &attachments);
+    void setEnvelope(NmApiMessageEnvelope &envelope);
+    
+private:
+
+    QSharedDataPointer<NmApiMessagePrivate> d;
+};
+} // namespace EmailClientApi
+
+Q_DECLARE_METATYPE(EmailClientApi::NmApiMessage)
+
+#endif /* NMAPIMESSAGE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapimessagebody.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,89 @@
+/*
+ * 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 NMAPIMESSAGEBODY_H
+#define NMAPIMESSAGEBODY_H
+
+#include <QExplicitlySharedDataPointer>
+#include <nmapidef.h>
+
+class QString;
+
+namespace EmailClientApi
+{
+
+class NmApiMessageBodyPrivate;
+
+class NMAPI_EXPORT NmApiMessageBody
+{
+public:
+    /*!
+       constructor for NmApiMessageBody
+     */
+    NmApiMessageBody();
+    /*!
+       copying constructor for NmApiMessageBody
+     */
+    NmApiMessageBody(const NmApiMessageBody &apiMessageBody);
+    
+    /*!
+       assignment operator for NmApiMessageBody
+     */    
+    NmApiMessageBody& operator=(const NmApiMessageBody &apiMessageBody);
+    
+    /*!
+       Compare data from \a apiMessageBody
+     */    
+    bool operator==(const NmApiMessageBody &apiMessageBody);
+    
+    virtual ~NmApiMessageBody();
+
+    /*!
+       getter for total size of message body in bytes
+     */
+    quint64 totalSize() const;
+
+    /*!
+       getter for bytes available in local mailbox store
+     */
+    quint64 fetchedSize() const;
+
+    /*!
+       getter for fetched content
+     */
+    QString content() const;
+
+    /*!
+       setter for total size of message body in bytes
+     */
+    void setTotalSize(quint64 size);
+
+    /*!
+       setter for bytes available on local mailbox store
+     */
+    void setFetchedSize(quint64 size);
+
+    /*!
+       setter for content
+     */
+    void setContent(const QString &content);
+
+private:
+    QExplicitlySharedDataPointer<NmApiMessageBodyPrivate> d;
+};
+}
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapimessagecontent.h	Thu Sep 30 11:43:07 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:
+*       Email message content public header.
+*/
+
+#ifndef NMAPIMESSAGECONTENT_H_
+#define NMAPIMESSAGECONTENT_H_
+
+#include <nmapidef.h>
+#include <QSharedDataPointer>
+
+namespace EmailClientApi
+{
+class NmApiMessageContentPrivate;
+
+class NMAPI_EXPORT NmApiMessageContent
+{
+public:
+    NmApiMessageContent();
+    NmApiMessageContent(const NmApiMessageContent &messagecontent);
+    virtual ~NmApiMessageContent();
+
+    NmApiMessageContent& operator=(const NmApiMessageContent &messagecontent);    
+
+    QString contentType() const;
+    bool isComplete();
+    quint32 size() const;
+    quint64 id() const;
+    
+    void setContentType(const QString &contentType);
+    void setComplete(bool complete);
+    void setSize(quint32 size);
+    void setId(quint64 id);
+
+private:
+    
+    QSharedDataPointer<NmApiMessageContentPrivate> d;
+};
+}
+#endif /*NMAPIMESSAGECONTENT_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapimessageenvelope.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,275 @@
+/*
+ * 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 NMAPIMESSAGEENVELOPE_H
+#define NMAPIMESSAGEENVELOPE_H
+
+
+#include <QExplicitlySharedDataPointer>
+#include <QList>
+
+#include <nmapidef.h>
+#include <nmapicommon.h>
+
+class QString;
+class QDateTime;
+
+namespace EmailClientApi
+{
+class NmApiMessageEnvelopePrivate;
+class NmApiEmailAddress;
+class NmApiMessageBody;
+
+// read-only envelope
+class NMAPI_EXPORT NmApiMessageEnvelope
+{
+public:
+    /*!
+       constructor for NmApiMessageEnvelope
+     */
+    NmApiMessageEnvelope();
+    
+    /*!
+       destructor for NmApiMessageEnvelope
+     */
+    virtual ~NmApiMessageEnvelope();
+    
+    /*!
+       copying constructor for NmApiMessageEnvelope
+     */
+    NmApiMessageEnvelope(const NmApiMessageEnvelope &envelope);
+
+    /*!
+       Assignment operator
+     */
+    NmApiMessageEnvelope &operator=(const NmApiMessageEnvelope &envelope);
+
+    /*!
+       Comapre data from \a envelope
+     */
+    bool operator==(const NmApiMessageEnvelope &envelope);
+    /*!        
+       getter for id
+     */
+    quint64 id() const;
+
+    /*!
+       getter for id of parent folder
+     */
+    quint64 parentFolder() const;
+
+    /*!
+       getter for id of mailbox
+     */
+    quint64 mailboxId() const;
+    
+    /*!
+       getter for subject
+     */
+    QString subject() const;
+
+    /*!
+       getter for sender
+     */
+    QString sender() const;
+
+    /*!
+       getter for to recipients
+     */
+    void getToRecipients(QList<EmailClientApi::NmApiEmailAddress> &toRecipients);
+
+    /*!
+       getter for cc recipients
+     */
+    void getCcRecipients(QList<EmailClientApi::NmApiEmailAddress> &ccRecipients);
+
+    /*!
+       getter for bcc recipients
+     */
+    void getBccRecipients(QList<EmailClientApi::NmApiEmailAddress> &bccRecipients);
+
+    /*!
+       getter for sent time
+     */
+    QDateTime sentTime() const;
+
+    /*!
+       getter for is read flag
+     */
+    bool isRead() const;
+
+    /*!
+       getter for has attachments flag
+     */
+    bool hasAttachments() const;
+
+    /*!
+       getter for is forwarded flag
+     */
+    bool isForwarded() const;
+
+    /*!
+       getter for is replied flag
+     */
+    bool isReplied() const;
+
+    /*!
+       getter for content type
+     */
+    QString contentType() const;
+
+    /*!
+       getter for plaintext body
+     */
+    void getPlainTextBody(EmailClientApi::NmApiMessageBody &body);
+
+    /*!
+       getter for plaintext body
+     */
+    QString plainText() const;
+
+    /*!
+       getter for messages fetched size 
+     */
+    quint64 totalSize() const;
+
+    /*!
+       getter for messages fetched size 
+     */
+    quint64 fetchedSize() const;
+
+    /*!
+        getter for priority
+     */
+    NmApiMessagePriority priority() const;
+
+    /*!
+        getter for flags
+     */
+    NmApiMessageFlags flags() const;
+
+    /*!
+        getter for flag
+     */
+     bool isFlagSet(const NmApiMessageFlag flag) const;
+
+    /*!
+       setter for id 
+     */
+    void setId(quint64 id);
+
+    /*!
+       setter for parent folder 
+     */
+    void setParentFolder(quint64 parentFolder);
+
+    /*!
+       setter for mailbox id
+     */
+    void setMailboxId(quint64 mailboxId);
+    
+    /*!
+       setter for subject 
+     */
+    void setSubject(const QString &subject);
+
+    /*!
+       setter for sender  
+     */
+    void setSender(const QString &sender);
+
+    /*!
+       setter for to recipients 
+     */
+    void setToRecipients(const QList<EmailClientApi::NmApiEmailAddress> &toRecipients);
+
+    /*!
+       setter for cc recipients 
+     */
+    void setCcRecipients(const QList<EmailClientApi::NmApiEmailAddress> &ccRecipients);
+
+    /*!
+       setter for bcc recipients 
+     */
+    void setBccRecipients(const QList<EmailClientApi::NmApiEmailAddress> &bccRecipients);
+
+    /*!
+       setter for sent time 
+     */
+    void setSentTime(QDateTime sentTime);
+
+    /*!
+       setter for is read flag
+     */
+    void setIsRead(bool isRead);
+
+    /*!
+       setter for has attachments flag 
+     */
+    void setHasAttachments(bool hasAttachments);
+
+    /*!
+       setter for is forwarded flag 
+     */
+    void setIsForwarded(bool isForwarded);
+
+    /*!
+       setter for is replied flag 
+     */
+    void setIsReplied(bool isReplied);
+
+    /*!
+       setter for content type 
+     */
+    void setContentType(const QString &contentType);
+
+    /*!
+       setter for messages plain text 
+     */
+    void setPlainText(const QString &plainText);
+
+    /*!
+       setter for messages fetched size 
+     */
+    void setTotalSize(quint64 totalSize);
+
+    /*!
+       setter for messages fetched size 
+     */
+    void setFetchedSize(quint64 fetchedSize);
+
+    /*!
+       setter for priority
+     */
+    void setPriority(NmApiMessagePriority forwarded);
+
+    /*!
+        setter for flags
+     */
+    void setFlags(const NmApiMessageFlags flags, bool set);
+
+    /*!
+        setter for flag
+     */
+    void setFlag(const NmApiMessageFlag flag, bool set);
+
+private:
+    QExplicitlySharedDataPointer<NmApiMessageEnvelopePrivate> d;
+};
+}
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapimessagemanager.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,70 @@
+/*
+ * 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 <QPointer>
+#include <QList>
+#include <QVariant>
+
+#include <nmapidef.h>
+#include <nmapioperation.h>
+#include <nmapimessage.h>
+
+namespace EmailClientApi {
+
+class NmApiMessageManagerPrivate;
+
+class NMAPI_EXPORT NmApiMessageManager : public QObject
+{
+    Q_OBJECT
+public:
+    NmApiMessageManager(QObject *parent,quint64 mailboxId);
+
+    virtual ~NmApiMessageManager();
+
+public slots: 
+    QPointer<NmApiOperation> createDraftMessage(const QVariant *initData);
+    
+    QPointer<NmApiOperation> createForwardMessage(NmApiMessage *orig,const QVariant *initData);
+    
+    QPointer<NmApiOperation> createReplyMessage(const NmApiMessage *orig,const QVariant *initData,bool replyAll);
+    
+    QPointer<NmApiOperation> moveMessages(const QList<quint64> messageIds,quint64 sourceFolderId,quint64 targetFolderId);
+    
+    QPointer<NmApiOperation> saveMessage(const NmApiMessage &message);
+    
+    QPointer<NmApiOperation> deleteMessages(const QList<quint64> messageIds);
+    
+    QPointer<NmApiOperation> fetchMessage(quint64 messageId);
+    
+    QPointer<NmApiOperation> sendMessage(const NmApiMessage &message);
+    
+    QPointer<NmApiOperation> createAttachment(NmApiMessage &message,const QVariant &attachmenSpec);
+    
+    QPointer<NmApiOperation> removeAttachment(NmApiMessage &message,quint64 attachmentId);
+    
+    QPointer<NmApiOperation> fetchAttachment(const NmApiMessage &relatedMessage,quint64 attachmentId);
+
+private:
+    NmApiMessageManagerPrivate* d;
+};
+
+} // namespace EmailClientApi
+#endif /*NMAPIMESSAGEMANAGER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapimessagesearch.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,60 @@
+/*
+ * 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 messages search public header.
+ */
+
+#ifndef NMAPIMESSAGESEARCH_H_
+#define NMAPIMESSAGESEARCH_H_
+
+#include <nmapidef.h>
+#include <nmapimessagetask.h>
+#include <nmapicommon.h>
+#include <nmapimessage.h>
+
+class NmApiMessageSearchPrivate;
+
+namespace EmailClientApi 
+{
+
+class NMAPI_EXPORT NmApiMessageSearch : public NmApiMessageTask
+{
+    Q_OBJECT
+public:
+    NmApiMessageSearch(QObject *parent, quint64 mailboxId);
+
+    virtual ~NmApiMessageSearch();
+    
+    bool isRunning() const;
+
+    bool initialise(const QList<QString> &searchStrings, EmailClientApi::NmApiMailSortCriteria sortCriteria);
+
+public slots: 
+
+    bool start();
+
+    void cancel();
+    
+signals:
+
+    void messageFound(EmailClientApi::NmApiMessage &message);
+
+    void searchComplete(int result = NmApiNoError);
+
+private:
+    NmApiMessageSearchPrivate* d;
+};
+
+} // namespace EmailClientApi
+#endif /* NMAPIMESSAGESEARCH_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapimessagetask.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,60 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *
+ */
+
+#ifndef NMAPIMESSAGETASK_H_
+#define NMAPIMESSAGETASK_H_
+
+#include <QObject>
+
+#include <nmapidef.h>
+
+/*!
+   base class for async tasks
+ */
+class NMAPI_EXPORT NmApiMessageTask : public QObject
+{
+    Q_OBJECT
+protected:
+    NmApiMessageTask(QObject *parent);
+
+public:
+    virtual ~NmApiMessageTask();
+
+public slots:
+    /*!
+       Starts task and returns true if starting succeeded.
+     */
+    virtual bool start() = 0;
+
+    /*!
+       Cancels started but not yet completed task. may not be applicable
+       in all tasks.
+     */
+    virtual void cancel() = 0;
+
+    signals:
+    /*!
+       task failed, error code is specific to concrete task
+     */
+    void failed (int error);
+    /*!
+       task canceled
+     */
+    void canceled();
+};
+
+#endif /*NMAPIMESSAGETASK_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapioperation.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,57 @@
+/*
+ * 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 NMAPIOPERATION_H_
+#define NMAPIOPERATION_H_
+
+#include <QObject>
+#include <QVariant>
+#include "nmapicommon.h"
+
+#include <nmapidef.h>
+
+namespace EmailClientApi 
+{
+
+class NMAPI_EXPORT NmApiOperation : public QObject
+{ 
+    Q_OBJECT 
+    
+protected:
+    NmApiOperation(QObject *parent, NmApiOperationStatus status, NmApiOperationType operationType);
+    
+public:
+    virtual ~NmApiOperation();
+
+    NmApiOperationStatus status() const;
+    NmApiOperationType operation() const;
+
+private slots:
+    virtual void start() = 0;
+
+public slots:
+    virtual void cancel() = 0; 
+
+signals:    
+    void operationComplete(int resultCode, QVariant data = QVariant());
+
+protected:
+    NmApiOperationStatus mStatus;
+    NmApiOperationType mOperationType;
+};
+
+}
+#endif /* NMAPIOPERATION_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_client_api/inc/nmapitextcontent.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,48 @@
+/*
+ * 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 text content public header.
+ */
+
+#ifndef NMAPITEXTCONTENT_H_
+#define NMAPITEXTCONTENT_H_
+
+#include <QString>
+#include <QSharedDataPointer>
+#include <nmapimessagecontent.h>
+#include <nmapidef.h>
+
+namespace EmailClientApi
+{
+class NmApiTextContentPrivate;
+
+class NMAPI_EXPORT NmApiTextContent : public NmApiMessageContent
+{
+public:
+    NmApiTextContent();
+    NmApiTextContent(const NmApiTextContent &textcontent);    
+    virtual ~NmApiTextContent();
+
+    NmApiTextContent& operator=(const NmApiTextContent &textcontent);    
+
+    QString content() const;
+    void setContent(const QString &content);
+
+private:
+    
+    QSharedDataPointer<NmApiTextContentPrivate> d;
+};
+}
+
+#endif /* NMAPITEXTCONTENT_H_ */
--- a/email_plat/nmail_client_api/nmail_client_api.pri	Wed Sep 15 17:47:19 2010 +0300
+++ b/email_plat/nmail_client_api/nmail_client_api.pri	Thu Sep 30 11:43:07 2010 +0300
@@ -18,24 +18,25 @@
 symbian*: {
     # Build.inf rules
     BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
-            "nmail_client_api/nmapicommon.h            APP_LAYER_PLATFORM_EXPORT_PATH(nmapicommon.h)" \
-            "nmail_client_api/nmapiemailaddress.h      APP_LAYER_PLATFORM_EXPORT_PATH(nmapiemailaddress.h)" \
-            "nmail_client_api/nmapiemailservice.h      APP_LAYER_PLATFORM_EXPORT_PATH(nmapiemailservice.h)" \
-            "nmail_client_api/nmapidef.h               APP_LAYER_PLATFORM_EXPORT_PATH(nmapidef.h)" \
-            "nmail_client_api/nmapienvelopelisting.h   APP_LAYER_PLATFORM_EXPORT_PATH(nmapienvelopelisting.h)" \
-            "nmail_client_api/nmapieventnotifier.h     APP_LAYER_PLATFORM_EXPORT_PATH(nmapieventnotifier.h)" \
-            "nmail_client_api/nmapifolder.h            APP_LAYER_PLATFORM_EXPORT_PATH(nmapifolder.h)" \
-            "nmail_client_api/nmapifolderlisting.h     APP_LAYER_PLATFORM_EXPORT_PATH(nmapifolderlisting.h)" \
-            "nmail_client_api/nmapimailbox.h           APP_LAYER_PLATFORM_EXPORT_PATH(nmapimailbox.h)" \
-            "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/nmapimessagemanager.h    APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagemanager.h)" \
-            "nmail_client_api/nmapimessagesearch.h     APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagesearch.h)" \
-            "nmail_client_api/nmapimessage.h           APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessage.h)" \
-            "nmail_client_api/nmapimessagecontent.h    APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagecontent.h)" \
-            "nmail_client_api/nmapitextcontent.h       APP_LAYER_PLATFORM_EXPORT_PATH(nmapitextcontent.h)" \
-            "nmail_client_api/nmapiattachment.h        APP_LAYER_PLATFORM_EXPORT_PATH(nmapiattachment.h)"
+            "nmail_client_api/inc/nmapicommon.h            APP_LAYER_PLATFORM_EXPORT_PATH(nmapicommon.h)" \
+            "nmail_client_api/inc/nmapiemailaddress.h      APP_LAYER_PLATFORM_EXPORT_PATH(nmapiemailaddress.h)" \
+            "nmail_client_api/inc/nmapiemailservice.h      APP_LAYER_PLATFORM_EXPORT_PATH(nmapiemailservice.h)" \
+            "nmail_client_api/inc/nmapidef.h               APP_LAYER_PLATFORM_EXPORT_PATH(nmapidef.h)" \
+            "nmail_client_api/inc/nmapienvelopelisting.h   APP_LAYER_PLATFORM_EXPORT_PATH(nmapienvelopelisting.h)" \
+            "nmail_client_api/inc/nmapieventnotifier.h     APP_LAYER_PLATFORM_EXPORT_PATH(nmapieventnotifier.h)" \
+            "nmail_client_api/inc/nmapifolder.h            APP_LAYER_PLATFORM_EXPORT_PATH(nmapifolder.h)" \
+            "nmail_client_api/inc/nmapifolderlisting.h     APP_LAYER_PLATFORM_EXPORT_PATH(nmapifolderlisting.h)" \
+            "nmail_client_api/inc/nmapimailbox.h           APP_LAYER_PLATFORM_EXPORT_PATH(nmapimailbox.h)" \
+            "nmail_client_api/inc/nmapimailboxlisting.h    APP_LAYER_PLATFORM_EXPORT_PATH(nmapimailboxlisting.h)" \
+            "nmail_client_api/inc/nmapimessagebody.h       APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagebody.h)" \
+            "nmail_client_api/inc/nmapimessageenvelope.h   APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessageenvelope.h)" \
+            "nmail_client_api/inc/nmapimessagetask.h       APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagetask.h)" \
+            "nmail_client_api/inc/nmapimessagemanager.h    APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagemanager.h)" \
+            "nmail_client_api/inc/nmapioperation.h         APP_LAYER_PLATFORM_EXPORT_PATH(nmapioperation.h)" \
+            "nmail_client_api/inc/nmapimessagesearch.h     APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagesearch.h)" \
+            "nmail_client_api/inc/nmapimessage.h           APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessage.h)" \
+            "nmail_client_api/inc/nmapimessagecontent.h    APP_LAYER_PLATFORM_EXPORT_PATH(nmapimessagecontent.h)" \
+            "nmail_client_api/inc/nmapitextcontent.h       APP_LAYER_PLATFORM_EXPORT_PATH(nmapitextcontent.h)" \
+            "nmail_client_api/inc/nmapiattachment.h        APP_LAYER_PLATFORM_EXPORT_PATH(nmapiattachment.h)"
 
 }
--- a/email_plat/nmail_client_api/nmapiattachment.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *     Email message attachment public header.
- */
-
-#ifndef NMAPIATTACHMENT_H_
-#define NMAPIATTACHMENT_H_
-
-#include <QString>
-#include <xqsharablefile.h>
-#include <nmapimessagecontent.h>
-#include <nmapidef.h>
-
-namespace EmailClientApi
-{
-class NmApiAttachmentPrivate;
-
-class NMAPI_EXPORT NmApiAttachment : public NmApiMessageContent
-{
-public:
-    NmApiAttachment();
-    virtual ~NmApiAttachment();
-
-    QString fileName();
-    XQSharableFile file();
-
-    void setFileName(const QString &fileName);
-
-private:
-    
-    NmApiAttachmentPrivate *d;
-};
-}
-
-#endif /* NMAPIATTACHMENT_H_ */
--- a/email_plat/nmail_client_api/nmapicommon.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,156 +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 NMAPICOMMON_H_
-#define NMAPICOMMON_H_
-
-#include <QMetaType>
-
-namespace EmailClientApi
-{
-    /*!
-       Enum to describe mailbox events
-     */
-    enum NmApiMailboxEvent
-    {
-        MailboxCreated, MailboxDeleted
-    };
-
-    /*!
-        Email to message priority
-     */
-    enum NmApiMessagePriority
-    {
-        NmApiMessagePriorityLow,
-        NmApiMessagePriorityNormal,
-        NmApiMessagePriorityHigh
-    };
-
-    /*!
-        Enum to message flags
-     */
-    enum NmApiMessageFlag 
-    {
-        NmApiMessageFlagRead = 1,
-        NmApiMessageFlagReadLocally = 2,
-        NmApiMessageFlagLow = 4,
-        NmApiMessageFlagImportant = 8,
-        NmApiMessageFlagFollowUpComplete = 16,
-        NmApiMessageFlagFollowUp = 32,
-        NmApiMessageFlagAttachments = 64,
-        NmApiMessageFlagMultiple = 128,
-        NmApiMessageFlagCalendarMsg = 256,
-        NmApiMessageFlagAnswered = 512,
-        NmApiMessageFlagForwarded = 1024,
-        NmApiMessageFlagOnlyToMe = 2048,
-        NmApiMessageFlagRemoteDeleted = 4096,
-        NmApiMessageFlagHasMsgSender = 8192
-    };
-    Q_DECLARE_FLAGS(NmApiMessageFlags, NmApiMessageFlag)
-    Q_DECLARE_OPERATORS_FOR_FLAGS(NmApiMessageFlags)
-
-    /*!
-       Enum to describe message events.
-     */
-    enum NmApiMessageEvent 
-    {
-        MessageCreated,
-        MessageDeleted,
-        MessageChanged
-    };
-    
-    /*!
-       Enum to describe type of email folder 
-     */
-    enum NmApiEmailFolderType
-    {
-        Inbox, Drafts, Outbox, Sent, Deleted, EOther
-    };
-
-    /*!
-        Email list sorting options
-     */
-    enum NmApiMailSortField
-        {
-        MailDontCare,            // user accepts any sort order
-        MailSortByDate,          // sorting is done by date
-        MailSortBySender,        // sorting is done by sender
-        MailSortByRecipient,     // sorting is done by recipients
-        MailSortBySubject,       // sorting is done by subject
-        MailSortByPriority,      // sorting is done by priority
-        MailSortByFlagStatus,    // follow up and completed   
-        MailSortByUnread,        // sorting is based on unread
-        MailSortBySize,          // sorting is done by size
-        MailSortByAttachment     // sorting is based on if message has attachments
-        };
-
-    /*!
-        Email list sort order
-     */
-    enum NmApiMailSortOrder
-        {
-        MailDescending,
-        MailAscending    
-        };
-
-    
-    /*!
-       Enum to describe error types
-     */
-    enum NmApiError
-    {
-        GeneralError = -1, NotSupportedError
-    };
-    
-    /*!
-        Sort criteria definion Class for searching email messages
-     */
-    class NmApiMailSortCriteria 
-        {
-        public:
-            NmApiMailSortField iField;
-            NmApiMailSortOrder iOrder;
-        };
-    
-    /*!
-        NmApi error codes
-    */
-    const int NmApiNoError = 0;
-    const int NmApiNotFoundError = -1;
-    const int NmApiGeneralError = -2;
-    const int NmApiCancelError = -3;
-    
-    /*!
-        NmApi predefined constants for ContentTypes
-    */
-    const QString NmApiContentTypeMultipartMixed = "multipart/mixed";
-    const QString NmApiContentTypeMultipartAlternative = "multipart/alternative";
-    const QString NmApiContentTypeMultipartDigest = "multipart/digest";
-    const QString NmApiContentTypeMultipartParallel = "multipart/parallel";
-    const QString NmApiContentTypeMultipartRelated =  "multipart/related";
-    const QString NmApiContentTypeTextPlain = "text/plain";
-    const QString NmApiContentTypeTextHtml = "text/html";
-    const QString NmApiContentTypeTypeMessage = "message/rfc822";
-    const QString NmApiContentTypeParamName = " name=";
-    const QString NmApiContentTypeParamCharset = " charset=";
-}
-Q_DECLARE_METATYPE (EmailClientApi::NmApiMailboxEvent)
-Q_DECLARE_METATYPE(EmailClientApi::NmApiMessageEvent)
-Q_DECLARE_METATYPE (EmailClientApi::NmApiEmailFolderType)
-Q_DECLARE_METATYPE (EmailClientApi::NmApiError)
-
-#endif /* NMAPICOMMON_H_ */
--- a/email_plat/nmail_client_api/nmapidef.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +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 NMAPIENGINEDEF_H_
-#define NMAPIENGINEDEF_H_
-
-#include <QtGlobal>
-
-#if defined(Q_OS_WIN)
-#define NMAPI_EXPORT __declspec(dllexport)
-#else
-
-#if defined(BUILD_EMAIL_API_DLL)
-#define NMAPI_EXPORT Q_DECL_EXPORT
-#else
-#define NMAPI_EXPORT Q_DECL_IMPORT
-#endif
-
-#endif
-
-#endif /* NMAPIENGINEDEF_H_ */
--- a/email_plat/nmail_client_api/nmapiemailaddress.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-/*
- * 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: 
- *
- */
-
-#ifndef NMAPIEMAILADDRESS_H
-#define NMAPIEMAILADDRESS_H
-
-#include <QExplicitlySharedDataPointer>
-#include <nmapidef.h>
-
-/*!
-   Email address
- */
-
-class QString;
-
-namespace EmailClientApi
-{
-
-class NmApiEmailAddressPrivate;
-
-class NMAPI_EXPORT NmApiEmailAddress
-{
-public:
-    /*!
-       Constructor for NmApiEmailAddress class
-     */
-    NmApiEmailAddress();
-    virtual ~NmApiEmailAddress();
-
-    /*!
-       copying constructor for NmApiEmailAddress
-     */
-    NmApiEmailAddress(const NmApiEmailAddress &addr);
-
-    /*!
-       Assignment operator
-     */
-    NmApiEmailAddress &operator=(const NmApiEmailAddress &addr);
-
-    /*!
-       Compares data from \a addr
-     */
-    bool operator==(const NmApiEmailAddress &addr);
-
-    /*
-       getter for displayname
-     */
-    QString displayName() const;
-
-    /*!
-       getter for address
-     */
-    QString address() const;
-
-    /*!
-       setter for displayname 
-     */
-    void setDisplayName(const QString &displayName);
-
-    /*!
-       setter for address
-     */
-    void setAddress(const QString &address);
-private:
-    QExplicitlySharedDataPointer<NmApiEmailAddressPrivate> d;
-};
-}
-
-#endif
--- a/email_plat/nmail_client_api/nmapiemailservice.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +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 NMAPIEMAILSERVICE_H
-#define NMAPIEMAILSERVICE_H
-
-#include <nmapidef.h>
-#include <QObject>
-
-class NmApiEngine;
-
-/*!
-   Client that wants to access mailboxes, messages and receive related events
-   use this class as "entry point". 
- */
-
-namespace EmailClientApi
-{
-
-class NmApiMessageEnvelope;
-class NmApiMailbox;
-class NmApiMessage;
-
-class NMAPI_EXPORT NmApiEmailService : public QObject
-{
-    Q_OBJECT
-public:
-
-    /*!
-       constructor for NmApiEmailService
-     */
-    NmApiEmailService(QObject* parent);
-
-    /*!
-       destructor for NmApiEmailService
-     */
-    virtual ~NmApiEmailService();
-
-    /*!
-       Initialises email service. this must be called and initialised signal received 
-       before services of the library are used.
-     */
-    void initialise();
-
-    /*!
-        frees resources.
-     */
-    void uninitialise();
-
-    /*!
-       gets mail message envelope by id (see also NmApiEventNotifier)
-     */
-    bool getEnvelope(const quint64 mailboxId, 
-                     const quint64 folderId, 
-                     const quint64 envelopeId, 
-                     EmailClientApi::NmApiMessageEnvelope &envelope);
-
-    /*!
-        gets mailbox info by id (see also NmApiEventNotifier)
-     */
-    bool getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo);
-
-    /*!
-       gets mail message by id (see also NmApiEventNotifier)
-     */
-    bool getMessage(const quint64 mailboxId, 
-                     const quint64 folderId, 
-                     const quint64 messageId, 
-                     EmailClientApi::NmApiMessage &message);
-
-
-    
-    /*!
-       returns isrunning flag value
-     */
-    bool isRunning() const;
-    signals:
-    /*!
-       this signal is emitted when initialisation is completed
-       boolean argument tells if initialisation succeeded
-     */
-    void initialized(bool);
-
-private:
-    NmApiEngine *mEngine;
-    bool mIsRunning;
-};
-}
-#endif /* NMAPIEMAILSERVICE_H */
--- a/email_plat/nmail_client_api/nmapienvelopelisting.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +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 NMAPIENVELOPELISTING_H_
-#define NMAPIENVELOPELISTING_H_
-
-#include <QList>
-
-#include <nmapimessagetask.h>
-#include <nmapidef.h>
-
-class QObject;
-
-class NmApiEngine;
-
-// list messages in particular folder.
-namespace EmailClientApi
-{
-class NmApiEnvelopeListingPrivate;
-class NmApiMessageEnvelope;
-
-class NMAPI_EXPORT NmApiEnvelopeListing : public NmApiMessageTask
-{
-    Q_OBJECT
-public:
-    /*!
-       Constructor of class. It set start values.
-     */
-    NmApiEnvelopeListing(QObject *parent, const quint64 folderId, const quint64 mailboxId);
-
-    /*!
-       Destructor of class. It release engine to be safe if manual releasing won't work.
-     */
-    ~NmApiEnvelopeListing();
-
-    enum {EnvelopeListingFailed = -1};
-
-    /*! 
-       \brief Returns results after envelopesListed signal is received.
-       
-        Caller gets ownership of envelopes. Returns true if results were available.
-        Before calling this method, cancel and start should be called, 
-        because after second call it returns empty list.
-        It also at start clear inputlist of NmApiMessageEnvelope.
-        
-        \param envelopes envelopes
-     */
-    bool getEnvelopes(QList<EmailClientApi::NmApiMessageEnvelope> &envelopes);
-
-    /*!
-       \brief Return info if listing is running
-     */
-    bool isRunning() const;
-    signals:
-    /*!
-       Emitted when listing is available, count is number of envelopes found
-       or EnvelopeListingFailed if listing failed
-     */
-    void envelopesListed(qint32 count);
-
-public slots:
-    /*!
-       \brief Starts gathering envelopes list.
-       
-       In first turn it will get whole folderlist. 
-       If start works, it do nothing.
-       
-       To asynchronous operation ce be used \sa QTimer::singleShot on this method.
-       Example:
-       \code
-       QTimer::singleShot(0,nmEnvelopeListing,SLOT(start());
-       \endcode
-       
-     */
-    bool start();
-
-    /*!
-       \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.
-     */
-    void cancel();
-
-private:
-    NmApiEnvelopeListingPrivate *mListingPrivate;
-};
-}
-
-#endif /* NMAPIENVELOPELISTING_H_ */
--- a/email_plat/nmail_client_api/nmapieventnotifier.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +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 NMAPIEVENTNOTIFIER_H
-#define NMAPIEVENTNOTIFIER_H
-
-#include <nmapimessagetask.h>
-#include <nmapidef.h>
-#include <nmapicommon.h>
-
-struct NmApiEvent;
-
-namespace EmailClientApi
-{
-class NmApiEventNotifierPrivate;
-
-/*!
-   Notifier for mailbox and message events
-   
-   Example of use:
-   \code
-   NmApiEventNotifier *notifier = new NmApiEventNotifier(this);
-   notifier->start();
-   connect(notifier,SIGNAL(messageEvent(MessageEvent,quint64,quint64,QList<quint64>)),this,
-                    SLOT(processMessage(MessageEvent,quint64,quint64,QList<quint64>)),Qt::QueuedConnection);
-   \endcode
-   And then when want to end need to do:
-   \code
-   notifier->cancel();
-   delete notifier; // or notifier->deleteLater();
-   \endcode
- */
-class NMAPI_EXPORT NmApiEventNotifier : public NmApiMessageTask
-{
-    Q_OBJECT
-public:
-    /*!
-       Constructor
-     */
-    NmApiEventNotifier(QObject *parent);
-
-    /*!
-       Destructor
-     */
-    virtual ~NmApiEventNotifier();
-
-    /*!
-       Start monitoring email events
-       
-       Return value informs if monitoring system is up
-     */
-    virtual bool start();
-
-    /*!
-       Cancels monitoring.
-       
-       In user responsibility is to cancel monitoring.
-       On end it clear buffer events and emits \sa NmApiMessageTask::canceled() signal.
-     */
-    virtual void cancel();
-
-    /*!
-       Checks if event notifier is running.
-     */
-    bool isRunning() const;
-
-    signals:
-    /*!
-       This signal is emited when buffer of mailbox events is ready to send. Buffer is list of mailbox events with id.
-       
-       
-       It emits signals grouped by events. So there will be as much signals as much there are events.
-       For safety when connect it need to use \sa Qt::QueuedConnection.
-       After that use \sa EmailClientApi::NmEmailService::getMailbox to get object.
-       \param event Event of mailbox
-       \param id List of mailbox ids where event occur.
-     */
-    void mailboxEvent(EmailClientApi::NmApiMailboxEvent event, QList<quint64> id);
-
-    /*!
-       This signal is emited when buffer of messages events is ready to send. Buffer is list of messages events with id.
-     *
-       It emits signals grouped by events, mailbox and folder. So there will be as much signals as much there are events.
-       For safety when connect it need to use \sa Qt::QueuedConnection.
-       After that use \sa EmailClientApi::NmApiEmailService::getEnvelope to get object.
-       
-       \param event Event of messages
-       \param mailboxId Message mailbox
-       \param folderId Message folder
-       \param envelopeIdList List of messages ids where event occur
-     */
-    void messageEvent(EmailClientApi::NmApiMessageEvent event, quint64 mailboxId, quint64 folderId, QList<quint64> envelopeIdList);
-
-public slots:
-    /*!
-       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.
-     */
-    void sendEventsFromBuffer();
-
-private:
-    NmApiEventNotifierPrivate *mNmApiEventNotifierPrivate;
-};
-
-}
-
-Q_DECLARE_METATYPE(QList<quint64>)
-
-#endif
--- a/email_plat/nmail_client_api/nmapifolder.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,119 +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 NMAPIFOLDERINFO_H
-#define NMAPIFOLDERINFO_H
-
-#include <QExplicitlySharedDataPointer>
-#include <QList>
-#include <nmapidef.h>
-#include <nmapicommon.h>
-
-/*!
-   Mailbox metadata class
- */
-namespace EmailClientApi
-{
-
-class NmApiFolderPrivate;
-
-class NMAPI_EXPORT NmApiFolder
-{
-public:
-    /*!
-       constructor for NmApiFolder class
-     */
-    NmApiFolder();
-    
-    /*!
-        Copy constructor for NmApiFolder 
-     */
-    NmApiFolder(const NmApiFolder &nmApiFolder);
-    
-    /*!
-       destructor for NmApiFolder class
-     */
-    virtual ~NmApiFolder();
-
-    /*!
-       Assigns data from \a folder
-     */
-    NmApiFolder &operator=(const NmApiFolder &folder);
-    
-    /*!
-       Compares data from \a folder
-     */
-    bool operator==(const NmApiFolder &folder);
-    
-    /*!
-       getter for id
-     */
-    quint64 id() const;
-
-    /*!
-       getter for name 
-     */
-    QString name() const;
-
-    /*!
-       getter for foldertype
-     */
-    EmailClientApi::NmApiEmailFolderType folderType() const;
-
-    /*!
-       setter for id
-     */
-    void setId(quint64 id);
-
-    /*!
-       setter for name
-     */
-    void setName(const QString &name);
-
-    /*!
-       setter for foldertype
-     */
-    void setFolderType(EmailClientApi::NmApiEmailFolderType folderType);
-
-    /*!
-       setter for childfolder ids
-     */
-    void setChildFolderIds(QList<quint64> &childFolderIds);
-
-    /*!
-       setter for childfolder ids
-     */
-    void setParentFolderId(quint64 parentId);
-
-    /*!
-       returns child folder ids.
-       to be implemented later when nmail functionality is available
-     */
-    void getChildFolderIds(QList<quint64> &childFolderIds);
-
-    /*!
-       returns parent folder id.
-       
-     */
-    quint64 parentFolderId() const;
-
-private:
-    QExplicitlySharedDataPointer<NmApiFolderPrivate> d;
-};
-
-}
-#endif
--- a/email_plat/nmail_client_api/nmapifolderlisting.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,102 +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 NMAPIFOLDERLISTING_H_
-#define NMAPIFOLDERLISTING_H_
-
-#include <nmapimessagetask.h>
-#include <nmapidef.h>
-
-class NmApiEngine;
-
-namespace EmailClientApi
-{
-
-class NmApiFolderListingPrivate;
-class NmApiMailbox;
-class NmApiFolder;
-/*!
-   \class Class for creating list of all folders
- */
-class NMAPI_EXPORT NmApiFolderListing : public NmApiMessageTask
-{
-    Q_OBJECT
-public:
-    /*!
-       Constructor of class. 
-     */
-    NmApiFolderListing(QObject *parent, const quint64 &mailboxId);
-    /*!
-       Destructor of class. 
-     */
-    ~NmApiFolderListing();
-
-    enum {FolderListingFailed = -1};
-
-    /*! 
-       \brief Returns results after foldersListed signal is received.
-       
-        Before calling this method, cancel and start should be called, 
-        because after second call it returns empty list..
-        It also at start clear inputlist of NmFolder.
-     */
-    bool getFolders(QList<EmailClientApi::NmApiFolder> &folders);
-
-    /*!
-       \brief Returns info if listing is running
-     */
-    bool isRunning() const;
-
-    signals:
-    /*!
-       emitted when listing is available, count is number of folders found
-       or FolderListingFailed if listing failed
-     */
-    void foldersListed(qint32 count);
-
-public slots:
-    /*!
-       \brief Starts gathering folders list.
-       
-       In first turn it will get whole folderlist. 
-       \todo After that it will wait for folder events.
-       If start works, it do nothing.
-       
-       To asynchronous operation ce be used \sa QTimer::singleShot on this method.
-       Example:
-       <code> 
-       QTimer::singleShot(0,nmFolderListing,SLOT(start());
-       </code>
-       
-     */
-    bool start();
-
-    /*!
-       \brief Stops gathering folder list.
-       
-       In first it change state of listing.
-       Then it release engine.
-       On end it clears list of folders and emits \sa NmApiMessageTask::canceled() signal.
-     */
-    void cancel();
-
-private:
-    NmApiFolderListingPrivate *mFolderListing;
-};
-}
-
-#endif /* NMAPIFOLDERLISTING_H_ */
--- a/email_plat/nmail_client_api/nmapimailbox.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +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 NMAPIMAILBOX_H
-#define NMAPIMAILBOX_H
-
-#include <QExplicitlySharedDataPointer>
-#include <nmapidef.h>
-
-class QString;
-
-/*!
-   Mailbox metadata class
- */
-
-namespace EmailClientApi
-{
-
-class NmApiMailboxPrivate;
-
-class NMAPI_EXPORT NmApiMailbox
-{
-public:
-    /*!
-        constructor for NmApiMailbox 
-     */
-    NmApiMailbox();
-    
-    /*!
-        Copy constructor for NmApiMailbox 
-     */
-   NmApiMailbox(const NmApiMailbox &nmApiMailbox);
-    
-    /*!
-       destructor for NmApiMailbox
-     */
-    virtual ~NmApiMailbox();
-    
-    /*!
-       Assign data from \a mailbox
-     */
-    NmApiMailbox &operator=(const NmApiMailbox &mailbox);
-    
-    /*!
-       Compare data from \a mailbox
-     */
-    bool operator==(const NmApiMailbox &mailbox);
-    
-    /*!
-       getter for id
-     */
-    quint64 id() const;
-
-    /*!
-       getter for name
-     */
-    QString name() const;
-
-    /*!
-       getter for address
-     */
-    QString address() const;
-
-    /*!
-       setter for id
-     */
-    void setId(quint64 id);
-
-    /*! 
-       setter for name
-     */
-    void setName(const QString &name);
-
-    /*!
-       setter for address
-     */
-    void setAddress(const QString &address);
-private:
-    QExplicitlySharedDataPointer<NmApiMailboxPrivate> d;
-};
-}
-#endif
--- a/email_plat/nmail_client_api/nmapimailboxlisting.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +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 NMAPIMAILBOXLISTING_H_
-#define NMAPIMAILBOXLISTING_H_
-
-
-#include <nmapimessagetask.h>
-#include <nmapidef.h>
-
-class QObject;
-
-namespace EmailClientApi
-{
-class NmApiMailboxListingPrivate;
-class NmApiMailbox;
-
-/*!
-   \class Class for creating list of all mailboxes
- */
-class NMAPI_EXPORT NmApiMailboxListing : public NmApiMessageTask
-{
-    Q_OBJECT
-public:
-    /*!
-       Constructor of class. It set start values.
-     */
-    NmApiMailboxListing(QObject *parent);
-    /*!
-       Destructor of class. It release engine to be safe if manual releasing won't work.
-     */
-    ~NmApiMailboxListing();
-
-    enum {MailboxListingFailed = -1};
-
-    /*! 
-       \brief Returns results after mailboxesListed signal is received.
-       
-        Caller gets ownership of mailboxes. Returns true if results were available.
-        Before calling this method, cancel and start should be called, 
-        because after second call it returns empty list.
-        At start it clear inputlist of mailboxes.
-        
-        \return Return true if results were avaible
-        \param mailboxes List of mailboxes to filled. On start is cleared. 
-     */
-    bool getMailboxes(QList<EmailClientApi::NmApiMailbox> &mailboxes);
-
-    /*!
-       \brief Return info if listing is running
-       
-       \return Return true if listing is running
-     */
-    bool isRunning() const;
-
-    signals:
-    /*!
-       
-       emitted when listing is available, count is number of mailboxes found
-       or MailboxListingFailed if listing failed
-       
-       \param count Count of mailboxes inside class.
-     */
-    void mailboxesListed(qint32 count);
-
-public slots:
-    /*!
-       \brief Starts gathering mailbox list.
-       
-       In first turn it will get whole mailboxlist. 
-       Then it initialize core arguments and emits signal when ready.
-       
-       To asynchronous operation can be used \sa QTimer::singleShot on this method.
-       Example:
-       <code> 
-       QTimer::singleShot(0,nmMailboxListing,SLOT(start());
-       </code>
-       
-       \return Return true if everything go good and core of listing works good.
-       
-     */
-    bool start();
-
-    /*!
-       \brief Stop gathering mailbox list.
-       
-       In first it change state of listing.
-       Then it release engine.
-       On end it clears list of mailboxes and emits \sa NmApiMessageTask::canceled() signal.
-     */
-    void cancel();
-
-private:
-    NmApiMailboxListingPrivate *mNmApiMailboxListingPrivate;
-};
-
-}
-
-#endif /* NMAPIMAILBOXLISTING_H_ */
--- a/email_plat/nmail_client_api/nmapimessage.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,58 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*		Api's email message class.
-*/
-
-#ifndef NMAPIMESSAGE_H_
-#define NMAPIMESSAGE_H_
-
-#include <nmapitextcontent.h>
-#include <nmapiattachment.h>
-#include <nmapimessageenvelope.h>
-#include <nmapidef.h>
-#include <QMetaType>
-
-namespace EmailClientApi
-{
-class NmApiMessagePrivate;
-class NmApiMessageEnvelope;
-
-class NMAPI_EXPORT NmApiMessage
-{
-public:
-    NmApiMessage();
-    virtual ~NmApiMessage();
-
-    NmApiTextContent plainTextContent();
-    NmApiTextContent htmlContent();
-    bool isComplete();
-    QList<NmApiAttachment> attachments();
-    void addAttachment(NmApiAttachment &attachment);
-    NmApiMessageEnvelope& envelope();
-    void setPlainTextContent(NmApiTextContent &textContent);
-    void setHtmlContent(NmApiTextContent &textContent);
-    void setComplete(bool complete);
-    void setAttachments(QList<NmApiAttachment> &attachments);
-    void setEnvelope(NmApiMessageEnvelope &envelope);
-    
-private:
-    
-    NmApiMessagePrivate *d;
-};
-} // namespace EmailClientApi
-
-Q_DECLARE_METATYPE(EmailClientApi::NmApiMessage)
-
-#endif /* NMAPIMESSAGE_H_ */
--- a/email_plat/nmail_client_api/nmapimessagebody.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +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 NMAPIMESSAGEBODY_H
-#define NMAPIMESSAGEBODY_H
-
-#include <QExplicitlySharedDataPointer>
-#include <nmapidef.h>
-
-class QString;
-
-namespace EmailClientApi
-{
-
-class NmApiMessageBodyPrivate;
-
-class NMAPI_EXPORT NmApiMessageBody
-{
-public:
-    /*!
-       constructor for NmApiMessageBody
-     */
-    NmApiMessageBody();
-    /*!
-       copying constructor for NmApiMessageBody
-     */
-    NmApiMessageBody(const NmApiMessageBody &apiMessageBody);
-    
-    /*!
-       assignment operator for NmApiMessageBody
-     */    
-    NmApiMessageBody& operator=(const NmApiMessageBody &apiMessageBody);
-    
-    /*!
-       Compare data from \a apiMessageBody
-     */    
-    bool operator==(const NmApiMessageBody &apiMessageBody);
-    
-    virtual ~NmApiMessageBody();
-
-    /*!
-       getter for total size of message body in bytes
-     */
-    quint64 totalSize() const;
-
-    /*!
-       getter for bytes available in local mailbox store
-     */
-    quint64 fetchedSize() const;
-
-    /*!
-       getter for fetched content
-     */
-    QString content() const;
-
-    /*!
-       setter for total size of message body in bytes
-     */
-    void setTotalSize(quint64 size);
-
-    /*!
-       setter for bytes available on local mailbox store
-     */
-    void setFetchedSize(quint64 size);
-
-    /*!
-       setter for content
-     */
-    void setContent(const QString &content);
-
-private:
-    QExplicitlySharedDataPointer<NmApiMessageBodyPrivate> d;
-};
-}
-#endif
--- a/email_plat/nmail_client_api/nmapimessagecontent.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
-* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:
-*       Email message content public header.
-*/
-
-#ifndef NMAPIMESSAGECONTENT_H_
-#define NMAPIMESSAGECONTENT_H_
-
-#include <nmapidef.h>
-
-namespace EmailClientApi
-{
-class NmApiMessageContentPrivate;
-
-class NMAPI_EXPORT NmApiMessageContent
-{
-public:
-    NmApiMessageContent();
-    virtual ~NmApiMessageContent();
-
-    QString contentType() const;
-    bool isComplete();
-    quint32 size() const;
-    quint64 id() const;
-    
-    void setContentType(const QString &contentType);
-    void setComplete(bool complete);
-    void setSize(quint32 size);
-    void setId(quint64 id);
-
-private:
-    
-    NmApiMessageContentPrivate *d;
-};
-}
-#endif /*NMAPIMESSAGECONTENT_H_ */
--- a/email_plat/nmail_client_api/nmapimessageenvelope.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,275 +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 NMAPIMESSAGEENVELOPE_H
-#define NMAPIMESSAGEENVELOPE_H
-
-
-#include <QExplicitlySharedDataPointer>
-#include <QList>
-
-#include <nmapidef.h>
-#include <nmapicommon.h>
-
-class QString;
-class QDateTime;
-
-namespace EmailClientApi
-{
-class NmApiMessageEnvelopePrivate;
-class NmApiEmailAddress;
-class NmApiMessageBody;
-
-// read-only envelope
-class NMAPI_EXPORT NmApiMessageEnvelope
-{
-public:
-    /*!
-       constructor for NmApiMessageEnvelope
-     */
-    NmApiMessageEnvelope();
-    
-    /*!
-       destructor for NmApiMessageEnvelope
-     */
-    virtual ~NmApiMessageEnvelope();
-    
-    /*!
-       copying constructor for NmApiMessageEnvelope
-     */
-    NmApiMessageEnvelope(const NmApiMessageEnvelope &envelope);
-
-    /*!
-       Assignment operator
-     */
-    NmApiMessageEnvelope &operator=(const NmApiMessageEnvelope &envelope);
-
-    /*!
-       Comapre data from \a envelope
-     */
-    bool operator==(const NmApiMessageEnvelope &envelope);
-    /*!        
-       getter for id
-     */
-    quint64 id() const;
-
-    /*!
-       getter for id of parent folder
-     */
-    quint64 parentFolder() const;
-
-    /*!
-       getter for id of mailbox
-     */
-    quint64 mailboxId() const;
-    
-    /*!
-       getter for subject
-     */
-    QString subject() const;
-
-    /*!
-       getter for sender
-     */
-    QString sender() const;
-
-    /*!
-       getter for to recipients
-     */
-    void getToRecipients(QList<EmailClientApi::NmApiEmailAddress> &toRecipients);
-
-    /*!
-       getter for cc recipients
-     */
-    void getCcRecipients(QList<EmailClientApi::NmApiEmailAddress> &ccRecipients);
-
-    /*!
-       getter for bcc recipients
-     */
-    void getBccRecipients(QList<EmailClientApi::NmApiEmailAddress> &bccRecipients);
-
-    /*!
-       getter for sent time
-     */
-    QDateTime sentTime() const;
-
-    /*!
-       getter for is read flag
-     */
-    bool isRead() const;
-
-    /*!
-       getter for has attachments flag
-     */
-    bool hasAttachments() const;
-
-    /*!
-       getter for is forwarded flag
-     */
-    bool isForwarded() const;
-
-    /*!
-       getter for is replied flag
-     */
-    bool isReplied() const;
-
-    /*!
-       getter for content type
-     */
-    QString contentType() const;
-
-    /*!
-       getter for plaintext body
-     */
-    void getPlainTextBody(EmailClientApi::NmApiMessageBody &body);
-
-    /*!
-       getter for plaintext body
-     */
-    QString plainText() const;
-
-    /*!
-       getter for messages fetched size 
-     */
-    quint64 totalSize() const;
-
-    /*!
-       getter for messages fetched size 
-     */
-    quint64 fetchedSize() const;
-
-    /*!
-        getter for priority
-     */
-    NmApiMessagePriority priority() const;
-
-    /*!
-        getter for flags
-     */
-    NmApiMessageFlags flags() const;
-
-    /*!
-        getter for flag
-     */
-     bool isFlagSet(const NmApiMessageFlag flag) const;
-
-    /*!
-       setter for id 
-     */
-    void setId(quint64 id);
-
-    /*!
-       setter for parent folder 
-     */
-    void setParentFolder(quint64 parentFolder);
-
-    /*!
-       setter for mailbox id
-     */
-    void setMailboxId(quint64 mailboxId);
-    
-    /*!
-       setter for subject 
-     */
-    void setSubject(const QString &subject);
-
-    /*!
-       setter for sender  
-     */
-    void setSender(const QString &sender);
-
-    /*!
-       setter for to recipients 
-     */
-    void setToRecipients(const QList<EmailClientApi::NmApiEmailAddress> &toRecipients);
-
-    /*!
-       setter for cc recipients 
-     */
-    void setCcRecipients(const QList<EmailClientApi::NmApiEmailAddress> &ccRecipients);
-
-    /*!
-       setter for bcc recipients 
-     */
-    void setBccRecipients(const QList<EmailClientApi::NmApiEmailAddress> &bccRecipients);
-
-    /*!
-       setter for sent time 
-     */
-    void setSentTime(QDateTime sentTime);
-
-    /*!
-       setter for is read flag
-     */
-    void setIsRead(bool isRead);
-
-    /*!
-       setter for has attachments flag 
-     */
-    void setHasAttachments(bool hasAttachments);
-
-    /*!
-       setter for is forwarded flag 
-     */
-    void setIsForwarded(bool isForwarded);
-
-    /*!
-       setter for is replied flag 
-     */
-    void setIsReplied(bool isReplied);
-
-    /*!
-       setter for content type 
-     */
-    void setContentType(const QString &contentType);
-
-    /*!
-       setter for messages plain text 
-     */
-    void setPlainText(const QString &plainText);
-
-    /*!
-       setter for messages fetched size 
-     */
-    void setTotalSize(quint64 totalSize);
-
-    /*!
-       setter for messages fetched size 
-     */
-    void setFetchedSize(quint64 fetchedSize);
-
-    /*!
-       setter for priority
-     */
-    void setPriority(NmApiMessagePriority forwarded);
-
-    /*!
-        setter for flags
-     */
-    void setFlags(const NmApiMessageFlags flags, bool set);
-
-    /*!
-        setter for flag
-     */
-    void setFlag(const NmApiMessageFlag flag, bool set);
-
-private:
-    QExplicitlySharedDataPointer<NmApiMessageEnvelopePrivate> d;
-};
-}
-#endif
-
--- a/email_plat/nmail_client_api/nmapimessagemanager.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *     Email message related operations
- */
-
-#ifndef NMAPIMESSAGEMANAGER_H_
-#define NMAPIMESSAGEMANAGER_H_
-
-#include <QObject>
-#include <QList>
-#include <QVariant>
-
-#include <nmapidef.h>
-#include <nmapimessage.h>
-
-namespace EmailClientApi {
-
-class NmApiMessageManagerPrivate;
-
-class NMAPI_EXPORT NmApiMessageManager : public QObject
-{
-    Q_OBJECT
-public:
-    NmApiMessageManager(QObject *parent,quint64 mailboxId);
-
-    virtual ~NmApiMessageManager();
-
-public slots:
-    bool createDraftMessage(const QVariant *initData);
-    
-    bool createForwardMessage(NmApiMessage *orig,const QVariant *initData);
-    
-    bool createReplyMessage(const NmApiMessage *orig,const QVariant *initData,bool replyAll);
-    
-    bool moveMessages(const QList<quint64> messageIds,quint64 sourceFolderId,quint64 targetFolderId);
-    
-    bool saveMessage(const NmApiMessage &message);
-    
-    bool deleteMessages(const QList<quint64> messageIds);
-    
-    bool fetchMessage(quint64 messageId);
-    
-    bool sendMessage(const NmApiMessage &message);
-    
-    bool createAttachment(NmApiMessage &message,const QVariant &attachmenSpec);
-
-    bool removeAttachment(NmApiMessage &message,quint64 attachmentId);
-    
-	bool fetchAttachment(const NmApiMessage &relatedMessage,quint64 attachmentId);
-	
-private:
-    NmApiMessageManagerPrivate* d;
-};
-
-} // namespace EmailClientApi
-#endif /*NMAPIMESSAGEMANAGER_H_ */
--- a/email_plat/nmail_client_api/nmapimessagesearch.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *     Email messages search public header.
- */
-
-#ifndef NMAPIMESSAGESEARCH_H_
-#define NMAPIMESSAGESEARCH_H_
-
-#include <nmapidef.h>
-#include <nmapimessagetask.h>
-#include <nmapicommon.h>
-#include <nmapimessage.h>
-
-class NmApiMessageSearchPrivate;
-
-namespace EmailClientApi 
-{
-
-class NMAPI_EXPORT NmApiMessageSearch : public NmApiMessageTask
-{
-    Q_OBJECT
-public:
-    NmApiMessageSearch(QObject *parent, quint64 mailboxId);
-
-    virtual ~NmApiMessageSearch();
-    
-    bool isRunning() const;
-
-    bool initialise(const QList<QString> &searchStrings, EmailClientApi::NmApiMailSortCriteria sortCriteria);
-
-public slots: 
-
-    bool start();
-
-    void cancel();
-    
-signals:
-
-    void messageFound(EmailClientApi::NmApiMessage &message);
-
-    void searchComplete(int result = NmApiNoError);
-
-private:
-    NmApiMessageSearchPrivate* d;
-};
-
-} // namespace EmailClientApi
-#endif /* NMAPIMESSAGESEARCH_H_ */
--- a/email_plat/nmail_client_api/nmapimessagetask.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +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 NMAPIMESSAGETASK_H_
-#define NMAPIMESSAGETASK_H_
-
-#include <QObject>
-
-#include <nmapidef.h>
-
-/*!
-   base class for async tasks
- */
-class NMAPI_EXPORT NmApiMessageTask : public QObject
-{
-    Q_OBJECT
-protected:
-    NmApiMessageTask(QObject *parent);
-
-public:
-    virtual ~NmApiMessageTask();
-
-public slots:
-    /*!
-       Starts task and returns true if starting succeeded.
-     */
-    virtual bool start() = 0;
-
-    /*!
-       Cancels started but not yet completed task. may not be applicable
-       in all tasks.
-     */
-    virtual void cancel() = 0;
-
-    signals:
-    /*!
-       task failed, error code is specific to concrete task
-     */
-    void failed (int error);
-    /*!
-       task canceled
-     */
-    void canceled();
-};
-
-#endif /*NMAPIMESSAGETASK_H_ */
--- a/email_plat/nmail_client_api/nmapitextcontent.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *     Email message text content public header.
- */
-
-#ifndef NMAPITEXTCONTENT_H_
-#define NMAPITEXTCONTENT_H_
-
-#include <QString>
-
-#include <nmapimessagecontent.h>
-#include <nmapidef.h>
-
-namespace EmailClientApi
-{
-class NmApiTextContentPrivate;
-
-class NMAPI_EXPORT NmApiTextContent : public NmApiMessageContent
-{
-public:
-    NmApiTextContent();
-    virtual ~NmApiTextContent();
-
-    QString content() const;
-    void setContent(const QString &content);
-
-private:
-    
-    NmApiTextContentPrivate *d;
-};
-}
-
-#endif /* NMAPITEXTCONTENT_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/email_plat/nmail_settings_api/inc/nmapimailboxsettings.h	Thu Sep 30 11:43:07 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:
+ *
+ */
+
+#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);
+    QString getMailboxType(quint64 mailboxId);
+    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/inc/nmapimailboxsettingsdata.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,134 @@
+/*
+ * 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";
+
+const QString EmailProfileOffsetKUTD = "KUTD";
+const QString EmailProfileOffsetSE = "SE";
+const QString EmailProfileOffsetMF = "MF";
+const QString EmailProfileOffsetUD = "UD";
+
+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/email_plat/nmail_settings_api/inc/nmapisettingsmanager.h	Thu Sep 30 11:43:07 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:
+ *
+ */
+
+#ifndef NMAPISETTINGSMANAGER_H_
+#define NMAPISETTINGSMANAGER_H_
+
+#include <nmapidef.h>
+
+namespace EmailClientApi
+{
+
+class NmApiMailboxSettingsData;
+class NmApiSettingsManagerPrivate;
+class NMAPI_EXPORT NmApiSettingsManager
+{
+public:
+    NmApiSettingsManager(const quint64 mailboxId);
+    virtual ~NmApiSettingsManager();
+
+    bool load(quint64 mailboxId, NmApiMailboxSettingsData &data);
+    bool save(const NmApiMailboxSettingsData &data);
+    
+protected:    
+    NmApiSettingsManagerPrivate *d;
+ 
+};
+
+}
+
+#endif /* NMAPISETTINGSMANAGER_H_ */
--- a/email_plat/nmail_settings_api/nmail_settings_api.pri	Wed Sep 15 17:47:19 2010 +0300
+++ b/email_plat/nmail_settings_api/nmail_settings_api.pri	Thu Sep 30 11:43:07 2010 +0300
@@ -10,7 +10,7 @@
 # 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)" \
-    "nmail_settings_api/nmapisettingsmanager.h APP_LAYER_PLATFORM_EXPORT_PATH(nmapisettingsmanager.h)"
+    "nmail_settings_api/inc/nmapimailboxsettingsdata.h APP_LAYER_PLATFORM_EXPORT_PATH(nmapimailboxsettingsdata.h)" \
+    "nmail_settings_api/inc/nmapimailboxsettings.h APP_LAYER_PLATFORM_EXPORT_PATH(nmapimailboxsettings.h)" \
+    "nmail_settings_api/inc/nmapisettingsmanager.h APP_LAYER_PLATFORM_EXPORT_PATH(nmapisettingsmanager.h)"
 
--- a/email_plat/nmail_settings_api/nmapimailboxsettings.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#ifndef 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_ */
--- a/email_plat/nmail_settings_api/nmapimailboxsettingsdata.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#ifndef 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";
-
-const QString EmailProfileOffsetKUTD = "KUTD";
-const QString EmailProfileOffsetSE = "SE";
-const QString EmailProfileOffsetMF = "MF";
-const QString EmailProfileOffsetUD = "UD";
-
-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_ */
--- a/email_plat/nmail_settings_api/nmapisettingsmanager.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:
- *
- */
-
-#ifndef NMAPISETTINGSMANAGER_H_
-#define NMAPISETTINGSMANAGER_H_
-
-#include <nmapidef.h>
-
-namespace EmailClientApi
-{
-
-class NmApiMailboxSettingsData;
-class NmApiSettingsManagerPrivate;
-class NMAPI_EXPORT NmApiSettingsManager
-{
-public:
-    NmApiSettingsManager(const quint64 mailboxId);
-    virtual ~NmApiSettingsManager();
-
-    bool load(quint64 mailboxId, NmApiMailboxSettingsData &data);
-    bool save(const NmApiMailboxSettingsData &data);
-    
-protected:    
-    NmApiSettingsManagerPrivate *d;
- 
-};
-
-}
-
-#endif /* NMAPISETTINGSMANAGER_H_ */
--- a/emailservices/emailclientapi/inc/emailmessagesearch.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailclientapi/inc/emailmessagesearch.h	Thu Sep 30 11:43:07 2010 +0300
@@ -144,6 +144,11 @@
      * Function leaves if search is going on. Otherwise it doesn't do anything.
      */
     inline void IsSearchGoingOnL() const; 
+    
+    /**
+     * Cancels search. For private use.
+     */
+    void CancelSearch();
 
 private:
     
--- a/emailservices/emailclientapi/src/emailmessage.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailclientapi/src/emailmessage.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -249,17 +249,17 @@
 void CEmailMessage::SetRecipientsL( const MEmailAddress::TRole aRole,
         REmailAddressArray& aRecipients )
     {
+    User::LeaveIfNull( iPluginMessage );
+    
     TInt count( aRecipients.Count() );
 
     for( TInt i=0;i<count;i++ )
         {
         const MEmailAddress* address = aRecipients[i];
-        CFSMailAddress* fsAddress = CFSMailAddress::NewLC();
+        CFSMailAddress* fsAddress = CFSMailAddress::NewL();
         fsAddress->SetEmailAddress( address->Address() );
         fsAddress->SetDisplayName( address->DisplayName() );
         
-        User::LeaveIfNull( iPluginMessage );
-        
         if( aRole == MEmailAddress::ETo )
             {
             iPluginMessage->AppendToRecipient( fsAddress );
@@ -274,9 +274,9 @@
             }
         else
             {
+            delete fsAddress;
             User::Leave( KErrArgument );
-            }
-        CleanupStack::Pop( fsAddress );
+            }        
         }
     }
 
--- a/emailservices/emailclientapi/src/emailmessagesearch.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailclientapi/src/emailmessagesearch.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -91,7 +91,7 @@
     {
     if (KErrNone != iGate.Wait(1))
         {
-        this->Cancel();
+        this->CancelSearch();
         }
     delete this;
     }
@@ -256,21 +256,12 @@
 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 );
+        {        
+        CancelSearch();
         }
-    else
-        {
-        // Release gate
-        iGate.Signal();
-        }
+    
+    // Release gate
+    iGate.Signal();    
     }
 
 // -----------------------------------------------------------------------------
@@ -295,7 +286,9 @@
         // Release gate
         iGate.Signal();       
         }
-
+    //if we really locked iGate here, we release it in else 
+    //brach. If it was already locked, we must not release it here!
+    // coverity[missing_unlock]
     return ret; 
     }
 
@@ -306,7 +299,7 @@
     {
     if ( KErrNone != iGate.Wait( 1 ) )
         {
-        this->Cancel();
+        this->CancelSearch();
         }
     
     iCriteria = TFSMailSortCriteria();
@@ -360,4 +353,17 @@
         }
     }
 
+// -----------------------------------------------------------------------------
+// Cancels search
+// -----------------------------------------------------------------------------
+void CEmailMessageSearchAsync::CancelSearch()
+    {
+    /**
+     * 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 );
+    }
 // End of file
--- a/emailservices/emailcommon/inc/CFSMailBox.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailcommon/inc/CFSMailBox.h	Thu Sep 30 11:43:07 2010 +0300
@@ -435,19 +435,14 @@
   	 CFSMailBox();
 
     /**
-     * Function used internally to inform that Mru list related to this
-     * mailbox should now be updated using the given recipient info. In
-     * other words this function makes sure that the given recipients are
-     * found from the common email mru list.
+     * Function used internally to update Mru list using the given recipient
+     * info. In other words this function makes sure that the given recipients
+     * are found from the common email mru list.
      *
-     * @param aRecipients email recipients in TO-field
-     * @param aCCRecipients email recipients in CC-field
-     * @param aBCCRecipients email recipients in BCC-field
+     * @param aRecipients email recipients to be saved in cenrep.
      */
-    void UpdateMrusL(
-        const RPointerArray<CFSMailAddress>& aRecipients,
-        const RPointerArray<CFSMailAddress>& aCCRecipients,
-        const RPointerArray<CFSMailAddress>& aBCCRecipients ) const;
+    void UpdateMrus(
+        const RPointerArray<CFSMailAddress>& aRecipients ) const;
 
  private: // data
 
--- a/emailservices/emailcommon/src/CFSMailBox.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailcommon/src/CFSMailBox.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -31,7 +31,7 @@
 #include "CFSMailFolder.h"
 #include "CFSMailAddress.h"
 // </qmail>
-#include <emailmru.h>
+#include "emailmru.h"
 
 
 // ================= MEMBER FUNCTIONS ==========================================
@@ -69,9 +69,6 @@
 
     // get requesthandler pointer
     iRequestHandler = static_cast<CFSMailRequestHandler*>(Dll::Tls());
-    QT_TRYCATCH_LEAVING({
-    iMru = new EmailMRU();
-    });
 }
 
 // -----------------------------------------------------------------------------
@@ -82,9 +79,7 @@
     NM_FUNCTION;
     // <qmail> Not using KMailboxExtMrCalInfo </qmail>
     iFolders.ResetAndDestroy();
-    QT_TRYCATCH_LEAVING({
     delete iMru;
-    });
 }
 
 // -----------------------------------------------------------------------------
@@ -94,6 +89,10 @@
 {
     NM_FUNCTION;
 
+    QT_TRYCATCH_LEAVING({
+    iMru = new EmailMRU();
+    });
+
 // <qmail>
     CFSMailBoxBase::ConstructL(aMailBoxId);
 // </qmail>
@@ -431,9 +430,9 @@
 
     if(CFSMailPlugin* plugin = iRequestHandler->GetPluginByUid(GetId()))
         {
-        UpdateMrusL( aMessage.GetToRecipients(),
-                     aMessage.GetCCRecipients(),
-                     aMessage.GetBCCRecipients() );
+        UpdateMrus( aMessage.GetToRecipients() );
+        UpdateMrus( aMessage.GetCCRecipients() );
+        UpdateMrus( aMessage.GetBCCRecipients() );
         plugin->SendMessageL( aMessage );
         }
 	}
@@ -454,10 +453,9 @@
 
     if ( plugin )
         {
-        UpdateMrusL( aMessage.GetToRecipients(),
-                     aMessage.GetCCRecipients(),
-                     aMessage.GetBCCRecipients() );
-
+        UpdateMrus( aMessage.GetToRecipients() );
+        UpdateMrus( aMessage.GetCCRecipients() );
+        UpdateMrus( aMessage.GetBCCRecipients() );
 
         // init asynchronous request
         request = iRequestHandler->InitAsyncRequestL( GetId().PluginId(),
@@ -697,17 +695,16 @@
 
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
-// CFSMailBox::UpdateMrusL
+// CFSMailBox::UpdateMrus
 // -----------------------------------------------------------------------------
-void CFSMailBox::UpdateMrusL(
-    const RPointerArray<CFSMailAddress>& aRecipients,
-    const RPointerArray<CFSMailAddress>& aCCRecipients,
-    const RPointerArray<CFSMailAddress>& aBCCRecipients ) const
+void CFSMailBox::UpdateMrus(
+    const RPointerArray<CFSMailAddress>& aRecipients ) const
     {
     NM_FUNCTION;
 
     QT_TRYCATCH_LEAVING({
-        TUint count( aRecipients.Count() );
+
+    TUint count( aRecipients.Count() );
         TUint indexer( 0 );
         while ( indexer < count )
             {
@@ -718,31 +715,6 @@
             iMru->updateMRU(qname, qaddress);
             indexer++;
             }
-
-        count = aCCRecipients.Count();
-        indexer = 0 ;
-        while ( indexer < count )
-            {
-            TDesC& address(aCCRecipients[indexer]->GetEmailAddress() );
-            TDesC& name(aCCRecipients[indexer]->GetDisplayName() );
-            QString qaddress = QString::fromUtf16(address.Ptr(), address.Length());
-            QString qname = QString::fromUtf16(name.Ptr(), name.Length());
-            iMru->updateMRU(qname, qaddress);
-            indexer++;
-            }
-
-        count = aBCCRecipients.Count();
-        indexer = 0 ;
-        while ( indexer < count )
-            {
-            TDesC& address(aBCCRecipients[indexer]->GetEmailAddress() );
-            TDesC& name(aBCCRecipients[indexer]->GetDisplayName() );
-            QString qaddress = QString::fromUtf16(address.Ptr(), address.Length());
-            QString qname = QString::fromUtf16(name.Ptr(), name.Length());
-            iMru->updateMRU(qname, qaddress);
-            indexer++;
-            }
-
     });
 
     }
--- a/emailservices/emailcommon/src/CFSMailMessageBase.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailcommon/src/CFSMailMessageBase.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -288,6 +288,8 @@
     if (aRecipient) 
         {
         iNmPrivateMessageEnvelope->mToRecipients.append(aRecipient->GetNmAddress());
+        delete aRecipient;//ownership transferred to us so we can delete.
+        aRecipient = NULL;
         }
 // </qmail>
 }
@@ -304,6 +306,8 @@
         {
         iNmPrivateMessageEnvelope->mCcRecipients.append(
             aRecipient->GetNmAddress());
+        delete aRecipient;//ownership transferred to us so we can delete.
+        aRecipient = NULL;
         }
 // </qmail>
 }
@@ -320,6 +324,8 @@
         {
         iNmPrivateMessageEnvelope->mBccRecipients.append(
             aRecipient->GetNmAddress());
+        delete aRecipient;//ownership transferred to us so we can delete.
+        aRecipient = NULL;
         }
 // </qmail>      
 }
--- a/emailservices/emailcommon/src/CFSMailRequestHandler.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailcommon/src/CFSMailRequestHandler.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -153,9 +153,11 @@
         newRequest.iRequestStatus = TFSPendingRequest::EFSRequestPending;
         CFSMailRequestObserver* observer =
             CFSMailRequestObserver::NewL(*this, aOperationObserver);
+        CleanupStack::PushL(observer);
         newRequest.iObserver = observer;
         iPendingRequests.AppendL(newRequest);
-
+        CleanupStack::Pop(observer);
+        
         return newRequest;
     }
 
--- a/emailservices/emaildebug/inc/emailtrace.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emaildebug/inc/emailtrace.h	Thu Sep 30 11:43:07 2010 +0300
@@ -260,14 +260,17 @@
             
     static QFile file(NM_LOG_DIRECTORY +
                       QString("nmail_timestamps.log"));
-        if (NM_LOG_TO_FILE && !file.isOpen()) {
-            file.open(QIODevice::Append | QIODevice::Text | QIODevice::ReadWrite);
-        }
-        if (file.isWritable()) {
-            QTextStream(&file) << timestamp << '\n';
-        } else {
-            qDebug("[Nmail] %s",timestamp.toLatin1().data());
-        }
+    if (NM_LOG_TO_FILE && !file.isOpen()) {
+        file.open(QIODevice::Append | QIODevice::Text | QIODevice::ReadWrite);
+    }
+    if (file.isWritable()) {
+        QTextStream(&file) << timestamp << '\n';
+    } else {
+        qDebug("[Nmail] %s",timestamp.toLatin1().data());
+    }
+    if(file.isOpen()) {
+        file.close();
+    }
 }
 
 #else
--- a/emailservices/emailframework/inc/CFSMailPlugin.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailframework/inc/CFSMailPlugin.h	Thu Sep 30 11:43:07 2010 +0300
@@ -1063,7 +1063,7 @@
     /**
      * Returns plugin implementation uid
      */
-    inline TUid Id( ) const;
+    virtual TUid Id( ) const = 0;
 
 protected:
 
@@ -1085,7 +1085,6 @@
      * instance identifier key for destructor
      */
     TUid        iDtor_ID_Key;
-
     };
 
 //<cmail>
--- a/emailservices/emailframework/inc/CFSMailPlugin.inl	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailframework/inc/CFSMailPlugin.inl	Thu Sep 30 11:43:07 2010 +0300
@@ -60,9 +60,10 @@
 //
 inline CFSMailPlugin* CFSMailPlugin::NewL(TUid aUid)
     {
-    return static_cast<CFSMailPlugin*>(
+    CFSMailPlugin* plugin = static_cast<CFSMailPlugin*>(
         REComSession::CreateImplementationL(
             aUid, _FOFF( CFSMailPlugin, iDtor_ID_Key ) ) );
+    return plugin;
     }
 
 // -----------------------------------------------------------------------------
@@ -153,13 +154,3 @@
     }
 // </qmail>
 
-// <qmail>
-// -----------------------------------------------------------------------------
-// CFSMailPlugin::Id
-// -----------------------------------------------------------------------------
-inline TUid CFSMailPlugin::Id( ) const
-    {
-    return iDtor_ID_Key;
-    }
-// </qmail>
-
--- a/emailservices/emailstore/base_plugin/bwins/basepluginu.def	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailstore/base_plugin/bwins/basepluginu.def	Thu Sep 30 11:43:07 2010 +0300
@@ -107,7 +107,7 @@
 	?SetEndTimeInUtcL@CBaseMrInfoObject@@UAEXVTTime@@@Z @ 106 NONAME ; void CBaseMrInfoObject::SetEndTimeInUtcL(class TTime)
 	?SetRecurrenceTypeL@CBaseMrRecurrenceRule@@UAEXW4TMRRecurrenceType@MRRecurrenceRule@@@Z @ 107 NONAME ; void CBaseMrRecurrenceRule::SetRecurrenceTypeL(enum MRRecurrenceRule::TMRRecurrenceType)
 	?TranslateEmailFwMessageL@CBasePlugin@@MAEXAAVCFSMailMessagePart@@AAVCMsgStoreMessagePart@@H@Z @ 108 NONAME ; void CBasePlugin::TranslateEmailFwMessageL(class CFSMailMessagePart &, class CMsgStoreMessagePart &, int)
-	?GetPluginId@CBasePlugin@@MAEIXZ @ 109 NONAME ; unsigned int CBasePlugin::GetPluginId(void)
+  ?GetPluginId@CBasePlugin@@MBEIXZ @ 109 NONAME ; unsigned int CBasePlugin::GetPluginId(void) const
 	?CreateForwardReplyMessageL@CBasePlugin@@IAEPAVCFSMailMessage@@ABVTFSMailMsgId@@0HABVTDesC16@@HH@Z @ 110 NONAME ; class CFSMailMessage * CBasePlugin::CreateForwardReplyMessageL(class TFSMailMsgId const &, class TFSMailMsgId const &, int, class TDesC16 const &, int, int)
 	?SetCommonNameL@CBaseMrAttendee@@UAEXABVTDesC16@@@Z @ 111 NONAME ; void CBaseMrAttendee::SetCommonNameL(class TDesC16 const &)
 	?CreateMessageToSendL@CBasePlugin@@UAEPAVCFSMailMessage@@ABVTFSMailMsgId@@@Z @ 112 NONAME ; class CFSMailMessage * CBasePlugin::CreateMessageToSendL(class TFSMailMsgId const &)
@@ -222,4 +222,5 @@
 	?ExtensionL@CBaseMrInfoObject@@UAEPAXVTUid@@@Z @ 221 NONAME ; void * CBaseMrInfoObject::ExtensionL(class TUid)
 	?TranslateMsgStorePropsL@CBasePlugin@@MAEXABVTFSMailMsgId@@AAVCMsgStorePropertyContainer@@AAVCFSMailMessagePart@@W4TFSMailDetails@@@Z @ 222 NONAME ; void CBasePlugin::TranslateMsgStorePropsL(class TFSMailMsgId const &, class CMsgStorePropertyContainer &, class CFSMailMessagePart &, enum TFSMailDetails)
 	?GetMailboxDisplayNameL@CBasePlugin@@IAEXIAAVRBuf16@@@Z @ 223 NONAME ; void CBasePlugin::GetMailboxDisplayNameL(unsigned int, class RBuf16 &)
+        ?Id@CBasePlugin@@UBE?AVTUid@@XZ @ 224 NONAME ; class TUid CBasePlugin::Id(void) const
 
--- a/emailservices/emailstore/base_plugin/eabi/basepluginu.def	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailstore/base_plugin/eabi/basepluginu.def	Thu Sep 30 11:43:07 2010 +0300
@@ -13,7 +13,7 @@
 	_ZN11CBasePlugin10ResetCacheEv @ 12 NONAME
 	_ZN11CBasePlugin11CancelSyncLERK12TFSMailMsgId @ 13 NONAME
 	_ZN11CBasePlugin11ChildPartsLERK12TFSMailMsgIdS2_S2_S2_R13RPointerArrayI18CFSMailMessagePartE @ 14 NONAME
-	_ZN11CBasePlugin11GetPluginIdEv @ 15 NONAME
+	_ZNK11CBasePlugin11GetPluginIdEv @ 15 NONAME
 	_ZN11CBasePlugin11RefreshNowLERK12TFSMailMsgIdR22MFSMailRequestObserverii @ 16 NONAME
 	_ZN11CBasePlugin11SetContentLERK7TDesC16RK12TFSMailMsgIdS5_S5_S5_ @ 17 NONAME
 	_ZN11CBasePlugin12AddObserverLER20MFSMailEventObserver @ 18 NONAME
@@ -309,4 +309,5 @@
 	_ZThn4_NK21CBaseMrRecurrenceRule19RecurrenceStartTimeEv @ 308 NONAME
 	_ZThn4_NK21CBaseMrRecurrenceRule20RecurrentDaysofMonthEv @ 309 NONAME
 	_ZThn4_NK21CBaseMrRecurrenceRule4TypeEv @ 310 NONAME
+        _ZNK11CBasePlugin2IdEv @ 311 NONAME
 
--- a/emailservices/emailstore/base_plugin/inc/BasePlugin.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailstore/base_plugin/inc/BasePlugin.h	Thu Sep 30 11:43:07 2010 +0300
@@ -462,6 +462,9 @@
          virtual void SetMailboxName(
             const TFSMailMsgId& /*aMailboxId*/,
             const TDesC& /*aMailboxName*/ );
+        // <qmail>
+        virtual TUid Id( ) const;
+        // </qmail>
 
     // MMsgStoreObserver //
     public:
@@ -496,9 +499,9 @@
         void GetMailboxDisplayNameL(
             TMsgStoreId aId,
             RBuf& aDisplayName );
-
-         virtual TUint GetPluginId();
-
+         // <qmail>
+         virtual TUint GetPluginId() const;
+         // </qmail>
         /**
          * Get signature string from protocol specific subclass.
          * Caller is responsible for memory of returned string.
--- a/emailservices/emailstore/base_plugin/src/BasePlugin.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailstore/base_plugin/src/BasePlugin.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -1732,4 +1732,15 @@
     
     CleanupStack::PopAndDestroy( &currentDisplayName );
     }
+ // <qmail> 
+/**
+ * Id - Return plugin implementation id  
+ *
+ */ 
+TUid CBasePlugin::Id( ) const
+    {
+    return TUid::Uid( GetPluginId() );
+    }
+// </qmail>
 
+
--- a/emailservices/emailstore/base_plugin/src/basepluginmisc.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailstore/base_plugin/src/basepluginmisc.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -28,14 +28,15 @@
 #include "baseplugincommonutils.h"
 #include "baseplugindelayedopsprivate.h"
 
+// <qmail>
 /**
  * Base plugin has no particular id.
  */
-TUint CBasePlugin::GetPluginId()
+TUint CBasePlugin::GetPluginId() const
     {
     return 0;
     }
-
+// </qmail>
 
 /**
  *
--- a/emailservices/emailstore/message_store/debuglog/src/DebugLog.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/emailstore/message_store/debuglog/src/DebugLog.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -402,7 +402,8 @@
                                       TRefByValue< const TDesC16 > aFmt, 
                                       ... ) const
     {
-	VA_LIST list; // coverity[UNINIT]
+    // coverity[UNINIT]
+	VA_LIST list; 
 	VA_START(list,aFmt);
 
 	RDebugLog* self = const_cast<RDebugLog*>(this);
@@ -445,7 +446,8 @@
                                       TRefByValue< const TDesC8 > aFmt, 
                                       ... ) const
     {
-	VA_LIST list; // coverity[UNINIT]
+    // coverity[UNINIT]
+	VA_LIST list; 
 	VA_START(list,aFmt);
 
 	RDebugLog* self = const_cast<RDebugLog*>(this);
--- a/emailservices/nmailagent/inc/nmmailagent.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmailagent/inc/nmmailagent.h	Thu Sep 30 11:43:07 2010 +0300
@@ -90,7 +90,7 @@
 
     void valueChanged(const XQSettingsKey &key, const QVariant &value);
 
-    void delayedMailboxCreated(const NmId mailboxId);
+    void delayedMailboxCreated();
     
     void handleViewStateChangedEvent(const NmUiEventsNotifier::NmUiEventType eventType,
                                      const NmUiViewId viewId,
@@ -171,6 +171,7 @@
     int mLastOutboxCount;
     bool mUnreadIndicatorActive;
     int mSilenceMode;
+    NmId mNewMailboxId;
 };
 
 
--- a/emailservices/nmailagent/src/nmmailagent.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmailagent/src/nmmailagent.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -243,7 +243,7 @@
             mPluginFactory->interfaceInstance(pluginObject);
         if (plugin) {
             plugin->listMailboxes(mailboxes);
-            
+
             // Add the indicators
             // Must be made in reverse order to show them properly in
             // HbIndicator menu
@@ -259,20 +259,20 @@
                             arg(mailboxInfo->mName).
                             arg(mailboxInfo->mNewUnreadMailIdList.count()).
                             arg(mailboxInfo->mMailIdList.count()));
-    
+
                         bool wasActive = isMailboxActive(mailbox->id());
                         if (!wasActive) {
                             // do not activate the mailbox if it was left as hidden last time
                             activate = false;
                             mailboxInfo->mNewUnreadMailIdList.clear();
                         }
-    
+
                         mailboxInfo->mOutboxMails = getOutboxCount(mailbox->id(),
                             mailboxInfo->mOutboxFolderId);
                         if (mailboxInfo->mOutboxMails > 0 && wasActive) {
                             activate = true;
                         }
-    
+
                         // Create indicator for visible mailboxes
                         updateMailboxState(mailbox->id(), activate, false);
                     }
@@ -565,6 +565,7 @@
         QList<QVariant> list;
         list.append(QVariant(mailboxId));
         request->setArguments(list);
+        request->setSynchronous(EFalse);
         ok = request->send();
         NM_COMMENT(QString("Launch ok=%1 error=%2").arg(ok).arg(request->lastError()));
         delete request;
@@ -640,7 +641,7 @@
             NM_COMMENT("NmMailAgent: first mail in outbox");
         }
         mailboxInfo->mOutboxMails += messageIds.count();
-        
+
         updateMailboxState(mailboxId,true,true);
         updateSendIndicator();
     }
@@ -683,7 +684,7 @@
                     }
                 }
             }
-            
+
             if (updateMailbox) {
                 updateMailboxState(mailboxId);
                 updateUnreadIndicator();
@@ -703,7 +704,7 @@
     const NmId &mailboxId)
 {
     NM_FUNCTION;
-    
+
     NmMailboxInfo *mailboxInfo = getMailboxInfo(mailboxId);
 
     if (mailboxInfo) {
@@ -785,11 +786,9 @@
                 NmMailboxInfo *mailboxInfo = getMailboxInfo(mailboxId); // create a new mailbox if needed
                 if (!mailboxInfo) {
                     // Unable to initialise the mailbox. Try again later.
-                    NM_COMMENT("Cannot initialise mailbox");
-
-                    qRegisterMetaType<NmId>("NmId");
-                    QMetaObject::invokeMethod(this, "delayedMailboxCreated",
-                        Qt::QueuedConnection, Q_ARG(NmId,mailboxId));
+                    NM_COMMENT("Cannot initialise mailbox - retry in 200 ms");
+                    mNewMailboxId=mailboxId;
+                    QTimer::singleShot(200, this, SLOT(delayedMailboxCreated()));
                 }
 
                 // make sure the mailbox activity data is reseted
@@ -817,6 +816,7 @@
                     }
                 }
                 delete mailbox;
+                mailbox = NULL;
             }
             break;
         case NmMailboxDeleted:
@@ -840,12 +840,12 @@
 
     \param mailboxId id of the mailbox
 */
-void NmMailAgent::delayedMailboxCreated(const NmId mailboxId)
+void NmMailAgent::delayedMailboxCreated()
 {
     NM_FUNCTION;
 
     // create and subscribe to the mailbox, if not done earlier
-    getMailboxInfo(mailboxId);
+    getMailboxInfo(mNewMailboxId);
 }
 
 
@@ -870,7 +870,7 @@
         if (info) {
             // The message list view was shown. If the indicator of the mailbox
             // in question is active, deactivate it.
-            updateMailboxState(info->mId, false, false);  
+            updateMailboxState(info->mId, false, false);
             resetMailboxState(info);
         }
     }
@@ -910,7 +910,7 @@
 void NmMailAgent::resetMailboxState(NmMailboxInfo *info)
 {
     NM_FUNCTION;
-    
+
     info->mActive = false; // indicator is no longer active
     info->mNewUnreadMailIdList.clear(); // no mails are no longer 'new'
     storeMailboxActive(info->mId, false);
@@ -1074,10 +1074,12 @@
     NmMailboxInfo *info = NULL;
     NmDataPluginInterface *plugin = mPluginFactory->interfaceInstance(id);
     if (plugin) {
-        plugin->getMailboxById(id, mailbox);
-        if (mailbox) {
-            info = createMailboxInfo(*mailbox,plugin);
+        int err = plugin->getMailboxById(id, mailbox);
+        if (err == NmNoError && mailbox) {
+            info = createMailboxInfo(*mailbox,plugin);            
         }
+        delete mailbox;
+        mailbox = NULL;
     }
 
     return info;
@@ -1187,7 +1189,7 @@
     if (mAlertToneAllowed) {
         // Play tone only when phone is not in silence mode.
         if (!mSilenceMode) {
-            // Must instantiate it again to make sure correct tone is played  
+            // Must instantiate it again to make sure correct tone is played
             XQSystemToneService systemTone;
             systemTone.playTone(XQSystemToneService::EmailAlertTone);
         }
--- a/emailservices/nmailbase/inc/nmcommon.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmailbase/inc/nmcommon.h	Thu Sep 30 11:43:07 2010 +0300
@@ -164,10 +164,10 @@
     };
 Q_DECLARE_METATYPE(NmMailSortOrder)
 
+
 /*!
 	NMail error codes
 */
-
 const int NmNoError = 0;
 const int NmNotFoundError = -1;
 const int NmGeneralError = -2;
@@ -175,6 +175,8 @@
 const int NmAuthenticationError = -200;
 const int NmServerConnectionError = -201;
 const int NmConnectionError = -202;
+const int NmDiskFullError = -300;
+
 
 /*!
 	Predefined constants for ContentTypes and parameters
@@ -201,7 +203,7 @@
    
    It is used in NmFrameworkAdapter and NmDataPluginInterface
  */
-static const int NmMaxItemsInMessageList = 1000;
+static const int NmMaxItemsInMessageList = 2000;
 
 /*!
     \class NmId
--- a/emailservices/nmclientapi/bwins/nmailclientapiu.def	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/bwins/nmailclientapiu.def	Thu Sep 30 11:43:07 2010 +0300
@@ -102,7 +102,7 @@
 	?hasAttachments@NmApiMessageEnvelope@EmailClientApi@@QBE_NXZ @ 101 NONAME ; bool EmailClientApi::NmApiMessageEnvelope::hasAttachments(void) const
 	?setSender@NmApiMessageEnvelope@EmailClientApi@@QAEXABVQString@@@Z @ 102 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setSender(class QString const &)
 	??_ENmApiMailboxListing@EmailClientApi@@UAE@I@Z @ 103 NONAME ; EmailClientApi::NmApiMailboxListing::~NmApiMailboxListing(unsigned int)
-	?moveMessages@NmApiMessageManager@EmailClientApi@@QAE_NV?$QList@_K@@_K1@Z @ 104 NONAME ; bool EmailClientApi::NmApiMessageManager::moveMessages(class QList<unsigned long long>, unsigned long long, unsigned long long)
+	?moveMessages@NmApiMessageManager@EmailClientApi@@QAE_NV?$QList@_K@@_K1@Z @ 104 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::moveMessages(class QList<unsigned long long>, unsigned long long, unsigned long long)
 	?trUtf8@NmApiMessageTask@@SA?AVQString@@PBD0@Z @ 105 NONAME ; class QString NmApiMessageTask::trUtf8(char const *, char const *)
 	?staticMetaObject@NmApiMessageTask@@2UQMetaObject@@B @ 106 NONAME ; struct QMetaObject const NmApiMessageTask::staticMetaObject
 	??1NmApiMailboxSettingsData@EmailClientApi@@QAE@XZ @ 107 NONAME ; EmailClientApi::NmApiMailboxSettingsData::~NmApiMailboxSettingsData(void)
@@ -132,9 +132,9 @@
 	??_ENmApiFolder@EmailClientApi@@UAE@I@Z @ 131 NONAME ; EmailClientApi::NmApiFolder::~NmApiFolder(unsigned int)
 	?name@NmApiMailbox@EmailClientApi@@QBE?AVQString@@XZ @ 132 NONAME ; class QString EmailClientApi::NmApiMailbox::name(void) const
 	?getStaticMetaObject@NmApiFolderListing@EmailClientApi@@SAABUQMetaObject@@XZ @ 133 NONAME ; struct QMetaObject const & EmailClientApi::NmApiFolderListing::getStaticMetaObject(void)
-	?deleteMessages@NmApiMessageManager@EmailClientApi@@QAE_NV?$QList@_K@@@Z @ 134 NONAME ; bool EmailClientApi::NmApiMessageManager::deleteMessages(class QList<unsigned long long>)
+	?deleteMessages@NmApiMessageManager@EmailClientApi@@QAE_NV?$QList@_K@@@Z @ 134 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::deleteMessages(class QList<unsigned long long>)
 	?trUtf8@NmApiEmailService@EmailClientApi@@SA?AVQString@@PBD0@Z @ 135 NONAME ; class QString EmailClientApi::NmApiEmailService::trUtf8(char const *, char const *)
-	?createDraftMessage@NmApiMessageManager@EmailClientApi@@QAE_NPBVQVariant@@@Z @ 136 NONAME ; bool EmailClientApi::NmApiMessageManager::createDraftMessage(class QVariant const *)
+	?createDraftMessage@NmApiMessageManager@EmailClientApi@@QAE_NPBVQVariant@@@Z @ 136 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::createDraftMessage(class QVariant const *)
 	??1NmApiMailboxListing@EmailClientApi@@UAE@XZ @ 137 NONAME ; EmailClientApi::NmApiMailboxListing::~NmApiMailboxListing(void)
 	??0NmApiMailboxSettings@EmailClientApi@@QAE@PAVQObject@@@Z @ 138 NONAME ; EmailClientApi::NmApiMailboxSettings::NmApiMailboxSettings(class QObject *)
 	??1NmApiFolder@EmailClientApi@@UAE@XZ @ 139 NONAME ; EmailClientApi::NmApiFolder::~NmApiFolder(void)
@@ -249,7 +249,7 @@
 	??_ENmApiSettingsManager@EmailClientApi@@UAE@I@Z @ 248 NONAME ; EmailClientApi::NmApiSettingsManager::~NmApiSettingsManager(unsigned int)
 	??1NmApiMessageContent@EmailClientApi@@UAE@XZ @ 249 NONAME ; EmailClientApi::NmApiMessageContent::~NmApiMessageContent(void)
 	?isComplete@NmApiMessage@EmailClientApi@@QAE_NXZ @ 250 NONAME ; bool EmailClientApi::NmApiMessage::isComplete(void)
-	?fetchMessage@NmApiMessageManager@EmailClientApi@@QAE_N_K@Z @ 251 NONAME ; bool EmailClientApi::NmApiMessageManager::fetchMessage(unsigned long long)
+	?fetchMessage@NmApiMessageManager@EmailClientApi@@QAE_N_K@Z @ 251 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::fetchMessage(unsigned long long)
 	??1NmApiAttachment@EmailClientApi@@UAE@XZ @ 252 NONAME ; EmailClientApi::NmApiAttachment::~NmApiAttachment(void)
 	??_ENmApiMessage@EmailClientApi@@UAE@I@Z @ 253 NONAME ; EmailClientApi::NmApiMessage::~NmApiMessage(unsigned int)
 	?file@NmApiAttachment@EmailClientApi@@QAE?AVXQSharableFile@@XZ @ 254 NONAME ; class XQSharableFile EmailClientApi::NmApiAttachment::file(void)
@@ -258,8 +258,8 @@
 	?setMailboxId@NmApiMessageEnvelope@EmailClientApi@@QAEX_K@Z @ 257 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setMailboxId(unsigned long long)
 	?setContentType@NmApiMessageContent@EmailClientApi@@QAEXABVQString@@@Z @ 258 NONAME ; void EmailClientApi::NmApiMessageContent::setContentType(class QString const &)
 	??0NmApiTextContent@EmailClientApi@@QAE@ABV01@@Z @ 259 NONAME ABSENT ; EmailClientApi::NmApiTextContent::NmApiTextContent(class EmailClientApi::NmApiTextContent const &)
-	?createForwardMessage@NmApiMessageManager@EmailClientApi@@QAE_NPAVNmApiMessage@2@PBVQVariant@@@Z @ 260 NONAME ; bool EmailClientApi::NmApiMessageManager::createForwardMessage(class EmailClientApi::NmApiMessage *, class QVariant const *)
-	?createReplyMessage@NmApiMessageManager@EmailClientApi@@QAE_NPBVNmApiMessage@2@PBVQVariant@@_N@Z @ 261 NONAME ; bool EmailClientApi::NmApiMessageManager::createReplyMessage(class EmailClientApi::NmApiMessage const *, class QVariant const *, bool)
+	?createForwardMessage@NmApiMessageManager@EmailClientApi@@QAE_NPAVNmApiMessage@2@PBVQVariant@@@Z @ 260 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::createForwardMessage(class EmailClientApi::NmApiMessage *, class QVariant const *)
+	?createReplyMessage@NmApiMessageManager@EmailClientApi@@QAE_NPBVNmApiMessage@2@PBVQVariant@@_N@Z @ 261 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::createReplyMessage(class EmailClientApi::NmApiMessage const *, class QVariant const *, bool)
 	??0NmApiMessageContent@EmailClientApi@@QAE@ABV01@@Z @ 262 NONAME ABSENT ; EmailClientApi::NmApiMessageContent::NmApiMessageContent(class EmailClientApi::NmApiMessageContent const &)
 	?setId@NmApiMessageContent@EmailClientApi@@QAEX_K@Z @ 263 NONAME ; void EmailClientApi::NmApiMessageContent::setId(unsigned long long)
 	?setEnvelope@NmApiMessage@EmailClientApi@@QAEXAAVNmApiMessageEnvelope@2@@Z @ 264 NONAME ; void EmailClientApi::NmApiMessage::setEnvelope(class EmailClientApi::NmApiMessageEnvelope &)
@@ -269,22 +269,22 @@
 	?id@NmApiMessageContent@EmailClientApi@@QBE_KXZ @ 268 NONAME ; unsigned long long EmailClientApi::NmApiMessageContent::id(void) const
 	?setHtmlContent@NmApiMessage@EmailClientApi@@QAEXAAVNmApiTextContent@2@@Z @ 269 NONAME ; void EmailClientApi::NmApiMessage::setHtmlContent(class EmailClientApi::NmApiTextContent &)
 	??0NmApiMessage@EmailClientApi@@QAE@XZ @ 270 NONAME ; EmailClientApi::NmApiMessage::NmApiMessage(void)
-	?sendMessage@NmApiMessageManager@EmailClientApi@@QAE_NABVNmApiMessage@2@@Z @ 271 NONAME ; bool EmailClientApi::NmApiMessageManager::sendMessage(class EmailClientApi::NmApiMessage const &)
+	?sendMessage@NmApiMessageManager@EmailClientApi@@QAE_NABVNmApiMessage@2@@Z @ 271 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::sendMessage(class EmailClientApi::NmApiMessage const &)
 	?setComplete@NmApiMessageContent@EmailClientApi@@QAEX_N@Z @ 272 NONAME ; void EmailClientApi::NmApiMessageContent::setComplete(bool)
 	?size@NmApiMessageContent@EmailClientApi@@QBEIXZ @ 273 NONAME ; unsigned int EmailClientApi::NmApiMessageContent::size(void) const
 	?plainTextContent@NmApiMessage@EmailClientApi@@QAE?AVNmApiTextContent@2@XZ @ 274 NONAME ; class EmailClientApi::NmApiTextContent EmailClientApi::NmApiMessage::plainTextContent(void)
 	??_ENmApiAttachment@EmailClientApi@@UAE@I@Z @ 275 NONAME ; EmailClientApi::NmApiAttachment::~NmApiAttachment(unsigned int)
 	??_ENmApiMessageContent@EmailClientApi@@UAE@I@Z @ 276 NONAME ; EmailClientApi::NmApiMessageContent::~NmApiMessageContent(unsigned int)
 	?envelope@NmApiMessage@EmailClientApi@@QAEAAVNmApiMessageEnvelope@2@XZ @ 277 NONAME ; class EmailClientApi::NmApiMessageEnvelope & EmailClientApi::NmApiMessage::envelope(void)
-	?fetchAttachment@NmApiMessageManager@EmailClientApi@@QAE_NABVNmApiMessage@2@_K@Z @ 278 NONAME ; bool EmailClientApi::NmApiMessageManager::fetchAttachment(class EmailClientApi::NmApiMessage const &, unsigned long long)
+	?fetchAttachment@NmApiMessageManager@EmailClientApi@@QAE_NABVNmApiMessage@2@_K@Z @ 278 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::fetchAttachment(class EmailClientApi::NmApiMessage const &, unsigned long long)
 	?htmlContent@NmApiMessage@EmailClientApi@@QAE?AVNmApiTextContent@2@XZ @ 279 NONAME ; class EmailClientApi::NmApiTextContent EmailClientApi::NmApiMessage::htmlContent(void)
 	??1NmApiTextContent@EmailClientApi@@UAE@XZ @ 280 NONAME ; EmailClientApi::NmApiTextContent::~NmApiTextContent(void)
 	?setSize@NmApiMessageContent@EmailClientApi@@QAEXI@Z @ 281 NONAME ; void EmailClientApi::NmApiMessageContent::setSize(unsigned int)
-	?saveMessage@NmApiMessageManager@EmailClientApi@@QAE_NABVNmApiMessage@2@@Z @ 282 NONAME ; bool EmailClientApi::NmApiMessageManager::saveMessage(class EmailClientApi::NmApiMessage const &)
+	?saveMessage@NmApiMessageManager@EmailClientApi@@QAE_NABVNmApiMessage@2@@Z @ 282 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::saveMessage(class EmailClientApi::NmApiMessage const &)
 	?content@NmApiTextContent@EmailClientApi@@QBE?AVQString@@XZ @ 283 NONAME ; class QString EmailClientApi::NmApiTextContent::content(void) const
 	??0NmApiAttachment@EmailClientApi@@QAE@ABV01@@Z @ 284 NONAME ; EmailClientApi::NmApiAttachment::NmApiAttachment(class EmailClientApi::NmApiAttachment const &)
 	??_ENmApiTextContent@EmailClientApi@@UAE@I@Z @ 285 NONAME ; EmailClientApi::NmApiTextContent::~NmApiTextContent(unsigned int)
-	?removeAttachment@NmApiMessageManager@EmailClientApi@@QAE_NAAVNmApiMessage@2@_K@Z @ 286 NONAME ; bool EmailClientApi::NmApiMessageManager::removeAttachment(class EmailClientApi::NmApiMessage &, unsigned long long)
+	?removeAttachment@NmApiMessageManager@EmailClientApi@@QAE_NAAVNmApiMessage@2@_K@Z @ 286 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::removeAttachment(class EmailClientApi::NmApiMessage &, unsigned long long)
 	??4NmApiMessageContent@EmailClientApi@@QAEAAV01@ABV01@@Z @ 287 NONAME ABSENT ; class EmailClientApi::NmApiMessageContent & EmailClientApi::NmApiMessageContent::operator=(class EmailClientApi::NmApiMessageContent const &)
 	?setContent@NmApiTextContent@EmailClientApi@@QAEXABVQString@@@Z @ 288 NONAME ; void EmailClientApi::NmApiTextContent::setContent(class QString const &)
 	??0NmApiMessageContent@EmailClientApi@@QAE@XZ @ 289 NONAME ; EmailClientApi::NmApiMessageContent::NmApiMessageContent(void)
@@ -298,7 +298,7 @@
 	??0NmApiAttachment@EmailClientApi@@QAE@XZ @ 297 NONAME ; EmailClientApi::NmApiAttachment::NmApiAttachment(void)
 	?contentType@NmApiMessageContent@EmailClientApi@@QBE?AVQString@@XZ @ 298 NONAME ; class QString EmailClientApi::NmApiMessageContent::contentType(void) const
 	?setComplete@NmApiMessage@EmailClientApi@@QAEX_N@Z @ 299 NONAME ; void EmailClientApi::NmApiMessage::setComplete(bool)
-	?createAttachment@NmApiMessageManager@EmailClientApi@@QAE_NAAVNmApiMessage@2@ABVQVariant@@@Z @ 300 NONAME ; bool EmailClientApi::NmApiMessageManager::createAttachment(class EmailClientApi::NmApiMessage &, class QVariant const &)
+	?createAttachment@NmApiMessageManager@EmailClientApi@@QAE_NAAVNmApiMessage@2@ABVQVariant@@@Z @ 300 NONAME ABSENT ; bool EmailClientApi::NmApiMessageManager::createAttachment(class EmailClientApi::NmApiMessage &, class QVariant const &)
 	?addAttachment@NmApiMessage@EmailClientApi@@QAEXAAVNmApiAttachment@2@@Z @ 301 NONAME ; void EmailClientApi::NmApiMessage::addAttachment(class EmailClientApi::NmApiAttachment &)
 	??0NmApiTextContent@EmailClientApi@@QAE@XZ @ 302 NONAME ; EmailClientApi::NmApiTextContent::NmApiTextContent(void)
 	?trUtf8@NmApiMessageSearch@EmailClientApi@@SA?AVQString@@PBD0@Z @ 303 NONAME ; class QString EmailClientApi::NmApiMessageSearch::trUtf8(char const *, char const *)
@@ -327,4 +327,34 @@
 	?setFlag@NmApiMessageEnvelope@EmailClientApi@@QAEXW4NmApiMessageFlag@2@_N@Z @ 326 NONAME ; void EmailClientApi::NmApiMessageEnvelope::setFlag(enum EmailClientApi::NmApiMessageFlag, bool)
 	?flags@NmApiMessageEnvelope@EmailClientApi@@QBE?AV?$QFlags@W4NmApiMessageFlag@EmailClientApi@@@@XZ @ 327 NONAME ; class QFlags<enum EmailClientApi::NmApiMessageFlag> EmailClientApi::NmApiMessageEnvelope::flags(void) const
 	?getMessage@NmApiEmailService@EmailClientApi@@QAE_N_K00AAVNmApiMessage@2@@Z @ 328 NONAME ; bool EmailClientApi::NmApiEmailService::getMessage(unsigned long long, unsigned long long, unsigned long long, class EmailClientApi::NmApiMessage &)
+	?getFolder@NmApiEmailService@EmailClientApi@@QAE_N_K0AAVNmApiFolder@2@@Z @ 329 NONAME ; bool EmailClientApi::NmApiEmailService::getFolder(unsigned long long, unsigned long long, class EmailClientApi::NmApiFolder &)
+	?staticMetaObject@NmApiOperation@EmailClientApi@@2UQMetaObject@@B @ 330 NONAME ; struct QMetaObject const EmailClientApi::NmApiOperation::staticMetaObject
+	?saveMessage@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@ABVNmApiMessage@2@@Z @ 331 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::saveMessage(class EmailClientApi::NmApiMessage const &)
+	?moveMessages@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@V?$QList@_K@@_K1@Z @ 332 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::moveMessages(class QList<unsigned long long>, unsigned long long, unsigned long long)
+	?removeAttachment@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@AAVNmApiMessage@2@_K@Z @ 333 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::removeAttachment(class EmailClientApi::NmApiMessage &, unsigned long long)
+	?trUtf8@NmApiOperation@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 334 NONAME ; class QString EmailClientApi::NmApiOperation::trUtf8(char const *, char const *, int)
+	?createAttachment@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@AAVNmApiMessage@2@ABVQVariant@@@Z @ 335 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::createAttachment(class EmailClientApi::NmApiMessage &, class QVariant const &)
+	??1NmApiOperation@EmailClientApi@@UAE@XZ @ 336 NONAME ; EmailClientApi::NmApiOperation::~NmApiOperation(void)
+	?operationComplete@NmApiOperation@EmailClientApi@@IAEXHVQVariant@@@Z @ 337 NONAME ; void EmailClientApi::NmApiOperation::operationComplete(int, class QVariant)
+	?createDraftMessage@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@PBVQVariant@@@Z @ 338 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::createDraftMessage(class QVariant const *)
+	?createForwardMessage@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@PAVNmApiMessage@2@PBVQVariant@@@Z @ 339 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::createForwardMessage(class EmailClientApi::NmApiMessage *, class QVariant const *)
+	?operation@NmApiOperation@EmailClientApi@@QBE?AW4NmApiOperationType@2@XZ @ 340 NONAME ; enum EmailClientApi::NmApiOperationType EmailClientApi::NmApiOperation::operation(void) const
+	??_ENmApiOperation@EmailClientApi@@UAE@I@Z @ 341 NONAME ; EmailClientApi::NmApiOperation::~NmApiOperation(unsigned int)
+	??0NmApiOperation@EmailClientApi@@IAE@PAVQObject@@W4NmApiOperationStatus@1@W4NmApiOperationType@1@@Z @ 342 NONAME ; EmailClientApi::NmApiOperation::NmApiOperation(class QObject *, enum EmailClientApi::NmApiOperationStatus, enum EmailClientApi::NmApiOperationType)
+	?deleteMessages@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@V?$QList@_K@@@Z @ 343 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::deleteMessages(class QList<unsigned long long>)
+	?tr@NmApiOperation@EmailClientApi@@SA?AVQString@@PBD0@Z @ 344 NONAME ; class QString EmailClientApi::NmApiOperation::tr(char const *, char const *)
+	?qt_metacast@NmApiOperation@EmailClientApi@@UAEPAXPBD@Z @ 345 NONAME ; void * EmailClientApi::NmApiOperation::qt_metacast(char const *)
+	?fetchMessage@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@_K@Z @ 346 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::fetchMessage(unsigned long long)
+	?fetchAttachment@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@ABVNmApiMessage@2@_K@Z @ 347 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::fetchAttachment(class EmailClientApi::NmApiMessage const &, unsigned long long)
+	?qt_metacall@NmApiOperation@EmailClientApi@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 348 NONAME ; int EmailClientApi::NmApiOperation::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?metaObject@NmApiOperation@EmailClientApi@@UBEPBUQMetaObject@@XZ @ 349 NONAME ; struct QMetaObject const * EmailClientApi::NmApiOperation::metaObject(void) const
+	?status@NmApiOperation@EmailClientApi@@QBE?AW4NmApiOperationStatus@2@XZ @ 350 NONAME ; enum EmailClientApi::NmApiOperationStatus EmailClientApi::NmApiOperation::status(void) const
+	?tr@NmApiOperation@EmailClientApi@@SA?AVQString@@PBD0H@Z @ 351 NONAME ; class QString EmailClientApi::NmApiOperation::tr(char const *, char const *, int)
+	?sendMessage@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@ABVNmApiMessage@2@@Z @ 352 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::sendMessage(class EmailClientApi::NmApiMessage const &)
+	?createReplyMessage@NmApiMessageManager@EmailClientApi@@QAE?AV?$QPointer@VNmApiOperation@EmailClientApi@@@@PBVNmApiMessage@2@PBVQVariant@@_N@Z @ 353 NONAME ; class QPointer<class EmailClientApi::NmApiOperation> EmailClientApi::NmApiMessageManager::createReplyMessage(class EmailClientApi::NmApiMessage const *, class QVariant const *, bool)
+	?trUtf8@NmApiOperation@EmailClientApi@@SA?AVQString@@PBD0@Z @ 354 NONAME ; class QString EmailClientApi::NmApiOperation::trUtf8(char const *, char const *)
+	?getStaticMetaObject@NmApiOperation@EmailClientApi@@SAABUQMetaObject@@XZ @ 355 NONAME ; struct QMetaObject const & EmailClientApi::NmApiOperation::getStaticMetaObject(void)
+	??4NmApiMessage@EmailClientApi@@QAEAAV01@ABV01@@Z @ 356 NONAME ; class EmailClientApi::NmApiMessage & EmailClientApi::NmApiMessage::operator=(class EmailClientApi::NmApiMessage const &)
+	??4NmApiAttachment@EmailClientApi@@QAEAAV01@ABV01@@Z @ 357 NONAME ; class EmailClientApi::NmApiAttachment & EmailClientApi::NmApiAttachment::operator=(class EmailClientApi::NmApiAttachment const &)
+	?getMailboxType@NmApiMailboxSettings@EmailClientApi@@QAE?AVQString@@_K@Z @ 358 NONAME ; class QString EmailClientApi::NmApiMailboxSettings::getMailboxType(unsigned long long)
 
--- a/emailservices/nmclientapi/eabi/nmailclientapiu.def	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/eabi/nmailclientapiu.def	Thu Sep 30 11:43:07 2010 +0300
@@ -368,4 +368,32 @@
 	_ZNK14EmailClientApi20NmApiMessageEnvelope8priorityEv @ 367 NONAME
 	_ZNK14EmailClientApi20NmApiMessageEnvelope9isFlagSetENS_16NmApiMessageFlagE @ 368 NONAME
 	_ZN14EmailClientApi17NmApiEmailService10getMessageEyyyRNS_12NmApiMessageE @ 369 NONAME
+	_ZN14EmailClientApi17NmApiEmailService9getFolderEyyRNS_11NmApiFolderE @ 370 NONAME
+	_ZN14EmailClientApi14NmApiOperation11qt_metacallEN11QMetaObject4CallEiPPv @ 371 NONAME
+	_ZN14EmailClientApi14NmApiOperation11qt_metacastEPKc @ 372 NONAME
+	_ZN14EmailClientApi14NmApiOperation16staticMetaObjectE @ 373 NONAME DATA 16
+	_ZN14EmailClientApi14NmApiOperation17operationCompleteEi8QVariant @ 374 NONAME
+	_ZN14EmailClientApi14NmApiOperation19getStaticMetaObjectEv @ 375 NONAME
+	_ZN14EmailClientApi14NmApiOperationC2EP7QObjectNS_20NmApiOperationStatusENS_18NmApiOperationTypeE @ 376 NONAME
+	_ZN14EmailClientApi14NmApiOperationD0Ev @ 377 NONAME
+	_ZN14EmailClientApi14NmApiOperationD1Ev @ 378 NONAME
+	_ZN14EmailClientApi14NmApiOperationD2Ev @ 379 NONAME
+	_ZNK14EmailClientApi14NmApiOperation10metaObjectEv @ 380 NONAME
+	_ZNK14EmailClientApi14NmApiOperation6statusEv @ 381 NONAME
+	_ZNK14EmailClientApi14NmApiOperation9operationEv @ 382 NONAME
+	_ZTIN14EmailClientApi14NmApiOperationE @ 383 NONAME
+	_ZTVN14EmailClientApi14NmApiOperationE @ 384 NONAME
+	_ZN14EmailClientApi12NmApiMessageC1ERKS0_ @ 385 NONAME
+	_ZN14EmailClientApi12NmApiMessageC2ERKS0_ @ 386 NONAME
+	_ZN14EmailClientApi12NmApiMessageaSERKS0_ @ 387 NONAME
+	_ZN14EmailClientApi15NmApiAttachmentC1ERKS0_ @ 388 NONAME
+	_ZN14EmailClientApi15NmApiAttachmentC2ERKS0_ @ 389 NONAME
+	_ZN14EmailClientApi15NmApiAttachmentaSERKS0_ @ 390 NONAME
+	_ZN14EmailClientApi16NmApiTextContentC1ERKS0_ @ 391 NONAME
+	_ZN14EmailClientApi16NmApiTextContentC2ERKS0_ @ 392 NONAME
+	_ZN14EmailClientApi16NmApiTextContentaSERKS0_ @ 393 NONAME
+	_ZN14EmailClientApi19NmApiMessageContentC1ERKS0_ @ 394 NONAME
+	_ZN14EmailClientApi19NmApiMessageContentC2ERKS0_ @ 395 NONAME
+	_ZN14EmailClientApi19NmApiMessageContentaSERKS0_ @ 396 NONAME
+	_ZN14EmailClientApi20NmApiMailboxSettings14getMailboxTypeEy @ 397 NONAME
 
--- a/emailservices/nmclientapi/inc/nmapiattachment_p.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapiattachment_p.h	Thu Sep 30 11:43:07 2010 +0300
@@ -25,8 +25,8 @@
 {
 
 public:
-    
     NmApiAttachmentPrivate();
+    NmApiAttachmentPrivate(const NmApiAttachmentPrivate &attachmentprivate);
     virtual ~NmApiAttachmentPrivate();
 
     QString fileName();
--- a/emailservices/nmclientapi/inc/nmapiengine.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapiengine.h	Thu Sep 30 11:43:07 2010 +0300
@@ -19,6 +19,7 @@
 #define NMAPIENGINE_H
 
 #include <CFSMailPlugin.h>
+#include <CFSMailFolder.h>
 
 #include "nmcommon.h"
 #include "nmapiprivateclasses.h"
@@ -27,8 +28,9 @@
 
 namespace EmailClientApi
 {
+
+class NmApiFolder;
 class NmApiMailbox;
-class NmApiFolder;
 class NmApiMessageEnvelope;
 class NmApiMessage;
 }
@@ -51,6 +53,11 @@
         const quint64 folderId,
         const quint64 envelopeId,
         EmailClientApi::NmApiMessageEnvelope &envelope);
+
+    bool getFolderById(
+        const quint64 mailboxId,
+        const quint64 folderId,
+        EmailClientApi::NmApiFolder &mailboxFolder);
 		
     bool getMailboxById(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailbox);
 
--- a/emailservices/nmclientapi/inc/nmapiheaders.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapiheaders.h	Thu Sep 30 11:43:07 2010 +0300
@@ -33,6 +33,7 @@
 #include <QDateTime>
 #include <QExplicitlySharedDataPointer>
 #include <QSharedData>
+#include <QPointer>
 
 #include <imapset.h>
 #include <pop3set.h>
@@ -41,9 +42,12 @@
 
 #include <e32base.h>
 
-#include <SMTPSET.H>
+#include <smtpset.h>
 
 #include <xqconversions.h>
+#include <xqsettingsmanager.h>
+#include <xqcentralrepositorysearchcriteria.h>
+#include <xqcentralrepositoryutils.h>
 
 #include <nmdataplugininterface.h>
 
@@ -66,6 +70,7 @@
 // nmail_settings_api
 #include <nmapimailboxsettings.h>
 #include <nmapimailboxsettingsdata.h>
+#include <nmapisettingsmanager.h>
 
 // nmail_client_api
 #include <nmapicommon.h>
@@ -84,6 +89,7 @@
 #include <nmapimessage.h>
 #include <nmapimessagemanager.h>
 #include <nmapimessagesearch.h>
+#include <nmapioperation.h>
 #include <nmapimessagecontent.h>
 #include <nmapitextcontent.h>
 #include <nmapiattachment.h>
@@ -108,9 +114,12 @@
 #include "nmapitypesconverter.h"
 #include "nmapimessagesearch_p.h"
 #include "nmapimessage_p.h"
+#include "nmapisettingsmanager_p.h"
 #include "nmapimessagecontent_p.h"
 #include "nmapitextcontent_p.h"
 #include "nmapiattachment_p.h"
-
+#include "nmapioperationcreatedraftmessage.h"
+#include "ipssettingkeys.h"
+#include "nmapioperationsendmessage.h"
 
 #endif // NMAPIHEADERS_H
--- a/emailservices/nmclientapi/inc/nmapimailboxsettings_p.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapimailboxsettings_p.h	Thu Sep 30 11:43:07 2010 +0300
@@ -38,6 +38,7 @@
     ~NmApiMailboxSettingsPrivate();
 
     bool listMailboxIds(QList<quint64> &idList);
+    QString getMailboxType(quint64 mailboxId);
     bool loadSettings(quint64 mailboxId, NmApiMailboxSettingsData &data);
     bool saveSettings(const NmApiMailboxSettingsData &data);
     bool createMailbox(const QString &mailboxType, NmApiMailboxSettingsData &data);
@@ -49,6 +50,7 @@
     
 private:
     void createPopImapMailbox(const QString &type, NmApiMailboxSettingsData &data);
+    QString resolveMailboxTypeL(quint64 mailboxId);
 
     
 private:
--- a/emailservices/nmclientapi/inc/nmapimessage_p.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapimessage_p.h	Thu Sep 30 11:43:07 2010 +0300
@@ -26,6 +26,7 @@
 
 public:
     NmApiMessagePrivate();
+    NmApiMessagePrivate(const NmApiMessagePrivate &other);
     virtual ~NmApiMessagePrivate();
 
     NmApiTextContent plainTextContent();
--- a/emailservices/nmclientapi/inc/nmapimessagecontent_p.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapimessagecontent_p.h	Thu Sep 30 11:43:07 2010 +0300
@@ -25,6 +25,7 @@
 {
 public:
     NmApiMessageContentPrivate();
+    NmApiMessageContentPrivate(const NmApiMessageContentPrivate &messagecontentprivate);
     virtual ~NmApiMessageContentPrivate();
 
     QString contentType() const;
--- a/emailservices/nmclientapi/inc/nmapimessagemanager_p.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapimessagemanager_p.h	Thu Sep 30 11:43:07 2010 +0300
@@ -19,15 +19,14 @@
 #define NMAPIMESSAGEMANAGER_P_H_
 
 #include <QObject>
+#include <QPointer>
+
+#include <CFSMailCommon.h>
 #include <nmapimessagemanager.h>
-#include <nmapifolder.h>
-#include <nmapidatapluginfactory.h>
-#include <nmcommon.h>
-#include <nmapifolder.h>
-#include <nmapiprivateclasses.h>
 
-
-class NmApiEmailMessage;
+class NmApiEngine;
+class CFSMailBox;
+class CFSMailPlugin;
 
 namespace EmailClientApi
 {
@@ -39,42 +38,19 @@
     NmApiMessageManagerPrivate(QObject *parent,quint64 mailboxId);
     virtual ~NmApiMessageManagerPrivate();
     
+public slots: 
+    QPointer<NmApiOperation> createDraftMessage(const QVariant *initData);
+    QPointer<NmApiOperation> sendMessage(const NmApiMessage &message);
+    QPointer<NmApiOperation> saveMessage(const NmApiMessage &message);
+
 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 initialise();
     
-	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;
+    TFSMailMsgId mMailBoxId;
+    CFSMailBox *mMailBox;
+    CFSMailPlugin *mMailPlugin; //not owned
+    NmApiEngine *mEngine;
 };
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapioperationcreatedraftmessage.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,57 @@
+/*
+ * 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:
+ *      Draft message creation operation header.
+ */
+
+#ifndef NMAPIOPERATIONCREATEDRAFTMESSAGE_H_
+#define NMAPIOPERATIONCREATEDRAFTMESSAGE_H_
+
+#include <QObject>
+#include <QVariant>
+#include <MFSMailRequestObserver.h>
+#include <nmapioperation.h>
+
+class CFSMailBox;
+
+using namespace EmailClientApi;
+
+class NmApiOperationCreateDraftMessage : public NmApiOperation, 
+                                         public MFSMailRequestObserver
+{
+    Q_OBJECT
+public:
+    NmApiOperationCreateDraftMessage(const QVariant *initData,
+                                     CFSMailBox &mailBox,
+                                     QObject *parent = 0);
+    virtual ~NmApiOperationCreateDraftMessage();
+
+    // from MFSMailRequestObserver
+    void RequestResponseL(TFSProgress aEvent, TInt aRequestId);
+
+private slots:
+    void start();
+
+public slots:
+    void cancel();
+    
+private:
+    const QVariant mInitData;
+    CFSMailBox &mMailBox;
+    TInt mRequestId;
+
+};
+
+
+#endif /* NMAPIOPERATIONCREATEDRAFTMESSAGE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/inc/nmapioperationsendmessage.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ *      Send message operation header.
+ */
+
+#ifndef NMAPIOPERATIONSENDMESSAGE_H_
+#define NMAPIOPERATIONSENDMESSAGE_H_
+
+#include <QObject>
+#include <nmapioperation.h>
+#include <nmapimessage.h>
+#include <MFSMailRequestObserver.h>
+
+class CFSMailBox;
+namespace EmailClientApi
+{
+
+class NmApiMessage;
+
+class NmApiOperationSendMessage : public NmApiOperation, public MFSMailRequestObserver
+{
+    Q_OBJECT
+public:
+    NmApiOperationSendMessage(const NmApiMessage &message, CFSMailBox &mailBox, QObject *parent = 0);
+    virtual ~NmApiOperationSendMessage();
+    
+    void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
+
+private slots:
+    void start();
+
+public slots:
+    void cancel();
+    
+private:
+    NmApiMessage mMessage;
+    CFSMailBox &mMailBox;
+    TInt mRequestId;
+};
+}
+
+#endif /* NMAPIOPERATIONSENDMESSAGE_H_ */
--- a/emailservices/nmclientapi/inc/nmapipopimapsettingsmanager.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapipopimapsettingsmanager.h	Thu Sep 30 11:43:07 2010 +0300
@@ -11,27 +11,28 @@
 *
 * Contributors:
 *
-* Description:
+* Description: Handles the populating of default settings for pop and imap mailboxes
 *
 */
 
 #ifndef NMAPIPOPIMAPSETTINGSMANAGER_H
 #define NMAPIPOPIMAPSETTINGSMANAGER_H
 
-#include <nmapimailboxsettingsdata.h>
 
 namespace EmailClientApi {
-
+class NmApiMailboxSettingsData;
 class NmApiPopImapSettingsManager 
 {
-public:       
+public:
     NmApiPopImapSettingsManager();
-    virtual ~NmApiPopImapSettingsManager();
+    ~NmApiPopImapSettingsManager();
     bool populateDefaults(const QString &mailboxType, NmApiMailboxSettingsData &data);
 
 private:
-    void populateImapDefs(NmApiMailboxSettingsData &data);
-    void populatePopDefs(NmApiMailboxSettingsData &data);
+    void populateImapDefaultsL(NmApiMailboxSettingsData &data);
+    void populatePopDefaultsL(NmApiMailboxSettingsData &data);
+    void populateSmtpDefaultsL(NmApiMailboxSettingsData &data);
+    void populateCenrepDefaults(NmApiMailboxSettingsData &data);
     
 };
 }//namespace
--- a/emailservices/nmclientapi/inc/nmapisettingsmanager_p.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapisettingsmanager_p.h	Thu Sep 30 11:43:07 2010 +0300
@@ -18,53 +18,95 @@
 #ifndef NMAPISETTINGSMANAGER_P_H_
 #define NMAPISETTINGSMANAGER_P_H_
 
-#include <QVariant>
-
-#include <nmapimailboxsettingsdata.h>
-#include <cemailaccounts.h>
-
-class CImImap4Settings;
-class CImSmtpSettings;
-class XQSettingsManager;
-class XQCentralRepositoryUtils;
 
 namespace EmailClientApi
 {
 
 class NmApiSettingsManagerPrivate
 {
+private:
+    class AccountDataCleanUpItem
+    {
+    public:
+        /* CleanupItem class for making sure that all allocated members 
+           will be deleted and set to null when load or save function execution
+           stops.
+         */
+        AccountDataCleanUpItem(CEmailAccounts *&account,
+            CImPop3Settings *&pop3Settings,
+            CImImap4Settings *&imap4Settings,
+            CImSmtpSettings *&smtpSettings,
+            XQSettingsManager *&qSettingsManager
+        )
+            : 
+            mAccount(account),
+            mPop3Settings(pop3Settings),
+            mImap4Settings(imap4Settings),
+            mSmtpSettings(smtpSettings),
+            mQSettingsManager(qSettingsManager)
+        {
+        }
+        
+        ~AccountDataCleanUpItem()
+        {
+            delete mAccount;
+            mAccount = NULL;
+            delete mPop3Settings;
+            mPop3Settings = NULL;
+            delete mImap4Settings;
+            mImap4Settings = NULL;
+            delete mSmtpSettings;
+            mSmtpSettings = NULL;
+            delete mQSettingsManager;
+            mQSettingsManager = NULL;
+        }        
+
+    public:
+        CEmailAccounts *&mAccount;
+        CImPop3Settings *&mPop3Settings;
+        CImImap4Settings *&mImap4Settings;
+        CImSmtpSettings *&mSmtpSettings;
+        XQSettingsManager *&mQSettingsManager;
+    };
+    
 public:
-    NmApiSettingsManagerPrivate(const quint64 mailboxId);
+    NmApiSettingsManagerPrivate();
     ~NmApiSettingsManagerPrivate();
 
     bool load(quint64 mailboxId, NmApiMailboxSettingsData &data);
-    bool save(const NmApiMailboxSettingsData &data);
+    bool save(quint64 mailboxId, const NmApiMailboxSettingsData &data);
 
 private:
-    bool writeSettingL(const NmApiMailboxSettingsData &data);
-    bool saveSettings();
-    bool readSetting(NmApiMailboxSettingsData &data);
-    bool readCenRepSetting(NmApiMailboxSettingsData &data);
+
+    void fillImapSettingDataL(const NmApiMailboxSettingsData &data);
+    void fillPopSettingDataL(const NmApiMailboxSettingsData &data);
+    void fillSmtpSettingDataL(const NmApiMailboxSettingsData &data, 
+            const QVariant settingValue, const int key);
+   
+    void writeSettingL(const NmApiMailboxSettingsData &data);
+    void readSettings(NmApiMailboxSettingsData &data);
+    bool readCenRepSettings(NmApiMailboxSettingsData &data);
     QVariant readFromCenRep(quint32 key) const;
+    QVariant readFromCenRep(quint32 key, bool &success) const;
     bool writeSettingToCenRep(const NmApiMailboxSettingsData &data);
     bool writeToCenRep(quint32 key, const QVariant &value) const;
-    void setSecurity(QString securityType);
-    QString security() const;
-    QString alwaysOnlineState() const;
-    void setAlwaysOnlineState(const QVariant state);
-    void calculateMailboxOffset();
-    void calculateActiveProfileOffset();
-    qint32 convertToProfileOffset(int profile) const;
-    bool checkAccountType();
+    void setSecurity(CImBaseEmailSettings &settings, QString securityType);
+    
+    QString security(CImBaseEmailSettings &settings) const;
+    QString alwaysOnlineState(bool &success) const;
+    bool setAlwaysOnlineState(const QVariant &state);
+    bool calculateMailboxOffset();
+    bool calculateActiveProfileOffset();
+    bool checkAccountTypeL();
     void initAccountL();
 
 private:
-    NmApiMailboxSettingsData *mSettingsData;
 
     CEmailAccounts *mAccount;
     CImPop3Settings *mPop3Settings;
     CImImap4Settings *mImap4Settings;
     CImSmtpSettings *mSmtpSettings;
+    XQSettingsManager *mQSettingsManager;
 
     TSmtpAccount mSmtpAccount;
     TImapAccount mImap4Account;
@@ -73,7 +115,7 @@
     QString mMailboxType;
     qint32 mMailboxOffset;
     qint32 mActiveProfileOffset;
-    XQSettingsManager *mQSettingsManager;
+    
 
     quint32 mMailboxId;
 };
--- a/emailservices/nmclientapi/inc/nmapitextcontent_p.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/inc/nmapitextcontent_p.h	Thu Sep 30 11:43:07 2010 +0300
@@ -25,8 +25,8 @@
 {
 
 public:
-    
     NmApiTextContentPrivate();
+    NmApiTextContentPrivate(const NmApiTextContentPrivate &textcontentprivate);
     virtual ~NmApiTextContentPrivate();
 
     QString content() const;
--- a/emailservices/nmclientapi/nmclientapi.pro	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/nmclientapi.pro	Thu Sep 30 11:43:07 2010 +0300
@@ -23,14 +23,13 @@
 # BUILD_DLL
 DEFINES += BUILD_EMAIL_API_DLL
 
+INCLUDEPATH +=  inc \
+                ../../email_plat/nmail_client_api/inc \
+                ../../email_plat/nmail_settings_api/inc \
+                ../../inc
 
-INCLUDEPATH +=  inc \
-                ../../email_plat/nmail_client_api \
-                ../../email_plat/nmail_settings_api \
-                ../../inc
-                
-DEPENDPATH +=  ../../email_plat/nmail_client_api \
-                ../../email_plat/nmail_settings_api \
+DEPENDPATH +=   ../../email_plat/nmail_client_api/inc \
+                ../../email_plat/nmail_settings_api/inc \
                 $$APP_LAYER_SYSTEMINCLUDE 
 
 MOC_DIR = tmp
@@ -52,6 +51,7 @@
            nmapimessagemanager.h \
            nmapisettingsmanager.h \
            nmapimailboxsettings.h \
+           nmapioperation.h \
            nmapimessagesearch.h \
            nmapimessage.h \
            nmapimessagecontent.h \
@@ -73,7 +73,7 @@
            inc/nmapimessagebody_p.h \
            inc/nmapimessageenvelope_p.h \
            inc/nmapimessagemanager_p.h \
-	       inc/nmapisettingsmanager_p.h \
+           inc/nmapisettingsmanager_p.h \
            inc/nmapipopimapsettingsmanager.h \
            inc/nmapiprivateclasses.h \
            inc/nmapitypesconverter.h \
@@ -82,7 +82,10 @@
            inc/nmapimessage_p.h \
            inc/nmapimessagecontent_p.h \
            inc/nmapitextcontent_p.h \
-           inc/nmapiattachment_p.h
+           inc/nmapiattachment_p.h \
+           inc/nmapioperationcreatedraftmessage.h \
+           inc/nmapioperationsendmessage.h
+	   
 SOURCES += src/nmapidatapluginfactory.cpp \
            src/nmapiemailaddress.cpp \
            src/nmapiemailservice.cpp \
@@ -110,6 +113,7 @@
            src/nmapisettingsmanager_p.cpp \
            src/nmapisettingsmanager.cpp \
            src/nmapitypesconverter.cpp \
+           src/nmapioperation.cpp \
            src/nmapimessagesearch.cpp \
            src/nmapimessagesearch_p.cpp \
            src/nmapimessage.cpp \
@@ -119,7 +123,9 @@
            src/nmapitextcontent.cpp \
            src/nmapitextcontent_p.cpp \
            src/nmapiattachment.cpp \
-           src/nmapiattachment_p.cpp
+           src/nmapiattachment_p.cpp \
+           src/nmapioperationcreatedraftmessage.cpp \
+           src/nmapioperationsendmessage.cpp
 
 
 
@@ -132,7 +138,7 @@
 
     TARGET.UID2 = 0x1000008D
     TARGET.UID3 = 0x2002C366
-    
+
     INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
 
     MMP_RULES += "SYSTEMINCLUDE /epoc32/include/ecom" 
@@ -156,10 +162,9 @@
 
     MMP_RULES += defBlock
     MMP_RULES += SMPSAFE
-    
+
      BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
-    "rom/nmailclientapi.iby CORE_APP_LAYER_IBY_EXPORT_PATH(nmailclientapi.iby)"    
-    
+    "rom/nmailclientapi.iby CORE_APP_LAYER_IBY_EXPORT_PATH(nmailclientapi.iby)"
 
 }
 
--- a/emailservices/nmclientapi/src/nmapiattachment.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapiattachment.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -30,6 +30,15 @@
 }
 
 /*!
+    Class copy constructor.
+*/
+NmApiAttachment::NmApiAttachment(const NmApiAttachment &attachment)
+{
+    NM_FUNCTION;
+    d = attachment.d;
+}
+
+/*!
     Class destructor.
 */
 NmApiAttachment::~NmApiAttachment()
@@ -37,6 +46,16 @@
     NM_FUNCTION;
 }
 
+NmApiAttachment& NmApiAttachment::operator=(const NmApiAttachment &attachment)
+{
+    if (this == &attachment)
+        return *this;
+    
+    d = attachment.d;
+
+    return *this;
+}
+
 /*!
    Getter for filename
  */
--- a/emailservices/nmclientapi/src/nmapiattachment_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapiattachment_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -30,6 +30,16 @@
 }
 
 /*!
+    Class copy constructor.
+*/
+NmApiAttachmentPrivate::NmApiAttachmentPrivate(const NmApiAttachmentPrivate &attachmentprivate)
+ : QSharedData(attachmentprivate),
+   mFilename(attachmentprivate.mFilename)
+{
+    NM_FUNCTION;
+}
+
+/*!
     Class destructor.
 */
 NmApiAttachmentPrivate::~NmApiAttachmentPrivate()
--- a/emailservices/nmclientapi/src/nmapiemailservice.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapiemailservice.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -60,6 +60,25 @@
 }
 
 /*!
+    gets mailbox folder by id (see also NmEventNotifier)
+ */
+bool NmApiEmailService::getFolder(
+    const quint64 mailboxId,
+    const quint64 folderId,
+    EmailClientApi::NmApiFolder &mailboxFolder)
+{
+    NM_FUNCTION;
+
+    bool found = false;
+
+    if (mEngine) {
+        found = mEngine->getFolderById(mailboxId, folderId, mailboxFolder);
+    }
+
+    return found;
+}
+
+/*!
     gets mailbox info by id (see also NmEventNotifier)
  */
 bool NmApiEmailService::getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo)
--- a/emailservices/nmclientapi/src/nmapiengine.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapiengine.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -313,7 +313,7 @@
    
    \param mailboxId Mailbox id from where envlope should come
    \param folderId Folder id from where envlope should come
-   \param folderId Id of envelope which should be returned
+   \param messageId Id of envelope which should be returned
    \param envelope Envelope to fill.
    
    \return Return true if it will find any envelope
@@ -356,6 +356,49 @@
 }
 
 /*!
+   Return folder given by mailbox and folder id.
+   
+   \param mailboxId Id of Mailbox which should be returned
+   \param folderId Folder id id of folder to be fetched
+   \param mailboxFolder reference to copy reference of NmApiFolder
+   
+   \return Return true if it will find folder
+ */
+bool NmApiEngine::getFolderById(
+    const quint64 mailboxId,
+    const quint64 folderId,
+    EmailClientApi::NmApiFolder &mailboxFolder)
+{
+    NM_FUNCTION;
+
+    bool found = false;
+
+    listMailPlugins();
+
+    CFSMailPlugin *plugin = NULL;
+    CFSMailFolder *fsFolder = NULL;
+    TFSMailMsgId fsMailBoxId = TFSMailMsgId(mailboxId);
+    TFSMailMsgId fsFolderId = TFSMailMsgId(folderId);
+
+    for (int i = 0; i < mMailPlugins.Count() && !fsFolder; i++){
+        plugin = mMailPlugins[i];
+        if (plugin && (plugin->Id() == fsMailBoxId.PluginId())) {
+            TRAPD(err, fsFolder = plugin->GetFolderByUidL(fsMailBoxId, fsFolderId));
+            Q_UNUSED(err);
+        }
+    }
+    if (fsFolder) {
+        NmFolder *nmFolder = fsFolder->GetNmFolder();
+        EmailClientApi::NmApiFolder apiFolder = NmToApiConverter::NmFolder2NmApiFolder(*nmFolder);
+        mailboxFolder = apiFolder;
+        found = true;
+        delete nmFolder;
+        delete fsFolder;
+    }
+    return found;
+}
+
+/*!
    Return message given by mailbox, folder and message id.
    
    \param mailboxId Mailbox id from where message should come
@@ -378,21 +421,19 @@
     listMailPlugins();
 
     CFSMailPlugin *plugin = NULL;
-    CFSMailMessage* fsMessage = NULL;
+    CFSMailMessage *fsMessage = NULL;
     TFSMailMsgId fsMailBoxId = TFSMailMsgId(mailboxId);
     TFSMailMsgId fsFolderId = TFSMailMsgId(folderId);
     TFSMailMsgId fsMessageId = TFSMailMsgId(messageId);
     
     for (int i = 0; i < mMailPlugins.Count() && !fsMessage; i++){
         plugin = mMailPlugins[i];
-        if (plugin) {
-            QT_TRY {
-                fsMessage = plugin->GetMessageByUidL(fsMailBoxId,
+        if (plugin && (plugin->Id() == fsMailBoxId.PluginId())) {
+            TRAPD(err, fsMessage = plugin->GetMessageByUidL(fsMailBoxId,
                     fsFolderId,
                     fsMessageId,
-                    EFSMsgDataStructure);
-            }
-            QT_CATCH(...){}
+                    EFSMsgDataStructure));
+            Q_UNUSED(err);
         }
     }
     if (fsMessage) {
@@ -400,6 +441,7 @@
         EmailClientApi::NmApiMessage apiMessage = NmToApiConverter::NmMessage2NmApiMessage(*nmMessage);
         message = apiMessage;
         found = true;
+        delete nmMessage;
         delete fsMessage;
     }
     return found;
@@ -424,13 +466,13 @@
 
     if (instance) {    
         NmMailbox *nmmailbox = NULL;
-        instance->getMailboxById(NmId(mailboxId), nmmailbox);
+        int err =instance->getMailboxById(NmId(mailboxId), nmmailbox);
     
-        if (nmmailbox) {
+        if (err == NmNoError && nmmailbox) {
             mailbox = NmToApiConverter::NmMailbox2NmApiMailbox(*nmmailbox);
-            found = true;
-            delete nmmailbox;
+            found = true;            
         }
+        delete nmmailbox;
     }
     
     return found;
--- a/emailservices/nmclientapi/src/nmapimailboxsettings.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimailboxsettings.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -34,33 +34,63 @@
 }
 
 /*!
+ Lists ids of mailboxes
+
  \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);
 }
 
+/*!
+ Returns the type of mailbox for mailboxId
+
+ \fn getMailboxType
+ \param mailboxId - id of mailbox as quint64. A list of mailbox ids can be received via
+ listMailboxIds
+ \return mailbox type on success, NULL QString on failure
+ */
+QString NmApiMailboxSettings::getMailboxType(quint64 mailboxId)
+{
+    return d->getMailboxType(mailboxId);
+}
+
+/*!
+ Loads mailbox settings from central repository for mailboxId into data structure
+
+ \fn loadSettings
+ \param mailboxId - id of mailbox as quint64. A list of mailbox ids can be received via
+ listMailboxIds
+ \param data - NmApiMailboxSettingsData& class to load mailbox settings to.
+ \return true is successful, otherwise return false
+ */
 bool NmApiMailboxSettings::loadSettings(quint64 mailboxId, NmApiMailboxSettingsData &data)
 {
 	return d->loadSettings(mailboxId, data);
 }
 
+/*!
+ Saves mailbox settings to central repository
+
+ \fn saveSettings
+ \param data - NmApiMailboxSettingsData& class containing mailbox settings.
+ \return true is successful, otherwise return false
+ */
 bool NmApiMailboxSettings::saveSettings(const NmApiMailboxSettingsData &data)
 {
 	return d->saveSettings(data);
 }
 
 /*!
+ Creates a mailbox
+
  \fn createMailbox
  \param mailboxType - mailbox type as QString
  \param data - mailbox settings data
-
- Creates a mailbox
+ \return true is successful, otherwise return false
  */
 bool NmApiMailboxSettings::createMailbox(const QString &mailboxType, NmApiMailboxSettingsData &data)
 {
@@ -68,11 +98,11 @@
 }
 
 /*!
+ Deletes mailbox with specific id.
+
  \fn deleteMailbox
- \param mailboxId - mailbox id.
- \return quint64 - the mailbox id.
- 
- Deletes mailbox with specific id.
+ \param mailboxId - mailbox id
+ \return quint32 - nmailclient API wide error
  */
 bool NmApiMailboxSettings::deleteMailbox(quint64 mailboxId)
 {
@@ -80,12 +110,12 @@
 }
 
 /*!
+ Populates NmApiMailboxSettingsData with protocol specific settings data.
+
  \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)
 {
--- a/emailservices/nmclientapi/src/nmapimailboxsettings_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimailboxsettings_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -18,11 +18,10 @@
 #include "nmapiheaders.h"
 #include <nmapisettingsmanager.h>
 
-
 namespace EmailClientApi
 {
-NmApiMailboxSettingsPrivate::NmApiMailboxSettingsPrivate(QObject *parent) : 
-    QObject(parent), 
+NmApiMailboxSettingsPrivate::NmApiMailboxSettingsPrivate(QObject *parent) :
+    QObject(parent),
     mFactory(NULL),
     mDeleteMailboxOperation(NULL)
 {
@@ -36,43 +35,87 @@
     NM_FUNCTION;
     NmApiDataPluginFactory::releaseInstance(mFactory);
     if(mDeleteMailboxOperation && mDeleteMailboxOperation->isRunning()) {
-        mDeleteMailboxOperation->cancelOperation();        
+        mDeleteMailboxOperation->cancelOperation();
     }
 }
 
 bool NmApiMailboxSettingsPrivate::listMailboxIds(QList<quint64> &idList)
 {
-    NM_FUNCTION; 
+    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;   
+
+            ret = true;
             }
-        } 
-     
+        }
+
     return ret;
 }
 
+QString NmApiMailboxSettingsPrivate::getMailboxType(quint64 mailboxId)
+{
+    QString mailboxType;
+    //Return null string if mailbox is not resolved or some error occurs
+    TRAP_IGNORE(mailboxType = resolveMailboxTypeL(mailboxId));
+    NM_ERROR(!mailboxType.isNull(), QString("Can not receive mailbox type")
+                                    + QString::number(mailboxId));
+    return mailboxType;
+}
+
+QString NmApiMailboxSettingsPrivate::resolveMailboxTypeL(quint64 mailboxId)
+{
+    QString mailboxType;
+    quint32 serviceId = mailboxId;
+    CEmailAccounts *accounts = CEmailAccounts::NewLC();
+
+    RArray<TImapAccount> imapAccounts;
+    CleanupClosePushL(imapAccounts);
+    accounts->GetImapAccountsL(imapAccounts);
+    for (int i=0; i < imapAccounts.Count(); ++i) {
+        if (imapAccounts[i].iImapService == serviceId) {
+            mailboxType = NmApiMailboxTypeImap;
+            break;
+        }
+    }
+    CleanupStack::PopAndDestroy(&imapAccounts);
+
+    if (mailboxType.isNull()) {
+        RArray<TPopAccount> popAccounts;
+        CleanupClosePushL(popAccounts);
+        accounts->GetPopAccountsL(popAccounts);
+        for (int i = 0; i < popAccounts.Count(); ++i) {
+            if (popAccounts[i].iPopService == serviceId) {
+                mailboxType = NmApiMailboxTypePop;
+                break;
+            }
+        }
+        CleanupStack::PopAndDestroy(&popAccounts);
+    }
+    CleanupStack::PopAndDestroy(accounts);
+    return mailboxType;
+}
+
+
 bool NmApiMailboxSettingsPrivate::loadSettings(quint64 mailboxId, NmApiMailboxSettingsData &data)
 {
     NM_FUNCTION;
-    QScopedPointer<NmApiSettingsManager> settingsManager(new NmApiSettingsManager(mailboxId));  
+    QScopedPointer<NmApiSettingsManager> settingsManager(new NmApiSettingsManager(mailboxId));
     return settingsManager->load(mailboxId, data);
 }
 
 bool NmApiMailboxSettingsPrivate::saveSettings(const NmApiMailboxSettingsData &data)
 {
     NM_FUNCTION;
-    QScopedPointer<NmApiSettingsManager> settingsManager(new NmApiSettingsManager(data.mailboxId()));  
+    QScopedPointer<NmApiSettingsManager> settingsManager(new NmApiSettingsManager(data.mailboxId()));
     return settingsManager->save(data);
 }
 
@@ -84,10 +127,10 @@
     Q_UNUSED(mailboxType);
     Q_UNUSED(data);
     bool ret = false;
-    
+
     /*QT_TRY {
         if (mailboxType==NmApiMailboxTypePop || mailboxType==NmApiMailboxTypeImap) {
-            QScopedPointer<NmApiPopImapSettingsManager> popImapManager(new NmApiPopImapSettingsManager());  
+            QScopedPointer<NmApiPopImapSettingsManager> popImapManager(new NmApiPopImapSettingsManager());
             popImapManager->createMailbox(mailboxType, data);
             ret = true;
         }
@@ -99,41 +142,26 @@
     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;
+	Q_UNUSED(mailboxId);
+    return false;
+
 }
 
 bool NmApiMailboxSettingsPrivate::populateDefaultSettings(
-    const QString &mailboxType, NmApiMailboxSettingsData &data) 
+    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;
+	NM_FUNCTION;
+//    Q_UNUSED(mailboxType);
+//    Q_UNUSED(data);
+    QScopedPointer<NmApiPopImapSettingsManager> popImapManager(new NmApiPopImapSettingsManager());
+    return popImapManager->populateDefaults(mailboxType, data);
+//    return true;
 }
 
 }// namespace
--- a/emailservices/nmclientapi/src/nmapimessage.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessage.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -30,6 +30,15 @@
 }
 
 /*!
+    Class copy constructor.
+*/
+NmApiMessage::NmApiMessage(const NmApiMessage &other)
+{
+    NM_FUNCTION;
+    d = other.d;
+}
+
+/*!
     Class destructor.
 */
 NmApiMessage::~NmApiMessage()
@@ -37,6 +46,16 @@
     NM_FUNCTION;
 }
 
+NmApiMessage& NmApiMessage::operator=(const NmApiMessage &other)
+{
+    if (this == &other)
+        return *this;
+    
+    d = other.d;
+
+    return *this;
+}
+
 /*!
  \fn plainTextContent 
  \return Message plain text content.
--- a/emailservices/nmclientapi/src/nmapimessage_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessage_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -29,6 +29,20 @@
 }
 
 /*!
+    Class copy constructor.
+*/
+NmApiMessagePrivate::NmApiMessagePrivate(const NmApiMessagePrivate &other)
+ : QSharedData(other),
+   mPlainTextContent(other.mPlainTextContent),
+   mHtmlContent(other.mHtmlContent),
+   mComplete(other.mComplete),
+   mAttachments(other.mAttachments),
+   mEnvelope(other.mEnvelope)
+{
+    NM_FUNCTION;
+}
+
+/*!
     Class destructor.
 */
 NmApiMessagePrivate::~NmApiMessagePrivate()
--- a/emailservices/nmclientapi/src/nmapimessagecontent.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessagecontent.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -30,6 +30,15 @@
 }
 
 /*!
+    Class copy constructor.
+*/
+NmApiMessageContent::NmApiMessageContent(const NmApiMessageContent &messagecontent)
+{
+    NM_FUNCTION;
+    d = messagecontent.d;
+}
+
+/*!
    Destructor for NmApiMessageContent
  */
 NmApiMessageContent::~NmApiMessageContent()
@@ -37,6 +46,16 @@
     NM_FUNCTION;
 }
 
+NmApiMessageContent& NmApiMessageContent::operator=(const NmApiMessageContent &messagecontent)
+{
+    if (this == &messagecontent)
+        return *this;
+    
+    d = messagecontent.d;
+
+    return *this;
+}
+
 /*!
    Getter for content type
  */
--- a/emailservices/nmclientapi/src/nmapimessagecontent_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessagecontent_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -29,6 +29,19 @@
 }
 
 /*!
+    Class copy constructor.
+*/
+NmApiMessageContentPrivate::NmApiMessageContentPrivate(const NmApiMessageContentPrivate &messagecontentprivate)
+ : QSharedData(messagecontentprivate),
+   mContentType(messagecontentprivate.mContentType),
+   mComplete(messagecontentprivate.mComplete),
+   mSize(messagecontentprivate.mSize),
+   mId(messagecontentprivate.mId)
+{
+    NM_FUNCTION;
+}
+
+/*!
    Destructor for NmApiMessageContentPrivate
  */
 NmApiMessageContentPrivate::~NmApiMessageContentPrivate()
--- a/emailservices/nmclientapi/src/nmapimessagemanager.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessagemanager.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -35,42 +35,43 @@
 
 NmApiMessageManager::~NmApiMessageManager()
 {
-	delete d;
 }
    
-
-    // creates a new email message
-    // signaled with draftMessageCreated(NmApiMessage *message,int result) 
-    //    * ownership transferred
-bool NmApiMessageManager::createDraftMessage(const QVariant *initData)
+/*!
+ \fn createDraftMessage 
+ \param initData Initializing data. Can contain NULL value.
+ \return Create draft message operation.
+ 
+ Creates a new email message. Returns create draft message operation. 
+ */
+QPointer<NmApiOperation> NmApiMessageManager::createDraftMessage(const QVariant *initData)
 {
     NM_FUNCTION;
-    Q_UNUSED(initData);
-	return false;
+    return d->createDraftMessage(initData);
 }
     
     // creates fw message
     // signaled with forwardMessageCreated(NmApiMessage *message,int result) 
     //    * ownership transferred
- bool NmApiMessageManager::createForwardMessage(NmApiMessage *orig,const QVariant *initData)
+QPointer<NmApiOperation> NmApiMessageManager::createForwardMessage(NmApiMessage *orig,const QVariant *initData)
  {
     NM_FUNCTION;
     Q_UNUSED(initData);
     Q_UNUSED(orig);
-	return false;
+	return 0;
  }
     
     // creates reply message
     // signaled with replyMessageCreated(NmApiMessage *message,int result) 
     //    * ownership transferred
-bool NmApiMessageManager::createReplyMessage(const NmApiMessage *orig,
+QPointer<NmApiOperation> NmApiMessageManager::createReplyMessage(const NmApiMessage *orig,
         const QVariant *initData,bool replyAll)
 {
     NM_FUNCTION;
     Q_UNUSED(orig);
     Q_UNUSED(initData);
     Q_UNUSED(replyAll);
-	return false;
+	return 0;
 }
  
 /*!
@@ -83,7 +84,7 @@
  Starts async move operation for given messages.  
  Completion signalled with messagesMoved(int result).
  */
-bool NmApiMessageManager::moveMessages(const QList<quint64> messageIds,
+QPointer<NmApiOperation> NmApiMessageManager::moveMessages(const QList<quint64> messageIds,
 									quint64 sourceFolderId,
 									quint64 targetFolderId)
 {    
@@ -91,68 +92,82 @@
     Q_UNUSED(messageIds);
     Q_UNUSED(sourceFolderId);
     Q_UNUSED(targetFolderId);
-    return false;
+    return 0;
 	//return d->moveMessages(messageIds,sourceFolderId,targetFolderId);
 }
     
-// signaled with messageSaved(quint64 messageId, int result)
-bool NmApiMessageManager::saveMessage(const NmApiMessage &message)
+/*!
+ \fn saveMessage 
+ \param message Message to be saved (note that message must exists to complete successfully).
+ \return Save message operation.
+ 
+ Saves email message. Message must be created before this operation with createDraftMessage/createForwardMessage/
+ createReplyMessage operation. Operation will run unsuccessfully, if message haven't created before. 
+ Returns save message operation. 
+ */
+QPointer<NmApiOperation> NmApiMessageManager::saveMessage(const NmApiMessage &message)
 {
-    Q_UNUSED(message);
-	return false;
+    return d->saveMessage(message);
 }
     
 // deletes message
 // signaled with messagesDeleted(int result)
-bool NmApiMessageManager::deleteMessages(const QList<quint64> messageIds)
+QPointer<NmApiOperation> NmApiMessageManager::deleteMessages(const QList<quint64> messageIds)
 {
     Q_UNUSED(messageIds);
-	return false;
+	return 0;
 }
     
     // starts fetching rest of message body from server
     // signaled with messageFetched(quint64 messageId, int result)
-bool NmApiMessageManager::fetchMessage(quint64 messageId)
+QPointer<NmApiOperation> NmApiMessageManager::fetchMessage(quint64 messageId)
 {
     Q_UNUSED(messageId);
-	return false;
+	return 0;
 }
     
-    // moves message to outbox. Actual sending time may be immediate or scheduled
-    // signaled with messageSent(quint64 messageId, int result)
-bool NmApiMessageManager::sendMessage(const NmApiMessage &message)
+/*!
+ \fn sendMessage 
+ \param message Message to be sent (note that message must exists to complete successfully).
+ \return Send message operation.
+ 
+ Sends email message. Message must be created before this operation with createDraftMessage/createForwardMessage/
+ createReplyMessage operation. Operation will run unsuccessfully, if message haven't created before. 
+ Returns send message operation. 
+ */
+QPointer<NmApiOperation> NmApiMessageManager::sendMessage(const NmApiMessage &message)
 {
-    Q_UNUSED(message);
-	return false;
+    NM_FUNCTION;
+    return d->sendMessage(message);
 }
 
 // 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(NmApiMessage &message,
+QPointer<NmApiOperation> NmApiMessageManager::createAttachment(NmApiMessage &message,
 										const QVariant &attachmenSpec)
 {
     Q_UNUSED(message);
     Q_UNUSED(attachmenSpec);
-    return false;
+    return 0;
 }
                                                       
 // removes attachment from a message
 // signaled with attachmentRemoved(int result)
-bool NmApiMessageManager::removeAttachment(NmApiMessage &message,
+QPointer<NmApiOperation> NmApiMessageManager::removeAttachment(NmApiMessage &message,
 quint64 attachmentId)
 {    
     Q_UNUSED(message);
     Q_UNUSED(attachmentId);
-    return false;
+    return 0;
 }
 
-bool NmApiMessageManager::fetchAttachment(const NmApiMessage &relatedMessage,
+QPointer<NmApiOperation> NmApiMessageManager::fetchAttachment(const NmApiMessage &relatedMessage,
         quint64 attachmentId)
 {
     Q_UNUSED(relatedMessage);
     Q_UNUSED(attachmentId);
-    return false;
+    return 0;
 }
  
 } // namespace EmailClientApi
--- a/emailservices/nmclientapi/src/nmapimessagemanager_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessagemanager_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -21,145 +21,109 @@
 namespace EmailClientApi
 {
 
+/*!
+    Class constructor.
+*/
 NmApiMessageManagerPrivate::NmApiMessageManagerPrivate(QObject *parent,quint64 mailboxId)
 : QObject(parent),
-  mState(NmApiMessageManagerPrivate::EIdle), mMailboxId(mailboxId)
+  mMailBoxId(0),
+  mMailBox(NULL),
+  mMailPlugin(NULL),
+  mEngine(NULL)
 {
-    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);
-	
+    NM_FUNCTION;
+    NmId mailBoxId(mailboxId);
+    mMailBoxId = TFSMailMsgId(mailBoxId);
+    mEngine = NmApiEngine::instance();
+    initialise();
 }
 
+/*!
+    Class destructor.
+*/
 NmApiMessageManagerPrivate::~NmApiMessageManagerPrivate()
 {
     NM_FUNCTION;
-    NmDataPluginInterface *interface = mFactory->interfaceInstance();
-    interface->unsubscribeMailboxEvents(mMailboxId);
-    NmApiDataPluginFactory::releaseInstance(mFactory);
+    
+    if (mMailBox){
+        delete mMailBox;
+        mMailBox = NULL;
+    }
+    
+    NmApiEngine::releaseInstance(mEngine);
 }
-    
+
 /*!
- \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.
+ \fn createDraftMessage 
+ \param initData Initializing data. Can contain NULL value.
+ \return Create draft message operation.
  
- Starts async move operation for given messages.  
- Completion signalled with messagesMoved(int result).
+ Returns create draft message operation.
  */
-bool NmApiMessageManagerPrivate::moveMessages(const QList<quint64> messageIds,
-											quint64 sourceFolder,
-											quint64 targetFolder)
+QPointer<NmApiOperation> NmApiMessageManagerPrivate::createDraftMessage(const QVariant *initData)
 {
     NM_FUNCTION;
-    Q_UNUSED(messageIds);
-    Q_UNUSED(sourceFolder);
-    Q_UNUSED(targetFolder);
-    return false;
+    if (mMailBox){
+        QPointer<NmApiOperation> operation = new NmApiOperationCreateDraftMessage(initData, *mMailBox, this);
+        return operation;
+    }
+    return NULL;
 }
-    
+
 /*!
- \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.
+ \fn sendMessage 
+ \param message message to be sent.
+ \return Send message operation.
  
- Starts async copy operation for given messages.  
- Completion signalled with messagesCopied(int result).
+ Returns Send message operation.
  */
-bool NmApiMessageManagerPrivate::copyMessages(const QList<quint64> messageIds,
-                                            const quint64 sourceFolder,
-											const quint64 targetFolder)
+QPointer<NmApiOperation> NmApiMessageManagerPrivate::sendMessage(const NmApiMessage &message)
 {
     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;
-        }        
+    if (mMailBox){
+        QPointer<NmApiOperation> operation = new NmApiOperationSendMessage(message, *mMailBox, this);
+        return operation;
     }
-	mState = NmApiMessageManagerPrivate::EIdle;
-	return ret;
+    return NULL;
 }
-  
+
 /*!
- \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.
+ \fn saveMessage 
+ \param message Message to be saved.
+ \return Save message operation.
+ 
+ Saves email message. Returns save message operation. 
  */
-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;
+QPointer<NmApiOperation> NmApiMessageManagerPrivate::saveMessage(const NmApiMessage &message)
+{
+    return NULL;
+}
+
+/*!
+ \fn initialise
+ 
+ Initializes mailbox and mailplugin.
+ */
+void NmApiMessageManagerPrivate::initialise()
+{
+    NM_FUNCTION;
+    RPointerArray<CFSMailPlugin> mailPlugins;
+    if (mEngine) {
+        mEngine->listMailPlugins(mailPlugins);
+    
+        for (int i = 0; i < mailPlugins.Count() && !mMailPlugin; i++){
+            if (mailPlugins[i]->Id() == mMailBoxId.PluginId()) {
+                mMailPlugin = mailPlugins[i];
             }
         }
-        mState = NmApiMessageManagerPrivate::EIdle;
-	}
+        
+        if (mMailPlugin) {
+            TRAPD(err, mMailBox = mMailPlugin->GetMailBoxByUidL(mMailBoxId));
+            Q_UNUSED(err);
+        }
+    }
 }
+
 } //namespace
 
 
--- a/emailservices/nmclientapi/src/nmapimessagesearch_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapimessagesearch_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -117,6 +117,10 @@
         NmMessage *nmmessage = aMatchMessage->GetNmMessage();
         EmailClientApi::NmApiMessage message = NmToApiConverter::NmMessage2NmApiMessage(*nmmessage);
         emit messageFound(message);
+        
+        delete nmmessage;
+        nmmessage = NULL;
+        
         delete aMatchMessage;
         aMatchMessage = NULL;
      }
@@ -218,15 +222,12 @@
     RPointerArray<CFSMailPlugin> mailPlugins;
     if (mEngine) {
         mEngine->listMailPlugins(mailPlugins);
-    }
-    CFSMailPlugin *plugin = NULL;
-    for (int i = 0; i < mailPlugins.Count() && !mMailBox; i++){
-        plugin = mailPlugins[i];
-        if (plugin) {
-            QT_TRY {
-                mMailBox = plugin->GetMailBoxByUidL(mMailBoxId);
+
+        for (int i = 0; i < mailPlugins.Count() && !mMailBox; i++){
+            if (mailPlugins[i]->Id() == mMailBoxId.PluginId()) {
+                TRAPD(err, mMailBox = mailPlugins[i]->GetMailBoxByUidL(mMailBoxId));
+                Q_UNUSED(err);
             }
-            QT_CATCH(...){}            
         }
     }
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/src/nmapioperation.cpp	Thu Sep 30 11:43:07 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:
+ *     Email message related operations
+ */
+
+#include "nmapiheaders.h"
+
+namespace EmailClientApi {
+
+NmApiOperation::NmApiOperation(QObject *parent, NmApiOperationStatus status, NmApiOperationType operationType)
+    :QObject(parent),
+     mStatus(status),
+     mOperationType(operationType)
+{
+    NM_FUNCTION;
+    QMetaObject::invokeMethod(this, "start", Qt::QueuedConnection);
+}
+
+NmApiOperation::~NmApiOperation()
+{
+    NM_FUNCTION;
+}
+
+/*!
+ \fn status 
+ \return Operation status.
+ */
+NmApiOperationStatus NmApiOperation::status() const 
+{
+    NM_FUNCTION;
+    return mStatus;
+}
+ 
+/*!
+ \fn operation 
+ \return Operation type.
+ */
+NmApiOperationType NmApiOperation::operation() const
+{
+    NM_FUNCTION;
+    return mOperationType;
+}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/src/nmapioperationcreatedraftmessage.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,112 @@
+/*
+ * 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:
+ *     Draft message creation operation implementation.
+ */
+
+#include "nmapiheaders.h"
+
+
+/*!
+    Class constructor.
+*/
+NmApiOperationCreateDraftMessage::NmApiOperationCreateDraftMessage(const QVariant *initData, 
+                                                                   CFSMailBox &mailBox,
+                                                                   QObject *parent)
+    :NmApiOperation(parent, NotStarted, CreateDraftMessage),
+     mInitData(initData),
+     mMailBox(mailBox),
+     mRequestId(NmApiNoError)
+{
+    NM_FUNCTION;
+}
+
+/*!
+    Class destructor.
+*/
+NmApiOperationCreateDraftMessage::~NmApiOperationCreateDraftMessage()
+{
+    NM_FUNCTION;
+}
+
+/*!
+ \fn start 
+ 
+ Starts create draft message operation for given mailboxid. 
+ Created draft message signaled with operationComplete(int resultCode, QVariant data = QVariant()). 
+ data parameter is type of NmApiMessage.
+ */
+void NmApiOperationCreateDraftMessage::start()
+{
+    NM_FUNCTION;
+    TRAPD(err, mMailBox.CreateMessageToSendL(*this));
+    if (err == KErrNone){
+        mStatus = Pending;
+    }
+    else {
+        mStatus = Failed;
+        emit operationComplete(NmApiGeneralError);
+    }
+}
+
+/*!
+ \fn cancel 
+ 
+ Cancel not supported in create draft message operation. 
+ */
+void NmApiOperationCreateDraftMessage::cancel()
+{
+    NM_FUNCTION;
+}
+
+/*!
+    Asynchronous request response message.
+    
+    \param aEvent Plugin event description.
+    \param aRequestId Request id of asyncronous operation.
+ */
+void NmApiOperationCreateDraftMessage::RequestResponseL(TFSProgress aEvent,
+                                                     TInt aRequestId)
+{
+    NM_FUNCTION;
+    
+    TFSProgress::TFSProgressStatus status = aEvent.iProgressStatus;
+
+    if (aRequestId == mRequestId) {
+        if (status == TFSProgress::EFSStatus_RequestComplete && aEvent.iParam) {
+            CFSMailMessage *fsMessage = static_cast<CFSMailMessage*>(aEvent.iParam);
+            NmMessage *nmmessage = fsMessage->GetNmMessage();
+            EmailClientApi::NmApiMessage apimessage = NmToApiConverter::NmMessage2NmApiMessage(*nmmessage);
+            QVariant qmessage;
+            qmessage.setValue(apimessage);
+            mStatus = Succeeded;
+            emit operationComplete(NmApiNoError, qmessage);
+            
+            delete nmmessage;
+            nmmessage = NULL;
+            
+            delete fsMessage;
+            fsMessage = NULL;
+        }
+        else if (status == TFSProgress::EFSStatus_RequestCancelled) {
+            mStatus = Canceled;
+            emit operationComplete(NmApiCancelError);
+        }
+        else {
+            mStatus = Failed;
+            emit operationComplete(NmApiGeneralError);
+        }
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmclientapi/src/nmapioperationsendmessage.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,117 @@
+/*
+ * 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:
+ *     Send message operation implementation.
+ */
+
+#include "nmapiheaders.h"
+
+namespace EmailClientApi 
+{
+
+NmApiOperationSendMessage::NmApiOperationSendMessage(const NmApiMessage &message, CFSMailBox &mailBox, QObject *parent)
+    :NmApiOperation(parent, Succeeded, SendMessage),
+     mMessage(message),
+     mMailBox(mailBox),
+     mRequestId(NmApiNoError)  
+     
+{
+    NM_FUNCTION;
+}
+
+NmApiOperationSendMessage::~NmApiOperationSendMessage()
+{
+    NM_FUNCTION;
+}
+
+void NmApiOperationSendMessage::start()
+{
+    NM_FUNCTION;
+
+    NmId id(mMessage.envelope().id());
+    TFSMailMsgId fsId(id);
+
+    RPointerArray<CFSMailPlugin> mailPlugins;
+    NmApiEngine *engine = NmApiEngine::instance();
+    if (engine) {
+        engine->listMailPlugins(mailPlugins);
+    }
+    
+    CFSMailPlugin *plugin = NULL;
+    CFSMailMessage *fsMessage = NULL;
+    TFSMailMsgId fsMailBoxId = mMailBox.GetId();
+    TFSMailMsgId fsFolderId = TFSMailMsgId();
+    TFSMailMsgId fsMessageId = TFSMailMsgId(fsId);
+    
+    for (int i = 0; i < mailPlugins.Count() && !fsMessage; i++){
+        plugin = mailPlugins[i];
+        if (plugin && (plugin->Id() == fsMailBoxId.PluginId())) {
+            TRAPD(err, fsMessage = plugin->GetMessageByUidL(fsMailBoxId,
+                    fsFolderId,
+                    fsMessageId,
+                    EFSMsgDataStructure));
+            Q_UNUSED(err);
+            if (fsMessage) {
+                break;
+            }
+        }
+    }
+    
+    if (fsMessage) {
+        TRAPD(mail_err, mMailBox.SendMessageL(*fsMessage, *this));
+        if (mail_err == KErrNone){
+            mStatus = Pending;
+        }
+        else {
+            mStatus = Failed;
+            emit operationComplete(NmApiGeneralError);
+        }
+    } else {
+        mStatus = Failed;
+        emit operationComplete(NmApiGeneralError);
+    }
+    if (fsMessage) {
+        delete fsMessage;
+    }
+    
+    NmApiEngine::releaseInstance(engine);
+}
+
+void NmApiOperationSendMessage::cancel()
+{
+    NM_FUNCTION;
+}
+
+void NmApiOperationSendMessage::RequestResponseL( TFSProgress aEvent, TInt aRequestId )
+{
+    NM_FUNCTION;
+    
+    TFSProgress::TFSProgressStatus status = aEvent.iProgressStatus;
+
+    if (aRequestId == mRequestId) {
+        if (status == TFSProgress::EFSStatus_RequestComplete && aEvent.iParam) {
+            mStatus = Succeeded;
+            emit operationComplete(NmApiNoError);
+        }
+        else if (status == TFSProgress::EFSStatus_RequestCancelled) {
+            mStatus = Canceled;
+            emit operationComplete(NmApiCancelError);
+        }
+        else {
+            mStatus = Failed;
+            emit operationComplete(NmApiGeneralError);
+        }
+    }
+}
+}
--- a/emailservices/nmclientapi/src/nmapipopimapsettingsmanager.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapipopimapsettingsmanager.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -11,116 +11,286 @@
 *
 * Contributors:
 *
-* Description:
+* Description: Handles the populating of default settings for pop and imap mailboxes
 *
 */
 
-#include "nmapiheaders.h"
-
-
+#include <nmapiheaders.h>
 
+static const unsigned int DefaultPopPort = 110;
+static const unsigned int DefaultImapPort = 143;
+static const unsigned int DefaultSmtpPort = 25;
 
-static const int DefaultPopPort = 110;
-static const int DefaultImapPort = 993;
+static const unsigned int DefaultPopPortSsl = 995;
+static const unsigned int DefaultImapPortSsl = 993;
+static const unsigned int DefaultSmtpPortSsl = 465;
 
 using namespace EmailClientApi;
-    
+
 NmApiPopImapSettingsManager::NmApiPopImapSettingsManager()
-{    
+{
+    NM_FUNCTION;
 }
 
 NmApiPopImapSettingsManager::~NmApiPopImapSettingsManager()
-{   
+{
+    NM_FUNCTION;
 }
 
 bool NmApiPopImapSettingsManager::populateDefaults(const QString &mailboxType, NmApiMailboxSettingsData &data)
 {
-    bool ret = false;
-    
-    QT_TRY {
-        if (mailboxType==NmApiMailboxTypePop) {
-            populatePopDefs(data);
-            ret = true;
+    NM_FUNCTION;
+    bool ret = true;
+ 
+    if (mailboxType==NmApiMailboxTypePop) {
+    TRAPD(err, populatePopDefaultsL(data));
+        if (KErrNone != err) {
+            ret = false;
         }
-        else if (mailboxType==NmApiMailboxTypeImap) {
-            populateImapDefs(data);
-            ret = true;
-        }
-        else {
+    }
+    else if (mailboxType==NmApiMailboxTypeImap) {
+        TRAPD(err, populateImapDefaultsL(data));
+        if (KErrNone != err) {
             ret = false;
         }
     }
-    QT_CATCH(...){
+    else {
+        // Mailbox type not recognized
         ret = false;
     }
-    
+
+    if (ret) {
+        TRAPD(err, populateSmtpDefaultsL(data));
+        if (KErrNone != err) {
+            ret = false;
+        }
+    }
+
+    if (ret) {
+        populateCenrepDefaults(data);
+    }
     return ret;
 }
 
-void NmApiPopImapSettingsManager::populateImapDefs(NmApiMailboxSettingsData &data)
+void NmApiPopImapSettingsManager::populateImapDefaultsL(NmApiMailboxSettingsData &data)
 {
-    QScopedPointer<CImImap4Settings> imapSettings(new CImImap4Settings());
-    
+    NM_FUNCTION;
+    QScopedPointer<CImImap4Settings> imapSettings;
+    imapSettings.reset(new (ELeave) CImImap4Settings());
+
     QScopedPointer<CImIAPPreferences> iapPref;
-    QT_TRAP_THROWING(iapPref.reset(CImIAPPreferences::NewLC());
-            CleanupStack::Pop(iapPref.data()));  
-        
+    iapPref.reset(CImIAPPreferences::NewLC());
+    CleanupStack::Pop(iapPref.data());  
+
     QScopedPointer<CEmailAccounts> mailAccounts;
-    QT_TRAP_THROWING(mailAccounts.reset(CEmailAccounts::NewL()));
+    mailAccounts.reset(CEmailAccounts::NewL());
         
-    QT_TRAP_THROWING( mailAccounts->PopulateDefaultImapSettingsL(*imapSettings,*iapPref));
+    mailAccounts->PopulateDefaultImapSettingsL(*imapSettings,*iapPref);
     
     data.setValue(IncomingLoginName, 
-                           XQConversions::s60Desc8ToQString(imapSettings->LoginName()));
+                            XQConversions::s60Desc8ToQString(imapSettings->LoginName()));
 
     data.setValue(IncomingPassword, 
-                           XQConversions::s60Desc8ToQString(imapSettings->Password()));
-       
+                            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());  
+                            XQConversions::s60DescToQString(imapSettings->ServerAddress()));
+
+    data.setValue(FolderPath,
+                            XQConversions::s60Desc8ToQString(imapSettings->FolderPath()));
+
+    TBool secureSockets = imapSettings->SecureSockets();
+    TBool sslWrapper = imapSettings->SSLWrapper();
+    
+    if (secureSockets == true && sslWrapper == false) {
+        data.setValue(IncomingMailSecurityType, NmApiStartTls);
+    }
+    else if (secureSockets == false && sslWrapper == true) {
+        data.setValue(IncomingMailSecurityType, NmApiSSLTls);
+    }
+    else {
+        data.setValue(IncomingMailSecurityType, NmApiSecurityOff);
+    }
+    
+    if (imapSettings->Port()) {
+        data.setValue(IncomingPort, imapSettings->Port());
+        }
+    else {
+        if (sslWrapper) {
+            data.setValue(IncomingPort, DefaultImapPortSsl);
+        }
+        else{
+            data.setValue(IncomingPort, DefaultImapPort);
+        }
+    }
+    
+    
+#if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
+    if (imapSettings->IMAP4Auth()) {
+        data.setValue(IncomingMailUsesAuthentication, true);
+        }
+    else {
+        data.setValue(IncomingMailUsesAuthentication, false);
+    }
+
+#endif
+
 }
 
-void NmApiPopImapSettingsManager::populatePopDefs(NmApiMailboxSettingsData &data)
+void NmApiPopImapSettingsManager::populatePopDefaultsL(NmApiMailboxSettingsData &data)
 {
-    QScopedPointer<CImPop3Settings> popSettings(new CImPop3Settings());
+    NM_FUNCTION;
+    QScopedPointer<CImPop3Settings> popSettings;
+    popSettings.reset(new (ELeave) CImPop3Settings());
    
     QScopedPointer<CImIAPPreferences> iapPref;
-    QT_TRAP_THROWING(iapPref.reset(CImIAPPreferences::NewLC());
-        CleanupStack::Pop(iapPref.data()));
+    iapPref.reset(CImIAPPreferences::NewLC());
+    CleanupStack::Pop(iapPref.data());
  
     QScopedPointer<CEmailAccounts> mailAccounts;
-    QT_TRAP_THROWING(mailAccounts.reset(CEmailAccounts::NewL()));
+    mailAccounts.reset(CEmailAccounts::NewL());
     
-    QT_TRAP_THROWING( mailAccounts->PopulateDefaultPopSettingsL(*popSettings,*iapPref));
+    mailAccounts->PopulateDefaultPopSettingsL(*popSettings,*iapPref);
     
     data.setValue(IncomingLoginName, 
-                        XQConversions::s60Desc8ToQString(popSettings->LoginName()));
+                            XQConversions::s60Desc8ToQString(popSettings->LoginName()));
    
     data.setValue(IncomingPassword, 
-                        XQConversions::s60Desc8ToQString(popSettings->Password()));
+                            XQConversions::s60Desc8ToQString(popSettings->Password()));
      
     data.setValue(IncomingMailServer, 
-                        XQConversions::s60DescToQString(popSettings->ServerAddress()));
+                            XQConversions::s60DescToQString(popSettings->ServerAddress()));
+    
+    TBool secureSockets = popSettings->SecureSockets();
+    TBool sslWrapper = popSettings->SSLWrapper();
     
+    if (secureSockets == true && sslWrapper == false) {
+        data.setValue(IncomingMailSecurityType, NmApiStartTls);
+    }
+    else if (secureSockets == false && sslWrapper == true) {
+        data.setValue(IncomingMailSecurityType, NmApiSSLTls);
+    }
+    else {
+        data.setValue(IncomingMailSecurityType, NmApiSecurityOff);
+    }
+
     if (popSettings->Port()) {
         data.setValue(IncomingPort, popSettings->Port());
         }
     else {
-        data.setValue(IncomingPort, DefaultPopPort);
+        if (sslWrapper) {
+            data.setValue(IncomingPort, DefaultPopPortSsl);
+        }
+        else{
+            data.setValue(IncomingPort, DefaultPopPort);
+        }
+    }
+
+#if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
+    if (popSettings->POP3Auth()) {
+        data.setValue(IncomingMailUsesAuthentication, true);
+    }
+    else {
+        data.setValue(IncomingMailUsesAuthentication, false);
+    }
+#endif
+}
+
+void NmApiPopImapSettingsManager::populateSmtpDefaultsL(NmApiMailboxSettingsData &data)
+{
+    NM_FUNCTION;
+    QScopedPointer<CImSmtpSettings> smtpSettings;
+    smtpSettings.reset(new (ELeave) CImSmtpSettings());
+   
+    QScopedPointer<CImIAPPreferences> iapPref;
+    iapPref.reset(CImIAPPreferences::NewLC());
+    CleanupStack::Pop(iapPref.data());
+ 
+    QScopedPointer<CEmailAccounts> mailAccounts;
+    mailAccounts.reset(CEmailAccounts::NewL());
+    
+    mailAccounts->PopulateDefaultSmtpSettingsL(*smtpSettings,*iapPref);
+    
+    data.setValue(EmailAddress, 
+                            XQConversions::s60DescToQString(smtpSettings->EmailAddress()));
+
+    data.setValue(ReplyAddress, 
+                            XQConversions::s60DescToQString(smtpSettings->ReplyToAddress()));
+
+    data.setValue(EmailAlias, 
+                            XQConversions::s60DescToQString(smtpSettings->EmailAlias()));
+
+    data.setValue(OutgoingMailServer,
+                            XQConversions::s60DescToQString(smtpSettings->ServerAddress()));
+
+    QString outgoingLoginName = XQConversions::s60Desc8ToQString(smtpSettings->LoginName()); 
+    QString outgoingPassword = XQConversions::s60Desc8ToQString(smtpSettings->Password()); 
+    data.setValue(OutgoingLoginName, outgoingLoginName);
+    data.setValue(OutgoingPassword, outgoingPassword);
+
+    if (smtpSettings->SMTPAuth()) {
+        QVariant incomingLoginName;
+        QVariant incomingPassword;
+        
+        if (data.getValue(IncomingLoginName, incomingLoginName)
+            && data.getValue(IncomingPassword, incomingPassword)) {
+            if (incomingLoginName == outgoingLoginName && incomingPassword == outgoingPassword) {
+                // incoming login name is same than outgoing
+                data.setValue(OutgoingMailUsesAuthentication, NmApiAuthSameAsIncoming);
+            }
+            else {
+                // Different login for outgoing mail
+                data.setValue(OutgoingMailUsesAuthentication, NmApiAuthUserAuthentication);
+            }
+        }
+        else {
+            // didn't get incoming password or login name. 
+            data.setValue(OutgoingMailUsesAuthentication, NmApiAuthUserAuthentication);
+        }
+    }
+    else {
+        data.setValue(OutgoingMailUsesAuthentication, NmApiAuthNone);
     }
     
-    data.setValue(OutgoingSecureSockets, popSettings->SecureSockets());
-    data.setValue(OutgoingSSLWrapper, popSettings->SSLWrapper());
+    TBool secureSockets = smtpSettings->SecureSockets();
+    TBool sslWrapper = smtpSettings->SSLWrapper();
+    
+    if (secureSockets == true && sslWrapper == false) {
+        data.setValue(OutgoingMailSecurityType, NmApiStartTls);
+    }
+    else if (secureSockets == false && sslWrapper == true) {
+        data.setValue(OutgoingMailSecurityType, NmApiSSLTls);
+    }
+    else {
+        data.setValue(OutgoingMailSecurityType, NmApiSecurityOff);
+    }
+    
+    if (smtpSettings->Port()) {
+        data.setValue(OutgoingPort, smtpSettings->Port());
+    }
+    else {
+        if (sslWrapper) {
+            data.setValue(OutgoingPort, DefaultSmtpPortSsl);
+        }
+        else{
+            data.setValue(OutgoingPort, DefaultSmtpPort);
+        }
+    }
 }
 
-
+void NmApiPopImapSettingsManager::populateCenrepDefaults(NmApiMailboxSettingsData &data)
+{
+    NM_FUNCTION;
+    data.setValue(DownloadPictures, int(0));
+    data.setValue(MessageDivider, int(0));
+    data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetSE);
+    data.setValue(ReceptionUserDefinedProfile, int(0));	// 0, because default profile is save energy
+    data.setValue(ReceptionInboxSyncWindow, IpsServices::DefaultValueSaveEnergyInboxSyncWindow);
+    data.setValue(ReceptionGenericSyncWindowInMessages, int(0)); // all messages
+    data.setValue(ReceptionRefreshPeriodOther, int(0)); // when opening mailbox. (no refreshing in save energy mode)
+    data.setValue(ReceptionWeekDays, IpsServices::DefaultValueSaveEnergyReceptionDays);
+    data.setValue(ReceptionDayStartTime, IpsServices::DefaultValueSaveEnergyReceptionStartTime);
+    data.setValue(ReceptionDayEndTime, IpsServices::DefaultValueSaveEnergyReceptionEndTime);
+    data.setValue(ReceptionRefreshPeriodDayTime, IpsServices::DefaultValueSaveEnergyReceptionRefreshPeriodDayTime);
+    data.setValue(UserNameHidden, int(0));
+}
--- a/emailservices/nmclientapi/src/nmapisettingsmanager.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapisettingsmanager.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -14,22 +14,22 @@
  * Description:
  *
  */
-#include <nmapisettingsmanager.h>
-#include "nmapisettingsmanager_p.h"
-#include "nmapiheaders.h"
+#include <nmapiheaders.h>
 
 namespace EmailClientApi
 {
 
 NmApiSettingsManager::NmApiSettingsManager(const quint64 mailboxId)
 {    
-    d = new NmApiSettingsManagerPrivate(mailboxId);
+    Q_UNUSED(mailboxId);
+    d = new NmApiSettingsManagerPrivate();
 }
 
 NmApiSettingsManager::~NmApiSettingsManager()
 {    
     delete d;
 }
+
 /*!     
  Loads email settings.
  \param mailboxId which settings are returned
@@ -48,7 +48,7 @@
  */
 bool NmApiSettingsManager::save(const NmApiMailboxSettingsData &data)
 {
-    return d->save(data);
+    return d->save(data.mailboxId(), data);
 }
 
 } // end namespace
--- a/emailservices/nmclientapi/src/nmapisettingsmanager_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapisettingsmanager_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -14,46 +14,37 @@
  * Description:
  *
  */
-
-#include <QVariant>
-#include <QList>
-
-#include <xqconversions.h>
-#include <xqsettingsmanager.h>
-#include <xqcentralrepositoryutils.h>
-#include <xqcentralrepositorysearchcriteria.h>
+#include <nmapiheaders.h>
 
-#include <pop3set.h>
-#include <imapset.h>
-#include <smtpset.h>
-#include <iapprefs.h>
+// Helpers
+HBufC8* StringToS60HBufC8LC(const QString &string)
+{
+    HBufC8* tmp = XQConversions::qStringToS60Desc8(string);
+    User::LeaveIfNull(tmp);
+    CleanupStack::PushL(tmp);
+    return tmp;
+}
 
-#include "ipssettingkeys.h"
-#include "nmapiheaders.h"
-#include <nmapisettingsmanager.h>
-#include "nmapisettingsmanager_p.h"
+const TPtrC StringToS60TPtrC(const QString &string)
+{
+    return TPtrC(reinterpret_cast<const TUint16*>(string.utf16()));
+}
+
 
 namespace EmailClientApi
 {
+const int KUndefinedOffset = -1;
 
-NmApiSettingsManagerPrivate::NmApiSettingsManagerPrivate(const quint64 mailboxId)
-    : mAccount(0),
-    mPop3Settings(0),
-    mImap4Settings(0),
-    mSmtpSettings(0),
-    mMailboxOffset(-1),
+NmApiSettingsManagerPrivate::NmApiSettingsManagerPrivate()
+    : mAccount(NULL),
+    mPop3Settings(NULL),
+    mImap4Settings(NULL),
+    mSmtpSettings(NULL),
+    mQSettingsManager(NULL),
+    mMailboxOffset(KUndefinedOffset),
+    mActiveProfileOffset(KUndefinedOffset),
     mMailboxId(0)
 {
-    QT_TRAP_THROWING(mAccount = CEmailAccounts::NewL());
-    mMailboxId = (quint32)mailboxId;
-
-    mQSettingsManager = new XQSettingsManager();
-    Q_CHECK_PTR(mQSettingsManager);
-
-    checkAccountType();
-    QT_TRAP_THROWING(initAccountL());
-    calculateMailboxOffset();
-
 }
 
 NmApiSettingsManagerPrivate::~NmApiSettingsManagerPrivate()
@@ -66,36 +57,53 @@
 }
 
 /*!
- Loads QMail specific settings.
+ Loads email account settings.
  \param mailboxId which settings are returned
  \param data consists of keys and values of settings.
  \return bool <true> when the setting items were found otherwise <false>.
  */
 bool NmApiSettingsManagerPrivate::load(quint64 mailboxId, NmApiMailboxSettingsData &data)
 {
-	mMailboxId = mailboxId;
-    return (readSetting(data) && readCenRepSetting(data));
+    AccountDataCleanUpItem(mAccount, mPop3Settings,
+            mImap4Settings, mSmtpSettings, mQSettingsManager);
+    mMailboxId = mailboxId; // Last 32 bits are used as mailbox id
+    data.setMailboxId(mailboxId);
+    bool retVal = false;
+    TRAPD(err, initAccountL());
+    if (!err) {
+        readSettings(data);
+        retVal = readCenRepSettings(data);
+    }
+    return retVal;
 }
 
 /*!
- Saves QMail specific settings.
+ Saves mailbox settings.
+ \param mailboxId which settings are saved
  \param data consists of keys and values of settings.
  \return bool <true> when the setting items were successfully saved otherwise <false>.
  */
-bool NmApiSettingsManagerPrivate::save(const NmApiMailboxSettingsData &data)
+bool NmApiSettingsManagerPrivate::save(quint64 mailboxId, const NmApiMailboxSettingsData &data)
 {
-    TInt err(KErrNone);
-    TRAP(err, writeSettingL(data));
-    return (!err && writeSettingToCenRep(data));
+    AccountDataCleanUpItem(mAccount, mPop3Settings,
+           mImap4Settings, mSmtpSettings, mQSettingsManager);
+    mMailboxId = mailboxId; // Last 32 bits are used as mailbox id
+    bool retVal = false;
+    TRAPD(err, initAccountL());
+    if (!err) {
+        TRAP(err, writeSettingL(data));
+        if(!err) {
+            retVal = writeSettingToCenRep(data);
+        }
+    }
+    return (!err && retVal);
 }
 
 /*!
- Finds and returns the SMTP specific setting.
- \param settingItem SettingItem enum of the setting to return
- \param QVariant SettingValue of the found setting value.
- \return bool <true> when the setting item was found otherwise <false>.
+ Reads the mailbox account specific settings.
+ \param data consists of keys and values of settings.
  */
-bool NmApiSettingsManagerPrivate::readSetting(NmApiMailboxSettingsData &data)
+void NmApiSettingsManagerPrivate::readSettings(NmApiMailboxSettingsData &data)
 {
     if (mMailboxType == NmApiMailboxTypePop) {
         data.setValue(IncomingLoginName, XQConversions::s60Desc8ToQString(mPop3Settings->LoginName()));
@@ -106,6 +114,7 @@
         data.setValue(IncomingMailUsesAuthentication, mPop3Settings->POP3Auth());
 #endif
         data.setValue(IncomingPort, mPop3Settings->Port());
+        data.setValue(IncomingMailSecurityType, security(*mPop3Settings));
     }
     else if (mMailboxType  == NmApiMailboxTypeImap) {
         data.setValue(IncomingLoginName, XQConversions::s60Desc8ToQString(mImap4Settings->LoginName()));
@@ -119,9 +128,9 @@
 #endif
         data.setValue(IncomingPort, mImap4Settings->Port());
         data.setValue(FolderPath, XQConversions::s60Desc8ToQString(mImap4Settings->FolderPath()));
+        data.setValue(IncomingMailSecurityType, security(*mImap4Settings));
     }
 
-    data.setValue(IncomingMailSecurityType, security());
     data.setValue(MyName, XQConversions::s60DescToQString(mSmtpSettings->EmailAlias()));
     data.setValue(EmailAlias, XQConversions::s60DescToQString(mSmtpSettings->EmailAlias()));
     data.setValue(EmailAddress, XQConversions::s60DescToQString(mSmtpSettings->EmailAddress()));
@@ -134,396 +143,387 @@
     data.setValue(OutgoingMailUsesAuthentication, mSmtpSettings->SMTPAuth());
     data.setValue(OutgoingSecureSockets, mSmtpSettings->SecureSockets());
     data.setValue(OutgoingSSLWrapper, mSmtpSettings->SSLWrapper());
-    data.setValue(OutgoingMailSecurityType, XQConversions::s60Desc8ToQString(mSmtpSettings->TlsSslDomain()));
-    return true;
+    data.setValue(OutgoingMailSecurityType, security(*mSmtpSettings));
+}
+
+/*!
+ Returns the Central Repository setting. Sets given boolen parameter to <false>
+ if error happens. If no error happens boolean status is not changed.
+ \param cenRepKey Central repository key
+ \param success  Boolean which is set to <false> if some other error than 
+                 XQSettingsManager::NotFoundError occurs.
+                 Note! Variable is never set to <true>.
+ \return QVariant The settings value for the given key.
+ */
+QVariant NmApiSettingsManagerPrivate::readFromCenRep(quint32 key,
+        bool &success) const
+    {
+    QVariant setting = readFromCenRep(key);
+
+    /*
+     XQSettingsManager::NotFoundError occurs if some setting is not found from the cenrep.
+     This is a valid case since all accounts doesn't neccessarily have all possible settings.
+     All other errors are "real" errors and those are indicated to the API user.
+     */
+    if (setting.isNull() 
+        && mQSettingsManager->error() != XQSettingsManager::NotFoundError) {
+        success = false;
+    }
+
+    return setting;
+    }
+
+bool NmApiSettingsManagerPrivate::readCenRepSettings(NmApiMailboxSettingsData &data)
+{
+    bool retVal = true;
+    
+    data.setValue(DownloadPictures, 
+        readFromCenRep(IpsServices::EmailKeyPreferenceDownloadPictures, retVal));
+    data.setValue(MessageDivider, 
+        readFromCenRep(IpsServices::EmailKeyPreferenceMessageDivider, retVal));
+
+    QVariant activeProfileSetting = readFromCenRep(IpsServices::EmailKeyReceptionActiveProfile, retVal);
+    
+    if (!activeProfileSetting.isNull()) {
+        switch (activeProfileSetting.toInt()) {
+            case IpsServices::EmailSyncProfileKeepUpToDate:
+                data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetKUTD);
+                break;
+            case IpsServices::EmailSyncProfileSaveEnergy:
+                data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetSE);
+                break;
+            case IpsServices::EmailSyncProfileManualFetch:
+                data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetMF);
+                break;
+            case IpsServices::EmailSyncProfileUserDefined:
+                data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetUD);
+                break;
+            default:
+                data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetKUTD);
+                break;
+        }
+    }
+
+    data.setValue(ReceptionUserDefinedProfile, readFromCenRep(
+            IpsServices::EmailKeyReceptionUserDefinedProfile, retVal));
+    data.setValue(ReceptionInboxSyncWindow, readFromCenRep(mActiveProfileOffset
+                        + IpsServices::EmailKeyReceptionInboxSyncWindow, retVal));
+    data.setValue(ReceptionGenericSyncWindowInMessages, readFromCenRep(mActiveProfileOffset
+                        + IpsServices::EmailKeyReceptionGenericSyncWindowInMessages, retVal));
+    data.setValue(ReceptionWeekDays, readFromCenRep(mActiveProfileOffset
+                        + IpsServices::EmailKeyReceptionWeekDays, retVal));
+    data.setValue(ReceptionDayStartTime, readFromCenRep(mActiveProfileOffset
+                        + IpsServices::EmailKeyReceptionDayStartTime, retVal));
+    data.setValue(ReceptionDayEndTime, readFromCenRep(mActiveProfileOffset
+                        + IpsServices::EmailKeyReceptionDayEndTime, retVal));
+    data.setValue(ReceptionRefreshPeriodDayTime, readFromCenRep(mActiveProfileOffset
+                        + IpsServices::EmailKeyReceptionRefreshPeriodDayTime, retVal));
+    data.setValue(ReceptionRefreshPeriodOther, readFromCenRep(mActiveProfileOffset
+                        + IpsServices::EmailKeyReceptionRefreshPeriodOther, retVal));
+    data.setValue(UserNameHidden, readFromCenRep(IpsServices::EmailKeyUserNameHidden, retVal));
+    data.setValue(EmailNotificationState, readFromCenRep(IpsServices::EmailKeyEMNState, retVal));
+    data.setValue(FirstEmnReceived, readFromCenRep(IpsServices::EmailKeyFirstEmnReceived, retVal));
+    data.setValue(EmnReceivedNotSynced, readFromCenRep(
+        IpsServices::EmailKeyEmnReceivedNotSynced, retVal));
+    data.setValue(AlwaysOnlineState, alwaysOnlineState(retVal));
+
+    data.setValue(AoLastSuccessfulUpdate, readFromCenRep(
+        IpsServices::EmailKeyAoLastSuccessfulUpdateL, retVal));
+    data.setValue(AoLastUpdateFailed, readFromCenRep(
+        IpsServices::EmailKeyAoLastUpdateFailed, retVal));
+    data.setValue(AoUpdateSuccessfulWithCurSettings, readFromCenRep(
+            IpsServices::EmailKeyAoUpdateSuccessfulWithCurSettings, retVal));
+    return retVal;
 }
 
-bool NmApiSettingsManagerPrivate::readCenRepSetting(NmApiMailboxSettingsData &data)
+void NmApiSettingsManagerPrivate::fillImapSettingDataL(const NmApiMailboxSettingsData &data)
 {
-    bool ret = true;
-    QVariant tmp;
-    data.setValue(DownloadPictures, readFromCenRep(IpsServices::EmailKeyPreferenceDownloadPictures));
-    data.setValue(MessageDivider, readFromCenRep(IpsServices::EmailKeyPreferenceMessageDivider));
-
-    tmp = readFromCenRep(IpsServices::EmailKeyReceptionActiveProfile);
-    switch(tmp.toInt()){
-        case 0:
-            data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetKUTD);
-            break;
-        case 1:
-            data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetSE);
-            break;
-        case 2:
-            data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetMF);
-            break;
-        case 3:
-            data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetUD);
-            break;
-        default:
-            data.setValue(ReceptionActiveProfile, EmailClientApi::EmailProfileOffsetKUTD);
-            break;
-    };
+    int key = -1;
+    QVariant settingValue;
+    QList<int> keylist = data.listSettings();
+    
+    for (int i = 0; i < keylist.size(); i++) {
+        key = keylist[i];
+        if (data.getValue(key, settingValue) && !settingValue.isNull()) {
+            switch (key) {
+                case IncomingLoginName:
+                    mImap4Settings->SetLoginNameL(*StringToS60HBufC8LC(settingValue.toString()));
+                    CleanupStack::PopAndDestroy();
+                    break;
+                case IncomingPassword:
+                    mImap4Settings->SetPasswordL(*StringToS60HBufC8LC(settingValue.toString()));
+                    CleanupStack::PopAndDestroy();
+                    break;
+                case MailboxName:
+                    mImap4Account.iImapAccountName.Copy(StringToS60TPtrC(settingValue.toString()));
+                    break;
+                case IncomingMailServer:
+                    mImap4Settings->SetServerAddressL(StringToS60TPtrC(settingValue.toString()));
+                    break;
+                case IncomingMailUsesAuthentication:
+#if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
+                   mImap4Settings->SetIAMP4Auth(settingValue.toBool());             
+#endif
+                   break;
+                case FolderPath:
+                   mImap4Settings->SetFolderPathL(*StringToS60HBufC8LC(settingValue.toString()));
+                   CleanupStack::PopAndDestroy();
+                   break;
+                case IncomingMailSecurityType:
+                    setSecurity(*mImap4Settings, settingValue.toString());
+                    break;
+                case IncomingPort:
+                    mImap4Settings->SetPort(settingValue.toInt());
+                    break;
+                case IncomingSecureSockets:
+                    mImap4Settings->SetSecureSockets(settingValue.toBool());
+                    break;
+                case IncomingSSLWrapper:
+                    mImap4Settings->SetSSLWrapper(settingValue.toBool());
+                    break;
+                default:
+                    fillSmtpSettingDataL(data, settingValue, key);
+                    break;
+            }
+        }
+    }
+}
 
-    data.setValue(ReceptionUserDefinedProfile, readFromCenRep(IpsServices::EmailKeyReceptionUserDefinedProfile));
-    data.setValue(ReceptionInboxSyncWindow, readFromCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionInboxSyncWindow));
-    data.setValue(ReceptionGenericSyncWindowInMessages, readFromCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionGenericSyncWindowInMessages));
-    data.setValue(ReceptionWeekDays, readFromCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionWeekDays));
-    data.setValue(ReceptionDayStartTime, readFromCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionDayStartTime));
-    data.setValue(ReceptionDayEndTime, readFromCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionDayEndTime));
-    data.setValue(ReceptionRefreshPeriodDayTime, readFromCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionRefreshPeriodDayTime));
-    data.setValue(ReceptionRefreshPeriodOther, readFromCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionRefreshPeriodOther));
-    data.setValue(UserNameHidden, readFromCenRep(IpsServices::EmailKeyUserNameHidden));
-    data.setValue(EmailNotificationState, readFromCenRep(IpsServices::EmailKeyEMNState));
-    data.setValue(FirstEmnReceived, readFromCenRep(IpsServices::EmailKeyFirstEmnReceived));
-    data.setValue(EmnReceivedNotSynced, readFromCenRep(IpsServices::EmailKeyEmnReceivedNotSynced));
+void NmApiSettingsManagerPrivate::fillPopSettingDataL(const NmApiMailboxSettingsData &data)
+{
+    int key = -1;
+    QVariant settingValue;
+    QList<int> keylist = data.listSettings();
+    
+    for (int i = 0; i < keylist.size(); i++) {
+       key = keylist[i];
+       if (data.getValue(key, settingValue) && !settingValue.isNull()) {
+           switch (key) {
+               case IncomingLoginName:
+                   mPop3Settings->SetLoginNameL(*StringToS60HBufC8LC(settingValue.toString()));
+                   CleanupStack::PopAndDestroy();
+                   break;
+               case IncomingPassword:
+                   mPop3Settings->SetPasswordL(*StringToS60HBufC8LC(settingValue.toString()));
+                   CleanupStack::PopAndDestroy();
+                   break;
+               case MailboxName:
+                   mPop3Account.iPopAccountName.Copy(StringToS60TPtrC(settingValue.toString()));
+                   break;
+               case IncomingMailServer:
+                   mPop3Settings->SetServerAddressL(StringToS60TPtrC(settingValue.toString()));
+                   break;
+               case IncomingMailUsesAuthentication:
+#if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
+                   mPop3Settings->SetPOP3Auth(settingValue.toBool());
+#endif
+                   break;
+               case IncomingMailSecurityType:
+                   setSecurity(*mPop3Settings, settingValue.toString());
+                   break;
+               case IncomingPort:
+                   mPop3Settings->SetPort(settingValue.toInt());
+                   break;
+               case IncomingSecureSockets:
+                   mPop3Settings->SetSecureSockets(settingValue.toBool());
+                   break;
+               case IncomingSSLWrapper:
+                   mPop3Settings->SetSSLWrapper(settingValue.toBool());
+                   break;
+               default:
+                   fillSmtpSettingDataL(data, settingValue, key);
+                   break;
+           }
+       }
+    }
+}
 
-    QString aolState = alwaysOnlineState();
-    if(aolState.length()>0)
-        data.setValue(AlwaysOnlineState, aolState);
-
-    data.setValue(AoLastSuccessfulUpdate, readFromCenRep(IpsServices::EmailKeyAoLastSuccessfulUpdateL));
-    data.setValue(AoLastUpdateFailed, readFromCenRep(IpsServices::EmailKeyAoLastUpdateFailed));
-    data.setValue(AoUpdateSuccessfulWithCurSettings, readFromCenRep(IpsServices::EmailKeyAoUpdateSuccessfulWithCurSettings));
-    return ret;
+void NmApiSettingsManagerPrivate::fillSmtpSettingDataL(const NmApiMailboxSettingsData &data, 
+        const QVariant settingValue, const int key)
+{    
+    switch (key) {
+       case EmailAddress:
+           mSmtpSettings->SetEmailAddressL(StringToS60TPtrC(settingValue.toString()));
+           break;
+       case ReplyAddress:  
+           mSmtpSettings->SetReplyToAddressL(StringToS60TPtrC(settingValue.toString()));
+           break;
+       case EmailAlias:
+           mSmtpSettings->SetEmailAliasL(StringToS60TPtrC(settingValue.toString()));
+           break;
+       case MyName:
+           // If EmailAlias is not set already
+           if(mSmtpSettings->EmailAlias().Length() == 0) {
+               mSmtpSettings->SetEmailAliasL(StringToS60TPtrC(settingValue.toString()));
+           }
+           break;
+       case OutgoingMailServer:
+           mSmtpSettings->SetServerAddressL(StringToS60TPtrC(settingValue.toString()));
+           break;
+       case OutgoingLoginName:
+           mSmtpSettings->SetLoginNameL(*StringToS60HBufC8LC(settingValue.toString()));
+           CleanupStack::PopAndDestroy();
+           break;
+       case OutgoingPassword:
+           mSmtpSettings->SetPasswordL(*StringToS60HBufC8LC(settingValue.toString()));
+           CleanupStack::PopAndDestroy();
+           break;
+       case UseOutgoingAuthentication:
+           // fall through
+       case OutgoingMailUsesAuthentication:
+           mSmtpSettings->SetSMTPAuth(settingValue.toBool());
+           break;
+       case OutgoingSecureSockets:
+           mSmtpSettings->SetSecureSockets(settingValue.toBool());
+           break;
+       case OutgoingSSLWrapper:
+           mSmtpSettings->SetSSLWrapper(settingValue.toBool());
+           break;
+       case OutgoingMailSecurityType:
+           setSecurity(*mSmtpSettings, settingValue.toString());
+           break;
+       case OutgoingPort:
+           mSmtpSettings->SetPort(settingValue.toInt());
+           break;
+       default:
+           break;
+   }
 }
 
 /*!
  Writes POP3/IMAP4 specific settings.
  \param data consists of keys and values of settings.
  */
-bool NmApiSettingsManagerPrivate::writeSettingL(const NmApiMailboxSettingsData &data)
-{
-    HBufC *tmp = 0;
-    HBufC8 *tmp8 = 0;
-    bool ret(false);
-    int key;
-    QVariant settingValue;
-    QList<int> keylist;
-    bool aliasSet = false;
-
-    keylist = data.listSettings();
-    for (int i = 0; i < keylist.size(); i++) {
-        key = keylist[i];
-        data.getValue(key, settingValue);
-        switch (key) {
-            case IncomingLoginName: {
-                tmp8 = XQConversions::qStringToS60Desc8(settingValue.toString());
-                if (mMailboxType == NmApiMailboxTypePop) {
-                    mPop3Settings->SetLoginNameL(*tmp8);
-                }
-                else if (mMailboxType == NmApiMailboxTypeImap) {
-                    mImap4Settings->SetLoginNameL(*tmp8);
-                    }
-                delete tmp8;
-                break;
-            }
-            case IncomingPassword: {
-                tmp8 = XQConversions::qStringToS60Desc8(settingValue.toString());
-                if (mMailboxType == NmApiMailboxTypePop) {
-                    mPop3Settings->SetPasswordL(*tmp8);
-                }
-                else if (mMailboxType == NmApiMailboxTypeImap) {
-                    mImap4Settings->SetPasswordL(*tmp8);
-                    }
-                delete tmp8;
-                break;
-            }
-            case MailboxName: {
-                tmp = XQConversions::qStringToS60Desc(settingValue.toString());
-                if (mMailboxType == NmApiMailboxTypePop) {
-                    mPop3Account.iPopAccountName.Copy(*tmp);
-                }
-                else if (mMailboxType == NmApiMailboxTypeImap) {
-                    mImap4Account.iImapAccountName.Copy(*tmp);
-                    }
-                delete tmp;
-                break;
-            }
-            case IncomingMailServer: {
-                tmp = XQConversions::qStringToS60Desc(settingValue.toString());
-
-                if (mMailboxType == NmApiMailboxTypePop) {
-                    mPop3Settings->SetServerAddressL(*tmp);
-                }
-                else if (mMailboxType == NmApiMailboxTypeImap) {
-                    mImap4Settings->SetServerAddressL(*tmp);
-                    }
-                delete tmp;
-                break;
-            }
-            case IncomingMailUsesAuthentication: {
-#if (defined SYMBIAN_EMAIL_CAPABILITY_SUPPORT)
-
-                if (mMailboxType == NmApiMailboxTypePop) {
-                    mPop3Settings->SetPOP3Auth(settingValue.toBool());
-                }
-                else if (mMailboxType == NmApiMailboxTypeImap) {
-                    mImap4Settings->SetIAMP4Auth(settingValue.toBool());
-                }
-#endif
-                break;
-            }
-            case IncomingMailSecurityType: {
-                setSecurity(settingValue.toString());
-                break;
-            }
-            case IncomingPort: {
-                if (mMailboxType == NmApiMailboxTypePop) {
-                mPop3Settings->SetPort(settingValue.toInt());
-                }
-                else if (mMailboxType == NmApiMailboxTypeImap) {
-                    mImap4Settings->SetPort(settingValue.toInt());
-                }
-                break;
-            }
-            case OutgoingPort: {
-                mSmtpSettings->SetPort(settingValue.toInt());
-                break;
-            }
-            case IncomingSecureSockets: {
-                if (mMailboxType == NmApiMailboxTypePop) {
-                    mPop3Settings->SetSecureSockets(settingValue.toBool());
-                 }
-                 else if (mMailboxType == NmApiMailboxTypeImap) {
-                    mImap4Settings->SetSecureSockets(settingValue.toBool());
-                     }
-                break;
-            }
-            case IncomingSSLWrapper: {
-                if (mMailboxType == NmApiMailboxTypePop) {
-                    mPop3Settings->SetSSLWrapper(settingValue.toBool());
-                }
-                else if (mMailboxType == NmApiMailboxTypeImap) {
-                    mImap4Settings->SetSSLWrapper(settingValue.toBool());
-                    }
-                break;
-            }
-            case EmailAddress: {
-                tmp = XQConversions::qStringToS60Desc(settingValue.toString());
-                mSmtpSettings->SetEmailAddressL(*tmp);
-                break;
-            }
-            case ReplyAddress: {
-                tmp = XQConversions::qStringToS60Desc(settingValue.toString());
-                mSmtpSettings->SetReplyToAddressL(*tmp);
-                break;
-            }
-            case EmailAlias: {
-                QVariant tmpName;
-                if(data.getValue(MyName,tmpName)) {
-                    if(tmpName.toString()
-                        ==XQConversions::s60DescToQString(mSmtpSettings->EmailAlias())) {
-                        aliasSet = true;
-                    }
-                }
-                tmp = XQConversions::qStringToS60Desc(settingValue.toString());
-                mSmtpSettings->SetEmailAliasL(*tmp);
-                break;
-            }
-            case MyName: {
-                if(!aliasSet) {
-                tmp = XQConversions::qStringToS60Desc(settingValue.toString());
-                mSmtpSettings->SetEmailAliasL(*tmp);
-                }
-                break;
-            }
-            case OutgoingMailServer: {
-                tmp = XQConversions::qStringToS60Desc(settingValue.toString());
-                mSmtpSettings->SetServerAddressL(*tmp);
-                break;
-            }
-            case OutgoingLoginName: {
-                tmp8 = XQConversions::qStringToS60Desc8(settingValue.toString());
-                mSmtpSettings->SetLoginNameL(*tmp8);
-                break;
-            }
-            case OutgoingPassword: {
-                tmp8 = XQConversions::qStringToS60Desc8(settingValue.toString());
-                mSmtpSettings->SetPasswordL(*tmp8);
-                break;
-            }
-            case UseOutgoingAuthentication:
-            case OutgoingMailUsesAuthentication: {
-                mSmtpSettings->SetSMTPAuth(settingValue.toBool());
-                break;
-            }
-            case OutgoingSecureSockets: {
-                mSmtpSettings->SetSecureSockets(settingValue.toBool());
-                break;
-            }
-            case OutgoingSSLWrapper: {
-                mSmtpSettings->SetSSLWrapper(settingValue.toBool());
-                break;
-            }
-            case OutgoingMailSecurityType: {
-                tmp8 = XQConversions::qStringToS60Desc8(settingValue.toString());
-                mSmtpSettings->SetTlsSslDomainL(*tmp8);
-                break;
-            }
-            case FolderPath: {
-                tmp8 = XQConversions::qStringToS60Desc8(settingValue.toString());
-                mImap4Settings->SetFolderPathL(*tmp8);
-                break;
-            }
-            default: {
-				break;
-            }
-        };
+void NmApiSettingsManagerPrivate::writeSettingL(const NmApiMailboxSettingsData &data)
+{     
+    if (mMailboxType == NmApiMailboxTypePop) {
+        fillPopSettingDataL(data);
+        mAccount->SavePopSettingsL(mPop3Account, *mPop3Settings);
     }
-    ret = saveSettings();
-    return ret;
+    else if (mMailboxType == NmApiMailboxTypeImap) {
+        fillImapSettingDataL(data);
+        mAccount->SaveImapSettingsL(mImap4Account, *mImap4Settings);
+    }   
+    mAccount->SaveSmtpSettingsL(mSmtpAccount, *mSmtpSettings);
 }
 
 /*!
-Writes settings to central repository.
-\param data consists of keys and values of settings.
+ Writes settings to central repository.
+ \param data consists of keys and values of settings.
  */
 bool NmApiSettingsManagerPrivate::writeSettingToCenRep(
     const NmApiMailboxSettingsData &data)
 {
-    int key;
+    int key = -1;
     QVariant settingValue;
-    QList<int> keylist;
-
-    keylist = data.listSettings();
+    QList<int> keylist = data.listSettings();
     bool ret = false;
-    if(keylist.contains(ReceptionActiveProfile)) {
-        data.getValue(ReceptionActiveProfile,settingValue);
+    
+    if (data.getValue(ReceptionActiveProfile, settingValue) && !settingValue.isNull()) {
         QVariant profileOffset = 0;
         if(settingValue.toString() == EmailClientApi::EmailProfileOffsetKUTD) {
-            profileOffset=0;
+            profileOffset = 0;
         } else if(settingValue.toString() == EmailClientApi::EmailProfileOffsetSE){
             profileOffset = 1;
         } else if (settingValue.toString() == EmailClientApi::EmailProfileOffsetMF){
-                    profileOffset = 2;
+            profileOffset = 2;
         } else if (settingValue.toString() == EmailClientApi::EmailProfileOffsetUD) {
             profileOffset = 3;
         }
         ret = writeToCenRep(IpsServices::EmailKeyReceptionActiveProfile, profileOffset);
         if(ret) {
-            calculateActiveProfileOffset();
+            ret = calculateActiveProfileOffset();
         }
     }
     if (ret) {
+        bool cenRepSuccess = true;
         for (int i = 0; i < keylist.size(); i++) {
             key = keylist[i];
-            data.getValue(key, settingValue);
-            switch (key) {
-                case DownloadPictures: {
-                    ret = writeToCenRep(IpsServices::EmailKeyPreferenceDownloadPictures,
-                        settingValue);
-                    break;
-                }
-                case MessageDivider: {
-                    ret = writeToCenRep(IpsServices::EmailKeyPreferenceMessageDivider, settingValue);
-                    break;
-                }
-                case ReceptionUserDefinedProfile: {
-                    ret = writeToCenRep(IpsServices::EmailKeyReceptionUserDefinedProfile,
-                        settingValue);
-                    break;
-                }
-                case ReceptionInboxSyncWindow: {
-                    ret = writeToCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionInboxSyncWindow, settingValue);
-                    break;
-                }
-                case ReceptionGenericSyncWindowInMessages: {
-                    ret = writeToCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionGenericSyncWindowInMessages, settingValue);
-                    break;
-                }
-                case ReceptionWeekDays: {
-                    ret = writeToCenRep(mActiveProfileOffset + IpsServices::EmailKeyReceptionWeekDays,
-                        settingValue);
-                    break;
-                }
-                case ReceptionDayStartTime: {
-                    ret = writeToCenRep(mActiveProfileOffset + IpsServices::EmailKeyReceptionDayStartTime,
-                        settingValue);
-                    break;
-                }
-                case ReceptionDayEndTime: {
-                    ret = writeToCenRep(mActiveProfileOffset + IpsServices::EmailKeyReceptionDayEndTime,
-                        settingValue);
-                    break;
-                }
-                case ReceptionRefreshPeriodDayTime: {
-                    ret = writeToCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionRefreshPeriodDayTime, settingValue);
-                    break;
-                }
-                case ReceptionRefreshPeriodOther: {
-                    ret = writeToCenRep(mActiveProfileOffset
-                        + IpsServices::EmailKeyReceptionRefreshPeriodOther, settingValue);
-                    break;
-                }
-                case UserNameHidden: {
-                    ret = writeToCenRep(IpsServices::EmailKeyUserNameHidden, settingValue);
-                    break;
+            if (data.getValue(key, settingValue) && !settingValue.isNull()) {
+                switch (key) {
+                    case DownloadPictures:
+                        cenRepSuccess = writeToCenRep(IpsServices::EmailKeyPreferenceDownloadPictures,
+                            settingValue);
+                        break;
+                    case MessageDivider:
+                        cenRepSuccess = writeToCenRep(IpsServices::EmailKeyPreferenceMessageDivider, 
+                            settingValue);
+                        break;
+                    case ReceptionUserDefinedProfile:
+                        cenRepSuccess = writeToCenRep(IpsServices::EmailKeyReceptionUserDefinedProfile,
+                            settingValue);
+                        break;
+                    case ReceptionInboxSyncWindow:
+                        cenRepSuccess = writeToCenRep(mActiveProfileOffset
+                            + IpsServices::EmailKeyReceptionInboxSyncWindow, settingValue);
+                        break;
+                    case ReceptionGenericSyncWindowInMessages:
+                        cenRepSuccess = writeToCenRep(mActiveProfileOffset
+                            + IpsServices::EmailKeyReceptionGenericSyncWindowInMessages, 
+                            settingValue);
+                        break;
+                    case ReceptionWeekDays:
+                        cenRepSuccess = writeToCenRep(mActiveProfileOffset 
+                            + IpsServices::EmailKeyReceptionWeekDays, settingValue);
+                        break;
+                    case ReceptionDayStartTime:
+                        cenRepSuccess = writeToCenRep(mActiveProfileOffset 
+                            + IpsServices::EmailKeyReceptionDayStartTime, settingValue);
+                        break;
+                    case ReceptionDayEndTime:
+                        cenRepSuccess = writeToCenRep(mActiveProfileOffset
+                            + IpsServices::EmailKeyReceptionDayEndTime, settingValue);
+                        break;
+                    case ReceptionRefreshPeriodDayTime:
+                        cenRepSuccess = writeToCenRep(mActiveProfileOffset
+                            + IpsServices::EmailKeyReceptionRefreshPeriodDayTime, settingValue);
+                        break;
+                    case ReceptionRefreshPeriodOther:
+                        cenRepSuccess = writeToCenRep(mActiveProfileOffset
+                            + IpsServices::EmailKeyReceptionRefreshPeriodOther, settingValue);
+                        break;
+                    case UserNameHidden:
+                        cenRepSuccess = writeToCenRep(IpsServices::EmailKeyUserNameHidden, 
+                            settingValue);
+                        break;
+                    case EmailNotificationState:
+                        cenRepSuccess = writeToCenRep(IpsServices::EmailKeyEMNState, 
+                            settingValue);
+                        break;
+                    case FirstEmnReceived:
+                        cenRepSuccess = writeToCenRep(IpsServices::EmailKeyFirstEmnReceived, 
+                            settingValue);
+                        break;
+                    case EmnReceivedNotSynced:
+                        cenRepSuccess = writeToCenRep(IpsServices::EmailKeyEmnReceivedNotSynced, 
+                            settingValue);
+                        break;
+                    case AlwaysOnlineState:
+                        cenRepSuccess = setAlwaysOnlineState(settingValue);
+                        break;
+                    case AoLastSuccessfulUpdate:
+                        cenRepSuccess = writeToCenRep(IpsServices::EmailKeyAoLastSuccessfulUpdateL, 
+                            settingValue);
+                        break;
+                    case AoLastUpdateFailed:
+                        cenRepSuccess = writeToCenRep(IpsServices::EmailKeyAoLastUpdateFailed, 
+                            settingValue);
+                        break;
+                    case AoUpdateSuccessfulWithCurSettings:
+                        cenRepSuccess = writeToCenRep(
+                            IpsServices::EmailKeyAoUpdateSuccessfulWithCurSettings,
+                            settingValue);
+                        break;
+                    case ReceptionActiveProfile:
+                        // fall through
+                    default:
+                        break;
                 }
-                case EmailNotificationState: {
-                    ret = writeToCenRep(IpsServices::EmailKeyEMNState, settingValue);
-                    break;
-                }
-                case FirstEmnReceived: {
-                    ret = writeToCenRep(IpsServices::EmailKeyFirstEmnReceived, settingValue);
-                    break;
-                }
-                case EmnReceivedNotSynced: {
-                    ret = writeToCenRep(IpsServices::EmailKeyEmnReceivedNotSynced, settingValue);
-                    break;
-                }
-                case AlwaysOnlineState: {
-                    setAlwaysOnlineState(settingValue);
-                    break;
-                }
-                case AoLastSuccessfulUpdate: {
-                    ret = writeToCenRep(IpsServices::EmailKeyAoLastSuccessfulUpdateL, settingValue);
-                    break;
-                }
-                case AoLastUpdateFailed: {
-                    ret = writeToCenRep(IpsServices::EmailKeyAoLastUpdateFailed, settingValue);
-                    break;
+                
+                if (!cenRepSuccess) {
+                    ret = false; // ret is false if even one of the cenrep operations fails
                 }
-                case AoUpdateSuccessfulWithCurSettings: {
-                    ret = writeToCenRep(IpsServices::EmailKeyAoUpdateSuccessfulWithCurSettings,
-                        settingValue);
-                    break;
-                }
-                case ReceptionActiveProfile:
-                default: {
-                    break;
-                }
-            };
-        }
-    }
-    return ret;
-}
-/*!
- Stores the POP3/IMAP4 specific settings.
- \return bool <true> when the settings were succesfully written, otherwise <false>.
- */
-bool NmApiSettingsManagerPrivate::saveSettings()
-{
-    bool ret(false);
-    if (mMailboxType == NmApiMailboxTypePop) {
-        TRAPD(err, mAccount->SavePopSettingsL(mPop3Account, *mPop3Settings));
-        if (err == KErrNone) {
-            ret = true;
-        }
-    }
-    else if (mMailboxType == NmApiMailboxTypeImap) {
-        TRAPD(err, mAccount->SaveImapSettingsL(mImap4Account, *mImap4Settings));
-        if (err == KErrNone) {
-            ret = true;
+            }
         }
     }
     return ret;
@@ -532,7 +532,7 @@
 /*!
  Reads a key value from the Central Repository.
  \param key Key identifier.
- \return the settings value for the given key.
+ \return QVariant The settings value for the given key.
  */
 QVariant NmApiSettingsManagerPrivate::readFromCenRep(quint32 key) const
 {
@@ -545,7 +545,7 @@
  Writes a key value to the Central Repository.
  \param key Key identifier.
  \param value The settings value for the given key.
- \return Returns <true> if the value was succesfully written, <false> if not.
+ \return bool Returns <true> if the value was succesfully written, <false> if not.
  */
 bool NmApiSettingsManagerPrivate::writeToCenRep(quint32 key, const QVariant &value) const
 {
@@ -554,102 +554,75 @@
     return mQSettingsManager->writeItemValue(settingKey, value);
 }
 
-void NmApiSettingsManagerPrivate::setSecurity(QString securityType)
+void NmApiSettingsManagerPrivate::setSecurity(CImBaseEmailSettings &settings, 
+    QString securityType)
 {
-    if (securityType == NmApiStartTls) {
-        if (mMailboxType == NmApiMailboxTypePop) {
-            mPop3Settings->SetSecureSockets(ETrue);
-            mPop3Settings->SetSSLWrapper(EFalse);
-        }
-        else {
-            mImap4Settings->SetSecureSockets(ETrue);
-            mImap4Settings->SetSSLWrapper(EFalse);
-        }
-    }
-    else if (securityType == NmApiSSLTls) {
-        if (mMailboxType == NmApiMailboxTypePop) {
-            mPop3Settings->SetSecureSockets(EFalse);
-            mPop3Settings->SetSSLWrapper(ETrue);
-        }
-        else {
-            mImap4Settings->SetSecureSockets(EFalse);
-            mImap4Settings->SetSSLWrapper(ETrue);
-        }
-    }
-    else {
-        if (mMailboxType == NmApiMailboxTypePop) {
-            mPop3Settings->SetSecureSockets(EFalse);
-            mPop3Settings->SetSSLWrapper(EFalse);
-        }
-        else {
-            mImap4Settings->SetSecureSockets(EFalse);
-            mImap4Settings->SetSSLWrapper(EFalse);
-        }
-    }
+    settings.SetSecureSockets(securityType == NmApiStartTls ? ETrue : EFalse );
+    settings.SetSSLWrapper(securityType == NmApiSSLTls ? ETrue : EFalse );
 }
 
-QString NmApiSettingsManagerPrivate::security() const
+QString NmApiSettingsManagerPrivate::security(CImBaseEmailSettings &settings) const
 {
-    bool ss(false);
-    bool sslw(false);
-    QString securityType("");
+    bool ss(settings.SecureSockets());
+    bool sslWrapper(settings.SSLWrapper());
+    QString securityType(NmApiSecurityOff);
 
-    if (mMailboxType == NmApiMailboxTypePop) {
-        ss = mPop3Settings->SecureSockets();
-        sslw = mPop3Settings->SSLWrapper();
+    if (ss == true && sslWrapper == false) {
+        securityType = NmApiStartTls;
     }
-    else {
-        ss = mImap4Settings->SecureSockets();
-        sslw = mImap4Settings->SSLWrapper();
+    else if (ss == false && sslWrapper == true) {
+        securityType = NmApiSSLTls;
     }
 
-    if (ss == true && sslw == false) {
-        securityType = NmApiStartTls;
-    }
-    else if (ss == false && sslw == true) {
-        securityType = NmApiSSLTls;
-    }
-    else {
-        securityType = NmApiSecurityOff;
-    }
     return securityType;
 }
 
 /*!
-
+ Function for getting online state.
+ \param success Boolean variable for informing if operation fails. 
+ Note! If success is already <false> it is not set to <true>.
+ \return QString Online state.
  */
-QString NmApiSettingsManagerPrivate::alwaysOnlineState() const
+QString NmApiSettingsManagerPrivate::alwaysOnlineState(bool &success) const
 {
-    TInt profile = IpsServices::EmailSyncProfileManualFetch;
-    QString ret = NmApiOff;
+    QString ret = NmApiOff;  
+    int settingValue = -1;
+    bool cenRepSuccess = true;
+    QVariant state = readFromCenRep(IpsServices::EmailKeyReceptionActiveProfile,
+        cenRepSuccess);
 
-    QVariant state;
-    TInt settingValue = -1;
-    state = readFromCenRep(IpsServices::EmailKeyReceptionActiveProfile);
-    settingValue = state.toInt();
-
-    if (settingValue >= 0) {
-        profile = settingValue;
-        if (profile != IpsServices::EmailSyncProfileManualFetch) {
+    if (cenRepSuccess) {
+        settingValue = state.toInt();
+        if (settingValue != IpsServices::EmailSyncProfileManualFetch) {
             ret = NmApiAlways;
         }
     }
+    else { // If cenrep read fails it is informed via parameter
+        success = cenRepSuccess;
+    }
+    
     return ret;
 }
 
 /*!
-
+ Function for setting online state off. It is not allowed to change it on.
+ \return bool Return <true> if operation was successful otherwise <false>.
  */
-void NmApiSettingsManagerPrivate::setAlwaysOnlineState(const QVariant state)
+bool NmApiSettingsManagerPrivate::setAlwaysOnlineState(const QVariant &state)
 {
-    //only allowed to switch state off, not on.
+    bool retVal = true;
     if (state.toString() == NmApiOff) {
-        writeToCenRep(IpsServices::EmailKeyReceptionActiveProfile,
+        retVal = writeToCenRep(IpsServices::EmailKeyReceptionActiveProfile,
             IpsServices::EmailSyncProfileManualFetch);
     }
+    return retVal;
 }
 
-void NmApiSettingsManagerPrivate::calculateMailboxOffset()
+/*!
+ Function for calculating mailbox offset.
+ \return bool Returns <true> if operation was successfull otherwise returns <false>.
+ */
+bool NmApiSettingsManagerPrivate::calculateMailboxOffset()
 {
     // Find all the keys that match the criteria 0xZZZZZ000, where Z=don't care.
     // This will give us all the keys that hold the mailbox ids, e.g. 0x00001000, 0x00002000, etc.
@@ -658,80 +631,75 @@
     XQCentralRepositorySearchCriteria criteria(IpsServices::EmailMailboxSettingRepository,
         partialKey, bitMask);
     // Set the mailbox id is value criteria for the search.
-    criteria.setValueCriteria((int) mMailboxId);
+    criteria.setValueCriteria((static_cast<int>(mMailboxId)));
 
     // Find the keys.
     XQCentralRepositoryUtils utils(*mQSettingsManager);
     QList<XQCentralRepositorySettingsKey> foundKeys = utils.findKeys(criteria);
 
+    bool retVal = true;
     // We should only get one key as a result.
     if (foundKeys.count() == 1) {
         mMailboxOffset = foundKeys[0].key();
-        calculateActiveProfileOffset();
+        retVal = calculateActiveProfileOffset();
     }
     else {
-        mActiveProfileOffset = -1;
-        mMailboxOffset = -1;
+        mActiveProfileOffset = KUndefinedOffset;
+        mMailboxOffset = KUndefinedOffset;
+        retVal = false;
     }
-}
-
-/*!
- Calculates the active reception schedule profile offset.
- */
-void NmApiSettingsManagerPrivate::calculateActiveProfileOffset()
-{
-    QVariant activeProfile = readFromCenRep(IpsServices::EmailKeyReceptionActiveProfile);
-    mActiveProfileOffset = convertToProfileOffset(activeProfile.toInt());
+    return retVal;
 }
 
 /*!
-
+ Calculates the Active profile offset.
+  \return bool Returns <true> if operation was successfull otherwise <false>.
  */
-qint32 NmApiSettingsManagerPrivate::convertToProfileOffset(int profile) const
+bool NmApiSettingsManagerPrivate::calculateActiveProfileOffset()
 {
-    quint32 profileOffset(0);
-    // Possible values are defined in ipssettingkeys.h
-    switch (profile) {
-        case 0: {
-            profileOffset = IpsServices::EmailProfileOffsetKUTD;
-            break;
-        }
-        case 1: {
-            profileOffset = IpsServices::EmailProfileOffsetSE;
-            break;
+    bool retVal = true;
+    QVariant activeProfile = readFromCenRep(
+        IpsServices::EmailKeyReceptionActiveProfile, retVal);
+    if (retVal) {
+        switch (activeProfile.toInt()) {
+            case 0:
+                mActiveProfileOffset = IpsServices::EmailProfileOffsetKUTD;
+                break;
+            case 1:
+                mActiveProfileOffset = IpsServices::EmailProfileOffsetSE;
+                break;
+            case 2:
+                mActiveProfileOffset = IpsServices::EmailProfileOffsetMF;
+                break;
+            case 3:
+                mActiveProfileOffset = IpsServices::EmailProfileOffsetUD;
+                break;
+            default:
+                mActiveProfileOffset = IpsServices::EmailProfileOffsetKUTD;
+                break;
         }
-        case 2: {
-            profileOffset = IpsServices::EmailProfileOffsetMF;
-            break;
-        }
-        case 3: {
-            profileOffset = IpsServices::EmailProfileOffsetUD;
-            break;
-        }
-        default: {
-            break;
-        }
-    };
-
-    return profileOffset;
+    }
+    return retVal;
 }
 
-bool NmApiSettingsManagerPrivate::checkAccountType()
+/*!
+ Function for checking account type. 
+ \return bool Returns <true> If account type was identified. <false> if not.  
+ */
+bool NmApiSettingsManagerPrivate::checkAccountTypeL()
 {
     bool identified = false;
-
     RArray<TImapAccount> imapAccounts;
     CleanupClosePushL(imapAccounts);
-    TRAPD(err, mAccount->GetImapAccountsL(imapAccounts));
-    if (err == KErrNone) {
-        for (int i=0; i < imapAccounts.Count(); ++i) {
-            TImapAccount account = imapAccounts[i];
-            if (account.iImapService == mMailboxId) {
-                mImap4Account = account;
-                mMailboxType = NmApiMailboxTypeImap;
-                identified = true;
-                break;
-            }
+    
+    mAccount->GetImapAccountsL(imapAccounts);
+    for (int i=0; i < imapAccounts.Count(); ++i) {
+        TImapAccount account = imapAccounts[i];
+        if (account.iImapService == mMailboxId) {
+            mImap4Account = account;
+            mMailboxType = NmApiMailboxTypeImap;
+            identified = true;
+            break;
         }
     }
     CleanupStack::PopAndDestroy(&imapAccounts);
@@ -739,44 +707,51 @@
     if (!identified) {
         RArray<TPopAccount> popAccounts;
         CleanupClosePushL(popAccounts);
-        TRAPD(err, mAccount->GetPopAccountsL(popAccounts));
-        if (err == KErrNone) {
-            for (int i = 0; i < popAccounts.Count(); ++i) {
-                TPopAccount account = popAccounts[i];
-                if (popAccounts[i].iPopService == mMailboxId) {
-                    mPop3Account = account;
-                    mMailboxType = NmApiMailboxTypePop;
-                    identified = true;
-                    break;
-                }
+        mAccount->GetPopAccountsL(popAccounts);
+        for (int i = 0; i < popAccounts.Count(); ++i) {
+            TPopAccount account = popAccounts[i];
+            if (popAccounts[i].iPopService == mMailboxId) {
+                mPop3Account = account;
+                mMailboxType = NmApiMailboxTypePop;
+                identified = true;
+                break;
             }
         }
         CleanupStack::PopAndDestroy(&popAccounts);
     }
-
     return identified;
 }
 
+/*!
+ Function for initializing account information.
+ */
 void NmApiSettingsManagerPrivate::initAccountL()
 {
-    if (mMailboxType == NmApiMailboxTypePop) {
+    mAccount = CEmailAccounts::NewL();
+   
+    if (!checkAccountTypeL()) {
+        User::Leave(KErrNotSupported); // Account type was not identified
+    }
+    
+    if (mMailboxType == NmApiMailboxTypePop) {      
         mPop3Settings = new(ELeave) CImPop3Settings();
         mAccount->LoadPopSettingsL(mPop3Account, *mPop3Settings);
+        mAccount->GetSmtpAccountL(mPop3Account.iSmtpService, mSmtpAccount);
     }
-    else if (mMailboxType == NmApiMailboxTypeImap) {
+    else if (mMailboxType == NmApiMailboxTypeImap) {   
         mImap4Settings = new(ELeave) CImImap4Settings();
         mAccount->LoadImapSettingsL(mImap4Account, *mImap4Settings);
+        mAccount->GetSmtpAccountL(mImap4Account.iSmtpService, mSmtpAccount);
+    }
+    else {
+        User::Leave(KErrNotSupported);
     }
 
     mSmtpSettings = new(ELeave) CImSmtpSettings();
-
-    if (mMailboxType == NmApiMailboxTypePop) {
-        mAccount->GetSmtpAccountL(mPop3Account.iSmtpService, mSmtpAccount);
-    }
-    else if (mMailboxType == NmApiMailboxTypeImap) {
-        mAccount->GetSmtpAccountL(mImap4Account.iSmtpService, mSmtpAccount);
-    }
     mAccount->LoadSmtpSettingsL(mSmtpAccount, *mSmtpSettings);
+    
+    QT_TRYCATCH_LEAVING(mQSettingsManager = new XQSettingsManager());
+    calculateMailboxOffset();
 }
 
 } // end namespace
--- a/emailservices/nmclientapi/src/nmapitextcontent.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapitextcontent.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -30,6 +30,15 @@
 }
 
 /*!
+    Class copy constructor.
+*/
+NmApiTextContent::NmApiTextContent(const NmApiTextContent &textcontent)
+{
+    NM_FUNCTION;
+    d = textcontent.d;
+}
+
+/*!
     Class destructor.
 */
 NmApiTextContent::~NmApiTextContent()
@@ -37,6 +46,16 @@
     NM_FUNCTION;
 }
 
+NmApiTextContent& NmApiTextContent::operator=(const NmApiTextContent &textcontent)
+{
+    if (this == &textcontent)
+        return *this;
+    
+    d = textcontent.d;
+
+    return *this;
+}
+
 /*!
    Getter for content
  */
--- a/emailservices/nmclientapi/src/nmapitextcontent_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapitextcontent_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -29,6 +29,16 @@
 }
 
 /*!
+    Class copy constructor.
+*/
+NmApiTextContentPrivate::NmApiTextContentPrivate(const NmApiTextContentPrivate &textcontentprivate)
+ : QSharedData(textcontentprivate),
+   mContent(textcontentprivate.mContent)
+{
+    NM_FUNCTION;
+}
+
+/*!
     Class destructor.
 */
 NmApiTextContentPrivate::~NmApiTextContentPrivate()
--- a/emailservices/nmclientapi/src/nmapitypesconverter.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmclientapi/src/nmapitypesconverter.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -79,7 +79,8 @@
     api_env.setSender(envelope.sender().address());
     api_env.setSentTime(envelope.sentTime());
     api_env.setSubject(envelope.subject());
-    api_env.setMailboxId(envelope.messageId().id());
+    NmId mailboxId(envelope.mailboxId());
+    api_env.setMailboxId(mailboxId.id());
     api_env.setFlags(static_cast<EmailClientApi::NmApiMessageFlags>(static_cast<int>(envelope.flags())), true);
 
     return api_env;
--- a/emailservices/nmutilities/bwins/nmutilitiesu.def	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/bwins/nmutilitiesu.def	Thu Sep 30 11:43:07 2010 +0300
@@ -1,66 +1,78 @@
 EXPORTS
-	?valueChanged@NmUiEventsNotifier@@AAEXABVXQSettingsKey@@ABVQVariant@@@Z @ 1 NONAME ; void NmUiEventsNotifier::valueChanged(class XQSettingsKey const &, class QVariant const &)
-	?tr@NmUiEventsNotifier@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString NmUiEventsNotifier::tr(char const *, char const *, int)
-	?viewStateChanged@NmUiEventsNotifier@@IAEXW4NmUiEventType@1@W4NmUiViewId@@VNmId@@@Z @ 3 NONAME ; void NmUiEventsNotifier::viewStateChanged(enum NmUiEventsNotifier::NmUiEventType, enum NmUiViewId, class NmId)
-	?getStaticMetaObject@NmUiEventsNotifier@@SAABUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const & NmUiEventsNotifier::getStaticMetaObject(void)
-	??0NmUiEventsNotifier@@QAE@PAVQObject@@@Z @ 5 NONAME ; NmUiEventsNotifier::NmUiEventsNotifier(class QObject *)
-	?qt_metacast@NmUiEventsNotifier@@UAEPAXPBD@Z @ 6 NONAME ; void * NmUiEventsNotifier::qt_metacast(char const *)
-	??_ENmUiEventsNotifier@@UAE@I@Z @ 7 NONAME ; NmUiEventsNotifier::~NmUiEventsNotifier(unsigned int)
-	??1NmUiEventsNotifier@@UAE@XZ @ 8 NONAME ; NmUiEventsNotifier::~NmUiEventsNotifier(void)
-	?trUtf8@NmUiEventsNotifier@@SA?AVQString@@PBD0@Z @ 9 NONAME ; class QString NmUiEventsNotifier::trUtf8(char const *, char const *)
-	?mailboxIcon@EmailMailboxInfo@@QBE?AVQString@@ABVQVariant@@@Z @ 10 NONAME ; class QString EmailMailboxInfo::mailboxIcon(class QVariant const &) const
-	?trUtf8@NmUiEventsNotifier@@SA?AVQString@@PBD0H@Z @ 11 NONAME ; class QString NmUiEventsNotifier::trUtf8(char const *, char const *, int)
-	??1EmailMailboxInfo@@QAE@XZ @ 12 NONAME ; EmailMailboxInfo::~EmailMailboxInfo(void)
-	?mailboxName@EmailMailboxInfo@@QBE?AVQString@@ABVQVariant@@@Z @ 13 NONAME ; class QString EmailMailboxInfo::mailboxName(class QVariant const &) const
-	??0EmailMailboxInfo@@QAE@XZ @ 14 NONAME ; EmailMailboxInfo::EmailMailboxInfo(void)
-	?notifyViewStateChanged@NmUiEventsNotifier@@SA_NW4NmUiEventType@1@W4NmUiViewId@@ABVNmId@@@Z @ 15 NONAME ; bool NmUiEventsNotifier::notifyViewStateChanged(enum NmUiEventsNotifier::NmUiEventType, enum NmUiViewId, class NmId const &)
-	?qt_metacall@NmUiEventsNotifier@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 16 NONAME ; int NmUiEventsNotifier::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?staticMetaObject@NmUiEventsNotifier@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const NmUiEventsNotifier::staticMetaObject
-	?tr@NmUiEventsNotifier@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString NmUiEventsNotifier::tr(char const *, char const *)
-	?metaObject@NmUiEventsNotifier@@UBEPBUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const * NmUiEventsNotifier::metaObject(void) const
-	?parseKeyValue@NmUiEventsNotifier@@ABE_NABVQByteArray@@AAW4NmUiEventType@1@AAW4NmUiViewId@@AAVNmId@@@Z @ 20 NONAME ; bool NmUiEventsNotifier::parseKeyValue(class QByteArray const &, enum NmUiEventsNotifier::NmUiEventType &, enum NmUiViewId &, class NmId &) const
-	?keysEqual@NmUiEventsNotifier@@ABE_NABVXQSettingsKey@@ABVXQPublishAndSubscribeSettingsKey@@@Z @ 21 NONAME ; bool NmUiEventsNotifier::keysEqual(class XQSettingsKey const &, class XQPublishAndSubscribeSettingsKey const &) const
-	?tr@NmContactHistoryModel@@SA?AVQString@@PBD0@Z @ 22 NONAME ; class QString NmContactHistoryModel::tr(char const *, char const *)
-	?qt_metacall@NmContactHistoryModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 23 NONAME ; int NmContactHistoryModel::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?writeEntry@EmailMRU@@AAE_NHVQString@@0@Z @ 24 NONAME ; bool EmailMRU::writeEntry(int, class QString, class QString)
-	?handleQueryCompleted@NmContactHistoryModel@@AAEXH@Z @ 25 NONAME ; void NmContactHistoryModel::handleQueryCompleted(int)
-	?tr@NmContactHistoryModel@@SA?AVQString@@PBD0H@Z @ 26 NONAME ; class QString NmContactHistoryModel::tr(char const *, char const *, int)
-	??0EmailMRU@@QAE@XZ @ 27 NONAME ; EmailMRU::EmailMRU(void)
-	?writeCenRep@EmailMRU@@AAE_NHVQString@@@Z @ 28 NONAME ; bool EmailMRU::writeCenRep(int, class QString)
-	?subItemAt@NmContactHistoryModelItem@@QBE?AVNmContactHistoryModelSubItem@@H@Z @ 29 NONAME ; class NmContactHistoryModelSubItem NmContactHistoryModelItem::subItemAt(int) const
-	?getStaticMetaObject@NmContactHistoryModel@@SAABUQMetaObject@@XZ @ 30 NONAME ; struct QMetaObject const & NmContactHistoryModel::getStaticMetaObject(void)
-	?updateMRU@EmailMRU@@QAE_NVQString@@0@Z @ 31 NONAME ; bool EmailMRU::updateMRU(class QString, class QString)
-	?staticMetaObject@NmContactHistoryModel@@2UQMetaObject@@B @ 32 NONAME ; struct QMetaObject const NmContactHistoryModel::staticMetaObject
-	?addressKeyByEntryIndex@EmailMRU@@CAHH@Z @ 33 NONAME ; int EmailMRU::addressKeyByEntryIndex(int)
-	?contactId@NmContactHistoryModelItem@@QBEIXZ @ 34 NONAME ; unsigned int NmContactHistoryModelItem::contactId(void) const
-	?query@NmContactHistoryModel@@QAEXABVQString@@@Z @ 35 NONAME ; void NmContactHistoryModel::query(class QString const &)
-	?moveEntry@EmailMRU@@AAEXHH@Z @ 36 NONAME ; void EmailMRU::moveEntry(int, int)
-	?trUtf8@NmContactHistoryModel@@SA?AVQString@@PBD0H@Z @ 37 NONAME ; class QString NmContactHistoryModel::trUtf8(char const *, char const *, int)
-	?metaObject@NmContactHistoryModel@@UBEPBUQMetaObject@@XZ @ 38 NONAME ; struct QMetaObject const * NmContactHistoryModel::metaObject(void) const
-	??1NmContactHistoryModelItem@@QAE@XZ @ 39 NONAME ; NmContactHistoryModelItem::~NmContactHistoryModelItem(void)
-	??_ENmContactHistoryModel@@UAE@I@Z @ 40 NONAME ; NmContactHistoryModel::~NmContactHistoryModel(unsigned int)
-	?reset@EmailMRU@@QAEXXZ @ 41 NONAME ; void EmailMRU::reset(void)
-	?appendSubItem@NmContactHistoryModelItem@@QAEXVNmContactHistoryModelSubItem@@@Z @ 42 NONAME ; void NmContactHistoryModelItem::appendSubItem(class NmContactHistoryModelSubItem)
-	?getEntry@EmailMRU@@QAE_NHAAVQString@@0@Z @ 43 NONAME ; bool EmailMRU::getEntry(int, class QString &, class QString &)
-	?updateEntry@EmailMRU@@AAE_NHVQString@@@Z @ 44 NONAME ; bool EmailMRU::updateEntry(int, class QString)
-	?readCenRep@EmailMRU@@AAE?AVQString@@H@Z @ 45 NONAME ; class QString EmailMRU::readCenRep(int)
-	?searchForAddress@EmailMRU@@AAEHVQString@@@Z @ 46 NONAME ; int EmailMRU::searchForAddress(class QString)
-	?subEntries@NmContactHistoryModelItem@@QBE?AV?$QList@VNmContactHistoryModelSubItem@@@@XZ @ 47 NONAME ; class QList<class NmContactHistoryModelSubItem> NmContactHistoryModelItem::subEntries(void) const
-	??1NmContactHistoryModel@@UAE@XZ @ 48 NONAME ; NmContactHistoryModel::~NmContactHistoryModel(void)
-	?getNextEntryIndex@EmailMRU@@AAEIXZ @ 49 NONAME ; unsigned int EmailMRU::getNextEntryIndex(void)
-	?trUtf8@NmContactHistoryModel@@SA?AVQString@@PBD0@Z @ 50 NONAME ; class QString NmContactHistoryModel::trUtf8(char const *, char const *)
-	??0NmContactHistoryModelItem@@QAE@ABV0@@Z @ 51 NONAME ; NmContactHistoryModelItem::NmContactHistoryModelItem(class NmContactHistoryModelItem const &)
-	?entryCount@EmailMRU@@QBEIXZ @ 52 NONAME ; unsigned int EmailMRU::entryCount(void) const
-	?nameKeyByEntryIndex@EmailMRU@@CAHH@Z @ 53 NONAME ; int EmailMRU::nameKeyByEntryIndex(int)
-	?setContactId@NmContactHistoryModelItem@@QAEXI@Z @ 54 NONAME ; void NmContactHistoryModelItem::setContactId(unsigned int)
-	??0NmContactHistoryModelItem@@QAE@XZ @ 55 NONAME ; NmContactHistoryModelItem::NmContactHistoryModelItem(void)
-	?rowCount@NmContactHistoryModel@@UBEHABVQModelIndex@@@Z @ 56 NONAME ; int NmContactHistoryModel::rowCount(class QModelIndex const &) const
-	?data@NmContactHistoryModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 57 NONAME ; class QVariant NmContactHistoryModel::data(class QModelIndex const &, int) const
-	?entryIndex@EmailMRU@@CAHH@Z @ 58 NONAME ; int EmailMRU::entryIndex(int)
-	?qt_metacast@NmContactHistoryModel@@UAEPAXPBD@Z @ 59 NONAME ; void * NmContactHistoryModel::qt_metacast(char const *)
-	?subItemCount@NmContactHistoryModelItem@@QBEHXZ @ 60 NONAME ; int NmContactHistoryModelItem::subItemCount(void) const
-	??0NmContactHistoryModel@@QAE@W4NmContactHistoryModelType@@@Z @ 61 NONAME ; NmContactHistoryModel::NmContactHistoryModel(enum NmContactHistoryModelType)
-	??1EmailMRU@@QAE@XZ @ 62 NONAME ; EmailMRU::~EmailMRU(void)
-	?modelCompleted@NmContactHistoryModel@@IAEXH@Z @ 63 NONAME ; void NmContactHistoryModel::modelCompleted(int)
-	?nameOrder@EmailMRU@@SAHXZ @ 64 NONAME ; int EmailMRU::nameOrder(void)
+	?entryIndex@EmailMRU@@CAHH@Z @ 1 NONAME ; int EmailMRU::entryIndex(int)
+	??0NmContactHistoryModel@@QAE@W4NmContactHistoryModelType@@@Z @ 2 NONAME ; NmContactHistoryModel::NmContactHistoryModel(enum NmContactHistoryModelType)
+	?tr@NmUiEventsNotifier@@SA?AVQString@@PBD0@Z @ 3 NONAME ; class QString NmUiEventsNotifier::tr(char const *, char const *)
+	??0NmUriParser@@QAE@XZ @ 4 NONAME ; NmUriParser::NmUriParser(void)
+	?writeCenRep@EmailMRU@@AAE_NHVQString@@@Z @ 5 NONAME ; bool EmailMRU::writeCenRep(int, class QString)
+	?contactId@NmContactHistoryModelItem@@QBEIXZ @ 6 NONAME ; unsigned int NmContactHistoryModelItem::contactId(void) const
+	?qt_metacall@NmUiEventsNotifier@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 7 NONAME ; int NmUiEventsNotifier::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?appendSubItem@NmContactHistoryModelItem@@QAEXVNmContactHistoryModelSubItem@@@Z @ 8 NONAME ; void NmContactHistoryModelItem::appendSubItem(class NmContactHistoryModelSubItem)
+	?staticMetaObject@NmContactHistoryModel@@2UQMetaObject@@B @ 9 NONAME ; struct QMetaObject const NmContactHistoryModel::staticMetaObject
+	?toAddresses@NmUriParser@@QBE?AVQStringList@@XZ @ 10 NONAME ; class QStringList NmUriParser::toAddresses(void) const
+	?bodyText@NmUriParser@@QBE?AVQString@@XZ @ 11 NONAME ; class QString NmUriParser::bodyText(void) const
+	?entryCount@EmailMRU@@QBEIXZ @ 12 NONAME ; unsigned int EmailMRU::entryCount(void) const
+	?qt_metacall@NmContactHistoryModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13 NONAME ; int NmContactHistoryModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??0NmContactHistoryModelItem@@QAE@XZ @ 14 NONAME ; NmContactHistoryModelItem::NmContactHistoryModelItem(void)
+	?keysEqual@NmUiEventsNotifier@@ABE_NABVXQSettingsKey@@ABVXQPublishAndSubscribeSettingsKey@@@Z @ 15 NONAME ; bool NmUiEventsNotifier::keysEqual(class XQSettingsKey const &, class XQPublishAndSubscribeSettingsKey const &) const
+	?getNextEntryIndex@EmailMRU@@AAEIXZ @ 16 NONAME ; unsigned int EmailMRU::getNextEntryIndex(void)
+	??_ENmContactHistoryModelItem@@UAE@I@Z @ 17 NONAME ; NmContactHistoryModelItem::~NmContactHistoryModelItem(unsigned int)
+	??1EmailMRU@@UAE@XZ @ 18 NONAME ; EmailMRU::~EmailMRU(void)
+	?writeEntry@EmailMRU@@AAE_NHVQString@@0@Z @ 19 NONAME ; bool EmailMRU::writeEntry(int, class QString, class QString)
+	?viewStateChanged@NmUiEventsNotifier@@IAEXW4NmUiEventType@1@W4NmUiViewId@@VNmId@@@Z @ 20 NONAME ; void NmUiEventsNotifier::viewStateChanged(enum NmUiEventsNotifier::NmUiEventType, enum NmUiViewId, class NmId)
+	?trUtf8@NmUiEventsNotifier@@SA?AVQString@@PBD0@Z @ 21 NONAME ; class QString NmUiEventsNotifier::trUtf8(char const *, char const *)
+	?reset@EmailMRU@@QAEXXZ @ 22 NONAME ; void EmailMRU::reset(void)
+	?qt_metacast@NmContactHistoryModel@@UAEPAXPBD@Z @ 23 NONAME ; void * NmContactHistoryModel::qt_metacast(char const *)
+	?parseKeyValue@NmUiEventsNotifier@@ABE_NABVQByteArray@@AAW4NmUiEventType@1@AAW4NmUiViewId@@AAVNmId@@@Z @ 24 NONAME ; bool NmUiEventsNotifier::parseKeyValue(class QByteArray const &, enum NmUiEventsNotifier::NmUiEventType &, enum NmUiViewId &, class NmId &) const
+	??_EEmailMRU@@UAE@I@Z @ 25 NONAME ; EmailMRU::~EmailMRU(unsigned int)
+	?addressKeyByEntryIndex@EmailMRU@@CAHH@Z @ 26 NONAME ; int EmailMRU::addressKeyByEntryIndex(int)
+	?metaObject@NmContactHistoryModel@@UBEPBUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const * NmContactHistoryModel::metaObject(void) const
+	??0NmUiEventsNotifier@@QAE@PAVQObject@@@Z @ 28 NONAME ; NmUiEventsNotifier::NmUiEventsNotifier(class QObject *)
+	?bccAddresses@NmUriParser@@QBE?AVQStringList@@XZ @ 29 NONAME ; class QStringList NmUriParser::bccAddresses(void) const
+	?trUtf8@NmUiEventsNotifier@@SA?AVQString@@PBD0H@Z @ 30 NONAME ; class QString NmUiEventsNotifier::trUtf8(char const *, char const *, int)
+	?nameOrder@EmailMRU@@SAHXZ @ 31 NONAME ; int EmailMRU::nameOrder(void)
+	??1NmContactHistoryModel@@UAE@XZ @ 32 NONAME ; NmContactHistoryModel::~NmContactHistoryModel(void)
+	?rowCount@NmContactHistoryModel@@UBEHABVQModelIndex@@@Z @ 33 NONAME ; int NmContactHistoryModel::rowCount(class QModelIndex const &) const
+	?mailboxIcon@EmailMailboxInfo@@QBE?AVQString@@ABV2@@Z @ 34 NONAME ; class QString EmailMailboxInfo::mailboxIcon(class QString const &) const
+	?data@NmContactHistoryModel@@UBE?AVQVariant@@ABVQModelIndex@@H@Z @ 35 NONAME ; class QVariant NmContactHistoryModel::data(class QModelIndex const &, int) const
+	?getStaticMetaObject@NmContactHistoryModel@@SAABUQMetaObject@@XZ @ 36 NONAME ; struct QMetaObject const & NmContactHistoryModel::getStaticMetaObject(void)
+	??1NmUiEventsNotifier@@UAE@XZ @ 37 NONAME ; NmUiEventsNotifier::~NmUiEventsNotifier(void)
+	?getEntry@EmailMRU@@QAE_NHAAVQString@@0@Z @ 38 NONAME ; bool EmailMRU::getEntry(int, class QString &, class QString &)
+	?getStaticMetaObject@NmUiEventsNotifier@@SAABUQMetaObject@@XZ @ 39 NONAME ; struct QMetaObject const & NmUiEventsNotifier::getStaticMetaObject(void)
+	?resetData@NmUriParser@@QAEXXZ @ 40 NONAME ; void NmUriParser::resetData(void)
+	?metaObject@NmUiEventsNotifier@@UBEPBUQMetaObject@@XZ @ 41 NONAME ; struct QMetaObject const * NmUiEventsNotifier::metaObject(void) const
+	?searchForAddress@EmailMRU@@AAEHVQString@@@Z @ 42 NONAME ; int EmailMRU::searchForAddress(class QString)
+	?subItemCount@NmContactHistoryModelItem@@QBEHXZ @ 43 NONAME ; int NmContactHistoryModelItem::subItemCount(void) const
+	?setContactId@NmContactHistoryModelItem@@QAEXI@Z @ 44 NONAME ; void NmContactHistoryModelItem::setContactId(unsigned int)
+	?tr@NmUiEventsNotifier@@SA?AVQString@@PBD0H@Z @ 45 NONAME ; class QString NmUiEventsNotifier::tr(char const *, char const *, int)
+	?mailboxName@EmailMailboxInfo@@QBE?AVQString@@ABV2@@Z @ 46 NONAME ; class QString EmailMailboxInfo::mailboxName(class QString const &) const
+	?addAddressesToList@NmUriParser@@AAEXAAVQString@@AAVQStringList@@@Z @ 47 NONAME ; void NmUriParser::addAddressesToList(class QString &, class QStringList &)
+	??_ENmContactHistoryModel@@UAE@I@Z @ 48 NONAME ; NmContactHistoryModel::~NmContactHistoryModel(unsigned int)
+	?tr@NmContactHistoryModel@@SA?AVQString@@PBD0@Z @ 49 NONAME ; class QString NmContactHistoryModel::tr(char const *, char const *)
+	??1NmUriParser@@QAE@XZ @ 50 NONAME ; NmUriParser::~NmUriParser(void)
+	?valueChanged@NmUiEventsNotifier@@AAEXABVXQSettingsKey@@ABVQVariant@@@Z @ 51 NONAME ; void NmUiEventsNotifier::valueChanged(class XQSettingsKey const &, class QVariant const &)
+	?handleQueryCompleted@NmContactHistoryModel@@AAEXH@Z @ 52 NONAME ; void NmContactHistoryModel::handleQueryCompleted(int)
+	?subItemAt@NmContactHistoryModelItem@@QBE?AVNmContactHistoryModelSubItem@@H@Z @ 53 NONAME ; class NmContactHistoryModelSubItem NmContactHistoryModelItem::subItemAt(int) const
+	?subject@NmUriParser@@QBE?AVQString@@XZ @ 54 NONAME ; class QString NmUriParser::subject(void) const
+	?trUtf8@NmContactHistoryModel@@SA?AVQString@@PBD0@Z @ 55 NONAME ; class QString NmContactHistoryModel::trUtf8(char const *, char const *)
+	??0NmContactHistoryModelItem@@QAE@ABV0@@Z @ 56 NONAME ; NmContactHistoryModelItem::NmContactHistoryModelItem(class NmContactHistoryModelItem const &)
+	?moveEntry@EmailMRU@@AAEXHH@Z @ 57 NONAME ; void EmailMRU::moveEntry(int, int)
+	?readCenRep@EmailMRU@@AAE?AVQString@@H@Z @ 58 NONAME ; class QString EmailMRU::readCenRep(int)
+	?staticMetaObject@NmUiEventsNotifier@@2UQMetaObject@@B @ 59 NONAME ; struct QMetaObject const NmUiEventsNotifier::staticMetaObject
+	?trUtf8@NmContactHistoryModel@@SA?AVQString@@PBD0H@Z @ 60 NONAME ; class QString NmContactHistoryModel::trUtf8(char const *, char const *, int)
+	??1NmContactHistoryModelItem@@UAE@XZ @ 61 NONAME ; NmContactHistoryModelItem::~NmContactHistoryModelItem(void)
+	??0EmailMailboxInfo@@QAE@XZ @ 62 NONAME ; EmailMailboxInfo::EmailMailboxInfo(void)
+	??0EmailMRU@@QAE@XZ @ 63 NONAME ; EmailMRU::EmailMRU(void)
+	?query@NmContactHistoryModel@@QAEXABVQString@@@Z @ 64 NONAME ; void NmContactHistoryModel::query(class QString const &)
+	?nameKeyByEntryIndex@EmailMRU@@CAHH@Z @ 65 NONAME ; int EmailMRU::nameKeyByEntryIndex(int)
+	?updateEntry@EmailMRU@@AAE_NHVQString@@@Z @ 66 NONAME ; bool EmailMRU::updateEntry(int, class QString)
+	?qt_metacast@NmUiEventsNotifier@@UAEPAXPBD@Z @ 67 NONAME ; void * NmUiEventsNotifier::qt_metacast(char const *)
+	?modelCompleted@NmContactHistoryModel@@IAEXH@Z @ 68 NONAME ; void NmContactHistoryModel::modelCompleted(int)
+	?updateMRU@EmailMRU@@QAE_NVQString@@0@Z @ 69 NONAME ; bool EmailMRU::updateMRU(class QString, class QString)
+	?notifyViewStateChanged@NmUiEventsNotifier@@SA_NW4NmUiEventType@1@W4NmUiViewId@@ABVNmId@@@Z @ 70 NONAME ; bool NmUiEventsNotifier::notifyViewStateChanged(enum NmUiEventsNotifier::NmUiEventType, enum NmUiViewId, class NmId const &)
+	?tr@NmContactHistoryModel@@SA?AVQString@@PBD0H@Z @ 71 NONAME ; class QString NmContactHistoryModel::tr(char const *, char const *, int)
+	?extractData@NmUriParser@@QAE_NABVQString@@@Z @ 72 NONAME ; bool NmUriParser::extractData(class QString const &)
+	??_ENmUiEventsNotifier@@UAE@I@Z @ 73 NONAME ; NmUiEventsNotifier::~NmUiEventsNotifier(unsigned int)
+	?ccAddresses@NmUriParser@@QBE?AVQStringList@@XZ @ 74 NONAME ; class QStringList NmUriParser::ccAddresses(void) const
+	?subEntries@NmContactHistoryModelItem@@QBE?AV?$QList@VNmContactHistoryModelSubItem@@@@XZ @ 75 NONAME ; class QList<class NmContactHistoryModelSubItem> NmContactHistoryModelItem::subEntries(void) const
+	??1EmailMailboxInfo@@QAE@XZ @ 76 NONAME ; EmailMailboxInfo::~EmailMailboxInfo(void)
 
Binary file emailservices/nmutilities/conf/2001E277.txt has changed
Binary file emailservices/nmutilities/conf/2003EA97.txt has changed
Binary file emailservices/nmutilities/conf/nmutilities.confml has changed
Binary file emailservices/nmutilities/conf/nmutilities_200255BA.crml has changed
Binary file emailservices/nmutilities/data/2001E277.txt has changed
Binary file emailservices/nmutilities/data/2003EA97.txt has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/data/aol.svg	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="44" height="44" viewBox="0 0 44 44">
+<rect fill="none" height="44" width="44"/>
+<circle cx="16.782" cy="22.024" fill="#0360A8" r="9.291"/>
+<path d="M4.518,17.73c0.18,0.019,0.272-0.093,0.379-0.323c0.119-0.258,0.648-1.375,0.735-1.551 c0.231-0.471,1.167-1.821,1.349-2.031c0.863-1.013,1.889-1.956,3.134-2.73c1.509-0.926,3.344-1.63,5.262-1.864 c0.462-0.061,1.577-0.099,1.793-0.087c0.427,0.012,1.587,0.132,1.617,0.131c0.085,0.004,0.271-0.014,0.313-0.167 c0.016-0.052-0.005-0.125-0.032-0.156c-0.004-0.004-0.012-0.015-0.014-0.02c-0.019-0.028-0.09-0.087-0.104-0.098 c-0.138-0.105-1.564-0.922-1.657-0.977c-1.035-0.593-9.261-5.346-9.288-5.362C7.279,2.08,6.6,1.943,6.048,2.021 c-0.405,0.057-0.777,0.255-1.045,0.55C4.74,2.853,4.545,3.249,4.441,3.717C4.385,3.978,4.356,4.3,4.356,4.615 c0,0.485-0.01,12.065-0.006,12.406C4.353,17.416,4.326,17.697,4.518,17.73z" fill="#0360A8"/>
+<path d="M19.096,34.852c-0.078-0.121-0.215-0.131-0.438-0.109c-0.053,0-0.107,0.014-0.155,0.018 c-1.094,0.143-2.195,0.131-3.269-0.012c-1.696-0.223-3.345-0.786-4.828-1.652c-1.494-0.877-2.82-2.066-3.885-3.531 c-0.253-0.356-0.496-0.729-0.715-1.111C5.504,27.93,4.97,26.734,4.94,26.669c-0.065-0.136-0.055-0.131-0.143-0.278 c-0.042-0.06-0.091-0.101-0.154-0.117c-0.062-0.017-0.1-0.012-0.135-0.004c-0.079,0.026-0.097,0.045-0.124,0.135 c-0.005,0.029-0.009,0.113-0.017,0.193c-0.002,0.029-0.004,0.135-0.007,0.262c-0.005,0.205-0.003,0.16-0.003,0.355 c0,0.165,0,0.328,0,0.495c0,0.181,0,0.358,0,0.537c0,0.106,0,0.219,0,0.333c0,0.466,0,0.938,0.005,1.411c0,0.725,0,1.446,0,2.174 c0,1.194,0,2.388,0.003,3.58c0,1.196,0,2.392,0,3.584c0,0.034,0,0.065,0,0.103c0,1.418,0.623,2.315,1.571,2.524 c0.376,0.08,0.797,0.06,1.25-0.088c0.256-0.078,0.525-0.199,0.798-0.354c0.427-0.244,10.373-5.979,10.896-6.285 c0.016-0.004,0.068-0.045,0.122-0.097C19.067,35.061,19.154,34.964,19.096,34.852z" fill="#0360A8"/>
+<path d="M26.605,30.391c-0.17-0.162-0.008-0.394,0.256-0.738c0.143-0.188,0.679-0.938,0.773-1.09 c0.336-0.537,0.648-1.09,0.912-1.662c0.123-0.264,0.232-0.531,0.326-0.807c0.456-1.345,0.786-2.753,0.786-4.181 c-0.015-1.726-0.251-3.33-0.929-5.03c-0.158-0.406-0.66-1.395-0.722-1.507c-0.223-0.418-0.538-0.869-0.884-1.364 c-0.282-0.362-0.24-0.553-0.137-0.604c0.021-0.012,0.078-0.031,0.152-0.009c0.03,0.009,0.09,0.021,0.192,0.077 c0.071,0.033,0.205,0.105,0.325,0.174c0.135,0.081,1.1,0.656,1.195,0.708c1.027,0.604,2.023,1.21,3.054,1.812 c1.036,0.596,6.225,3.678,6.251,3.693c0.722,0.426,1.178,0.953,1.373,1.472c0.143,0.379,0.154,0.779,0.031,1.16 c-0.111,0.366-0.349,0.724-0.701,1.044c-0.199,0.184-0.44,0.35-0.715,0.506c-0.422,0.242-10.662,6.021-10.969,6.189 C26.891,30.393,26.738,30.503,26.605,30.391z" fill="#0360A8"/>
+<path d="M15.184,40.294c0,0.92,0.72,1.646,1.634,1.646c0.895,0,1.644-0.752,1.644-1.646 c0-0.938-0.706-1.647-1.644-1.647C15.918,38.646,15.184,39.387,15.184,40.294z M15.435,40.275c0-0.77,0.624-1.393,1.383-1.393 c0.759,0,1.382,0.637,1.382,1.424c0,0.771-0.623,1.396-1.382,1.396C16.069,41.704,15.435,41.051,15.435,40.275z" fill="#0360A8"/>
+<path d="M17.127,40.645l-0.215-0.31l0.05-0.008c0.289-0.031,0.464-0.224,0.464-0.515 c0-0.293-0.201-0.441-0.592-0.441c0,0-0.479,0-0.532,0v1.816h0.301c0-0.059-0.004-0.84-0.004-0.84l0.026,0.006l0.529,0.834 c0,0,0.25,0.006,0.327,0.004C17.432,41.111,17.127,40.645,17.127,40.645z M16.592,40.145v-0.518c0.044,0,0.209,0.005,0.209,0.005 c0.241,0,0.286,0.077,0.286,0.222c0,0.071-0.027,0.295-0.366,0.295C16.721,40.148,16.624,40.145,16.592,40.145z" fill="#0360A8"/>
+</svg>
\ No newline at end of file
--- a/emailservices/nmutilities/data/email_brand.qrc	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-<RCC>
-    <qresource prefix="/" >
-        <file alias="gmail" >icons/gmail.svg</file>
-        <file alias="microsoft" >icons/microsoft.svg</file>
-        <file alias="ovi" >icons/ovi.svg</file>
-        <file alias="yahoo" >icons/yahoo.svg</file>
-    </qresource>
-</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/data/gmail.svg	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="44px" version="1.1" viewBox="0 0 44 44" width="44px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<g>
+<g>
+<path d="M39.93,26.113L33.107,9.192c-0.342-0.854-1.299-1.439-2.246-1.273L5.592,12.24    c-1.207,0.207-1.889,1.304-1.604,2.353l5.404,19.943c0.373,1.384,1.789,1.756,2.672,1.496l26.732-7.411    C39.99,28.281,40.297,27.022,39.93,26.113z" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M5.064,13.609c-0.157,0.214-0.202,0.477-0.133,0.729l5.403,19.941    c0.157,0.58,0.789,1.004,1.468,0.813l26.727-7.414c0.512-0.144,0.693-0.704,0.494-1.2l-0.734-1.828    C38.285,24.651,5.219,13.401,5.064,13.609z" fill-opacity="0.5" stroke-opacity="0.5"/>
+<path d="M31.027,7.904L5.756,12.228c-0.627,0.104-0.961,0.632-0.824,1.134l5.403,19.941    c0.203,0.747,0.974,0.955,1.468,0.813l26.727-7.413c0.471-0.132,0.713-0.663,0.494-1.201L32.199,8.575    C32.027,8.152,31.525,7.82,31.027,7.904z" fill="#9E3434"/>
+<polygon fill="#C41200" points="31.191,8.462 5.434,12.943 11.063,33.507 38.674,25.947 31.633,8.386   "/>
+<linearGradient gradientTransform="matrix(0.9758 -0.2187 -0.2187 -0.9758 -392.924 -999.3136)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="182.1484" x2="182.1484" y1="-1076.46" y2="-1095.4785">
+<stop offset="0" style="stop-color:#DCDCDC"/>
+<stop offset="0.0225" style="stop-color:#DCDCDC"/>
+<stop offset="0.1404" style="stop-color:#FFFFFF"/>
+<stop offset="0.8146" style="stop-color:#FFFFFF"/>
+<stop offset="0.9663" style="stop-color:#E9E9E9"/>
+<stop offset="1" style="stop-color:#E9E9E9"/>
+</linearGradient>
+<polygon fill="url(#SVGID_1_)" points="6.135,13.334 31.363,8.89 38.016,25.575 11.503,32.753   "/>
+<linearGradient gradientTransform="matrix(0.9758 -0.2187 -0.2187 -0.9758 -392.924 -999.3136)" gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="182.1543" x2="182.1543" y1="-1084.5869" y2="-1097.6411">
+<stop offset="0" style="stop-color:#DF3900"/>
+<stop offset="1" style="stop-color:#B30C00"/>
+</linearGradient>
+<polygon fill="url(#SVGID_2_)" points="25.547,9.734 21.746,16.667 12.137,12.086 5.932,13.175 11.374,32.908 15.432,31.808     10.737,15.837 23.396,22.109 29.457,12 35.027,26.491 38.205,25.628 31.443,8.7   "/>
+<polygon fill="#C41230" fill-opacity="0.4" points="25.125,19.798 24.959,20.087 37.676,25.401   "/>
+<polygon fill="#C41230" fill-opacity="0.4" points="20.182,20.908 20.523,21.092 11.696,32.399   "/>
+</g>
+<rect fill="none" height="44" width="44"/>
+</g>
+</svg>
--- a/emailservices/nmutilities/data/icons/aol.svg	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="44" height="44" viewBox="0 0 44 44">
-<rect fill="none" height="44" width="44"/>
-<circle cx="16.782" cy="22.024" fill="#0360A8" r="9.291"/>
-<path d="M4.518,17.73c0.18,0.019,0.272-0.093,0.379-0.323c0.119-0.258,0.648-1.375,0.735-1.551 c0.231-0.471,1.167-1.821,1.349-2.031c0.863-1.013,1.889-1.956,3.134-2.73c1.509-0.926,3.344-1.63,5.262-1.864 c0.462-0.061,1.577-0.099,1.793-0.087c0.427,0.012,1.587,0.132,1.617,0.131c0.085,0.004,0.271-0.014,0.313-0.167 c0.016-0.052-0.005-0.125-0.032-0.156c-0.004-0.004-0.012-0.015-0.014-0.02c-0.019-0.028-0.09-0.087-0.104-0.098 c-0.138-0.105-1.564-0.922-1.657-0.977c-1.035-0.593-9.261-5.346-9.288-5.362C7.279,2.08,6.6,1.943,6.048,2.021 c-0.405,0.057-0.777,0.255-1.045,0.55C4.74,2.853,4.545,3.249,4.441,3.717C4.385,3.978,4.356,4.3,4.356,4.615 c0,0.485-0.01,12.065-0.006,12.406C4.353,17.416,4.326,17.697,4.518,17.73z" fill="#0360A8"/>
-<path d="M19.096,34.852c-0.078-0.121-0.215-0.131-0.438-0.109c-0.053,0-0.107,0.014-0.155,0.018 c-1.094,0.143-2.195,0.131-3.269-0.012c-1.696-0.223-3.345-0.786-4.828-1.652c-1.494-0.877-2.82-2.066-3.885-3.531 c-0.253-0.356-0.496-0.729-0.715-1.111C5.504,27.93,4.97,26.734,4.94,26.669c-0.065-0.136-0.055-0.131-0.143-0.278 c-0.042-0.06-0.091-0.101-0.154-0.117c-0.062-0.017-0.1-0.012-0.135-0.004c-0.079,0.026-0.097,0.045-0.124,0.135 c-0.005,0.029-0.009,0.113-0.017,0.193c-0.002,0.029-0.004,0.135-0.007,0.262c-0.005,0.205-0.003,0.16-0.003,0.355 c0,0.165,0,0.328,0,0.495c0,0.181,0,0.358,0,0.537c0,0.106,0,0.219,0,0.333c0,0.466,0,0.938,0.005,1.411c0,0.725,0,1.446,0,2.174 c0,1.194,0,2.388,0.003,3.58c0,1.196,0,2.392,0,3.584c0,0.034,0,0.065,0,0.103c0,1.418,0.623,2.315,1.571,2.524 c0.376,0.08,0.797,0.06,1.25-0.088c0.256-0.078,0.525-0.199,0.798-0.354c0.427-0.244,10.373-5.979,10.896-6.285 c0.016-0.004,0.068-0.045,0.122-0.097C19.067,35.061,19.154,34.964,19.096,34.852z" fill="#0360A8"/>
-<path d="M26.605,30.391c-0.17-0.162-0.008-0.394,0.256-0.738c0.143-0.188,0.679-0.938,0.773-1.09 c0.336-0.537,0.648-1.09,0.912-1.662c0.123-0.264,0.232-0.531,0.326-0.807c0.456-1.345,0.786-2.753,0.786-4.181 c-0.015-1.726-0.251-3.33-0.929-5.03c-0.158-0.406-0.66-1.395-0.722-1.507c-0.223-0.418-0.538-0.869-0.884-1.364 c-0.282-0.362-0.24-0.553-0.137-0.604c0.021-0.012,0.078-0.031,0.152-0.009c0.03,0.009,0.09,0.021,0.192,0.077 c0.071,0.033,0.205,0.105,0.325,0.174c0.135,0.081,1.1,0.656,1.195,0.708c1.027,0.604,2.023,1.21,3.054,1.812 c1.036,0.596,6.225,3.678,6.251,3.693c0.722,0.426,1.178,0.953,1.373,1.472c0.143,0.379,0.154,0.779,0.031,1.16 c-0.111,0.366-0.349,0.724-0.701,1.044c-0.199,0.184-0.44,0.35-0.715,0.506c-0.422,0.242-10.662,6.021-10.969,6.189 C26.891,30.393,26.738,30.503,26.605,30.391z" fill="#0360A8"/>
-<path d="M15.184,40.294c0,0.92,0.72,1.646,1.634,1.646c0.895,0,1.644-0.752,1.644-1.646 c0-0.938-0.706-1.647-1.644-1.647C15.918,38.646,15.184,39.387,15.184,40.294z M15.435,40.275c0-0.77,0.624-1.393,1.383-1.393 c0.759,0,1.382,0.637,1.382,1.424c0,0.771-0.623,1.396-1.382,1.396C16.069,41.704,15.435,41.051,15.435,40.275z" fill="#0360A8"/>
-<path d="M17.127,40.645l-0.215-0.31l0.05-0.008c0.289-0.031,0.464-0.224,0.464-0.515 c0-0.293-0.201-0.441-0.592-0.441c0,0-0.479,0-0.532,0v1.816h0.301c0-0.059-0.004-0.84-0.004-0.84l0.026,0.006l0.529,0.834 c0,0,0.25,0.006,0.327,0.004C17.432,41.111,17.127,40.645,17.127,40.645z M16.592,40.145v-0.518c0.044,0,0.209,0.005,0.209,0.005 c0.241,0,0.286,0.077,0.286,0.222c0,0.071-0.027,0.295-0.366,0.295C16.721,40.148,16.624,40.145,16.592,40.145z" fill="#0360A8"/>
-</svg>
\ No newline at end of file
--- a/emailservices/nmutilities/data/icons/gmail.svg	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="44px" version="1.1" viewBox="0 0 44 44" width="44px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
-<g>
-<g>
-<path d="M39.93,26.113L33.107,9.192c-0.342-0.854-1.299-1.439-2.246-1.273L5.592,12.24    c-1.207,0.207-1.889,1.304-1.604,2.353l5.404,19.943c0.373,1.384,1.789,1.756,2.672,1.496l26.732-7.411    C39.99,28.281,40.297,27.022,39.93,26.113z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M5.064,13.609c-0.157,0.214-0.202,0.477-0.133,0.729l5.403,19.941    c0.157,0.58,0.789,1.004,1.468,0.813l26.727-7.414c0.512-0.144,0.693-0.704,0.494-1.2l-0.734-1.828    C38.285,24.651,5.219,13.401,5.064,13.609z" fill-opacity="0.5" stroke-opacity="0.5"/>
-<path d="M31.027,7.904L5.756,12.228c-0.627,0.104-0.961,0.632-0.824,1.134l5.403,19.941    c0.203,0.747,0.974,0.955,1.468,0.813l26.727-7.413c0.471-0.132,0.713-0.663,0.494-1.201L32.199,8.575    C32.027,8.152,31.525,7.82,31.027,7.904z" fill="#9E3434"/>
-<polygon fill="#C41200" points="31.191,8.462 5.434,12.943 11.063,33.507 38.674,25.947 31.633,8.386   "/>
-<linearGradient gradientTransform="matrix(0.9758 -0.2187 -0.2187 -0.9758 -392.924 -999.3136)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="182.1484" x2="182.1484" y1="-1076.46" y2="-1095.4785">
-<stop offset="0" style="stop-color:#DCDCDC"/>
-<stop offset="0.0225" style="stop-color:#DCDCDC"/>
-<stop offset="0.1404" style="stop-color:#FFFFFF"/>
-<stop offset="0.8146" style="stop-color:#FFFFFF"/>
-<stop offset="0.9663" style="stop-color:#E9E9E9"/>
-<stop offset="1" style="stop-color:#E9E9E9"/>
-</linearGradient>
-<polygon fill="url(#SVGID_1_)" points="6.135,13.334 31.363,8.89 38.016,25.575 11.503,32.753   "/>
-<linearGradient gradientTransform="matrix(0.9758 -0.2187 -0.2187 -0.9758 -392.924 -999.3136)" gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="182.1543" x2="182.1543" y1="-1084.5869" y2="-1097.6411">
-<stop offset="0" style="stop-color:#DF3900"/>
-<stop offset="1" style="stop-color:#B30C00"/>
-</linearGradient>
-<polygon fill="url(#SVGID_2_)" points="25.547,9.734 21.746,16.667 12.137,12.086 5.932,13.175 11.374,32.908 15.432,31.808     10.737,15.837 23.396,22.109 29.457,12 35.027,26.491 38.205,25.628 31.443,8.7   "/>
-<polygon fill="#C41230" fill-opacity="0.4" points="25.125,19.798 24.959,20.087 37.676,25.401   "/>
-<polygon fill="#C41230" fill-opacity="0.4" points="20.182,20.908 20.523,21.092 11.696,32.399   "/>
-</g>
-<rect fill="none" height="44" width="44"/>
-</g>
-</svg>
--- a/emailservices/nmutilities/data/icons/microsoft.svg	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="44px" version="1.1" viewBox="0 0 44 44" width="44px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
-<g>
-<path d="M37.778,10.364c-4.158,1.571-7.277,2.283-11.252-0.597   c-0.313-0.222-0.77-0.281-1.186-0.092c0.031-0.379-0.156-0.803-0.51-1.053c-1.781-1.102-5.235-4.021-13.006-0.786   c-0.274,0.114-0.54,0.411-0.621,0.696L8.063,19.427c-0.047,0.229-0.039,0.582,0.263,0.96c0.03,0.037,0.073,0.086,0.127,0.141   c-0.099,0.039-0.198,0.079-0.296,0.121c-0.137,0.059-0.483,0.246-0.631,0.709L4.427,32.214c-0.062,0.307-0.002,0.743,0.41,1.111   l0.207,0.162c0.325,0.258,0.786,0.284,1.078,0.174c4.319-1.614,6.833-1.822,10.51,0.549c0.298,0.188,0.665,0.249,1.093,0.058   c-0.002,0.463,0.269,0.851,0.555,1.007c4.27,2.857,8.704,3.091,13.845,0.901c0.355-0.179,0.578-0.429,0.666-0.735l3.029-10.604   c0.133-0.729-0.289-1.026-0.465-1.183c0.584-0.235,0.895-0.384,1.043-0.881l3.143-10.785C39.862,10.954,38.63,10.058,37.778,10.364   z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M20.73,22.326c0.004-0.031-0.01-0.106-0.047-0.134   c-2.603-1.686-5.517-3.396-12.201-0.63L5.385,32.406l0,0c-0.001,0.009-0.011,0.09,0.051,0.145c-0.002,0-0.002,0-0.002,0   l0.004,0.003l0.209,0.162c0,0,0-0.001,0,0c0.069,0.044,0.092,0.026,0.135,0.031c5.3-1.982,7.922-1.588,11.382,0.64l-0.002,0.001   c0,0,0.021,0.011,0.047,0.018l0,0c0.09,0.024,0.331-0.151,0.345-0.214c0,0,0.002,0,0.002,0.002l0.002-0.002v0.002L20.73,22.326z    M34.812,24.471l-0.254-0.2c-0.021-0.024-14.95,6.821-14.952,6.846L18.715,34.2v0.001c-0.057,0.17,0.109,0.263,0.109,0.263v-0.001   c2.744,1.841,6.72,3.457,12.913,0.813c0,0,0.004-0.002,0.01-0.002c0.018-0.011,0.074-0.044,0.102-0.101L34.86,24.66   c0-0.002,0-0.002-0.002-0.004C34.878,24.561,34.856,24.521,34.812,24.471z M9.365,19.978L9.365,19.978c0.002,0,0,0.007,0.006,0.006   c0.025-0.004,0.09-0.032,0.09-0.032c7.083-2.807,9.955-0.169,11.38,0.596c0.001,0,0.001,0.002,0.002,0.002   c0.003,0.001,0.003,0.002,0.005,0.002l0,0l0,0c0.07,0.043,0.365-0.054,0.396-0.172l0.001,0.002l0.001-0.007   c0.001-0.001,0.001-0.001,0.001-0.001l0,0l3.121-10.776l0,0V9.595c0.006-0.023-0.029-0.124-0.045-0.131l0,0l0,0   c-2.114-1.278-5.175-3.579-12.132-0.728c-0.045,0.019-3.176,10.882-3.176,10.882l0,0C8.997,19.729,9.262,19.975,9.365,19.978z    M38.604,11.697c0,0.001,0,0.002,0,0.002c0.041-0.121-0.264-0.518-0.48-0.42c-3.604,1.362-15.287,8.693-15.328,8.777l-0.431,1.49   c-0.057,0.169,0.096,0.252,0.096,0.252h0.002c2.858,1.915,6.606,3.415,12.884,0.804c0,0,0.002,0,0.006-0.002   c0.02-0.009,0.076-0.042,0.105-0.101L38.604,11.697L38.604,11.697L38.604,11.697z" fill-opacity="0.5" stroke-opacity="0.5"/>
-<radialGradient cx="22.0581" cy="22.0171" gradientUnits="userSpaceOnUse" id="SVGID_1_" r="20.4721">
-<stop offset="0" style="stop-color:#D1E7EE"/>
-<stop offset="0.0051" style="stop-color:#D1E7EE"/>
-<stop offset="0.7411" style="stop-color:#3474AA"/>
-<stop offset="1" style="stop-color:#244B93"/>
-</radialGradient>
-<path d="M20.684,21.216c-2.604-1.686-5.47-3.405-12.154-0.642c0,0-0.051,0.03-0.064,0.074l-3.081,10.78l0,0   l0,0l0,0c-0.001,0.009-0.011,0.09,0.05,0.144l0,0l0.002,0.003l0.209,0.163c0,0,0.002-0.002,0.002,0   c0.068,0.044,0.09,0.026,0.135,0.031c5.299-1.983,7.921-1.587,11.381,0.639L17.16,32.41c0,0,0.02,0.011,0.047,0.018l0,0   c0.09,0.024,0.331-0.151,0.345-0.215l0,0c0,0.001,0.001,0.001,0.003,0.002v-0.002c0,0.001,0,0.001,0,0.002l3.174-10.865   C20.734,21.316,20.721,21.242,20.684,21.216z" fill="url(#SVGID_1_)"/>
-<radialGradient cx="22.0356" cy="21.9517" gradientTransform="matrix(1 0 0 -1 -0.0225 43.8779)" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="17.3888">
-<stop offset="0" style="stop-color:#FFE23D"/>
-<stop offset="0.2386" style="stop-color:#FFE23D"/>
-<stop offset="0.3435" style="stop-color:#FDDB3A"/>
-<stop offset="0.494" style="stop-color:#F7C832"/>
-<stop offset="0.671" style="stop-color:#EEA925"/>
-<stop offset="0.8325" style="stop-color:#E48717"/>
-<stop offset="1" style="stop-color:#E48717"/>
-</radialGradient>
-<path d="M34.812,23.492l-0.254-0.201c-0.021-0.022-0.07-0.049-0.17-0.032l0,0l0,0   c-6.318,2.14-9.357,0.88-12.103-0.971c-0.246-0.119-0.484,0.23-0.487,0.257l0.003-0.002l-0.002,0.002h0.002l-0.003,0.004   l-3.082,10.674v0.001c-0.057,0.17,0.109,0.261,0.109,0.261l0,0c2.743,1.841,6.721,3.458,12.914,0.814l0,0   c0,0,0.004-0.003,0.008-0.003c0.018-0.013,0.074-0.044,0.104-0.103l3.012-10.51c0-0.002-0.002-0.002-0.002-0.004   C34.878,23.584,34.856,23.545,34.812,23.492z" fill="url(#SVGID_2_)"/>
-<radialGradient cx="21.9673" cy="22.0635" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="17.6608">
-<stop offset="0" style="stop-color:#FFE23D"/>
-<stop offset="0.0152" style="stop-color:#FFE23D"/>
-<stop offset="0.6701" style="stop-color:#E48717"/>
-<stop offset="0.821" style="stop-color:#E7521F"/>
-<stop offset="0.9373" style="stop-color:#E92F25"/>
-<stop offset="1" style="stop-color:#EA2227"/>
-</radialGradient>
-<path d="M21.25,19.395l3.12-10.775l0,0l0,0l0,0V8.617c0.008-0.023-0.029-0.124-0.043-0.132l0,0l0,0l0,0   c-2.13-1.286-5.074-3.659-12.126-0.722c-0.006,0.006-0.053,0.048-0.059,0.064L9.018,18.641l0,0   c-0.021,0.109,0.246,0.354,0.35,0.357l0,0c0.001,0,0,0.008,0.004,0.007c0.027-0.004,0.091-0.032,0.091-0.032   c7.083-2.807,9.955-0.17,11.38,0.596c0.001,0,0.001,0.002,0.002,0.002c0.002,0.001,0.004,0.002,0.006,0.002l0,0v0.001   c0.069,0.041,0.364-0.055,0.396-0.173l0,0l0.001,0.002l0.001-0.007C21.25,19.396,21.25,19.396,21.25,19.395   C21.25,19.396,21.25,19.396,21.25,19.395z" fill="url(#SVGID_3_)"/>
-<radialGradient cx="22.0356" cy="21.9521" gradientTransform="matrix(1 0 0 -1 -0.0225 43.8779)" gradientUnits="userSpaceOnUse" id="SVGID_4_" r="19.9665">
-<stop offset="0" style="stop-color:#D1E787"/>
-<stop offset="0.0152" style="stop-color:#D1E787"/>
-<stop offset="0.1256" style="stop-color:#C4DD7F"/>
-<stop offset="0.33" style="stop-color:#A2C268"/>
-<stop offset="0.5635" style="stop-color:#739D4A"/>
-<stop offset="1" style="stop-color:#29621A"/>
-</radialGradient>
-<path d="M38.604,10.724c0.041-0.122-0.264-0.52-0.48-0.42c-3.604,1.36-7.473,2.683-12.17-0.719   c-0.063-0.028-0.143-0.036-0.23,0.016V9.6c0.004-0.006-0.211,0.142-0.252,0.228l-3.106,10.744   c-0.057,0.169,0.097,0.252,0.097,0.252h0.002c2.859,1.916,6.605,3.414,12.883,0.805l0,0c0,0,0.004,0,0.008-0.003   c0.02-0.01,0.074-0.042,0.104-0.101L38.604,10.724L38.604,10.724v-0.003C38.604,10.723,38.604,10.724,38.604,10.724z" fill="url(#SVGID_4_)"/>
-<rect fill="none" height="44" width="43.999"/>
-</g>
-</svg>
--- a/emailservices/nmutilities/data/icons/ovi.svg	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="44px" version="1.1" viewBox="0 0 44 44" width="44px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
-<path d="M40,8.998H4C3.448,8.998,3,9.446,3,10V36C3,36.554,3.448,37.001,4,37.001H40C40.553,37.001,41,36.554,41,36  V10C41,9.446,40.553,8.998,40,8.998z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<rect fill-opacity="0.5" height="26" stroke-opacity="0.5" width="36" x="4" y="10"/>
-<rect fill="none" height="44" width="44"/>
-<rect fill="#44A51C" height="26" width="36" x="4" y="9"/>
-<path d="M26.924,28.059c-0.383,1.178-0.953,1.984-2.575,1.984c-1.617,0-2.223-0.809-2.585-1.984l-3.309-11.441h3.852  l2.351,9.901l2.494-9.901h3.257L26.924,28.059z" fill="#FFFFFF"/>
-<path d="M35.577,28.346c0,1.625-1.213,1.696-1.845,1.696c-0.604,0-1.829-0.097-1.829-1.696v-9.61  c0,0-0.094,0-0.212,0c-0.498,0-1.075-0.092-1.075-1.057c0-1.065,0.678-1.062,1.075-1.062c0.122,0,3.886,0,3.886,0V28.346z" fill="#FFFFFF"/>
-<path d="M33.771,15.23c-1.18,0-2.027-0.599-2.027-1.707c0-1.11,0.832-1.708,2.027-1.708  c1.133,0,2.032,0.623,2.032,1.708C35.803,14.632,34.949,15.23,33.771,15.23z" fill="#FFFFFF"/>
-<path d="M13.239,16.432c-3.99,0-6.094,2.722-6.094,6.598c0,3.923,1.545,7.013,6.046,7.013  c4.15,0,6.063-2.792,6.063-6.921C19.256,19.177,17.367,16.432,13.239,16.432z M13.193,27.918c-2.125,0-2.217-3-2.217-4.96  c0-1.913,0.163-4.406,2.217-4.406c1.959,0,2.238,2.63,2.238,4.406C15.432,25.244,15.313,27.918,13.193,27.918z" fill="#FFFFFF"/>
-</svg>
--- a/emailservices/nmutilities/data/icons/yahoo.svg	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg baseProfile="tiny" height="44px" version="1.1" viewBox="0 0 44 44" width="44px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
-<g>
-<path d="M42.004,12.443c0.128-0.507-0.186-1.124-0.825-1.206l-7.533-0.952   c-0.493-0.054-1.104,0.284-1.099,0.973l0.016,10.396c-0.201-6.839-6.434-11.582-15.292-11.582c-9.01,0-15.303,4.903-15.303,11.926   c0,7.023,6.293,11.932,15.303,11.932c8.877,0,15.114-4.767,15.294-11.626l0.006,3.711c0,0.149,0.034,0.296,0.096,0.422   c-0.254,0.104-0.563,0.354-0.616,0.794l-0.567,4.635c-0.064,0.536,0.316,1.021,0.852,1.088l5.004,0.612   c0.51,0.058,1.018-0.284,1.089-0.852l0.569-4.631c0.068-0.558-0.328-0.95-0.703-1.06c0.057-0.088,0.102-0.186,0.127-0.292   L42.004,12.443z" fill-opacity="0.2" stroke-opacity="0.2"/>
-<path d="M2.943,21.997c0,6.449,5.893,10.954,14.327,10.954   c8.433,0,14.321-4.509,14.321-10.954C31.592,15.55,2.943,15.55,2.943,21.997z M32.453,31.981l5.004,0.612l0.568-4.63l-5.006-0.617   L32.453,31.981z M37.473,26.494l3.583-14.287l-7.534-0.951l0.025,14.756L37.473,26.494z" fill-opacity="0.5" stroke-opacity="0.5"/>
-<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="164.792" x2="164.792" y1="-1036.0117" y2="-1057.9141">
-<stop offset="0" style="stop-color:#8418A8"/>
-<stop offset="1" style="stop-color:#4A005C"/>
-</linearGradient>
-<path d="M17.271,31.975c-8.435,0-14.327-4.505-14.327-10.954c0-6.447,5.893-10.948,14.327-10.948   c8.433,0,14.321,4.501,14.321,10.948C31.592,27.466,25.703,31.975,17.271,31.975L17.271,31.975z" fill="url(#SVGID_1_)"/>
-<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="182.7646" x2="182.7646" y1="-1052.3096" y2="-1057.5557">
-<stop offset="0" style="stop-color:#8418A8"/>
-<stop offset="1" style="stop-color:#4A005C"/>
-</linearGradient>
-<polygon fill="url(#SVGID_2_)" points="37.457,31.616 32.453,31.005 33.02,26.37 38.027,26.986 37.92,27.844  "/>
-<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="184.8135" x2="184.8135" y1="-1036.2168" y2="-1051.457">
-<stop offset="0" style="stop-color:#8418A8"/>
-<stop offset="1" style="stop-color:#4A005C"/>
-</linearGradient>
-<polygon fill="url(#SVGID_3_)" points="37.473,25.518 33.548,25.033 33.522,10.277 41.056,11.229  "/>
-<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="164.793" x2="164.793" y1="-1036.873" y2="-1057.0449">
-<stop offset="0" style="stop-color:#B340D9"/>
-<stop offset="1" style="stop-color:#58006D"/>
-</linearGradient>
-<path d="M17.271,31.105c-7.928,0-13.462-4.148-13.462-10.088c0-5.937,5.533-10.084,13.462-10.084   c7.923,0,13.459,4.147,13.459,10.084C30.728,26.962,25.193,31.105,17.271,31.105z" fill="url(#SVGID_4_)"/>
-<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="182.7637" x2="182.7637" y1="-1053.2764" y2="-1056.5957">
-<stop offset="0" style="stop-color:#B340D9"/>
-<stop offset="1" style="stop-color:#7B0099"/>
-</linearGradient>
-<polygon fill="url(#SVGID_5_)" points="36.703,30.656 33.416,30.251 33.772,27.337 37.063,27.736  "/>
-<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_6_" x1="184.708" x2="184.708" y1="-1037.2012" y2="-1050.5059">
-<stop offset="0" style="stop-color:#B340D9"/>
-<stop offset="1" style="stop-color:#7B0099"/>
-</linearGradient>
-<polygon fill="url(#SVGID_6_)" points="34.387,11.262 34.41,24.27 36.818,24.566 39.98,11.966  "/>
-<linearGradient gradientTransform="matrix(1 0 0 -1 -0.0225 43.8779)" gradientUnits="userSpaceOnUse" id="SVGID_7_" x1="17.2905" x2="17.2905" y1="33.8818" y2="19.3638">
-<stop offset="0" style="stop-color:#FFFFFF"/>
-<stop offset="1" style="stop-color:#8A26A3"/>
-</linearGradient>
-<path d="M17.271,26.594c-6.336,0-10.76-3.183-10.76-7.735s4.425-7.733,10.76-7.733   c6.334,0,10.755,3.182,10.755,7.733C28.025,23.413,23.604,26.594,17.271,26.594L17.271,26.594z" fill="url(#SVGID_7_)"/>
-<path d="M21.867,28.293L11.195,28.26l0.424-2.414c1.35-0.168,1.533,0.064,2.617-0.145   c0.051-0.657,0.024-2.126-0.016-2.642c-0.518-0.847-3.793-4.909-4.828-5.836c-0.264-0.048-3.079-0.481-3.079-0.481L6.25,14.824   l0.453-0.238C6.938,14.462,7.22,14.44,7.8,14.44c0.239,0,8.187,0.014,8.528,0.056l0.826,0.098l-0.283,2.046   c-0.963,0.209-0.963,0.209-2.106,0.287c0.627,0.855,2.461,3.224,2.687,3.521c0.182-0.15,1.595-1.3,2.067-1.725   c-0.942-0.132-0.39-0.156-1.575-0.128l-0.439-2.347l0.82-0.134c0.139-0.021,6.521-0.138,9.508,0.15l-1.59,2.304l-2.416,0.457   c-0.765,0.396-4.396,3.288-4.858,4.034c-0.155,0.802-0.093,1.777,0.007,2.604c0.23,0.002,3.027,0.173,3.027,0.173L21.867,28.293   L21.867,28.293z" fill="#6F0F8D"/>
-<path d="M25.781,17.799c-0.334,0.033-1.732,0.346-2.201,0.443c-0.502,0.137-5.092,3.683-5.395,4.552   c-0.232,1.071-0.117,2.411,0.073,3.652c0.303,0.064,2.487,0.008,2.887,0.074l-0.049,0.9c-0.392-0.026-8.142,0.065-8.933,0.044   l0.149-0.856c0.435-0.034,2.238,0.076,2.634-0.34c0.197-0.21,0.135-2.978,0.067-3.447c-0.168-0.502-4.209-5.549-5.248-6.352   c-0.3-0.103-2.19-0.291-2.66-0.391l-0.024-0.771c0.234-0.12,2.336,0.027,4.375-0.048c1.34-0.051,4.397,0,4.773,0.044l-0.095,0.68   c-0.401,0.103-2.339,0.136-2.843,0.271c1.307,1.941,3.373,4.444,4.043,5.415c0.371-0.535,3.607-2.766,3.707-3.533   c-0.502-0.103-2.166-0.34-2.435-0.34l-0.159-0.876c0.457-0.074,2.854,0,4.047,0c1.028,0,3.229,0,3.854,0.048L25.781,17.799z" fill="#FFFFFF"/>
-<linearGradient gradientTransform="matrix(1 0 0 -1 -0.0225 43.8779)" gradientUnits="userSpaceOnUse" id="SVGID_8_" x1="37.2061" x2="37.2061" y1="32.6162" y2="20.7104">
-<stop offset="0" style="stop-color:#FFFFFF"/>
-<stop offset="1" style="stop-color:#8A26A3"/>
-</linearGradient>
-<polygon fill="url(#SVGID_8_)" fill-opacity="0.5" points="39.98,11.966 34.387,11.262 34.408,23.168    37.535,21.71  " stroke-opacity="0.5"/>
-<linearGradient gradientTransform="matrix(1 0 0 -1 -0.0225 43.8779)" gradientUnits="userSpaceOnUse" id="SVGID_9_" x1="35.2959" x2="35.2959" y1="16.541" y2="14.1934">
-<stop offset="0" style="stop-color:#FFFFFF"/>
-<stop offset="1" style="stop-color:#8A26A3"/>
-</linearGradient>
-<polygon fill="url(#SVGID_9_)" fill-opacity="0.5" points="33.772,27.337 33.484,29.685 37.027,28.032    37.063,27.736  " stroke-opacity="0.5"/>
-<rect fill="none" height="44" width="44"/>
-</g>
-</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/data/microsoft.svg	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="44px" version="1.1" viewBox="0 0 44 44" width="44px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<g>
+<path d="M37.778,10.364c-4.158,1.571-7.277,2.283-11.252-0.597   c-0.313-0.222-0.77-0.281-1.186-0.092c0.031-0.379-0.156-0.803-0.51-1.053c-1.781-1.102-5.235-4.021-13.006-0.786   c-0.274,0.114-0.54,0.411-0.621,0.696L8.063,19.427c-0.047,0.229-0.039,0.582,0.263,0.96c0.03,0.037,0.073,0.086,0.127,0.141   c-0.099,0.039-0.198,0.079-0.296,0.121c-0.137,0.059-0.483,0.246-0.631,0.709L4.427,32.214c-0.062,0.307-0.002,0.743,0.41,1.111   l0.207,0.162c0.325,0.258,0.786,0.284,1.078,0.174c4.319-1.614,6.833-1.822,10.51,0.549c0.298,0.188,0.665,0.249,1.093,0.058   c-0.002,0.463,0.269,0.851,0.555,1.007c4.27,2.857,8.704,3.091,13.845,0.901c0.355-0.179,0.578-0.429,0.666-0.735l3.029-10.604   c0.133-0.729-0.289-1.026-0.465-1.183c0.584-0.235,0.895-0.384,1.043-0.881l3.143-10.785C39.862,10.954,38.63,10.058,37.778,10.364   z" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M20.73,22.326c0.004-0.031-0.01-0.106-0.047-0.134   c-2.603-1.686-5.517-3.396-12.201-0.63L5.385,32.406l0,0c-0.001,0.009-0.011,0.09,0.051,0.145c-0.002,0-0.002,0-0.002,0   l0.004,0.003l0.209,0.162c0,0,0-0.001,0,0c0.069,0.044,0.092,0.026,0.135,0.031c5.3-1.982,7.922-1.588,11.382,0.64l-0.002,0.001   c0,0,0.021,0.011,0.047,0.018l0,0c0.09,0.024,0.331-0.151,0.345-0.214c0,0,0.002,0,0.002,0.002l0.002-0.002v0.002L20.73,22.326z    M34.812,24.471l-0.254-0.2c-0.021-0.024-14.95,6.821-14.952,6.846L18.715,34.2v0.001c-0.057,0.17,0.109,0.263,0.109,0.263v-0.001   c2.744,1.841,6.72,3.457,12.913,0.813c0,0,0.004-0.002,0.01-0.002c0.018-0.011,0.074-0.044,0.102-0.101L34.86,24.66   c0-0.002,0-0.002-0.002-0.004C34.878,24.561,34.856,24.521,34.812,24.471z M9.365,19.978L9.365,19.978c0.002,0,0,0.007,0.006,0.006   c0.025-0.004,0.09-0.032,0.09-0.032c7.083-2.807,9.955-0.169,11.38,0.596c0.001,0,0.001,0.002,0.002,0.002   c0.003,0.001,0.003,0.002,0.005,0.002l0,0l0,0c0.07,0.043,0.365-0.054,0.396-0.172l0.001,0.002l0.001-0.007   c0.001-0.001,0.001-0.001,0.001-0.001l0,0l3.121-10.776l0,0V9.595c0.006-0.023-0.029-0.124-0.045-0.131l0,0l0,0   c-2.114-1.278-5.175-3.579-12.132-0.728c-0.045,0.019-3.176,10.882-3.176,10.882l0,0C8.997,19.729,9.262,19.975,9.365,19.978z    M38.604,11.697c0,0.001,0,0.002,0,0.002c0.041-0.121-0.264-0.518-0.48-0.42c-3.604,1.362-15.287,8.693-15.328,8.777l-0.431,1.49   c-0.057,0.169,0.096,0.252,0.096,0.252h0.002c2.858,1.915,6.606,3.415,12.884,0.804c0,0,0.002,0,0.006-0.002   c0.02-0.009,0.076-0.042,0.105-0.101L38.604,11.697L38.604,11.697L38.604,11.697z" fill-opacity="0.5" stroke-opacity="0.5"/>
+<radialGradient cx="22.0581" cy="22.0171" gradientUnits="userSpaceOnUse" id="SVGID_1_" r="20.4721">
+<stop offset="0" style="stop-color:#D1E7EE"/>
+<stop offset="0.0051" style="stop-color:#D1E7EE"/>
+<stop offset="0.7411" style="stop-color:#3474AA"/>
+<stop offset="1" style="stop-color:#244B93"/>
+</radialGradient>
+<path d="M20.684,21.216c-2.604-1.686-5.47-3.405-12.154-0.642c0,0-0.051,0.03-0.064,0.074l-3.081,10.78l0,0   l0,0l0,0c-0.001,0.009-0.011,0.09,0.05,0.144l0,0l0.002,0.003l0.209,0.163c0,0,0.002-0.002,0.002,0   c0.068,0.044,0.09,0.026,0.135,0.031c5.299-1.983,7.921-1.587,11.381,0.639L17.16,32.41c0,0,0.02,0.011,0.047,0.018l0,0   c0.09,0.024,0.331-0.151,0.345-0.215l0,0c0,0.001,0.001,0.001,0.003,0.002v-0.002c0,0.001,0,0.001,0,0.002l3.174-10.865   C20.734,21.316,20.721,21.242,20.684,21.216z" fill="url(#SVGID_1_)"/>
+<radialGradient cx="22.0356" cy="21.9517" gradientTransform="matrix(1 0 0 -1 -0.0225 43.8779)" gradientUnits="userSpaceOnUse" id="SVGID_2_" r="17.3888">
+<stop offset="0" style="stop-color:#FFE23D"/>
+<stop offset="0.2386" style="stop-color:#FFE23D"/>
+<stop offset="0.3435" style="stop-color:#FDDB3A"/>
+<stop offset="0.494" style="stop-color:#F7C832"/>
+<stop offset="0.671" style="stop-color:#EEA925"/>
+<stop offset="0.8325" style="stop-color:#E48717"/>
+<stop offset="1" style="stop-color:#E48717"/>
+</radialGradient>
+<path d="M34.812,23.492l-0.254-0.201c-0.021-0.022-0.07-0.049-0.17-0.032l0,0l0,0   c-6.318,2.14-9.357,0.88-12.103-0.971c-0.246-0.119-0.484,0.23-0.487,0.257l0.003-0.002l-0.002,0.002h0.002l-0.003,0.004   l-3.082,10.674v0.001c-0.057,0.17,0.109,0.261,0.109,0.261l0,0c2.743,1.841,6.721,3.458,12.914,0.814l0,0   c0,0,0.004-0.003,0.008-0.003c0.018-0.013,0.074-0.044,0.104-0.103l3.012-10.51c0-0.002-0.002-0.002-0.002-0.004   C34.878,23.584,34.856,23.545,34.812,23.492z" fill="url(#SVGID_2_)"/>
+<radialGradient cx="21.9673" cy="22.0635" gradientUnits="userSpaceOnUse" id="SVGID_3_" r="17.6608">
+<stop offset="0" style="stop-color:#FFE23D"/>
+<stop offset="0.0152" style="stop-color:#FFE23D"/>
+<stop offset="0.6701" style="stop-color:#E48717"/>
+<stop offset="0.821" style="stop-color:#E7521F"/>
+<stop offset="0.9373" style="stop-color:#E92F25"/>
+<stop offset="1" style="stop-color:#EA2227"/>
+</radialGradient>
+<path d="M21.25,19.395l3.12-10.775l0,0l0,0l0,0V8.617c0.008-0.023-0.029-0.124-0.043-0.132l0,0l0,0l0,0   c-2.13-1.286-5.074-3.659-12.126-0.722c-0.006,0.006-0.053,0.048-0.059,0.064L9.018,18.641l0,0   c-0.021,0.109,0.246,0.354,0.35,0.357l0,0c0.001,0,0,0.008,0.004,0.007c0.027-0.004,0.091-0.032,0.091-0.032   c7.083-2.807,9.955-0.17,11.38,0.596c0.001,0,0.001,0.002,0.002,0.002c0.002,0.001,0.004,0.002,0.006,0.002l0,0v0.001   c0.069,0.041,0.364-0.055,0.396-0.173l0,0l0.001,0.002l0.001-0.007C21.25,19.396,21.25,19.396,21.25,19.395   C21.25,19.396,21.25,19.396,21.25,19.395z" fill="url(#SVGID_3_)"/>
+<radialGradient cx="22.0356" cy="21.9521" gradientTransform="matrix(1 0 0 -1 -0.0225 43.8779)" gradientUnits="userSpaceOnUse" id="SVGID_4_" r="19.9665">
+<stop offset="0" style="stop-color:#D1E787"/>
+<stop offset="0.0152" style="stop-color:#D1E787"/>
+<stop offset="0.1256" style="stop-color:#C4DD7F"/>
+<stop offset="0.33" style="stop-color:#A2C268"/>
+<stop offset="0.5635" style="stop-color:#739D4A"/>
+<stop offset="1" style="stop-color:#29621A"/>
+</radialGradient>
+<path d="M38.604,10.724c0.041-0.122-0.264-0.52-0.48-0.42c-3.604,1.36-7.473,2.683-12.17-0.719   c-0.063-0.028-0.143-0.036-0.23,0.016V9.6c0.004-0.006-0.211,0.142-0.252,0.228l-3.106,10.744   c-0.057,0.169,0.097,0.252,0.097,0.252h0.002c2.859,1.916,6.605,3.414,12.883,0.805l0,0c0,0,0.004,0,0.008-0.003   c0.02-0.01,0.074-0.042,0.104-0.101L38.604,10.724L38.604,10.724v-0.003C38.604,10.723,38.604,10.724,38.604,10.724z" fill="url(#SVGID_4_)"/>
+<rect fill="none" height="44" width="43.999"/>
+</g>
+</svg>
Binary file emailservices/nmutilities/data/nmutilities.confml has changed
Binary file emailservices/nmutilities/data/nmutilities_200255BA.crml has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/data/ovi.svg	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="44px" version="1.1" viewBox="0 0 44 44" width="44px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<path d="M40,8.998H4C3.448,8.998,3,9.446,3,10V36C3,36.554,3.448,37.001,4,37.001H40C40.553,37.001,41,36.554,41,36  V10C41,9.446,40.553,8.998,40,8.998z" fill-opacity="0.2" stroke-opacity="0.2"/>
+<rect fill-opacity="0.5" height="26" stroke-opacity="0.5" width="36" x="4" y="10"/>
+<rect fill="none" height="44" width="44"/>
+<rect fill="#44A51C" height="26" width="36" x="4" y="9"/>
+<path d="M26.924,28.059c-0.383,1.178-0.953,1.984-2.575,1.984c-1.617,0-2.223-0.809-2.585-1.984l-3.309-11.441h3.852  l2.351,9.901l2.494-9.901h3.257L26.924,28.059z" fill="#FFFFFF"/>
+<path d="M35.577,28.346c0,1.625-1.213,1.696-1.845,1.696c-0.604,0-1.829-0.097-1.829-1.696v-9.61  c0,0-0.094,0-0.212,0c-0.498,0-1.075-0.092-1.075-1.057c0-1.065,0.678-1.062,1.075-1.062c0.122,0,3.886,0,3.886,0V28.346z" fill="#FFFFFF"/>
+<path d="M33.771,15.23c-1.18,0-2.027-0.599-2.027-1.707c0-1.11,0.832-1.708,2.027-1.708  c1.133,0,2.032,0.623,2.032,1.708C35.803,14.632,34.949,15.23,33.771,15.23z" fill="#FFFFFF"/>
+<path d="M13.239,16.432c-3.99,0-6.094,2.722-6.094,6.598c0,3.923,1.545,7.013,6.046,7.013  c4.15,0,6.063-2.792,6.063-6.921C19.256,19.177,17.367,16.432,13.239,16.432z M13.193,27.918c-2.125,0-2.217-3-2.217-4.96  c0-1.913,0.163-4.406,2.217-4.406c1.959,0,2.238,2.63,2.238,4.406C15.432,25.244,15.313,27.918,13.193,27.918z" fill="#FFFFFF"/>
+</svg>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/data/yahoo.svg	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg baseProfile="tiny" height="44px" version="1.1" viewBox="0 0 44 44" width="44px" x="0px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px">
+<g>
+<path d="M42.004,12.443c0.128-0.507-0.186-1.124-0.825-1.206l-7.533-0.952   c-0.493-0.054-1.104,0.284-1.099,0.973l0.016,10.396c-0.201-6.839-6.434-11.582-15.292-11.582c-9.01,0-15.303,4.903-15.303,11.926   c0,7.023,6.293,11.932,15.303,11.932c8.877,0,15.114-4.767,15.294-11.626l0.006,3.711c0,0.149,0.034,0.296,0.096,0.422   c-0.254,0.104-0.563,0.354-0.616,0.794l-0.567,4.635c-0.064,0.536,0.316,1.021,0.852,1.088l5.004,0.612   c0.51,0.058,1.018-0.284,1.089-0.852l0.569-4.631c0.068-0.558-0.328-0.95-0.703-1.06c0.057-0.088,0.102-0.186,0.127-0.292   L42.004,12.443z" fill-opacity="0.2" stroke-opacity="0.2"/>
+<path d="M2.943,21.997c0,6.449,5.893,10.954,14.327,10.954   c8.433,0,14.321-4.509,14.321-10.954C31.592,15.55,2.943,15.55,2.943,21.997z M32.453,31.981l5.004,0.612l0.568-4.63l-5.006-0.617   L32.453,31.981z M37.473,26.494l3.583-14.287l-7.534-0.951l0.025,14.756L37.473,26.494z" fill-opacity="0.5" stroke-opacity="0.5"/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="164.792" x2="164.792" y1="-1036.0117" y2="-1057.9141">
+<stop offset="0" style="stop-color:#8418A8"/>
+<stop offset="1" style="stop-color:#4A005C"/>
+</linearGradient>
+<path d="M17.271,31.975c-8.435,0-14.327-4.505-14.327-10.954c0-6.447,5.893-10.948,14.327-10.948   c8.433,0,14.321,4.501,14.321,10.948C31.592,27.466,25.703,31.975,17.271,31.975L17.271,31.975z" fill="url(#SVGID_1_)"/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="182.7646" x2="182.7646" y1="-1052.3096" y2="-1057.5557">
+<stop offset="0" style="stop-color:#8418A8"/>
+<stop offset="1" style="stop-color:#4A005C"/>
+</linearGradient>
+<polygon fill="url(#SVGID_2_)" points="37.457,31.616 32.453,31.005 33.02,26.37 38.027,26.986 37.92,27.844  "/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="184.8135" x2="184.8135" y1="-1036.2168" y2="-1051.457">
+<stop offset="0" style="stop-color:#8418A8"/>
+<stop offset="1" style="stop-color:#4A005C"/>
+</linearGradient>
+<polygon fill="url(#SVGID_3_)" points="37.473,25.518 33.548,25.033 33.522,10.277 41.056,11.229  "/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="164.793" x2="164.793" y1="-1036.873" y2="-1057.0449">
+<stop offset="0" style="stop-color:#B340D9"/>
+<stop offset="1" style="stop-color:#58006D"/>
+</linearGradient>
+<path d="M17.271,31.105c-7.928,0-13.462-4.148-13.462-10.088c0-5.937,5.533-10.084,13.462-10.084   c7.923,0,13.459,4.147,13.459,10.084C30.728,26.962,25.193,31.105,17.271,31.105z" fill="url(#SVGID_4_)"/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="182.7637" x2="182.7637" y1="-1053.2764" y2="-1056.5957">
+<stop offset="0" style="stop-color:#B340D9"/>
+<stop offset="1" style="stop-color:#7B0099"/>
+</linearGradient>
+<polygon fill="url(#SVGID_5_)" points="36.703,30.656 33.416,30.251 33.772,27.337 37.063,27.736  "/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 -147.5254 -1025.9395)" gradientUnits="userSpaceOnUse" id="SVGID_6_" x1="184.708" x2="184.708" y1="-1037.2012" y2="-1050.5059">
+<stop offset="0" style="stop-color:#B340D9"/>
+<stop offset="1" style="stop-color:#7B0099"/>
+</linearGradient>
+<polygon fill="url(#SVGID_6_)" points="34.387,11.262 34.41,24.27 36.818,24.566 39.98,11.966  "/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 -0.0225 43.8779)" gradientUnits="userSpaceOnUse" id="SVGID_7_" x1="17.2905" x2="17.2905" y1="33.8818" y2="19.3638">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#8A26A3"/>
+</linearGradient>
+<path d="M17.271,26.594c-6.336,0-10.76-3.183-10.76-7.735s4.425-7.733,10.76-7.733   c6.334,0,10.755,3.182,10.755,7.733C28.025,23.413,23.604,26.594,17.271,26.594L17.271,26.594z" fill="url(#SVGID_7_)"/>
+<path d="M21.867,28.293L11.195,28.26l0.424-2.414c1.35-0.168,1.533,0.064,2.617-0.145   c0.051-0.657,0.024-2.126-0.016-2.642c-0.518-0.847-3.793-4.909-4.828-5.836c-0.264-0.048-3.079-0.481-3.079-0.481L6.25,14.824   l0.453-0.238C6.938,14.462,7.22,14.44,7.8,14.44c0.239,0,8.187,0.014,8.528,0.056l0.826,0.098l-0.283,2.046   c-0.963,0.209-0.963,0.209-2.106,0.287c0.627,0.855,2.461,3.224,2.687,3.521c0.182-0.15,1.595-1.3,2.067-1.725   c-0.942-0.132-0.39-0.156-1.575-0.128l-0.439-2.347l0.82-0.134c0.139-0.021,6.521-0.138,9.508,0.15l-1.59,2.304l-2.416,0.457   c-0.765,0.396-4.396,3.288-4.858,4.034c-0.155,0.802-0.093,1.777,0.007,2.604c0.23,0.002,3.027,0.173,3.027,0.173L21.867,28.293   L21.867,28.293z" fill="#6F0F8D"/>
+<path d="M25.781,17.799c-0.334,0.033-1.732,0.346-2.201,0.443c-0.502,0.137-5.092,3.683-5.395,4.552   c-0.232,1.071-0.117,2.411,0.073,3.652c0.303,0.064,2.487,0.008,2.887,0.074l-0.049,0.9c-0.392-0.026-8.142,0.065-8.933,0.044   l0.149-0.856c0.435-0.034,2.238,0.076,2.634-0.34c0.197-0.21,0.135-2.978,0.067-3.447c-0.168-0.502-4.209-5.549-5.248-6.352   c-0.3-0.103-2.19-0.291-2.66-0.391l-0.024-0.771c0.234-0.12,2.336,0.027,4.375-0.048c1.34-0.051,4.397,0,4.773,0.044l-0.095,0.68   c-0.401,0.103-2.339,0.136-2.843,0.271c1.307,1.941,3.373,4.444,4.043,5.415c0.371-0.535,3.607-2.766,3.707-3.533   c-0.502-0.103-2.166-0.34-2.435-0.34l-0.159-0.876c0.457-0.074,2.854,0,4.047,0c1.028,0,3.229,0,3.854,0.048L25.781,17.799z" fill="#FFFFFF"/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 -0.0225 43.8779)" gradientUnits="userSpaceOnUse" id="SVGID_8_" x1="37.2061" x2="37.2061" y1="32.6162" y2="20.7104">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#8A26A3"/>
+</linearGradient>
+<polygon fill="url(#SVGID_8_)" fill-opacity="0.5" points="39.98,11.966 34.387,11.262 34.408,23.168    37.535,21.71  " stroke-opacity="0.5"/>
+<linearGradient gradientTransform="matrix(1 0 0 -1 -0.0225 43.8779)" gradientUnits="userSpaceOnUse" id="SVGID_9_" x1="35.2959" x2="35.2959" y1="16.541" y2="14.1934">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#8A26A3"/>
+</linearGradient>
+<polygon fill="url(#SVGID_9_)" fill-opacity="0.5" points="33.772,27.337 33.484,29.685 37.027,28.032    37.063,27.736  " stroke-opacity="0.5"/>
+<rect fill="none" height="44" width="44"/>
+</g>
+</svg>
--- a/emailservices/nmutilities/eabi/nmutilitiesu.def	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/eabi/nmutilitiesu.def	Thu Sep 30 11:43:07 2010 +0300
@@ -1,27 +1,27 @@
 EXPORTS
-	_ZN16EmailMailboxInfoC1Ev @ 1 NONAME
-	_ZN16EmailMailboxInfoC2Ev @ 2 NONAME
-	_ZN16EmailMailboxInfoD1Ev @ 3 NONAME
-	_ZN16EmailMailboxInfoD2Ev @ 4 NONAME
-	_ZN18NmUiEventsNotifier11qt_metacallEN11QMetaObject4CallEiPPv @ 5 NONAME
-	_ZN18NmUiEventsNotifier11qt_metacastEPKc @ 6 NONAME
-	_ZN18NmUiEventsNotifier12valueChangedERK13XQSettingsKeyRK8QVariant @ 7 NONAME
-	_ZN18NmUiEventsNotifier16staticMetaObjectE @ 8 NONAME DATA 16
-	_ZN18NmUiEventsNotifier16viewStateChangedENS_13NmUiEventTypeE10NmUiViewId4NmId @ 9 NONAME
-	_ZN18NmUiEventsNotifier19getStaticMetaObjectEv @ 10 NONAME
-	_ZN18NmUiEventsNotifier22notifyViewStateChangedENS_13NmUiEventTypeE10NmUiViewIdRK4NmId @ 11 NONAME
-	_ZN18NmUiEventsNotifierC1EP7QObject @ 12 NONAME
-	_ZN18NmUiEventsNotifierC2EP7QObject @ 13 NONAME
-	_ZN18NmUiEventsNotifierD0Ev @ 14 NONAME
-	_ZN18NmUiEventsNotifierD1Ev @ 15 NONAME
-	_ZN18NmUiEventsNotifierD2Ev @ 16 NONAME
-	_ZNK16EmailMailboxInfo11mailboxIconERK8QVariant @ 17 NONAME
-	_ZNK16EmailMailboxInfo11mailboxNameERK8QVariant @ 18 NONAME
-	_ZNK18NmUiEventsNotifier10metaObjectEv @ 19 NONAME
-	_ZNK18NmUiEventsNotifier13parseKeyValueERK10QByteArrayRNS_13NmUiEventTypeER10NmUiViewIdR4NmId @ 20 NONAME
-	_ZNK18NmUiEventsNotifier9keysEqualERK13XQSettingsKeyRK32XQPublishAndSubscribeSettingsKey @ 21 NONAME
-	_ZTI18NmUiEventsNotifier @ 22 NONAME
-	_ZTV18NmUiEventsNotifier @ 23 NONAME
+	_ZN11NmUriParser11extractDataERK7QString @ 1 NONAME
+	_ZN11NmUriParser18addAddressesToListER7QStringR11QStringList @ 2 NONAME
+	_ZN11NmUriParser9resetDataEv @ 3 NONAME
+	_ZN11NmUriParserC1Ev @ 4 NONAME
+	_ZN11NmUriParserC2Ev @ 5 NONAME
+	_ZN11NmUriParserD1Ev @ 6 NONAME
+	_ZN11NmUriParserD2Ev @ 7 NONAME
+	_ZN16EmailMailboxInfoC1Ev @ 8 NONAME
+	_ZN16EmailMailboxInfoC2Ev @ 9 NONAME
+	_ZN16EmailMailboxInfoD1Ev @ 10 NONAME
+	_ZN16EmailMailboxInfoD2Ev @ 11 NONAME
+	_ZN18NmUiEventsNotifier11qt_metacallEN11QMetaObject4CallEiPPv @ 12 NONAME
+	_ZN18NmUiEventsNotifier11qt_metacastEPKc @ 13 NONAME
+	_ZN18NmUiEventsNotifier12valueChangedERK13XQSettingsKeyRK8QVariant @ 14 NONAME
+	_ZN18NmUiEventsNotifier16staticMetaObjectE @ 15 NONAME DATA 16
+	_ZN18NmUiEventsNotifier16viewStateChangedENS_13NmUiEventTypeE10NmUiViewId4NmId @ 16 NONAME
+	_ZN18NmUiEventsNotifier19getStaticMetaObjectEv @ 17 NONAME
+	_ZN18NmUiEventsNotifier22notifyViewStateChangedENS_13NmUiEventTypeE10NmUiViewIdRK4NmId @ 18 NONAME
+	_ZN18NmUiEventsNotifierC1EP7QObject @ 19 NONAME
+	_ZN18NmUiEventsNotifierC2EP7QObject @ 20 NONAME
+	_ZN18NmUiEventsNotifierD0Ev @ 21 NONAME
+	_ZN18NmUiEventsNotifierD1Ev @ 22 NONAME
+	_ZN18NmUiEventsNotifierD2Ev @ 23 NONAME
 	_ZN21NmContactHistoryModel11qt_metacallEN11QMetaObject4CallEiPPv @ 24 NONAME
 	_ZN21NmContactHistoryModel11qt_metacastEPKc @ 25 NONAME
 	_ZN21NmContactHistoryModel14modelCompletedEi @ 26 NONAME
@@ -40,34 +40,52 @@
 	_ZN25NmContactHistoryModelItemC1Ev @ 39 NONAME
 	_ZN25NmContactHistoryModelItemC2ERKS_ @ 40 NONAME
 	_ZN25NmContactHistoryModelItemC2Ev @ 41 NONAME
-	_ZN25NmContactHistoryModelItemD1Ev @ 42 NONAME
-	_ZN25NmContactHistoryModelItemD2Ev @ 43 NONAME
-	_ZN8EmailMRU10entryIndexEi @ 44 NONAME
-	_ZN8EmailMRU10readCenRepEi @ 45 NONAME
-	_ZN8EmailMRU10writeEntryEi7QStringS0_ @ 46 NONAME
-	_ZN8EmailMRU11updateEntryEi7QString @ 47 NONAME
-	_ZN8EmailMRU11writeCenRepEi7QString @ 48 NONAME
-	_ZN8EmailMRU16searchForAddressE7QString @ 49 NONAME
-	_ZN8EmailMRU17getNextEntryIndexEv @ 50 NONAME
-	_ZN8EmailMRU19nameKeyByEntryIndexEi @ 51 NONAME
-	_ZN8EmailMRU22addressKeyByEntryIndexEi @ 52 NONAME
-	_ZN8EmailMRU5resetEv @ 53 NONAME
-	_ZN8EmailMRU8getEntryEiR7QStringS1_ @ 54 NONAME
-	_ZN8EmailMRU9moveEntryEii @ 55 NONAME
-	_ZN8EmailMRU9nameOrderEv @ 56 NONAME
-	_ZN8EmailMRU9updateMRUE7QStringS0_ @ 57 NONAME
-	_ZN8EmailMRUC1Ev @ 58 NONAME
-	_ZN8EmailMRUC2Ev @ 59 NONAME
-	_ZN8EmailMRUD1Ev @ 60 NONAME
-	_ZN8EmailMRUD2Ev @ 61 NONAME
-	_ZNK21NmContactHistoryModel10metaObjectEv @ 62 NONAME
-	_ZNK21NmContactHistoryModel4dataERK11QModelIndexi @ 63 NONAME
-	_ZNK21NmContactHistoryModel8rowCountERK11QModelIndex @ 64 NONAME
-	_ZNK25NmContactHistoryModelItem10subEntriesEv @ 65 NONAME
-	_ZNK25NmContactHistoryModelItem12subItemCountEv @ 66 NONAME
-	_ZNK25NmContactHistoryModelItem9contactIdEv @ 67 NONAME
-	_ZNK25NmContactHistoryModelItem9subItemAtEi @ 68 NONAME
-	_ZNK8EmailMRU10entryCountEv @ 69 NONAME
-	_ZTI21NmContactHistoryModel @ 70 NONAME
-	_ZTV21NmContactHistoryModel @ 71 NONAME
+	_ZN25NmContactHistoryModelItemD0Ev @ 42 NONAME
+	_ZN25NmContactHistoryModelItemD1Ev @ 43 NONAME
+	_ZN25NmContactHistoryModelItemD2Ev @ 44 NONAME
+	_ZN8EmailMRU10entryIndexEi @ 45 NONAME
+	_ZN8EmailMRU10readCenRepEi @ 46 NONAME
+	_ZN8EmailMRU10writeEntryEi7QStringS0_ @ 47 NONAME
+	_ZN8EmailMRU11updateEntryEi7QString @ 48 NONAME
+	_ZN8EmailMRU11writeCenRepEi7QString @ 49 NONAME
+	_ZN8EmailMRU16searchForAddressE7QString @ 50 NONAME
+	_ZN8EmailMRU17getNextEntryIndexEv @ 51 NONAME
+	_ZN8EmailMRU19nameKeyByEntryIndexEi @ 52 NONAME
+	_ZN8EmailMRU22addressKeyByEntryIndexEi @ 53 NONAME
+	_ZN8EmailMRU5resetEv @ 54 NONAME
+	_ZN8EmailMRU8getEntryEiR7QStringS1_ @ 55 NONAME
+	_ZN8EmailMRU9moveEntryEii @ 56 NONAME
+	_ZN8EmailMRU9nameOrderEv @ 57 NONAME
+	_ZN8EmailMRU9updateMRUE7QStringS0_ @ 58 NONAME
+	_ZN8EmailMRUC1Ev @ 59 NONAME
+	_ZN8EmailMRUC2Ev @ 60 NONAME
+	_ZN8EmailMRUD0Ev @ 61 NONAME
+	_ZN8EmailMRUD1Ev @ 62 NONAME
+	_ZN8EmailMRUD2Ev @ 63 NONAME
+	_ZNK11NmUriParser11ccAddressesEv @ 64 NONAME
+	_ZNK11NmUriParser11toAddressesEv @ 65 NONAME
+	_ZNK11NmUriParser12bccAddressesEv @ 66 NONAME
+	_ZNK11NmUriParser7subjectEv @ 67 NONAME
+	_ZNK11NmUriParser8bodyTextEv @ 68 NONAME
+	_ZNK16EmailMailboxInfo11mailboxIconERK7QString @ 69 NONAME
+	_ZNK16EmailMailboxInfo11mailboxNameERK7QString @ 70 NONAME
+	_ZNK18NmUiEventsNotifier10metaObjectEv @ 71 NONAME
+	_ZNK18NmUiEventsNotifier13parseKeyValueERK10QByteArrayRNS_13NmUiEventTypeER10NmUiViewIdR4NmId @ 72 NONAME
+	_ZNK18NmUiEventsNotifier9keysEqualERK13XQSettingsKeyRK32XQPublishAndSubscribeSettingsKey @ 73 NONAME
+	_ZNK21NmContactHistoryModel10metaObjectEv @ 74 NONAME
+	_ZNK21NmContactHistoryModel4dataERK11QModelIndexi @ 75 NONAME
+	_ZNK21NmContactHistoryModel8rowCountERK11QModelIndex @ 76 NONAME
+	_ZNK25NmContactHistoryModelItem10subEntriesEv @ 77 NONAME
+	_ZNK25NmContactHistoryModelItem12subItemCountEv @ 78 NONAME
+	_ZNK25NmContactHistoryModelItem9contactIdEv @ 79 NONAME
+	_ZNK25NmContactHistoryModelItem9subItemAtEi @ 80 NONAME
+	_ZNK8EmailMRU10entryCountEv @ 81 NONAME
+	_ZTI18NmUiEventsNotifier @ 82 NONAME
+	_ZTI21NmContactHistoryModel @ 83 NONAME
+	_ZTI25NmContactHistoryModelItem @ 84 NONAME
+	_ZTI8EmailMRU @ 85 NONAME
+	_ZTV18NmUiEventsNotifier @ 86 NONAME
+	_ZTV21NmContactHistoryModel @ 87 NONAME
+	_ZTV25NmContactHistoryModelItem @ 88 NONAME
+	_ZTV8EmailMRU @ 89 NONAME
 
--- a/emailservices/nmutilities/inc/emailmailboxinfo.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/inc/emailmailboxinfo.h	Thu Sep 30 11:43:07 2010 +0300
@@ -41,17 +41,17 @@
 
     /*!
         Returns mailbox icon name 
-        \param identifier can be domain name or mailbox id (NmId from nmailbase)
+        \param identifier should be a domain name
         \return mailbox icon name that can be used to construct HbIcon
      */
-    QString mailboxIcon(const QVariant &identifier) const;
+    QString mailboxIcon(const QString &identifier) const;
 
     /*!
         Returns branded mailbox name
-        \param identifier can be domain name or mailbox id (NmId from nmailbase)
+        \param identifier should be a domain name
         \return mailbox name
      */
-    QString mailboxName(const QVariant &identifier) const;
+    QString mailboxName(const QString &identifier) const;
 
 private:
     EmailMailboxInfoPrivate *d;
--- a/emailservices/nmutilities/inc/emailmailboxinfo_p.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/inc/emailmailboxinfo_p.h	Thu Sep 30 11:43:07 2010 +0300
@@ -35,16 +35,16 @@
     EmailMailboxInfoPrivate();
     ~EmailMailboxInfoPrivate();
     
-    QString name(const QVariant &identifier);
-    QString icon(const QVariant &identifier);
+    QString name(const QString &identifier);
+    QString icon(const QString &identifier);
     
     void processCenRepRecords(const QString &brandingId);
-    quint8 getCurrentCountryL() const;
+    int getCurrentCountryL() const;
     bool verifyTimeZone() const;
     void verifyMailAccountName(QString &brandingName) const;
 
     static EmailMailboxInfoPrivate *mSelf;
-    static qint32 mReferenceCount;
+    static int mReferenceCount;
 
     XQSettingsManager *mSettingsManager;
     
@@ -54,11 +54,6 @@
     QString mWlbDomainName;
     
     /*!
-         temporary store for domain name to avoid additional cenrep scan
-     */
-    QString mTempDomain;
-    
-    /*!
          temporary store for icon and name branding variables to avoid additional cenrep scan
      */
     QString mTempIcon;
@@ -68,9 +63,8 @@
          Map of already imported branding keys
      */
     QMap<unsigned long int, QString> mBrandingDataMap;
-   
+
     friend class EmailMailboxInfo;
-    friend class TestEmailMailboxInfoPrivate;
 };
 
 #endif /* MAILBOXINFO_P_H_ */
--- a/emailservices/nmutilities/inc/emailmru.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/inc/emailmru.h	Thu Sep 30 11:43:07 2010 +0300
@@ -61,7 +61,7 @@
 
     EmailMRU();
 
-    ~EmailMRU();
+    virtual ~EmailMRU();
 
     bool updateMRU(QString displayName, QString emailAddress);
 
--- a/emailservices/nmutilities/inc/nmcenrepkeys.h	Wed Sep 15 17:47:19 2010 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,201 +0,0 @@
-/*
-* Copyright (c) 2007-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:  Key to Central Repository to be used by Branding utilities
-*
-*/
-
-#ifndef NMCENREPKEYS_H
-#define NMCENREPKEYS_H
-
-
-namespace NmBrandingApi
-{
-    /*!
-      
-       Here are uids in central repository to be in use by branding.
-       
-       <b>General settings for branding.</b>
-       
-       EMAIL_CENREP = 0x2001E277
-       Uid of central repository for branding api
-       
-       RCC_PATH = 0xfffffffe;
-       Path to resource file with icons.
-       Example value: epoc32/data/Z/Resource/apps/email_brand.rcc 
-       
-       <b>Settings value for all brand icons and mailbox names</b>
-       Values in repository for brands are constructed in that way:
-       BRAND;regexp;MAIL_NAME;FILE_ALIAS
-       Where
-       BRAND brand from domain, for example yahoo
-       regexp is regular expression to match brand domain
-       MAIL_NAME is name of mail, for example Yahoo! Mail
-       FILE_ALIAS is file alias from resource that representant selected file,
-                  for example yahoo
-       Example value:
-       gmail;.*gmail(\.com|\.com.pl|\.de)$;GMail;gmail
-       
-       <b>List of all brands in cenrep:</b>
-       GOOGLE_MAIL = 0x00000001
-       Value: googlemail;googlemail\.com$;Google Mail;gmail
-       
-       GMAIL_MAIL = 0x00000002
-       gmail;gmail\.com$;Gmail;gmail
-       
-       YAHOO_MAIL = 0x00000003
-       yahoo;.*yahoo\.(((com(\.ar|\.br|\.cn|\.hk|\.mx|\.sg|\.tw|\.my|\.vn|\.ph|\.tr|\.co|\.pe|\.ve)?)$)|
-                       (co(\.kr|\.uk|\.id|\.th|\.in)$)|
-                       ((de|dk|es|fr|gr|ie|it|no|se|ca|cn|in|pl|cl)$));Yahoo! Mail;yahoo"
-                       
-       YMAIL_MAIL = 0x00000004
-       ymail;.*ymail\\.com;Yahoo! Mail;yahoo
-       
-       GEOCITIES_MAIL = 0x00000005
-       geocities;.*geocities\\.com;Yahoo! Mail;yahoo
-       
-       ROCKETMAIL_MAIL = 0x00000006
-       rocketmail;.*rocketmail\\.com;Yahoo! Mail;yahoo
-       
-       WANS_MAIL = 0x00000007
-       wans;.*wans\\.net;Yahoo! Mail;yahoo
-       
-       AOLCHINA_MAIL = 0x00000008
-       aolchina;.*aolchina\\.com;AOL Mail;aol
-       
-       AOL_MAIL = 0x000000009
-       aol;.*aol\\.(((co\\.(uk|nz))$)|
-                   ((com(\\.au|\\.ar|\\.co|\\.ve|\\.mx|\\.tr|\\.br)?)$)|
-                   ((cz|ch|be|cl|kr|ru|de|nl|es|fr|dk|at|it|hk|se|tw|jp)$));AOL Mail;aol
-                   
-       AIM_MAIL = 0x0000000A
-       aim;.*aim\\.com$;AIM Mail;aol
-       
-       AOL_NO_MAIL = 0x0000000B
-       aol;.*aol\\.no$;AOL epost;aol
-       
-       AOL_PL_MAIL = 0x0000000C
-       aol;.*aol\\.pl$;AOL Poczta;aol
-       
-       AOL_FI_MAIL = 0x0000000D
-       aol;.*aol\\.fi$;AOL Sähköposti;aol
-       
-       Y7MAIL_MAIL = 0x0000000E
-       y7mail;.*y7mail\\.com$;Yahoo!7 Mail;yahoo
-       
-       YAHOO_AU_MAIL = 0x0000000F
-       yahoo;.*yahoo\\.com\\.au$;Yahoo!7 Mail;yahoo
-       
-       AMERITECH_MAIL = 0x00000010
-       ameritech;ameritech\\.net$;AT&T Yahoo! Mail;yahoo
-       
-       FLASH_MAIL = 0x00000011
-       flash;flash\\.net$;AT&T Yahoo! Mail;yahoo
-       
-       NVBELL_MAIL = 0x00000012
-       nvbell;nvbell\\.net$;AT&T Yahoo! Mail;yahoo
-       
-       PACBELL_MAIL = 0x00000013
-       pacbell;pacbell\\.net$;AT&T Yahoo! Mail;yahoo
-       
-       PRODIIGY_MAIL = 0x00000014
-       prodigy;prodigy\\.net$;AT&T Yahoo! Mail;yahoo
-       
-       SBCGLOBAL_MAIL = 0x00000015
-       sbcglobal;sbcglobal\\.net$;AT&T Yahoo! Mail;yahoo
-       
-       BELLSOUTH_MAIL = 0x00000016
-       bellsouth;bellsouth\\.net$;AT&T Yahoo! Mail;yahoo
-       
-       SNET_MAIL = 0x00000017
-       snet;snet\\.net$;AT&T Yahoo! Mail;yahoo
-       
-       SWBELL_MAIL = 0x00000018
-       swbell;swbell\\.net$;AT&T Yahoo! Mail;yahoo
-       
-       OVI_MAIL = 0x00000019
-       ovi;.*ovi\\.com;Ovi Mail;ovi
-       
-       TALK21_MAIL = 0x0000001a
-       talk21;talk21\\.com$;BT Yahoo! Mail;yahoo
-       
-       BTOPENWORLD_MAIL = 0x0000001b
-       btopenworld;btopenworld\\.com$;BT Yahoo! Mail;yahoo
-       
-       ROGERS_MAIL = 0x0000001c
-       rogers;((ort|nl|uat)\\.)?rogers\\.com$;Rogers Yahoo! Mail;yahoo
-       
-       VERIZON_MAIL = 0x0000001d
-       verizon;verizon\\.net$;Verizon Yahoo! Mail;yahoo
-       
-       YAHOO_CO_NZ_MAIL = 0x0000001e
-       yahoo;yahoo\\.co\\.nz$;Yahoo!Xtra Mail;yahoo
-       
-       MSN_MAIL = 0x0000001f
-       msn;.*msn\\.com$;Hotmail;microsoft
-                      
-       HOTMAIL_MAIL_LIVE = 0x00000020
-       live;.*live\\.((com(\\.(ar|au|mx|my|pe|pk|pt|sg|ve|ph))?)|
-                      (co\\.(kr|uk|za))|
-                      (at|be|ca|cl|cn|de|dk|fr|hk|it|jp|nl|no|ph|ru|se|ie|in))$;Hotmail;microsoft")
-       
-       MYAOL_MAIL = 0x00000021
-       myaol;.*myaol\\.jp$;AOL Mail;aol
-       
-       HOTMAIL_MAIL = 0x00000022
-       hotmail;.*hotmail((-int.com)|(\\.(com|co\\.uk|co\\.jp|de|fr|it|nl|es)))$;Hotmail;microsoft
-                      
-       LIVEMAIL_MAIL = 0x00000023
-       livemail;livemail\\.(com.br|tw)$;Hotmail;microsoft
-              
-       WINDOWSLIVE_ES_COM_MAIL = 0x00000024
-       windowslive;windowslive\\.(es|com)$;Hotmail;microsoft
-       
-       MIBLI_MAIL = 0x00000025
-       mibli;.*mibli\\.com$;Hotmail;microsoft
-       
-       OXICASH_MAIL = 0x00000026
-       oxicash;.*oxicash\\.in$;Hotmail;microsoft
-       
-       KIMO_MAIL = 0x00000027
-       kimo;.*kimo\\.com;Yahoo! Mail;yahoo
-
-       <b>White Label Branding</b>
-       WLB_BRAND_NAME = 0xfffffffb
-       Domain name needed for match by WLB.
-       Example:
-       sonera.com
-       
-       WLB_MAILBOX_NAME = 0xfffffffc
-       Keep mailbox name for WLB mail
-       Example:
-       Sonera Mail
-       
-       WLB_ICON_PATH = 0xfffffffd
-       Path to WLB icon.
-       Example:
-       z:/app/resource/sonera_brand.svg
-       */
-      static const qint32 EMAIL_CENREP = 0x2001E277;
-      
-      static const quint32 RCC_PATH = 0xfffffffe;
-
-      static const quint32 WLB_BRAND_NAME = 0xfffffffb;
-      
-      static const quint32 WLB_MAILBOX_NAME = 0xfffffffc;
-      
-      static const quint32 WLB_ICON_PATH = 0xfffffffd;
-
-}
-    
-#endif /*NMCENREPKEYS_H*/
--- a/emailservices/nmutilities/inc/nmcontacthistorymodel_p.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/inc/nmcontacthistorymodel_p.h	Thu Sep 30 11:43:07 2010 +0300
@@ -48,7 +48,7 @@
 class NmContactHistoryModelPrivate : public QObject
 {
 
-    enum nameOrder 
+    enum NameOrder
     {
         LastNameFirstName = 0x0,
         LastNameCommaFirstName = 0x1,
@@ -80,12 +80,13 @@
                                       const QString &query);
 
 
-    int rowCount(const QModelIndex &parent) const;
+    int modelRowCount(const QModelIndex &parent) const;
+    int privateDataCount() const;
     QVariant data(const QModelIndex &index, int role) const;
     void refreshDataModel();
 
     bool fillMruMatchList();
-    QString obeyContactOrder(const QString &firstName, const QString &lastName);
+    QString obeyContactOrder(const QString &firstName, const QString &lastName) const;
 
 private:
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/inc/nmuriparser.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,57 @@
+/*
+* 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: A utility class for parsing URI strings
+*
+*/
+#ifndef NMURIPARSER_H_
+#define NMURIPARSER_H_
+
+#include <QObject>
+#include <QStringList>
+
+#include "emailutilitiesdef.h"
+
+/*!
+    \class NmUriParser
+    \brief A helper class for parsing URI strings
+*/
+class EMAIL_UTILITIES_EXPORT NmUriParser
+{
+public:
+
+    NmUriParser();
+    ~NmUriParser();
+
+    bool extractData(const QString &data);
+    void resetData();
+    
+    QString subject() const;
+    QStringList toAddresses() const;
+    QStringList ccAddresses() const;
+    QStringList bccAddresses() const;
+    QString bodyText() const;
+    
+private:
+    
+    void addAddressesToList(QString &addresses, QStringList &list);
+
+private: // Data
+
+    QString mSubject;
+    QStringList mToAddresses;
+    QStringList mCcAddresses;
+    QStringList mBccAddresses;
+    QString mBodyText;
+};
+#endif /* NMURIPARSER_H_*/
--- a/emailservices/nmutilities/inc/nmutilitiescommonheaders.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/inc/nmutilitiescommonheaders.h	Thu Sep 30 11:43:07 2010 +0300
@@ -11,18 +11,28 @@
  *
  * Contributors:
  *
- * Description:  common header for emailmailboxinfo_p 
+ * Description:  common header for nmutilities 
  *
  */
 
-#ifndef NMBRANDINGAPICOMMONHEADERS_H_
-#define NMBRANDINGAPICOMMONHEADERS_H_
+#ifndef NMUTILITIESCOMMONHEADERS_H_
+#define NMUTILITIESCOMMONHEADERS_H_
 
 #include <QResource>
+#include <QRegExp>
+#include <QStringList>
+#include <QSystemInfo>
+
 #include <XQSettingsManager>
+#include <XQCentralRepositoryUtils>
+#include <XQCentralRepositorySearchCriteria>
+
 #include <tzlocalizer.h>
-#include <qsysteminfo.h>
-#include <xqcentralrepositoryutils.h>
-#include <xqcentralrepositorysearchcriteria.h>
+
+#include <emailtrace.h>
+#include <nmcommon.h>
 
-#endif /* NMBRANDINGAPICOMMONHEADERS_H_ */
+#include "emailmailboxinfo.h"
+#include "emailmailboxinfo_p.h"
+
+#endif /* NMUTILITIESCOMMONHEADERS_H_ */
--- a/emailservices/nmutilities/nmutilities.pro	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/nmutilities.pro	Thu Sep 30 11:43:07 2010 +0300
@@ -31,7 +31,7 @@
                ../../email_plat/contact_history_model_api \
                ../../inc \
                ../../../inc \
-               $$MW_LAYER_SYSTEMINCLUDE
+               $$APP_LAYER_SYSTEMINCLUDE
 
 DEPENDPATH += src \
               inc \
@@ -40,8 +40,7 @@
 
 MOC_DIR = tmp
 
-HEADERS   += nmcenrepkeys.h \
-             emailutilitiesdef.h \
+HEADERS   += emailutilitiesdef.h \
              emailmailboxinfo_p.h \
              emailmailboxinfo.h \
              emailmru.h \
@@ -49,7 +48,8 @@
              nmutilitiescommonheaders.h \
              nmcontacthistorymodel_p.h \
              inc/nmcontacthistorymodelcommon.h \
-             inc/nmcontacthistorymodel.h
+             inc/nmcontacthistorymodel.h \
+             nmuriparser.h
              
 SOURCES   += emailmailboxinfo_p.cpp \
              emailmailboxinfo.cpp \
@@ -57,7 +57,8 @@
              emailmru.cpp \
              nmcontacthistorymodelitem.cpp \
              nmcontacthistorymodel_p.cpp \
-             nmcontacthistorymodel.cpp
+             nmcontacthistorymodel.cpp \
+             nmuriparser.cpp
 
 symbian*: { 
     TARGET.EPOCALLOWDLLDATA = 1
@@ -66,9 +67,6 @@
     TARGET.UID2 = 0x1000008D
     TARGET.UID3 = 0x2002EA97 
 
-    INCLUDEPATH += /epoc32/include/ecom \ 
-                   $$MW_LAYER_SYSTEMINCLUDE
-                      
     defBlock = \      
       "$${LITERAL_HASH}if defined(MARM)" \
       "DEFFILE  eabi/nmutilities.def" \
@@ -81,42 +79,37 @@
     
     LIBS += -lcentralrepository 
     LIBS += -ltimezonelocalization 
-    LIBS += -lxqsettingsmanager 
+    LIBS += -lxqsettingsmanager
 }
 
-win32 {
-   DESTDIR = ../../bin
-}
 
 # Build.inf rules  
 BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include <platform_paths.hrh>" \
-                             "rom/nmutilities.iby $$CORE_APP_LAYER_IBY_EXPORT_PATH(nmutilities.iby)" \
-                             "data/icons/gmail.svg                  /epoc32/release/winscw/udeb/z/resource/apps/gmail.svg" \
-                             "data/icons/gmail.svg                  /epoc32/release/winscw/urel/z/resource/apps/gmail.svg" \
-                             "data/icons/gmail.svg                  /epoc32/data/z/resource/apps/gmail.svg" \
-                             "data/icons/microsoft.svg              /epoc32/release/winscw/udeb/z/resource/apps/microsoft.svg" \
-                             "data/icons/microsoft.svg              /epoc32/release/winscw/urel/z/resource/apps/microsoft.svg" \
-                             "data/icons/microsoft.svg              /epoc32/data/z/resource/apps/microsoft.svg" \
-                             "data/icons/ovi.svg                    /epoc32/release/winscw/udeb/z/resource/apps/ovi.svg" \
-                             "data/icons/ovi.svg                    /epoc32/release/winscw/urel/z/resource/apps/ovi.svg" \
-                             "data/icons/ovi.svg                    /epoc32/data/z/resource/apps/ovi.svg" \
-                             "data/icons/yahoo.svg                  /epoc32/release/winscw/udeb/z/resource/apps/yahoo.svg" \
-                             "data/icons/yahoo.svg                  /epoc32/release/winscw/urel/z/resource/apps/yahoo.svg" \
-                             "data/icons/yahoo.svg                  /epoc32/data/z/resource/apps/yahoo.svg" \
-                             "data/icons/aol.svg                    /epoc32/release/winscw/udeb/z/resource/apps/aol.svg" \
-                             "data/icons/aol.svg                    /epoc32/release/winscw/urel/z/resource/apps/aol.svg" \
-                             "data/icons/aol.svg                    /epoc32/data/z/resource/apps/aol.svg" \
-                             "data/2001E277.txt                     /epoc32/release/winscw/udeb/z/private/10202be9/2001E277.txt" \
-                             "data/2001E277.txt                     /epoc32/release/winscw/urel/z/private/10202be9/2001E277.txt" \
-                             "data/2001E277.txt                     /epoc32/data/z/private/10202be9/2001E277.txt" \
-                             "data/2003EA97.txt /epoc32/release/winscw/udeb/z/private/10202be9/2003EA97.txt" \
-                             "data/2003EA97.txt /epoc32/release/winscw/urel/z/private/10202be9/2003EA97.txt" \
-                             "data/2003EA97.txt /epoc32/data/z/private/10202be9/2003EA97.txt" \
-                             "data/nmutilities.confml               APP_LAYER_CONFML(nmutilities.confml)" \
-                             "data/nmutilities_200255BA.crml        APP_LAYER_CRML(nmutilities_200255BA.crml)" \
-                             "inc/emailmru.h APP_LAYER_PLATFORM_EXPORT_PATH(emailmru.h)" \
-                             "inc/emailmailboxinfo.h                APP_LAYER_PLATFORM_EXPORT_PATH(emailmailboxinfo.h)" \
-                             "inc/nmutilitiescommonheaders.h        APP_LAYER_PLATFORM_EXPORT_PATH(nmutilitiescommonheaders.h)" \
+                             "rom/nmutilities.iby                   $$CORE_APP_LAYER_IBY_EXPORT_PATH(nmutilities.iby)" \
+                             "data/gmail.svg                        /epoc32/release/winscw/udeb/z/resource/apps/gmail.svg" \
+                             "data/gmail.svg                        /epoc32/release/winscw/urel/z/resource/apps/gmail.svg" \
+                             "data/gmail.svg                        /epoc32/data/z/resource/apps/gmail.svg" \
+                             "data/microsoft.svg                    /epoc32/release/winscw/udeb/z/resource/apps/microsoft.svg" \
+                             "data/microsoft.svg                    /epoc32/release/winscw/urel/z/resource/apps/microsoft.svg" \
+                             "data/microsoft.svg                    /epoc32/data/z/resource/apps/microsoft.svg" \
+                             "data/ovi.svg                          /epoc32/release/winscw/udeb/z/resource/apps/ovi.svg" \
+                             "data/ovi.svg                          /epoc32/release/winscw/urel/z/resource/apps/ovi.svg" \
+                             "data/ovi.svg                          /epoc32/data/z/resource/apps/ovi.svg" \
+                             "data/yahoo.svg                        /epoc32/release/winscw/udeb/z/resource/apps/yahoo.svg" \
+                             "data/yahoo.svg                        /epoc32/release/winscw/urel/z/resource/apps/yahoo.svg" \
+                             "data/yahoo.svg                        /epoc32/data/z/resource/apps/yahoo.svg" \
+                             "data/aol.svg                          /epoc32/release/winscw/udeb/z/resource/apps/aol.svg" \
+                             "data/aol.svg                          /epoc32/release/winscw/urel/z/resource/apps/aol.svg" \
+                             "data/aol.svg                          /epoc32/data/z/resource/apps/aol.svg" \
+                             "conf/2001E277.txt                     /epoc32/release/winscw/udeb/z/private/10202be9/2001E277.txt" \
+                             "conf/2001E277.txt                     /epoc32/release/winscw/urel/z/private/10202be9/2001E277.txt" \
+                             "conf/2001E277.txt                     /epoc32/data/z/private/10202be9/2001E277.txt" \
+                             "conf/2003EA97.txt                     /epoc32/release/winscw/udeb/z/private/10202be9/2003EA97.txt" \
+                             "conf/2003EA97.txt                     /epoc32/release/winscw/urel/z/private/10202be9/2003EA97.txt" \
+                             "conf/2003EA97.txt                     /epoc32/data/z/private/10202be9/2003EA97.txt" \
+                             "conf/nmutilities.confml               APP_LAYER_CONFML(nmutilities.confml)" \
+                             "conf/nmutilities_200255BA.crml        APP_LAYER_CRML(nmutilities_200255BA.crml)" \
+                             "inc/emailmru.h                        APP_LAYER_PLATFORM_EXPORT_PATH(emailmru.h)" \
                              "inc/emailutilitiesdef.h               APP_LAYER_PLATFORM_EXPORT_PATH(emailutilitiesdef.h)" \
-                             "inc/nmcenrepkeys.h                    APP_LAYER_PLATFORM_EXPORT_PATH(nmcenrepkeys.h)" \ 
-                             "inc/nmuieventsnotifier.h              APP_LAYER_PLATFORM_EXPORT_PATH(nmuieventsnotifier.h)"
+                             "inc/nmuieventsnotifier.h              APP_LAYER_PLATFORM_EXPORT_PATH(nmuieventsnotifier.h)" \
+                             "inc/nmuriparser.h                     APP_LAYER_PLATFORM_EXPORT_PATH(nmuriparser.h)"
--- a/emailservices/nmutilities/src/emailmailboxinfo.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/src/emailmailboxinfo.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -15,10 +15,7 @@
  *
  */
 
-#include "emailtrace.h"
-
-#include "emailmailboxinfo.h"
-#include "emailmailboxinfo_p.h"
+#include "nmutilitiescommonheaders.h"
 
 /*!
     private constructor of EmailMailboxInfo
@@ -42,10 +39,10 @@
 
 /*!
     Returns mailbox icon name 
-    \param identifier can be domain name or mailbox id (NmId from nmailbase)
+    \param identifier should be a domain name
     \return mailbox icon name that can be used to construct HbIcon
  */
-QString EmailMailboxInfo::mailboxIcon(const QVariant &identifier) const
+QString EmailMailboxInfo::mailboxIcon(const QString &identifier) const
 {
     NM_FUNCTION;
     
@@ -54,10 +51,10 @@
 
 /*!
     Returns branded mailbox name
-    \param identifier can be domain name or mailbox id (NmId from nmailbase)
+    \param identifier should be a domain name
     \return mailbox name
  */
-QString EmailMailboxInfo::mailboxName(const QVariant &identifier) const
+QString EmailMailboxInfo::mailboxName(const QString &identifier) const
 {
     NM_FUNCTION;
     
--- a/emailservices/nmutilities/src/emailmailboxinfo_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/src/emailmailboxinfo_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -15,31 +15,30 @@
  *
  */
 
-#include "emailtrace.h"
+#include "nmutilitiescommonheaders.h"
 
-#include "emailmailboxinfo_p.h"
-#include "nmutilitiescommonheaders.h"
-#include "nmcenrepkeys.h"
-#include <QRegExp>
-#include <QStringList>
+// data type match the types used by the corresponding APIs
+const long int NmEmailCenrep = 0x2001E277;
+const unsigned long int NmWlbBrandName = 0xfffffffb;
+const unsigned long int NmWlbMailboxName = 0xfffffffc;
+const unsigned long int NmWlbIconPath = 0xfffffffd;
 
-const unsigned long int partialKey = 0x0;
-const unsigned long int bitMask = 0x0F000000;
+const unsigned long int NmPartialKey = 0x0;
+const unsigned long int NmBitMask = 0x0F000000;
 
 EmailMailboxInfoPrivate* EmailMailboxInfoPrivate::mSelf = NULL;
-qint32 EmailMailboxInfoPrivate::mReferenceCount = 0;
+int EmailMailboxInfoPrivate::mReferenceCount = 0;
 
-const QString KBrandNameGmail("Gmail");
-const QString KBrandNameGoogleMail("Google Mail");
+const QString NmBrandNameGmail("Gmail");
+const QString NmBrandNameGoogleMail("Google Mail");
 
-const QString KMCCGermany("262");
-const QString KMCCUK1("234");
-const QString KMCCUK2("235");
+const QString NmMCCGermany("262");
+const QString NmMCCUK1("234");
+const QString NmMCCUK2("235");
 
-const quint8 KGermanyTzId = 36;
-const quint8 KUKTzId = 104;
+const quint8 NmGermanyTzId = 36;
+const quint8 NmUKTzId = 104;
 
-using namespace NmBrandingApi;
 using namespace QtMobility;
 
 /*!
@@ -51,9 +50,8 @@
     NM_FUNCTION;
     
     XQSettingsManager manager;
-    XQCentralRepositorySettingsKey rccKey(EMAIL_CENREP, RCC_PATH);
 
-    XQCentralRepositorySettingsKey wlbKey(EMAIL_CENREP, WLB_BRAND_NAME);
+    XQCentralRepositorySettingsKey wlbKey(NmEmailCenrep, NmWlbBrandName);
 
     mWlbDomainName = manager.readItemValue(wlbKey, XQSettingsManager::TypeString).value<QString> ();    
 }
@@ -103,18 +101,14 @@
     \param branding identifier
     \return branding name
  */
-QString EmailMailboxInfoPrivate::name(const QVariant &identifier)
+QString EmailMailboxInfoPrivate::name(const QString &identifier)
 {
     NM_FUNCTION;
     
     QString returnValue = "";
-    QString domainName = "";
-    if (identifier.canConvert<QString> ()) {
-        domainName = identifier.value<QString> ();
-    }
 
-    if (domainName.length() > 0) {
-        processCenRepRecords(domainName);
+    if (identifier.length() > 0) {
+        processCenRepRecords(identifier);
         returnValue = mTempName;
     }
 
@@ -128,22 +122,14 @@
     \param branding identifier
     \return branding icon
  */
-QString EmailMailboxInfoPrivate::icon(const QVariant &identifier)
+QString EmailMailboxInfoPrivate::icon(const QString &identifier)
 {
     NM_FUNCTION;
     
     QString returnValue = "";
-    QString domainName = "";
-    if (identifier.canConvert<QString> ()) {
-        domainName = identifier.value<QString> ();
-        int delimIndex = domainName.lastIndexOf('@');
-        if(delimIndex >= 0) {
-            domainName = domainName.mid(delimIndex + 1);
-        }
-    }
 
-    if (domainName.length() > 0){
-        processCenRepRecords(domainName);
+    if (identifier.length() > 0) {
+        processCenRepRecords(identifier);
         returnValue = mTempIcon;
     }
 
@@ -166,62 +152,60 @@
 
     if (brandingId == mWlbDomainName) {
         found = true;
-        XQCentralRepositorySettingsKey wlbNameKey(EMAIL_CENREP, WLB_MAILBOX_NAME);
-        XQCentralRepositorySettingsKey wlbIconKey(EMAIL_CENREP, WLB_ICON_PATH);
+        XQCentralRepositorySettingsKey wlbNameKey(NmEmailCenrep, NmWlbMailboxName);
+        XQCentralRepositorySettingsKey wlbIconKey(NmEmailCenrep, NmWlbIconPath);
 
-        icon = cenRepManager.readItemValue(wlbIconKey, XQSettingsManager::TypeString).value<QString> ();
-        name = cenRepManager.readItemValue(wlbNameKey, XQSettingsManager::TypeString).value<QString> ();
+        icon = cenRepManager.readItemValue(
+            wlbIconKey, XQSettingsManager::TypeString).value<QString> ();
+        
+        name = cenRepManager.readItemValue(
+            wlbNameKey, XQSettingsManager::TypeString).value<QString> ();
     }
     else {
-        XQCentralRepositorySearchCriteria sCriteria(EMAIL_CENREP, partialKey, bitMask);
+        XQCentralRepositorySearchCriteria sCriteria(NmEmailCenrep, NmPartialKey, NmBitMask);
         XQCentralRepositoryUtils cenrepUtils(cenRepManager);
         QList<XQCentralRepositorySettingsKey> foundKeys = cenrepUtils.findKeys(sCriteria);
 
-        foreach(XQCentralRepositorySettingsKey key, foundKeys)
-        {
+        int count = foundKeys.count();
+        for (int i = 0; i < count && !found; i++) {
+            XQCentralRepositorySettingsKey key = foundKeys[i];
+
             QString dataRow = "";
             if (mBrandingDataMap.contains(key.key())) {
                 dataRow = mBrandingDataMap.value(key.key());
             }
             //first we put every spotted data row to map
             else {
-                QVariant brandingDataRaw = cenRepManager.readItemValue(key,
-					XQSettingsManager::TypeString);
-                if (brandingDataRaw.canConvert<QString>()) {
-                    dataRow = brandingDataRaw.value<QString>();
-                    mBrandingDataMap.insert(key.key(), dataRow);
-                }
+                QVariant brandingDataRaw = cenRepManager.readItemValue(
+                    key, XQSettingsManager::TypeString);
+
+                dataRow = brandingDataRaw.toString(); // empty if cannot be converted
+                mBrandingDataMap.insert(key.key(), dataRow);
             }
 
             // then we check if this row contains matching data
             QStringList cenRepRecord = dataRow.split(";");
 
-            if (cenRepRecord.size() < 4) {
-                continue;
-            }
-
-            if (!brandingId.contains(cenRepRecord.at(0), Qt::CaseInsensitive)) {
-                continue;
-            }
+            if (cenRepRecord.size() >= 3) {
 
-            QRegExp regExp(cenRepRecord.at(1));
-            regExp.setCaseSensitivity(Qt::CaseInsensitive);
-
-            if (regExp.exactMatch(brandingId)) { //match
-                found = true;
-                icon = "z:/resource/apps/" + cenRepRecord.at(3) + ".svg";
-                name = cenRepRecord.at(2);
-                break;
+                QRegExp regExp(cenRepRecord.at(0));
+                regExp.setCaseSensitivity(Qt::CaseInsensitive);
+    
+                if (regExp.exactMatch(brandingId)) { //match
+                    found = true;
+                    icon = "z:/resource/apps/" + cenRepRecord.at(2) + ".svg";
+                    name = cenRepRecord.at(1);
+                }
             }
         }
     }
     if (!found ) { 
         //get default icon and name
         icon = "qtg_large_email";
+        // If "." does not match anywhere in the string, split() returns a single-element list 
+        // containing brandingId string => no safety check needed
         QStringList domain = brandingId.split(".");
-        if (domain.size() > 0) {
-            name = domain.at(0);
-        }
+        name = domain.at(0);
     }
     mTempIcon = icon;
     mTempName = name;
@@ -231,24 +215,33 @@
     gets current country code
     \return current country id
  */
-quint8 EmailMailboxInfoPrivate::getCurrentCountryL() const
+int EmailMailboxInfoPrivate::getCurrentCountryL() const
 {
     NM_FUNCTION;
     
+    int countryId = NmNotFoundError;
+    
     CTzLocalizer* localizer = CTzLocalizer::NewLC();
 
     CTzLocalizedCity* city = localizer->GetFrequentlyUsedZoneCityL(
         CTzLocalizedTimeZone::ECurrentZone);
-    CleanupStack::PushL(city);
+    
+    if (city) {
+        CleanupStack::PushL(city);
 
-    CTzLocalizedCityGroup* cityGroup = localizer->GetCityGroupL(city->GroupId());
+        CTzLocalizedCityGroup* cityGroup = localizer->GetCityGroupL(city->GroupId());
+        
+        if (cityGroup) {
+            countryId = cityGroup->Id();
 
-    TUint8 countryId = cityGroup->Id();
+            delete cityGroup;
+            cityGroup = NULL;
+            
+        }
+        CleanupStack::PopAndDestroy(city);
+    }
 
-    delete cityGroup;
-    cityGroup = NULL;
-
-    CleanupStack::PopAndDestroy(2, localizer);
+    CleanupStack::PopAndDestroy(localizer);
 
     return countryId;
 }
@@ -265,7 +258,7 @@
     bool retVal = false;
     TRAPD(err, timeZone = getCurrentCountryL());
 
-    if (err == KErrNone && (timeZone == KGermanyTzId || timeZone == KUKTzId)) {
+    if (err == KErrNone && (timeZone == NmGermanyTzId || timeZone == NmUKTzId)) {
         retVal = true;
     }
     return retVal;
@@ -279,19 +272,15 @@
 {
     NM_FUNCTION;
     
-    QSystemNetworkInfo *networkInfo = new QSystemNetworkInfo();
-    QString currentMCC = networkInfo->currentMobileCountryCode();
+    if (brandingName == NmBrandNameGmail) {
+        QSystemNetworkInfo *networkInfo = new QSystemNetworkInfo();
+        QString currentMCC = networkInfo->currentMobileCountryCode();
 
-    if (brandingName == KBrandNameGmail) {
-        if (currentMCC.size() > 0) {
-            if ((currentMCC == KMCCGermany) || (currentMCC == KMCCUK1) || (currentMCC == KMCCUK2)) {
-                brandingName = KBrandNameGoogleMail;
-            }
+        if ((currentMCC == NmMCCGermany) || (currentMCC == NmMCCUK1) || (currentMCC == NmMCCUK2)) {
+            brandingName = NmBrandNameGoogleMail;
         }
-        else { //if there is information (no sim)
-            if (verifyTimeZone()) {
-                brandingName = KBrandNameGoogleMail;
-            }
+        else if (verifyTimeZone()) { //if there is information (no sim)
+            brandingName = NmBrandNameGoogleMail;
         }
     }
 }
--- a/emailservices/nmutilities/src/emailmru.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/src/emailmru.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -35,7 +35,6 @@
     NM_FUNCTION;
 
     mRepositoryManager = new XQSettingsManager();
-    Q_CHECK_PTR(mRepositoryManager);
 
     mLatestIndex = readCenRep(currentIndexKey).toInt();
     mCount = readCenRep(countKey).toInt();
@@ -329,14 +328,13 @@
 }
 
 /*!
-    Writes entry. Overwrites any existing data at give index
-    \return contacts setting for lastname / firstname order.
+    Gets first name / last name order from cenrep.
+    defined in cntuids.h.
+    \return name order.
  */
 int EmailMRU::nameOrder()
 {
     XQSettingsManager *repositoryManager = new XQSettingsManager();
-    Q_CHECK_PTR(repositoryManager);
-
     XQCentralRepositorySettingsKey readKey(contactsRepositoryKey,
                                            nameOrderKey);
 
--- a/emailservices/nmutilities/src/nmcontacthistorymodel.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/src/nmcontacthistorymodel.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -17,6 +17,7 @@
 
 #include <QList>
 
+#include "emailtrace.h"
 #include "nmcontacthistorymodel.h"
 #include "nmcontacthistorymodel_p.h"
 
@@ -31,8 +32,8 @@
 NmContactHistoryModel::NmContactHistoryModel(
     const NmContactHistoryModelType modelType)
 {
+    NM_FUNCTION;
     d_ptr = new NmContactHistoryModelPrivate(modelType);
-    Q_CHECK_PTR(d_ptr);
 
     QObject::connect(d_ptr, SIGNAL(queryCompleted(int)), this,
         SLOT(handleQueryCompleted(int)));
@@ -43,6 +44,7 @@
  */
 NmContactHistoryModel::~NmContactHistoryModel()
 {
+    NM_FUNCTION;
     delete d_ptr;
 }
 
@@ -53,6 +55,7 @@
 */
 void NmContactHistoryModel::query(const QString &query)
 {
+    NM_FUNCTION;
     d_ptr->queryDatabases(query);
 }
 
@@ -64,8 +67,9 @@
 */
 void NmContactHistoryModel::handleQueryCompleted(int err)
 {
+    NM_FUNCTION;
 
-    int lastUpdateIndex = (d_ptr->mPrivateItemList.count())-1;
+    int lastUpdateIndex = (d_ptr->privateDataCount())-1;
 
     if (lastUpdateIndex != -1)
     {
@@ -79,7 +83,7 @@
 
         if (validIndex)
         {
-            dataChanged(index(0,0), index(lastUpdateIndex,0));
+            emit dataChanged(index(0,0), index(lastUpdateIndex,0));
         }
     }
 
@@ -93,7 +97,8 @@
 */
 int NmContactHistoryModel::rowCount(const QModelIndex &parent) const
 {
-    return d_ptr->rowCount(parent);
+    NM_FUNCTION;
+    return d_ptr->modelRowCount(parent);
 }
 
 /*!
@@ -104,6 +109,7 @@
 */
 QVariant NmContactHistoryModel::data(const QModelIndex &index, int role) const
 {
+    NM_FUNCTION;
     return d_ptr->data(index, role);
 }
 
--- a/emailservices/nmutilities/src/nmcontacthistorymodel_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/src/nmcontacthistorymodel_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -16,6 +16,7 @@
 */
 
 #include "emailmru.h"
+#include "emailtrace.h"
 #include "nmcontacthistorymodel_p.h"
 
 // --------------------------------------------------------------------------
@@ -30,9 +31,11 @@
 NmContactHistoryModelPrivate::NmContactHistoryModelPrivate(
     const NmContactHistoryModelType modelType) :
     mType(modelType),
-    mContactManager(0),
+    mContactManager(NULL),
     mModelReady(false)
 {
+    NM_FUNCTION;
+
     mContactManager = new QContactManager("symbian");
     mNameOrder = EmailMRU::nameOrder();
 }
@@ -42,6 +45,8 @@
 */
 NmContactHistoryModelPrivate::~NmContactHistoryModelPrivate()
 {
+    NM_FUNCTION;
+
     delete mContactManager;
     mPrivateItemList.clear();
     mModelItemList.clear();
@@ -58,6 +63,8 @@
 */
 void NmContactHistoryModelPrivate::queryDatabases(const QString& query)
 {
+    NM_FUNCTION;
+
     mModelReady = false;
     // Clear contacts in the list
     mPrivateItemList.clear();
@@ -65,6 +72,8 @@
     mMruList.clear();
     mMruMatches.clear();
 
+    mNameOrder = EmailMRU::nameOrder();
+
     // Modify search to suit our needs
     // Space must be removed, because it is understood as logigal AND
     // with QContactManager API
@@ -73,37 +82,38 @@
     int spcPosition = query.indexOf(" ");
 
     if ( spcPosition != -1 )
-        {
+    {
         modifiedQuery = query.left(spcPosition);
-        }
+    }
 
+    // Get matching MRU items
     queryMruDatabase(modifiedQuery);
+    
+    // Populate mPrivateItemList with matching MRU items.
     populateListWithMruItems(modifiedQuery);
 
-    if (mContactManager)
-        {
-        // Get matching IDs from Contacts DB
-        QList<QContactLocalId> cnt_ids = queryContactDatabase(modifiedQuery);
-
-        // Populate mPrivateItemList with contact items.
-        populateListWithContactItems(cnt_ids, modifiedQuery);
-        }
-
-    // Currently we will always emit 0 as completion code.
+    // Get matching IDs from Contacts DB
+    QList<QContactLocalId> cnt_ids = queryContactDatabase(modifiedQuery);
 
-    //TODO: Will be removed, Debug Code.
-    for (int i = 0; i < mPrivateItemList.size(); i++)
-        {
-        QSharedPointer<NmContactHistoryModelItemData> itemData = mPrivateItemList[i];
-
-        QString dbgString = itemData->mItems[0].mItemText;
-        dbgString.append(" ");
-        dbgString.append(itemData->mItems[1].mItemText);
-
-        qDebug(dbgString.toLatin1());
+    // Populate mPrivateItemList with contact items.
+    populateListWithContactItems(cnt_ids, modifiedQuery);
 
 
+    #ifdef _DEBUG
+    
+        for (int i = 0; i < mPrivateItemList.size(); i++)
+        {
+            QSharedPointer<NmContactHistoryModelItemData> itemData = mPrivateItemList[i];
+
+            QString dbgString = itemData->mItems[0].mItemText;
+            dbgString.append(" ");
+            dbgString.append(itemData->mItems[1].mItemText);
+
+            qDebug(dbgString.toLatin1());
         }
+        
+    #endif
+
 
     emit queryCompleted(0);
 }
@@ -119,6 +129,8 @@
 QList<QContactLocalId> NmContactHistoryModelPrivate::queryContactDatabase(
     const QString &query)
 {
+    NM_FUNCTION;
+
     // Define filter
     QContactDetailFilter df;
 
@@ -148,13 +160,16 @@
 bool NmContactHistoryModelPrivate::queryMruDatabase(
     const QString &query)
 {
+    NM_FUNCTION;
+    bool rVal = false;
+    
     if (mType == EmailAddressModel)
     {
         bool mruListFilled = fillMruMatchList();
 
         if (!mruListFilled)
         {
-            return false;
+            return rVal;
         }
 
         QHashIterator<QString, QString> i(mMruList);
@@ -179,10 +194,11 @@
             {
                 mMruMatches.insert(name, address);
             }
-        }
+        }      
+        rVal = true;
     }
 
-    return true;
+    return rVal;
 }
 
 /*!
@@ -197,6 +213,8 @@
     const QList<QContactLocalId> cnt_ids,
     const QString &modifiedQuery)
 {
+    NM_FUNCTION;
+
     int cntCount = cnt_ids.count();
     // Populate mPrivateItemList with contact items.
     for ( int cntIndex = 0; cntIndex < cntCount; cntIndex++)
@@ -288,41 +306,46 @@
 void NmContactHistoryModelPrivate::populateListWithMruItems(
     const QString &query)
 {
-    QMapIterator<QString, QString> i(mMruMatches);
+    NM_FUNCTION;
+
+    QMapIterator<QString, QString> mruMatch(mMruMatches);
 
-    while (i.hasNext())
+    while (mruMatch.hasNext())
     {
-        i.next();
+        mruMatch.next();
         // For Display name (ex. John Doe)
         NmContactHistoryModelSubItem itemSubItem1;
         // For Email address (ex. john.doe@company.com)
         NmContactHistoryModelSubItem itemSubItem2;
 
-        itemSubItem1.mItemText = i.key();
-        itemSubItem2.mItemText = i.value();
+        QString name = mruMatch.key();
+        QString address = mruMatch.value();
+
+        itemSubItem1.mItemText = name;
+        itemSubItem2.mItemText = address;
 
         // markup for first item.
-        if( i.key().indexOf(query, 0, Qt::CaseInsensitive) == 0)
+        if( name.indexOf(query, 0, Qt::CaseInsensitive) == 0)
         {
             itemSubItem1.mMatchingRanges.append(0);
             itemSubItem1.mMatchingRanges.append(query.length()-1);
         }
 
         QRegExp rx("[,\\s]", Qt::CaseInsensitive);
-        bool separatorExists = i.key().contains(rx);
+        bool separatorExists = name.contains(rx);
 
         if (separatorExists)
         {
-            int indexLN = i.key().indexOf(",", 0, Qt::CaseInsensitive);
+            int indexLN = name.indexOf(",", 0, Qt::CaseInsensitive);
 
             if (indexLN == -1)
             {
-                indexLN = i.key().indexOf(" ", 0, Qt::CaseInsensitive);
+                indexLN = name.indexOf(" ", 0, Qt::CaseInsensitive);
             }
 
             if (indexLN > 0)
             {
-                int matchPos = i.key().indexOf(query, indexLN, Qt::CaseInsensitive);
+                int matchPos = name.indexOf(query, indexLN, Qt::CaseInsensitive);
 
                 if (matchPos > 0)
                 {
@@ -333,7 +356,7 @@
         }
 
         // markup for second item.
-        if (itemSubItem2.mItemText.indexOf(query, 0, Qt::CaseInsensitive) == 0 )
+        if (address.indexOf(query, 0, Qt::CaseInsensitive) == 0 )
          {
              itemSubItem2.mMatchingRanges.append(0);
              itemSubItem2.mMatchingRanges.append(query.length()-1);
@@ -363,6 +386,8 @@
 */
 void NmContactHistoryModelPrivate::refreshDataModel()
 {
+    NM_FUNCTION;
+
     mModelItemList.clear();
 
     for (int cntIndex = 0;
@@ -396,23 +421,39 @@
 }
 
 /*!
-    This is called by public class NmContactHistoryModel when rowcount() is requested
+    This is called by public class NmContactHistoryModel when model row count is requested
     Not meant to be used alone.
 
 */
-int NmContactHistoryModelPrivate::rowCount(const QModelIndex &parent) const
+int NmContactHistoryModelPrivate::modelRowCount(const QModelIndex &parent) const
 {
+    NM_FUNCTION;
+
     Q_UNUSED(parent);
     return mModelItemList.count();
 }
 
 /*!
+    This is called by public class NmContactHistoryModel when private data count is required
+    ie. When model isn't populated yet but data query is complete.
+    Not meant to be used alone.
+
+*/
+int NmContactHistoryModelPrivate::privateDataCount() const
+{
+    NM_FUNCTION;
+    return mPrivateItemList.count();
+}
+
+/*!
     This is called by public class NmContactHistoryModel when data() is requested
     Not meant to be used alone.
 
 */
 QVariant NmContactHistoryModelPrivate::data(const QModelIndex &index, int role) const
 {
+    NM_FUNCTION;
+
     if ( mModelReady )
     {
         if (!index.isValid() ||
@@ -421,8 +462,7 @@
         {
             return QVariant();
         }
-
-        if (role == Qt::DisplayRole)
+        else if (role == Qt::DisplayRole)
         {
             QVariant v;
             NmContactHistoryModelItem i = mModelItemList.at(index.row());
@@ -442,8 +482,10 @@
 */
 bool NmContactHistoryModelPrivate::fillMruMatchList()
 {
-    //TODO: Possible optimization, remove extra calls EmailMRU(), We need to get list only once.
+    NM_FUNCTION;
+
     EmailMRU *mru = new EmailMRU();
+    bool rVal = false;
 
     if (mru)
     {
@@ -463,12 +505,14 @@
         }
 
         delete mru;
-        return true;
+        rVal = true;
     }
     else
     {
-        return false;
+        rVal = false;
     }
+
+    return rVal;
 }
 
 /*!
@@ -483,8 +527,10 @@
     \return concennated string formatted as contact setting specifies.
 */
 QString NmContactHistoryModelPrivate::obeyContactOrder(const QString &firstName,
-                                                       const QString &lastName)
+                                                       const QString &lastName) const
 {
+    NM_FUNCTION;
+
     QString result;
 
     switch (mNameOrder)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/src/nmuriparser.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,168 @@
+/*
+* 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: A utility class for parsing URI strings
+*
+*/
+#include "nmuriparser.h"
+#include "emailtrace.h"
+
+#include <QUrl>
+
+
+/*!
+    Keys for parsing data.
+*/
+static const QString NmUriParserEmailSendSubjectKey = "subject";
+static const QString NmUriParserEmailEmailSendToKey = "to";
+static const QString NmUriParserEmailSendCcKey = "cc";
+static const QString NmUriParserEmailSendBccKey = "bcc";
+static const QString NmUriParserEmailSendBodyTextKey = "body";
+
+/*!
+    Class constructor.
+*/
+NmUriParser::NmUriParser()
+{
+    NM_FUNCTION;
+}
+
+/*!
+    Class destructor.
+*/
+NmUriParser::~NmUriParser()
+{
+    NM_FUNCTION;
+}
+
+/*!
+    Extracts the data from the given QString into the class members.
+    \param data QString containing the data.
+    \return True if success, false otherwise.
+*/
+bool NmUriParser::extractData(const QString &data)
+{
+    NM_FUNCTION;
+    
+    bool success(false);
+    
+    QUrl uri(data);
+    
+    if (uri.isValid()) {
+        
+        mSubject = uri.queryItemValue(NmUriParserEmailSendSubjectKey);
+        QString to = uri.path();
+        QString cc = uri.queryItemValue(NmUriParserEmailSendCcKey);
+        QString bcc = uri.queryItemValue(NmUriParserEmailSendBccKey);
+        QString bodyText = uri.queryItemValue(NmUriParserEmailSendBodyTextKey);
+        if (bodyText.length()) {
+            mBodyText = bodyText;
+        }
+        
+        addAddressesToList(to, mToAddresses);
+        addAddressesToList(cc, mCcAddresses);
+        addAddressesToList(bcc, mBccAddresses);
+        
+        success = true;
+    }
+    
+    return success;
+}
+
+/*!
+    Appends the given addresses into the given list.
+    \param address The addresses to append.
+    \param list The list where the addresses are appended to.
+*/
+void NmUriParser::addAddressesToList(QString &addresses, QStringList &list)
+{
+    NM_FUNCTION;
+    
+    if (!addresses.isEmpty()) {
+
+        QStringList foundAddresses;
+                
+        // Process multiple addresses.
+        if (addresses.contains(",")) {
+            QString str;               
+            while (addresses.contains(",")) {
+                str = addresses.section(",", 0, 0); // Get the occurance.
+                addresses.remove(0, (addresses.indexOf(",")+1)); // Remove the occurance.
+                if (!str.isEmpty()) { // In case str would be empty on some error data. 
+                    foundAddresses.append(str);    
+                }
+            }
+        }
+        if (!addresses.isEmpty()) { // In case addresses would be empty on some error data. 
+            // Last one or single address.
+            foundAddresses.append(addresses);
+        }
+        // Append the found addresses into the given list.
+        list.append(foundAddresses);
+    }
+}
+    
+/*!
+    Resets the data.
+*/
+void NmUriParser::resetData()
+{
+    NM_FUNCTION;
+    
+    mSubject.clear();
+    mToAddresses.clear();
+    mCcAddresses.clear();
+    mBccAddresses.clear();
+    mBodyText.clear();
+}
+
+/*!
+    Getter for subject
+    \return QString subject of parsed uri
+*/
+QString NmUriParser::subject() const
+{
+    return mSubject;
+}
+/*!
+    Getter for to-addresses
+    \return QStringList list of parsed to-addresses
+*/
+QStringList NmUriParser::toAddresses() const
+{
+    return mToAddresses;
+}
+/*!
+    Getter for ccAddresses
+    \return QStringList list of parsed cc-addresses
+*/
+QStringList NmUriParser::ccAddresses() const
+{
+    return mCcAddresses;
+}
+/*!
+    Getter for bcc-Addresses
+    \return QStringList list of parsed bcc-addresses
+*/
+QStringList NmUriParser::bccAddresses() const
+{
+    return mBccAddresses;
+}
+/*!
+    Getter for bcc-Addresses
+    \return QString parsed body text
+*/
+QString NmUriParser::bodyText() const
+{
+    return mBodyText;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_emailmru/emailtrace.h	Thu Sep 30 11:43:07 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:
+ *
+ */
+
+#ifndef T_EMAILTRACE_H
+#define T_EMAILTRACE_H
+
+#define NM_COMMENT(msg)
+#define NM_ERROR(err,msg)
+#define NM_FUNCTION
+
+#endif /* T_EMAILTRACE_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_emailmru/unittest_emailmru.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,270 @@
+/*
+ * Copyright (c) 2007-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:  unittests fro emailmru
+ *
+ */
+
+//#include <XQSettingsManager.h>
+//#include <XQCentralRepositoryUtils.h>
+//#include <XQCentralRepositorySearchCriteria.h>
+
+
+//#include "XQSettingsManager.h"
+//#include "XQCentralRepositoryUtils.h"
+//#include "XQCentralRepositorySearchCriteria.h"
+
+#include "emailmru.h"
+#include "unittest_emailmru.h"
+
+/*!
+     Constructor
+ */
+TestEmailMru::TestEmailMru()
+{
+
+}
+
+/*!
+     Destructor
+ */
+TestEmailMru::~TestEmailMru()
+{
+
+}
+
+/*!
+     Called before testcase
+ */
+void TestEmailMru::initTestCase()
+{
+}
+
+/*!
+     Called after testcase
+ */
+void TestEmailMru::cleanupTestCase()
+{
+}
+
+/*!
+     Called before every function
+ */
+void TestEmailMru::init()
+{
+    iMru = new EmailMRU();
+}
+
+/*!
+     Called after everyfunction
+ */
+void TestEmailMru::cleanup()
+{
+    delete iMru;
+    iMru = NULL;
+}
+
+
+/*!
+     Test what happens when entry with same address
+     but different name is applied to MRU
+ */
+
+void TestEmailMru::testUpdateEntry()
+{
+//    EmailMRU *mru = new EmailMRU();
+    iMru->reset();
+    bool success;
+
+    QString name = "n1";
+    QString addr = "a1";
+    iMru->updateMRU(name, addr);
+
+    QString name2 = "n2";
+    QString addr2 = "a2";
+    iMru->updateMRU(name2, addr2);
+
+    QString name3 = "n3";
+    QString addr3 = "a3";
+    iMru->updateMRU(name3, addr3);
+
+    /*
+    CenRep Should be:
+
+    "n1" : "a1"
+    "n2" : "a2"
+    "n3" : "a3";
+
+     */
+
+    // Update A2
+    QString name4 = "n4";
+    QString addr4 = "a2";
+    iMru->updateMRU(name4, addr4);
+
+    /*
+    CenRep Should be:
+
+    "n1" : "a1"
+    "n3" : "a3"
+    "n4" : "a2"
+
+    */
+
+    QString e_name;
+    QString e_addr;
+
+    success = iMru->getEntry(1, e_name, e_addr);
+    QCOMPARE(e_name, name);
+    QCOMPARE(e_addr, addr);
+    QCOMPARE(success, true);
+
+    success = iMru->getEntry(2, e_name, e_addr);
+    QCOMPARE(e_name, name3);
+    QCOMPARE(e_addr, addr3);
+    QCOMPARE(success, true);
+
+    success = iMru->getEntry(3, e_name, e_addr);
+    QCOMPARE(e_name, name4);
+    QCOMPARE(e_addr, addr4);
+    QCOMPARE(success, true);
+
+    e_name.clear();
+    e_addr.clear();
+    QString emptyString;
+    emptyString.clear();
+
+    success = iMru->getEntry(4, e_name, e_addr);
+    QCOMPARE(e_name, emptyString);
+    QCOMPARE(e_addr, emptyString);
+    QCOMPARE(success, false);
+}
+
+/*!
+     Test what happens when the MRU is filled and
+     yet still more entries are applied
+ */
+
+void TestEmailMru::testUpperLimit()
+{
+//    EmailMRU *mru = new EmailMRU();
+    iMru->reset();
+
+    // first fill the MRU
+    for (qint32 i=0; i < emailAddressHistorySize; i++) {
+        QString name = "name";
+        QString addr = "addr";
+        QString num = QString::number(i);
+        name.append(num);
+        addr.append(num);
+        iMru->updateMRU(name, addr);
+    }
+
+    // next add one more pair, this should overwrite the
+    // first entries
+    QString e_name;
+    QString e_addr;
+    QString e_name_value = "expected_name";
+    QString e_addr_value = "expected_address";
+    iMru->updateMRU(e_name_value, e_addr_value);
+
+    iMru->getEntry(1, e_name, e_addr);
+
+    // finally compare if the first entries has been
+    // replaced
+    QCOMPARE(e_name, e_name_value);
+    QCOMPARE(e_addr, e_addr_value);
+}
+
+/*!
+     Provides data for testMruStrings
+ */
+void TestEmailMru::testMruStrings_data()
+{
+    QTest::addColumn<QString>("display_name");
+    QTest::addColumn<QString>("email_address");
+
+    QTest::newRow("1") << "name1" << "name1.name1@gmail.com";
+    QTest::newRow("2") << "name2" << "name.name.name.namenamenmanamnamenmanemane2.name2@gmailmailmailamil.com";
+    QTest::newRow("3") << "näMeöÅ3" << "name3@gmail.com";
+    QTest::newRow("4") << "name4$&#/\\" << "name4.name4@gmail.com";
+}
+
+/*!
+     Check that name and address pairs are successfully
+     saved into mru database
+ */
+void TestEmailMru::testMruStrings()
+{
+    QFETCH(QString, display_name);
+    QFETCH(QString, email_address);
+
+//    EmailMRU *mru = new EmailMRU();
+    iMru->reset();
+    iMru->updateMRU(display_name, email_address);
+
+    QString name;
+    QString address;
+    iMru->getEntry(1, name, address);
+
+    QCOMPARE(name, display_name);
+    QCOMPARE(address, email_address);
+}
+
+/*!
+    Reset mru database and verify that it is indeed empty
+ */
+void TestEmailMru::testReset()
+{
+//    EmailMRU *mru = new EmailMRU();
+    iMru->reset();
+    bool success;
+
+    quint32 mruCount = iMru->entryCount();
+
+    QString e_name;
+    QString e_addr;
+    QString name = "n1";
+    QString addr = "a1";
+    iMru->updateMRU(name, addr);
+
+    mruCount = iMru->entryCount();
+
+    success = iMru->getEntry(1, e_name, e_addr);
+    QCOMPARE(e_name, name);
+    QCOMPARE(e_addr, addr);
+    QCOMPARE(success, true);
+
+    e_name.clear();
+    e_addr.clear();
+    QString emptyString;
+    emptyString.clear();
+
+    iMru->reset();
+
+    mruCount = iMru->entryCount();
+
+    success = iMru->getEntry(1, e_name, e_addr);
+    QCOMPARE(e_name, emptyString);
+    QCOMPARE(e_addr, emptyString);
+    QCOMPARE(success, false);
+}
+
+void TestEmailMru::testNameOrder()
+{
+    int rVal = EmailMRU::nameOrder();
+    QVERIFY( rVal == 0 );
+}
+
+QTEST_MAIN( TestEmailMru );
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_emailmru/unittest_emailmru.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,41 @@
+/*
+ * unittest_emailmru.h
+ *
+ */
+
+#ifndef UNITTEST_EMAILMRU_H_
+#define UNITTEST_EMAILMRU_H_
+
+#include <QtTest/QtTest>
+
+class EmailMRU;
+
+class TestEmailMru : public QObject
+{
+Q_OBJECT
+
+public:
+
+    TestEmailMru();
+    ~TestEmailMru();
+
+private slots:
+
+    void initTestCase();
+    void cleanupTestCase();
+    void init();
+    void cleanup();
+    //tests
+    void testMruStrings();
+    void testMruStrings_data();
+    void testUpperLimit();
+    void testUpdateEntry();
+    void testReset();
+    void testNameOrder();
+
+private:
+    EmailMRU *iMru;
+
+};
+
+#endif /* UNITTEST_EMAILMRU_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_emailmru/unittest_emailmru.pro	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,50 @@
+# ============================================================================
+# Name : unitest_emailmailboxinfo.cpp
+# Part of : nmutilities
+# Description :
+# Copyright (c) 2009 Nokia. All rights reserved.
+# This material, including documentation and any related computer
+# programs, is protected by copyright controlled by Nokia. All
+# rights are reserved. Copying, including reproducing, storing,
+# adapting or translating, any or all of this material requires the
+# prior written consent of Nokia. This material also contains
+# confidential information which may not be disclosed to others
+# without the prior written consent of Nokia.
+# ============================================================================
+# ENTER HERE FILES NEEDED TO COMPILE WITH UNIT TESTS
+
+DEFINES -= XQSETTINGSMANAGER_LIBRARY
+DEFINES += XQSETTINGSMANAGER_NO_LIBRARY
+
+QT += testlib
+QT += core
+
+CONFIG += qtestlib
+CONFIG += symbian_test
+
+TEMPLATE = app
+TARGET = unittest_emailmru
+
+MOC_DIR = tmp
+
+INCLUDEPATH =   . \
+                $$MW_LAYER_SYSTEMINCLUDE
+  
+win32:DESTDIR = ../../bin
+
+HEADERS +=  emailtrace.h \
+            /epoc32/include/platform/mw/xqcentralrepositorysearchcriteria.h \
+            /epoc32/include/platform/mw/xqcentralrepositoryutils.h \
+            /epoc32/include/platform/mw/xqsettingsmanager.h \
+            unittest_emailmru.h \
+            ../../../inc/emailmru.h
+
+SOURCES +=  xqstubs.cpp 
+SOURCES +=  ../../../src/emailmru.cpp
+SOURCES +=  unittest_emailmru.cpp
+
+symbian*: { 
+    TARGET.CAPABILITY = CAP_APPLICATION
+    EPOCALLOWDLLDATA = 1
+    MMP_RULES += "USERINCLUDE ."
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_emailmru/xqstubs.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,160 @@
+#include <QObject>
+#include <QVariant>
+
+#include <XQCentralRepositorySearchCriteria.h>
+#include <XQCentralRepositoryUtils.h>
+#include <xqsettingsmanager.h>
+
+//#include <XQCentralRepositorySearchCriteria.h>
+//#include "XQCentralRepositoryUtils.h"
+//#include "xqsettingsmanager.h"
+
+QMap<unsigned long int, QString> UTmap;
+
+XQSettingsManager::XQSettingsManager(QObject* parent)
+    : QObject(parent)
+{
+//    Q_UNUSED(parent);
+    UTmap.clear();
+
+    QVariant n = 1;
+    UTmap[0] = n.toString();
+
+    n = 0;
+    UTmap[1] = n.toString();
+}
+
+XQSettingsManager::~XQSettingsManager()
+{
+    UTmap.clear();
+}
+/*
+QVariant XQSettingsManager::readItemValue(const XQCentralRepositorySettingsKey& key, XQSettingsManager::Type)
+{
+    return QVariant::fromValue(UTmap.value(key.key()));
+}
+*/
+
+
+QVariant XQSettingsManager::readItemValue(const XQSettingsKey& key, XQSettingsManager::Type)
+{
+    return QVariant::fromValue(UTmap.value(key.key()));
+}
+
+/*
+bool XQSettingsManager::writeItemValue(const XQCentralRepositorySettingsKey& key, const QVariant& value)
+{
+    UTmap[key.key()] = value.toString();
+    return true;
+}
+*/
+
+bool XQSettingsManager::writeItemValue(const XQSettingsKey& key, const QVariant& value)
+{
+    UTmap[key.key()] = value.toString();
+    return true;
+}
+
+XQCentralRepositoryUtils::XQCentralRepositoryUtils(XQSettingsManager& settingsManager, QObject* parent)
+{
+    Q_UNUSED(settingsManager);
+    Q_UNUSED(parent);
+}
+
+XQCentralRepositoryUtils::~XQCentralRepositoryUtils()
+{
+}
+
+bool XQCentralRepositoryUtils::resetRepository(long int repositoryUid)
+{
+    Q_UNUSED(repositoryUid);
+    UTmap.clear();
+    return true;
+}
+
+bool XQCentralRepositoryUtils::createKey(const XQCentralRepositorySettingsKey& key, const QVariant& value)
+{
+    Q_UNUSED(key);
+    Q_UNUSED(value);
+    return true;
+}
+
+bool XQCentralRepositoryUtils::deleteKey(const XQCentralRepositorySettingsKey& key)
+{
+    Q_UNUSED(key);
+    return true;
+}
+
+QList<XQCentralRepositorySettingsKey> XQCentralRepositoryUtils::findKeys(const XQCentralRepositorySearchCriteria& criteria)
+    {
+    QList<XQCentralRepositorySettingsKey> emptyList;
+
+    int size = UTmap.size();
+    int mockId = UTmap.key(criteria.value().toString());
+
+    if (mockId)
+        {
+        XQCentralRepositorySettingsKey key(mockId, mockId);
+        emptyList.append(key);
+        }
+
+    return emptyList;
+    }
+
+XQCentralRepositorySearchCriteria::XQCentralRepositorySearchCriteria(long int repositoryUid, unsigned long int partialKey, unsigned long int bitMask)
+{
+    Q_UNUSED(repositoryUid);
+    Q_UNUSED(partialKey);
+    Q_UNUSED(bitMask);
+}
+
+XQCentralRepositorySearchCriteria::~XQCentralRepositorySearchCriteria()
+{
+}
+
+void XQCentralRepositorySearchCriteria::setValueCriteria(const QVariant& value, bool negativeCriteria)
+    {
+    Q_UNUSED(negativeCriteria);
+    m_value = value;
+    }
+
+const QVariant& XQCentralRepositorySearchCriteria::value() const
+{
+    return m_value;
+}
+
+XQSettingsKey::XQSettingsKey(XQSettingsKey::Target target, long int uid, unsigned long int key) :
+    m_target(target),
+    m_uid(uid),
+    m_key(key)
+{
+
+}
+
+XQSettingsKey::~XQSettingsKey()
+{
+}
+
+XQSettingsKey::Target XQSettingsKey::target() const
+{
+    return m_target;
+}
+
+long int XQSettingsKey::uid() const
+{
+    return m_uid;
+}
+
+unsigned long int XQSettingsKey::key() const
+{
+    return m_key;
+}
+
+XQCentralRepositorySettingsKey::XQCentralRepositorySettingsKey(long int uid, unsigned long int key) :
+        XQSettingsKey(XQSettingsKey::TargetCentralRepository, uid, key)
+{
+}
+
+XQCentralRepositorySettingsKey::~XQCentralRepositorySettingsKey()
+    {
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel/nmcnthistorystub.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,196 @@
+/*
+* 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: Private implementation of Contact History Model API
+*
+*/
+
+extern bool constructorCalled;
+extern bool destructorCalled;
+extern bool rowcountCalled;
+extern bool dataCalled;
+extern bool modelcompletedCalled;
+extern bool queryCalled;
+extern bool refreshdatamodelCalled;
+extern bool handlequerycompletedCalled;
+
+#include "nmcontacthistorymodel_p.h"
+
+// --------------------------------------------------------------------------
+// Start of implementation (NmContactHistoryModelPrivate)
+// --------------------------------------------------------------------------
+/*!
+    Constructor of NmContactHistoryModelPrivate
+
+    \param type The valid values are described by
+    NmContactHistoryModelPrivate::HistoryModelType enum.
+*/
+NmContactHistoryModelPrivate::NmContactHistoryModelPrivate(
+    const NmContactHistoryModelType modelType) :
+    mType(modelType),
+    mSignalConnected(false)
+{
+    constructorCalled = true;
+    mPrivateItemList.append("DUMMYDATA");
+}
+
+/*!
+    Destructor of ContactHistoryModel
+*/
+NmContactHistoryModelPrivate::~NmContactHistoryModelPrivate()
+{
+    destructorCalled = true;
+}
+
+/*!
+    Searches contact & MRU  databases according to query parameters.
+    Emits QueryCompleted() when ready.
+
+    \param query Text to be searched
+    \return none
+
+    Note:: QContactManager supports max. ten characters long queries.
+*/
+void NmContactHistoryModelPrivate::queryDatabases(const QString& query)
+{
+    Q_UNUSED(query);
+    queryCalled = true;
+}
+
+void NmContactHistoryModelPrivate::refreshDataModel()
+{
+    refreshdatamodelCalled = true;
+}
+
+/*!
+    This is called by public class NmContactHistoryModel when rowcount() is requested
+    Not meant to be used alone.
+
+*/
+int NmContactHistoryModelPrivate::modelRowCount(const QModelIndex &parent) const
+{
+    Q_UNUSED(parent);
+    rowcountCalled = true;
+    return 0;
+}
+
+int NmContactHistoryModelPrivate::privateDataCount() const
+{
+    rowcountCalled = true;
+    return mPrivateItemList.count();
+}
+
+/*!
+    This is called by public class NmContactHistoryModel when data() is requested
+    Not meant to be used alone.
+
+*/
+QVariant NmContactHistoryModelPrivate::data(const QModelIndex &index, int role) const
+{
+    Q_UNUSED(index);
+    Q_UNUSED(role);
+
+    dataCalled = true;
+    return QVariant();
+}
+
+void NmContactHistoryModelPrivate::connectNotify ( const char * signal )
+    {
+    QString testSignal = signal;
+    mSignalConnected = true;
+    }
+
+// --------------------------------------------------------------------------
+// End of implementation (NmContactHistoryModelPrivate)
+// --------------------------------------------------------------------------
+
+NmContactHistoryModelItem::NmContactHistoryModelItem()
+{
+}
+
+/*!
+    Not meant to be used alone.
+*/
+NmContactHistoryModelItem::NmContactHistoryModelItem(
+    const NmContactHistoryModelItem &other)
+{
+    Q_UNUSED(other);
+}
+
+/*!
+    Not meant to be used alone.
+*/
+NmContactHistoryModelItem::~NmContactHistoryModelItem()
+{
+}
+
+/*!
+    Not meant to be used alone.
+*/
+unsigned int NmContactHistoryModelItem::contactId() const
+{
+    return 0;
+}
+
+/*!
+    Not meant to be used alone.
+*/
+void NmContactHistoryModelItem::setContactId(unsigned int contactId)
+{
+    Q_UNUSED(contactId);
+}
+
+/*!
+    Not meant to be used alone.
+*/
+int NmContactHistoryModelItem::subItemCount() const
+{
+    return 0;
+}
+
+/*!
+    Not meant to be used alone.
+*/
+NmContactHistoryModelSubItem NmContactHistoryModelItem::subItemAt(
+    int index) const
+{
+    Q_UNUSED(index);
+    return NmContactHistoryModelSubItem();
+
+}
+
+/*!
+    Returns SubEntries from private list
+    First entry is contact name
+    Second entry is email address / phone number
+
+    \return List of items.
+*/
+QList<NmContactHistoryModelSubItem> NmContactHistoryModelItem::subEntries(
+    ) const
+{
+    QList<NmContactHistoryModelSubItem> subItemList;
+    return subItemList;
+}
+
+/*!
+    Public - Appends subItem to private list
+
+    \param entry subItem to be appended
+*/
+void NmContactHistoryModelItem::appendSubItem(
+    NmContactHistoryModelSubItem entry)
+{
+    Q_UNUSED(entry);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel/nmcontacthistorymodel_p.h	Thu Sep 30 11:43:07 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: Private declaration of Contact History Model API
+*
+*/
+
+#ifndef NMCONTACTHISTORYMODELPRIVATE_H
+#define NMCONTACTHISTORYMODELPRIVATE_H
+
+#include <QObject>
+#include <QSharedData>
+
+#include "nmcontacthistorymodel.h"
+#include "nmcontacthistorymodelcommon.h"
+
+class NmContactHistoryModelItemData : public QSharedData
+{
+public:
+
+NmContactHistoryModelItemData() :
+    mContactId(0xDEAD)
+{
+
+}
+
+~NmContactHistoryModelItemData()
+{
+}
+
+    unsigned int mContactId;
+};
+
+class NmContactHistoryModelPrivate : public QObject
+{
+    enum nameOrder
+    {
+        LastNameFirstName = 0x0,
+        LastNameCommaFirstName = 0x1,
+        FirstNameLastName = 0x2
+    };
+
+Q_OBJECT
+
+public:
+
+    NmContactHistoryModelPrivate(const NmContactHistoryModelType modelType);
+    ~NmContactHistoryModelPrivate();
+
+signals:
+
+    void queryCompleted(int err);
+
+private:
+
+    void queryDatabases(const QString &query);
+    int modelRowCount(const QModelIndex &parent) const;
+    int privateDataCount() const;
+    QVariant data(const QModelIndex &index, int role) const;
+    void refreshDataModel();
+
+protected:
+    void connectNotify ( const char * signal );
+
+public:
+
+    // Member variables
+    NmContactHistoryModelType mType;
+    QList< QString > mPrivateItemList;
+
+    bool mSignalConnected;
+
+private:  // Friend definitions
+
+    friend class NmContactHistoryModel;
+    friend class TestNmContactHistoryModel;
+    friend class TestNmContactHistoryModelPrivate;
+};
+
+#endif //NMCONTACTHISTORYMODELPRIVATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel/unittest_nmcontacthistorymodel.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2007-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:  unittests fro emailmru
+ *
+ */
+
+#include "nmcontacthistorymodel.h"
+#include "nmcontacthistorymodel_p.h"
+#include "unittest_nmcontacthistorymodel.h"
+
+bool constructorCalled;
+bool destructorCalled;
+bool rowcountCalled;
+bool dataCalled;
+bool modelcompletedCalled;
+bool queryCalled;
+bool refreshdatamodelCalled;
+bool handlequerycompletedCalled;
+
+/*!
+     Constructor
+ */
+TestNmContactHistoryModel::TestNmContactHistoryModel()
+{
+
+}
+
+/*!
+     Destructor
+ */
+TestNmContactHistoryModel::~TestNmContactHistoryModel()
+{
+
+}
+
+/*!
+     Called before testcase
+ */
+void TestNmContactHistoryModel::initTestCase()
+{
+}
+
+/*!
+     Called after testcase
+ */
+void TestNmContactHistoryModel::cleanupTestCase()
+{
+}
+
+/*!
+     Called before every function
+ */
+void TestNmContactHistoryModel::init()
+{
+    constructorCalled = false;
+    destructorCalled = false;
+    rowcountCalled = false;
+    dataCalled = false;
+    modelcompletedCalled = false;
+    queryCalled = false;
+    refreshdatamodelCalled = false;
+    handlequerycompletedCalled = false;
+
+    mModel= new NmContactHistoryModel(EmailAddressModel);
+    mSlotCalled = false;
+}
+
+/*!
+     Called after everyfunction
+ */
+void TestNmContactHistoryModel::cleanup()
+{
+    delete mModel;
+    mModel = NULL;
+}
+
+void TestNmContactHistoryModel::testConstructor()
+{
+    QVERIFY(constructorCalled);
+    QVERIFY(mModel->d_ptr != NULL);
+
+    NmContactHistoryModelType modelType = mModel->d_ptr->mType;
+    QVERIFY(modelType == EmailAddressModel);
+}
+
+void TestNmContactHistoryModel::testDestructor()
+{
+    delete mModel;
+    mModel = NULL;
+    QVERIFY(destructorCalled);
+}
+
+void TestNmContactHistoryModel::testRowCount()
+{
+    int rowCount = mModel->rowCount(QModelIndex());
+    QVERIFY(rowCount == 0);
+    QVERIFY(rowcountCalled);
+}
+
+void TestNmContactHistoryModel::testData()
+{
+    mModel->data(QModelIndex(),0);
+    QVERIFY(dataCalled);
+}
+
+void TestNmContactHistoryModel::testQuery()
+{
+    mModel->query("TEST");
+    QVERIFY(queryCalled);
+}
+
+void TestNmContactHistoryModel::test_modelCompleted(int err)
+{
+    Q_UNUSED(err);
+    mSlotCalled = true;
+}
+
+void TestNmContactHistoryModel::testHandleQueryCompleted()
+{
+    mSlotCalled = false;
+    QObject::connect(mModel, SIGNAL(modelCompleted(int)), this, SLOT(test_modelCompleted(int)));
+    mModel->d_ptr->mPrivateItemList.append("TEST");
+    mModel->handleQueryCompleted(0);
+    QVERIFY(rowcountCalled);
+    QVERIFY(refreshdatamodelCalled);
+    QVERIFY(mSlotCalled);
+    
+    rowcountCalled = false;
+    refreshdatamodelCalled = false;
+    mSlotCalled = false;
+    
+    mModel->d_ptr->mPrivateItemList.clear();
+    mModel->handleQueryCompleted(0);    
+
+    QVERIFY(rowcountCalled);
+    QVERIFY(refreshdatamodelCalled == FALSE);
+    QVERIFY(mSlotCalled);
+}
+
+QTEST_MAIN( TestNmContactHistoryModel );
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel/unittest_nmcontacthistorymodel.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,46 @@
+/*
+ * unittest_
+ *
+ */
+
+#ifndef UNITTEST_NMCONTACTHISTORYMODEL_H_
+#define UNITTEST_NMCONTACTHISTORYMODEL_H_
+
+#include <QtTest/QtTest>
+
+class NmContactHistoryModel;
+
+class TestNmContactHistoryModel : public QObject
+{
+Q_OBJECT
+
+public:
+
+    TestNmContactHistoryModel();
+    ~TestNmContactHistoryModel();
+
+private slots:
+
+    void initTestCase();
+    void cleanupTestCase();
+    void init();
+    void cleanup();
+
+    // Test slot for testing signal.
+    void test_modelCompleted(int err);
+
+    //tests
+    void testConstructor();
+    void testDestructor();
+    void testRowCount();
+    void testData();
+    void testQuery();
+    void testHandleQueryCompleted();
+
+private:
+
+    NmContactHistoryModel *mModel;
+    bool mSlotCalled;
+};
+
+#endif /* UNITTEST_NMCONTACTHISTORYMODEL_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel/unittest_nmcontacthistorymodel.pro	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,49 @@
+# ============================================================================
+# Name : unittest_nmcontacthistorymodel
+# Part of : nmutilities
+# Description :
+# Copyright (c) 2009 Nokia. All rights reserved.
+# This material, including documentation and any related computer
+# programs, is protected by copyright controlled by Nokia. All
+# rights are reserved. Copying, including reproducing, storing,
+# adapting or translating, any or all of this material requires the
+# prior written consent of Nokia. This material also contains
+# confidential information which may not be disclosed to others
+# without the prior written consent of Nokia.
+# ============================================================================
+# ENTER HERE FILES NEEDED TO COMPILE WITH UNIT TESTS
+
+DEFINES -= NMCHMAPI_LIBRARY
+DEFINES += NMCHMAPI_LIBRARY_NO_LIBRARY
+
+QT += testlib
+QT += core
+
+CONFIG += qtestlib
+CONFIG += symbian_test
+
+TEMPLATE = app
+TARGET = unittest_nmcontacthistorymodel
+
+MOC_DIR = tmp
+
+INCLUDEPATH =   . \
+                ../../../inc/ \
+                $$MW_LAYER_SYSTEMINCLUDE
+
+win32:DESTDIR = ../../bin
+
+HEADERS +=  unittest_nmcontacthistorymodel.h \
+            nmcontacthistorymodel_p.h \
+            ../../../../../inc \
+            ../../../../../email_plat/contact_history_model_api/inc/nmcontacthistorymodel.h
+
+SOURCES +=  nmcnthistorystub.cpp
+SOURCES +=  ../../../src/nmcontacthistorymodel.cpp
+SOURCES +=  unittest_nmcontacthistorymodel.cpp
+
+symbian*: { 
+    TARGET.CAPABILITY = CAP_APPLICATION
+    EPOCALLOWDLLDATA = 1
+    MMP_RULES += "USERINCLUDE ."
+}
\ No newline at end of file
--- a/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/emailmru_stub.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/emailmru_stub.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -6,6 +6,7 @@
 extern bool getEntryCalled;
 extern bool nameOrderCalled;
 extern bool fillMruWithFalseValues;
+extern bool returnFalseFromGetEntry;
 
 EmailMRU::EmailMRU()
 {
@@ -87,6 +88,11 @@
         }
     }
 
+    if (returnFalseFromGetEntry) 
+    {
+        success = false;
+    }
+
     return success;
 }
 
--- a/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/unittest_nmcontacthistorymodel_p.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/unittest_nmcontacthistorymodel_p.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -41,6 +41,8 @@
 bool fillMruWithFalseValues;
 bool returnZeroEmails;
 
+bool returnFalseFromGetEntry;
+
 // -----------------------------------------------------------------------------
 // initTestCase
 // -----------------------------------------------------------------------------
@@ -72,6 +74,8 @@
     fillMruWithFalseValues = false;
     returnZeroEmails = false;
 
+    returnFalseFromGetEntry = false;
+    
     mTestObject = 0;
     mSignalEmitted = false;
     mTestObject = new NmContactHistoryModelPrivate(EmailAddressModel);
@@ -158,6 +162,12 @@
     QVERIFY( rValue );
     rValue = mTestObject->mMruMatches.contains("camel.case");
     QVERIFY(mTestObject->mMruMatches.count() == 1);
+    
+    mTestObject->mType = PhoneNumberModel;
+    rValue = mTestObject->queryMruDatabase("");
+    
+    QVERIFY( rValue == false );
+    mTestObject->mType = EmailAddressModel;
 }
 
 void TestNmContactHistoryModelPrivate::test_queryContactDatabase() // Ready.
@@ -237,6 +247,16 @@
 
     QVERIFY( markup2Start == 6 );
     QVERIFY( markup2Stop == 9 );
+
+    mTestObject->mMruMatches.clear();
+    mTestObject->mPrivateItemList.clear();
+    mTestObject->mMruMatches.insert("Name","name@test.com");   
+    mTestObject->mMruMatches.insert("Tset Eman","eman@tset.com");
+    
+    mTestObject->populateListWithMruItems("Name");
+
+    mTestObject->mPrivateItemList.clear();    
+    mTestObject->populateListWithMruItems("Name");    
 }
 
 void TestNmContactHistoryModelPrivate::test_populateListWithContactItems() // Ready
@@ -302,7 +322,7 @@
 void TestNmContactHistoryModelPrivate::test_queryDatabases() // Ready
 {
     mSignalEmitted = false;
-    QObject::connect(mTestObject, SIGNAL(queryCompleted(int)), this, SLOT(handleQueryCompleted(int)));
+    QObject::connect(mTestObject, SIGNAL(queryCompleted(int)), this, SLOT(test_handleQueryCompleted(int)));
 
     mTestObject->queryDatabases("Agent");
 
@@ -321,9 +341,11 @@
     QVERIFY( setMatchFlagsCalled );
     QVERIFY( setValueCalled );
     QVERIFY( ContactIdsCalled );
+    
+    mTestObject->queryDatabases("Agent Orange");    
 }
 
-void TestNmContactHistoryModelPrivate::refreshDataModel() // Ready
+void TestNmContactHistoryModelPrivate::test_refreshDataModel() // Ready
 {
     mTestObject->mPrivateItemList.clear();
 
@@ -362,7 +384,6 @@
     QSharedPointer<NmContactHistoryModelItemData> testData1
     (mTestObject->mPrivateItemList[0]);
 
-//    NmContactHistoryModelItem testData1 = mTestObject->mPrivateItemList[0];
     NmContactHistoryModelItem testData2 = mTestObject->mModelItemList[0];
 
     QVERIFY(testData1->mContactId == testData2.contactId());
@@ -375,6 +396,34 @@
     QVERIFY( testItem2.mItemText == itemSubItem2.mItemText );
 
     QVERIFY( testItem1.mMatchingRanges.count() == 2 );
+    
+    // Test NmContactHistoryModelItem untested functions here.
+    NmContactHistoryModelItem modelItem;
+    NmContactHistoryModelSubItem subItem1;
+    NmContactHistoryModelSubItem subItem2;
+    
+    subItem1.mItemText = "Test Object";
+    subItem2.mItemText = "test.object@cplusplus.com";    
+
+    modelItem.appendSubItem(subItem1);
+    modelItem.appendSubItem(subItem2);
+    
+    NmContactHistoryModelSubItem testItem3 = modelItem.subItemAt(0xBEEF);
+    QVERIFY( testItem3.mItemText.isEmpty() );
+    QVERIFY( testItem3.mMatchingRanges.count() == 0 );
+
+    testItem3 = modelItem.subItemAt(0);
+    QVERIFY( testItem3.mItemText == "Test Object" );
+
+    QList<NmContactHistoryModelSubItem> testItems;
+    testItems = modelItem.subEntries();
+    
+    QVERIFY( testItems.count() == 2 );    
+    testItems.clear();
+    
+    NmContactHistoryModelItem modelItem2;    
+    testItems = modelItem2.subEntries();
+    QVERIFY( testItems.count() == 0 );
 }
 
 void TestNmContactHistoryModelPrivate::test_rowCount() // Ready
@@ -385,19 +434,46 @@
     item.setContactId(0);
     mTestObject->mModelItemList.append(item);
 
-    QVERIFY(mTestObject->mModelItemList.count() == 1);
+    QModelIndex testIndex = QModelIndex();
+    int rowCount = mTestObject->modelRowCount(testIndex);
+    QVERIFY(rowCount == 1);
 
     mTestObject->mModelItemList.clear();
+    rowCount = mTestObject->modelRowCount(testIndex);
     QVERIFY(mTestObject->mModelItemList.count() == 0);
 
 }
 
-void TestNmContactHistoryModelPrivate::test_data() // Ready
+void TestNmContactHistoryModelPrivate::test_privateDataCount() // Ready
+{
+    mTestObject->mPrivateItemList.clear();
+    QVERIFY(mTestObject->mPrivateItemList.count() == 0);
+    int rowCount = mTestObject->privateDataCount();
+
+
+    QList<QContactLocalId> cnt_ids;
+    cnt_ids.append(12);
+
+    // Match in first name.
+    mTestObject->populateListWithContactItems(cnt_ids, "First");
+    QVERIFY( mTestObject->mPrivateItemList.count() == 1 );
+    rowCount = mTestObject->privateDataCount();
+    QVERIFY(rowCount == 1);  
+}
+
+
+void TestNmContactHistoryModelPrivate::test_dataFunc() // Ready
 {
     QModelIndex testIndex = QModelIndex();
+      
+    mTestObject->mModelReady = false;
     QVariant testVariant = mTestObject->data(testIndex, Qt::DisplayRole);
     QCOMPARE(testVariant, QVariant());
 
+    mTestObject->mModelReady = true;
+    testVariant = mTestObject->data(testIndex, Qt::DisplayRole);
+    QCOMPARE(testVariant, QVariant());
+
     for (int i = 0; i < 10; i++)
     {
         NmContactHistoryModelItem item;
@@ -408,7 +484,7 @@
     mTestObject->mModelItemList.clear();
 }
 
-void TestNmContactHistoryModelPrivate::fillMruMatchList() // Ready
+void TestNmContactHistoryModelPrivate::test_fillMruMatchList() // Ready
 {
     mTestObject->mMruList.clear();
     bool success = mTestObject->fillMruMatchList();
@@ -428,9 +504,16 @@
 
     containsValue = mTestObject->mMruList.contains("byvalue@plusplus.com");
     QVERIFY( containsValue );
+    
+    mTestObject->mMruList.clear();
+    returnFalseFromGetEntry = true;   
+    success = mTestObject->fillMruMatchList();
+    
+    QVERIFY( success );
+    QVERIFY(mTestObject->mMruList.count() == 0); 
 }
 
-void TestNmContactHistoryModelPrivate::obeyContactOrder() // Ready
+void TestNmContactHistoryModelPrivate::test_obeyContactOrder() // Ready
 {
     QString first = "Test";
     QString last = "Name";
@@ -461,12 +544,12 @@
 void TestNmContactHistoryModelPrivate::test_queryCompleted() // Ready
 {
     mSignalEmitted = false;
-    QObject::connect(mTestObject, SIGNAL(queryCompleted(int)), this, SLOT(handleQueryCompleted(int)));
+    QObject::connect(mTestObject, SIGNAL(queryCompleted(int)), this, SLOT(test_handleQueryCompleted(int)));
     mTestObject->queryDatabases(QString());
     QVERIFY( mSignalEmitted );
 }
 
-void TestNmContactHistoryModelPrivate::handleQueryCompleted(int err) // Internal
+void TestNmContactHistoryModelPrivate::test_handleQueryCompleted(int err) // Internal
 {
    Q_UNUSED(err);
    mSignalEmitted = true;
--- a/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/unittest_nmcontacthistorymodel_p.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/unittest_nmcontacthistorymodel_p.h	Thu Sep 30 11:43:07 2010 +0300
@@ -61,16 +61,17 @@
     void test_populateListWithMruItems();
 
     void test_rowCount();
-    void test_data();
+    void test_privateDataCount();
+    void test_dataFunc();
 
-    void refreshDataModel();
-    void fillMruMatchList();
-    void obeyContactOrder();
+    void test_refreshDataModel();
+    void test_fillMruMatchList();
+    void test_obeyContactOrder();
 
     void test_queryDatabases();
 
     void test_queryCompleted();
-    void handleQueryCompleted(int err);
+    void test_handleQueryCompleted(int err);
 
 private:
 
--- a/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/unittest_nmcontacthistorymodel_p.pro	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailservices/nmutilities/tsrc/unittests/unittest_nmcontacthistorymodel_p/unittest_nmcontacthistorymodel_p.pro	Thu Sep 30 11:43:07 2010 +0300
@@ -15,40 +15,36 @@
 #
 
 TEMPLATE = app
-TARGET = 
-DEPENDPATH += . 
+TARGET = unittest_nmcontacthistorymodel_p
+
+DEPENDPATH += . \
+              $$MW_LAYER_SYSTEMINCLUDE \
+              x:/epoc32/include/platform/mw
               
 INCLUDEPATH += . \
-         ../../../../../email_plat/contact_history_model_api/inc \
+               ../../../../../email_plat/contact_history_model_api/inc \
+               ../../../../../inc \
                /epoc32/include/mw/QtTest \
-         $$MW_LAYER_SYSTEMINCLUDE 
+               $$MW_LAYER_SYSTEMINCLUDE \
+               /epoc32/include/platform/mw
 
 QT += core
 
-CONFIG += qtestlib
-CONFIG += symbian_test 
+CONFIG += qtestlib 
+CONFIG += symbian_test
 
 # Input
 HEADERS += qtcontacts.h 
-#HEADERS += ../../../../../email_plat/contact_history_model_api/inc/nmcontacthistorymodel.h 
-#HEADERS += /inc/nmcontacthistorymodel.h 
-#HEADERS += nmcontacthistorymodel.h
 HEADERS += ../../../inc/nmcontacthistorymodel_p.h
-#HEADERS += nmcontacthistorymodelcommon.h 
-#HEADERS += nmcontacthistorymodel_p.h
 HEADERS += unittest_nmcontacthistorymodel_p.h         
 
 SOURCES += ../../../src/nmcontacthistorymodelitem.cpp 
 SOURCES += ../../../src/nmcontacthistorymodel_p.cpp 
-
-#SOURCES += ../../../src/nmcontacthistorymodel.cpp 
 SOURCES += emailmru_stub.cpp
 SOURCES += unittest_nmcontacthistorymodel_p.cpp 
 
 
-symbian: { 
+symbian*: { 
     TARGET.CAPABILITY = CAP_APPLICATION
     EPOCALLOWDLLDATA = 1
-    TARGET.EPOCHEAPSIZE = 0x20000 0x1600000
-    TARGET.UID3 = 0x20000A06
 }
--- a/emailuis/nmailui/conf/nmeditorview.docml	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/conf/nmeditorview.docml	Thu Sep 30 11:43:07 2010 +0300
@@ -5,13 +5,16 @@
             <widget name="scrollArea" type="NmBaseViewScrollArea">
                 <widget name="scrollAreaContents" role="HbScrollArea:contents" type="HbWidget">
                     <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 name="editorToEdit" type="NmRecipientLineEdit">
+                            <widget name="editorToLabel" type="HbLabel">
+                                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                <sizehint height="7.5un" type="FIXED" width="12.5un"/>
+                                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                                <enums name="elideMode" value="ElideNone"/>
+                                <string locid="txt_mail_editor_to" name="plainText"/>
+                                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+                            </widget>
                         </widget>
-                        <widget name="editorToEdit" 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"/>
@@ -20,19 +23,21 @@
                         <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 name="editorCcEdit" type="NmRecipientLineEdit">
+                            <widget name="editorCcLabel" type="HbLabel">
+                                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                <sizehint height="7.5un" type="FIXED" width="12.5un"/>
+                                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                                <enums name="elideMode" value="ElideNone"/>
+                                <string locid="txt_mail_editor_cc" name="plainText"/>
+                                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+                            </widget>
                         </widget>
-                        <widget name="editorCcEdit" 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"/>
@@ -41,19 +46,21 @@
                         <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 name="editorBccEdit" type="NmRecipientLineEdit">
+                            <widget name="editorBccLabel" type="HbLabel">
+                                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                <sizehint height="7.5un" type="FIXED" width="12.5un"/>
+                                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                                <enums name="elideMode" value="ElideNone"/>
+                                <string locid="txt_mail_editor_bcc" name="plainText"/>
+                                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+                            </widget>
                         </widget>
-                        <widget name="editorBccEdit" 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"/>
@@ -62,19 +69,21 @@
                         <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 name="editorSubjectEdit" type="NmHtmlLineEdit">
+                            <widget name="editorSubjectLabel" type="HbLabel">
+                                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                                <sizehint height="7.5un" type="FIXED" width="12.5un"/>
+                                <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+                                <enums name="elideMode" value="ElideNone"/>
+                                <string locid="txt_mail_editor_subject" name="plainText"/>
+                                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+                            </widget>
                         </widget>
-                        <widget name="editorSubjectEdit" type="NmHtmlLineEdit"/>
                         <widget name="editPriorityIcon" type="HbLabel">
                             <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
                             <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
@@ -89,7 +98,6 @@
                         <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"/>
--- a/emailuis/nmailui/inc/nmeditorcontent.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/inc/nmeditorcontent.h	Thu Sep 30 11:43:07 2010 +0300
@@ -52,6 +52,9 @@
 
     NmEditorHeader* header() const;
     
+public:
+    bool eventFilter(QObject *obj, QEvent *event);
+
 private:
     void createConnections();
     void removeEmbeddedImages(QString &bodyContent);
@@ -59,6 +62,7 @@
     void createDivisionFromHead(QString &bodyContent);
     void convertBodyToDiv(QString &bodyContent, const QString &replacementString);
     void convertBGColorToStyle(QString &bodyContent);
+    
 
 signals:
     void setPlainText(const QString&);
--- a/emailuis/nmailui/inc/nmeditorheader.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/inc/nmeditorheader.h	Thu Sep 30 11:43:07 2010 +0300
@@ -61,6 +61,7 @@
 private:
     void loadWidgets();
     void createConnections();
+    void adjustIndentForEditFields();
 
 signals:
     void headerHeightChanged(int);
@@ -74,6 +75,7 @@
     void editorContentChanged();
     void attachmentActivated(int arrayIndex);
     void attachmentLongPressed(int arrayIndex, QPointF point);
+    void toFieldLayoutReady();
 
 private:
     NmApplication &mApplication;
@@ -98,6 +100,7 @@
     HbWidget *mBccWidget;          // Not owned
     HbWidget *mSubjectWidget;      // Not owned
     QGraphicsLinearLayout *mSubjectLayout; // Not owned
+    HbLabel *mSubjectLabel;        // Not owned
     bool mCcBccFieldVisible;
 };
 
--- a/emailuis/nmailui/inc/nmeditorview.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/inc/nmeditorview.h	Thu Sep 30 11:43:07 2010 +0300
@@ -135,7 +135,6 @@
     NmEditorHeader *mHeaderWidget;      // Not owned
     NmMessage *mMessage;                // Owned
     NmEditorContent *mContent;          // Not owned
-    HbMenu *mPrioritySubMenu;           // Owned
     HbMenu *mAttachmentListContextMenu; // Owned
     NmId mSelectedAttachment;
     HbVkbHost *mVkbHost;                // Not owned
@@ -149,6 +148,7 @@
     QPointer<HbProgressDialog> mServiceSendingDialog; // Owned.
     HbListWidget *mTBExtnContentWidget;		// Owned
     QString mHiddenPriorityName;
+    QList<QString> mTempFiles;
 };
 
 
--- a/emailuis/nmailui/inc/nmmessagelistview.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/inc/nmmessagelistview.h	Thu Sep 30 11:43:07 2010 +0300
@@ -32,6 +32,7 @@
 class NmMessageListModel;
 class NmMailboxListModel;
 class HbAbstractViewItem;
+class NmAction;
 class NmActionResponse;
 class NmMessageListModelItem;
 class HbIconItem;
@@ -81,6 +82,7 @@
     void createToolBar();
     void setFolderName();
     void updateSyncIcon();
+    bool eventFilter(QObject *obj, QEvent *event);
 
 private:
     NmApplication &mApplication;
@@ -102,6 +104,7 @@
     NmId mSelectedMailboxId;
     int mPreviousModelCount;
     bool mIsFirstSyncInMessageList;
+    QList<NmAction*> mOptionsMenulist;
 };
 
 #endif /* NMMESSAGELISTVIEW_H_ */
--- a/emailuis/nmailui/inc/nmrecipientfield.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/inc/nmrecipientfield.h	Thu Sep 30 11:43:07 2010 +0300
@@ -26,6 +26,7 @@
 class HbPushButton;
 class HbIconItem;
 class HbDocumentLoader;
+class XQAiwRequest;
 
 class NmRecipientField : public QObject
 {
@@ -45,11 +46,13 @@
 
 public:
     NmRecipientLineEdit *editor() const;
+    HbLabel *label() const;
     const QString text() const;
 
 public slots:
     void setText(const QString &text);
     void launchContactsPicker();
+    void requestCompleted();
 
 private:
     HbDocumentLoader &mDocumentLoader;
@@ -58,6 +61,7 @@
     HbLabel *mLabel; // Not owned
     NmRecipientLineEdit *mRecipientsEditor; // Not owned
     HbPushButton *mLaunchContactsPickerButton; // Not owned
+    XQAiwRequest *mAiwRequest;
 };
 
 #endif   // NMRECIPIENTFIELD_H_
--- a/emailuis/nmailui/inc/nmuiheaders.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/inc/nmuiheaders.h	Thu Sep 30 11:43:07 2010 +0300
@@ -45,6 +45,8 @@
 #include <QTapGesture>
 #include <QPinchGesture>
 #include <QInputContext>
+#include <QFont>
+#include <QFontMetrics>
 
 // Orbit
 #include <hbmainwindow.h>
@@ -119,6 +121,7 @@
 
 // emailservices/nmutilities
 #include <nmuieventsnotifier.h>
+#include <nmuriparser.h>
 
 // nmailuiengine
 #include <nmuiengine.h>
--- a/emailuis/nmailui/inc/nmutilities.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/inc/nmutilities.h	Thu Sep 30 11:43:07 2010 +0300
@@ -23,8 +23,10 @@
 class NmMessage;
 class NmMessageEnvelope;
 class NmAddress;
+class NmMessagePart;
 class XQSharableFile;
 class HbMessageBox;
+class QStringList;
 
 /*!
 	UI utilities class
@@ -45,7 +47,11 @@
     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, QObject* listener = 0); 
+    static int openAttachment(NmMessagePart *part,
+                              QList<QString> &tmpFiles,
+                              QObject* listener = 0);
+    static void deleteTempFiles(QList<QString> &tmpFiles);
     static QString truncate( const QString &string, int length );
     static QString attachmentSizeString(const int sizeInBytes);
     static void displayErrorNote(QString noteText); 
@@ -58,6 +64,7 @@
                                             const char *member = 0);
     static QString createReplyHeader(const NmMessageEnvelope &env);
     static NmAddress *qstringToNmAddress(QString str);
+    static QList<NmAddress*> *qstringListToNmAddressList(const QStringList &strlist);
 };
 
 #endif /* NMUTILITIES_H_ */
--- a/emailuis/nmailui/inc/nmviewerserviceinterface.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/inc/nmviewerserviceinterface.h	Thu Sep 30 11:43:07 2010 +0300
@@ -44,11 +44,6 @@
 
 public slots:
 
-    /*!
-        Depricated!
-    */
-    void viewMessage(QVariant mailboxId, QVariant folderId, QVariant messageId);
-
     void viewMessage(QVariant idList, QVariant flags);
 
 
--- a/emailuis/nmailui/inc/nmviewerview.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/inc/nmviewerview.h	Thu Sep 30 11:43:07 2010 +0300
@@ -19,6 +19,7 @@
 #define NMVIEWERVIEW_H_
 
 #include <QPointer>
+#include <XQSharableFile.h>
 
 #include "nmbaseview.h"
 #include "nmactionobserver.h"
@@ -77,6 +78,9 @@
     void fetchMessage();
     void openAttachment(int index);
 	void createOptionsMenu();
+	void fileOpenCompleted(const QVariant&);
+	void fileOpenError(int, const QString&);
+	
 
 private slots:
     void setMessageData();
@@ -139,6 +143,9 @@
     bool mViewReady;
     bool mWaitNoteCancelled;
     HbMessageBox *mErrorNote;                       // Owned
+    QList<QString> mTempFiles;
+    bool mAttachmentOpen;
+    XQSharableFile mOpenedAttachment;
 };
 
 #endif /* NMVIEWERVIEW_H_ */
--- a/emailuis/nmailui/src/nmapplication.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmapplication.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -562,6 +562,9 @@
         // view if started as service to editor view (ShareUI).
         if (mActiveViewId == startParam->viewId() &&
         	(!startParam->service() || mActiveViewId!=NmUiViewMessageEditor)) {
+            
+            //startParam pointer is tested before usage below
+            //coverity[deref_arg]
             mViewStack->top()->reloadViewContents(startParam);
         }
         else {
--- a/emailuis/nmailui/src/nmeditorcontent.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmeditorcontent.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -77,6 +77,8 @@
     // pointer of the QTextDocument which the smiley engine has is NULL and
     // inserting a smiley will lead to an error.
     mEditorWidget->setPlainText("");
+    
+    QCoreApplication::instance()->installEventFilter(this); // see eventFilter()
 }
 
 /*!
@@ -85,6 +87,8 @@
 NmEditorContent::~NmEditorContent()
 {
     NM_FUNCTION;
+
+    QCoreApplication::instance()->removeEventFilter(this); // see eventFilter()
 }
 
 /*!
@@ -110,8 +114,8 @@
     
     // Create the "reply" header (also for forward message)
 	// sets the font color of the reply header and the original body text to black
-    if ((editorStartMode==NmUiEditorReply || editorStartMode==NmUiEditorReplyAll || 
-        editorStartMode==NmUiEditorForward) && originalMessage) {
+    if ((editorStartMode == NmUiEditorReply || editorStartMode == NmUiEditorReplyAll || 
+        editorStartMode == NmUiEditorForward) && originalMessage) {
 		bodyContent.append(QString("<style type=\"text/css\">* { color: black; }</style>"));
         bodyContent.append(NmUtilities::createReplyHeader(originalMessage->envelope()));
     }
@@ -126,17 +130,15 @@
  
     if (htmlPart) {
         QString bodyText(htmlPart->textContent());
-        if (editorStartMode==NmUiEditorReply || editorStartMode==NmUiEditorReplyAll || 
-                editorStartMode==NmUiEditorForward) {
+        if (editorStartMode == NmUiEditorReply || editorStartMode == NmUiEditorReplyAll || 
+                editorStartMode == NmUiEditorForward) {
             convertBodyStylesToDivision(bodyText);
         }
         
-        if(editorStartMode==NmUiEditorReply || editorStartMode==NmUiEditorReplyAll ) {
+        if(editorStartMode == NmUiEditorReply || editorStartMode == NmUiEditorReplyAll ) {
             removeEmbeddedImages(bodyText);
         }
-        
         bodyContent.append(bodyText);
-        cursor.insertHtml(bodyContent);
     }
     else if (plainPart) {
         // Plain text part was present, set it to HbTextEdit as HTML
@@ -151,6 +153,8 @@
 	cursor.clearSelection();
 	cursor.setPosition(0);
 	cursor.insertHtml(QString("<html><body></body></html>"));
+	mEditorWidget->moveCursor(QTextCursor::Start, QTextCursor::MoveAnchor);
+	QMetaObject::invokeMethod(this, "ensureCursorVisibility", Qt::QueuedConnection);
 }  
 
 /*!
@@ -176,18 +180,6 @@
     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);
@@ -276,7 +268,8 @@
 
 /*!
     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.
+    adjusted so that the cursor can be seen. For defining exatcly what area is ensured the 
+    same algorithm that HbAbstractEditPrivate::ensurePositionVisible() uses is used here. 
 */
 void NmEditorContent::ensureCursorVisibility()
 {
@@ -309,17 +302,8 @@
 
     // ensure that the cursor position is visible
     if (focused && !localRect.isEmpty()) {
-        QPointF topLeftPos = focused->mapToItem(mScrollAreaContents, localRect.topLeft());
-        QPointF bottomRightPos =
-            focused->mapToItem(mScrollAreaContents, localRect.bottomRight());
-        qreal marginRight = 0;
-        if (mScrollArea->style()) {
-            mScrollArea->style()->parameter("hb-param-margin-gene-right", marginRight);
-        }
-        bottomRightPos.rx() += marginRight;
-
-        mScrollArea->ensureVisible(topLeftPos);
-        mScrollArea->ensureVisible(bottomRightPos);
+        QRectF rect = focused->mapRectToItem(mScrollAreaContents, localRect);
+        mScrollArea->ensureVisible(rect.center(), rect.width(), rect.height() / 2 );
     }
 }
 /*!
@@ -352,7 +336,14 @@
     // Create translation object for header position adjustment.
     QRectF editorBodyRect = mEditorWidget->geometry();
     QTransform tr;
-    qreal leftMovementThreshold(editorBodyRect.width() - headerWidth);
+
+    qreal bodyWidth = editorBodyRect.width();
+    if ( bodyWidth < mApplication.screenSize().width() ) {
+    	    bodyWidth = mApplication.screenSize().width();
+    }
+
+    qreal leftMovementThreshold( bodyWidth - headerWidth);
+
     if (scrollPosition.x() < 0) {
         // Left side positioning. Allow left side baunch effect.
         tr.translate(editorBodyRect.topLeft().x() - margin ,0);
@@ -434,12 +425,12 @@
     
     QString bodyStartReplacement("<body>\n<div");
     
-    if(bodyContent.contains(bodyStyleDefinedRegExp)) {
+    if (bodyContent.contains(bodyStyleDefinedRegExp)) {
         QString headPartString = bodyStyleDefinedRegExp.cap(0);
         QString headBodyStyleString("body(\\s)*");
         QRegExp bodyStyleReplacementRegExp(headBodyStyleString, Qt::CaseInsensitive);
         
-        if(headPartString.contains(bodyStyleReplacementRegExp)) {
+        if (headPartString.contains(bodyStyleReplacementRegExp)) {
             headPartString.replace(bodyStyleReplacementRegExp, "div.reply ");
             bodyContent.replace(bodyStyleDefinedRegExp, headPartString);
             
@@ -465,9 +456,6 @@
  *  This is the body text.
  *  </div>
  *  </body>
- *  
- *  TODO: Tämä tapahtuu toistaiseksi riippumatta siitä onko bodyssa style-määrittelyä.
- *  TODO: Entä jos dokumentissa on määritelty useampi <body>? 
  */
 void NmEditorContent::convertBodyToDiv(QString &bodyContent, const QString &replacementString)
 {
@@ -497,10 +485,18 @@
 {
     NM_FUNCTION;
     
-    QString bgColorInBodyFetchString("<body[^<]+(bgcolor(\\s|)=(\\s|)(\"|)(#|))*>");
+    QString bgColorInBodyFetchString("<body"
+        "[^<]+"             // 1...* any character except '<'
+        "(bgcolor"
+        "(\\s|)"            // White space or nothing
+        "="
+        "(\\s|)"            // White space or nothing
+        "(\"|)"             // '"' or nothing
+        "(#|))"             // '#' or nothing
+        "*>");              // 0...* Any character + >
     QRegExp bgColorInBodyRegExp(bgColorInBodyFetchString, Qt::CaseInsensitive);
     
-    if(bodyContent.contains(bgColorInBodyRegExp)) {
+    if (bodyContent.contains(bgColorInBodyRegExp)) {
         // There can be only one meaningful bgcolor, the first one.
         QString bgColorString = bgColorInBodyRegExp.cap(0);
         
@@ -516,6 +512,7 @@
             "(\"|)"         // '"' or nothing
             "(#|)",         // '#' or nothing
             Qt::CaseInsensitive);
+        
         colorCode.remove(removeBeginningRegExp);
         
         QRegExp removeEndRegExp(""
@@ -523,9 +520,16 @@
             "([^<]*)"       // 0...* any characters except '<'
             ">)"            // '>'           
             "|>");          // ... or nothing before this, just '>'
+        
         colorCode.remove(removeEndRegExp);
         
-        QString plainBgColorFetchString("bgcolor(\\s|)*=(\\s|)*[^\\s]+(\\s|(?=>))");
+        QString plainBgColorFetchString("bgcolor"
+            "(\\s|)*"       // 0...* White space or nothing
+            "="             
+            "(\\s|)*"       // 0...* White space or nothing
+            "[^\\s]+"       // 1...* any character except white space
+            "(\\s|(?=>))"); // White space or follower by '>'
+        
         QString bgColorReplacement("style=\"background: #"+colorCode+"\" ");
         QRegExp plainBgColorFetchRegExp(plainBgColorFetchString, Qt::CaseInsensitive);
         
@@ -536,3 +540,22 @@
         bodyContent.replace(bgColorInBodyRegExp, bgColorString);
     }    
 }
+
+/*!
+ *  Listen to the input method events (eg. cursor position changes, preedit text changes etc.) and 
+ *  invoke ensureCursorVisibility. Qt FW does not automatically ensure the visiblity of a text in a
+ *  edit widget in our custom scroll area. Filtering events is the only way to get events of the
+ *  preedit text changes.
+ */
+bool NmEditorContent::eventFilter(QObject *obj, QEvent *event)
+{
+    // let the FW handle the event first
+    bool ret = QObject::eventFilter(obj, event);
+    
+    if (event && event->type() == QEvent::InputMethod) {
+        QMetaObject::invokeMethod(this, "ensureCursorVisibility", Qt::QueuedConnection);
+    }
+    
+    return ret;
+}
+
--- a/emailuis/nmailui/src/nmeditorheader.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmeditorheader.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -22,6 +22,7 @@
 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_SUBJECT_LABEL = "editorSubjectLabel";
 static const char *NMUI_EDITOR_TO_FIELD = "editorToField";
 static const char *NMUI_EDITOR_CC_FIELD = "editorCcField";
 static const char *NMUI_EDITOR_BCC_FIELD = "editorBccField";
@@ -87,6 +88,9 @@
         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);
+        // Connection for adjusting recipient field labels. Connection done earlier than other connections
+        // so that we don't miss signal.
+        connect(mToField->editor(), SIGNAL(layoutChanged ()), this, SLOT(toFieldLayoutReady()));
     
         // Sets up editor properties like no prediction, lower case preferred etc.
         HbEditorInterface toEditorInterface(mToField->editor());
@@ -111,6 +115,8 @@
         mSubjectWidget =
             qobject_cast<HbWidget *>(mDocumentLoader->findWidget(NMUI_EDITOR_SUBJECT_FIELD));
         mSubjectLayout = static_cast<QGraphicsLinearLayout *>(mSubjectWidget->layout());
+        mSubjectLabel =
+            qobject_cast<HbLabel *>(mDocumentLoader->findWidget(NMUI_EDITOR_SUBJECT_LABEL));
           
         // Add Subject: field
         mSubjectEdit = qobject_cast<NmHtmlLineEdit *>
@@ -505,3 +511,77 @@
     mAttachmentListWidget->setTransform(transform);
 }
 
+/*!
+   This slot will set the geometry, margin and font for the To,Cc,Bcc and Subject
+   labels located inside the edit fields. These adjustments are done to fix label text
+   position so that it is in same lavel than first line of the edit widget.
+   Slot is called once when 'To' field layout is ready after editor startup.
+   Because all fields are similar it is enough to use only 'To' field information
+   to adjust all header fields.
+*/
+void NmEditorHeader::toFieldLayoutReady()
+{
+    NM_FUNCTION;
+    
+    // Set same font for label and edit.
+    QFont editorFont = mToField->editor()->font();
+    mToField->label()->setFont(editorFont);
+    mCcField->label()->setFont(editorFont);
+    mBccField->label()->setFont(editorFont);
+    mSubjectLabel->setFont(editorFont);
+
+    // Set same height for label and edit.
+    qreal editorWidgetHeight = mToField->editor()->geometry().height();
+    mToField->label()->setPreferredHeight(editorWidgetHeight);
+    mCcField->label()->setPreferredHeight(editorWidgetHeight);
+    mBccField->label()->setPreferredHeight(editorWidgetHeight);
+    mSubjectLabel->setPreferredHeight(editorWidgetHeight);
+    
+    // Set left margin for labels.
+    qreal leftMargin;
+    mToField->editor()->layout()->getContentsMargins(&leftMargin, 0, 0, 0);
+    mToField->label()->setContentsMargins(leftMargin, 0, 0, 0);
+    mCcField->label()->setContentsMargins(leftMargin, 0, 0, 0);
+    mBccField->label()->setContentsMargins(leftMargin, 0, 0, 0);
+    mSubjectLabel->setContentsMargins(leftMargin, 0, 0, 0);
+    
+    adjustIndentForEditFields();
+}
+
+/*!
+   Set the length of the label and the indention of the edit fields (To,Cc,Bcc,Subject) so
+   that there is enough space for the label field.
+*/
+void NmEditorHeader::adjustIndentForEditFields()
+{
+    NM_FUNCTION;
+
+    // Get spacing between label and edit.
+    qreal spacingBetweenLabelAndEdit = 0;
+    HbStyle().parameter("hb-param-margin-gene-middle-horizontal", spacingBetweenLabelAndEdit);
+    // Add more space for label right margin. Without this, last letter ':' of the label is not
+    // fit into field.
+    spacingBetweenLabelAndEdit *= 2;
+    
+    // Get font metrics (We assume that every label has same font).
+    QFontMetrics fm(mToField->label()->font());
+    
+    // Set length of the label widgets based on the string width.
+    // Also set indent for the first line of the edit widget.
+    qreal textWidth = 0;
+    textWidth = fm.width(mToField->label()->plainText()) + spacingBetweenLabelAndEdit;
+    mToField->label()->setPreferredWidth(textWidth);    
+    mToField->editor()->setIndentForLabel(textWidth);    
+    
+    textWidth = fm.width(mCcField->label()->plainText()) + spacingBetweenLabelAndEdit;
+    mCcField->label()->setPreferredWidth(textWidth);
+    mCcField->editor()->setIndentForLabel(textWidth);
+
+    textWidth = fm.width(mBccField->label()->plainText()) + spacingBetweenLabelAndEdit;
+    mBccField->label()->setPreferredWidth(textWidth);
+    mBccField->editor()->setIndentForLabel(textWidth);
+    
+    textWidth = fm.width(mSubjectLabel->plainText()) + spacingBetweenLabelAndEdit;
+    mSubjectLabel->setPreferredWidth(textWidth);
+    mSubjectEdit->setIndentForLabel(textWidth);
+}
--- a/emailuis/nmailui/src/nmeditorview.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmeditorview.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -89,6 +89,9 @@
 {
     NM_FUNCTION;
 
+    // Delete opened temporary files.
+    NmUtilities::deleteTempFiles(mTempFiles);
+    
     if (mRemoveAttachmentOperation && mRemoveAttachmentOperation->isRunning()) {
         mRemoveAttachmentOperation->cancelOperation();
     }
@@ -104,7 +107,6 @@
     delete mMessage;
     mWidgetList.clear();
     delete mDocumentLoader;
-    delete mPrioritySubMenu;
 
     if (mAttachmentListContextMenu) {
         mAttachmentListContextMenu->clearActions();
@@ -139,8 +141,6 @@
 {
     NM_FUNCTION;
     
-    mPrioritySubMenu = NULL;
-
     // Use the document loader to load the view.
     QObjectList objectList;
     objectList.append(this);
@@ -583,6 +583,30 @@
                 this,
                 SLOT(messageCreated(int)));
     }
+    
+    // Set focus
+    if (mContent && mContent->header() ) {
+        if (startMode == NmUiEditorCreateNew || XQServiceUtil::isEmbedded()) {
+            if (mContent->header()->toEdit()) {
+                mContent->header()->toEdit()->setFocus(Qt::OtherFocusReason);
+            }
+        }
+        else
+        {
+            if (mContent->editor()) {
+                mContent->editor()->setFocus(Qt::OtherFocusReason);
+            }
+        }
+    }
+
+    // Show VKB
+    QInputContext *ic = qApp->inputContext();
+
+    if(ic) {
+        QEvent *event = new QEvent(QEvent::RequestSoftwareInputPanel);
+        ic->filterEvent(event);
+        delete event;
+    }
 }
 
 /*!
@@ -751,34 +775,19 @@
         }
         if (mContent && mContent->header() ) {
             if (mContent->header()->subjectEdit()) {
-                mMessage->envelope().setSubject(
-                    mContent->header()->subjectEdit()->text());
+                mMessage->envelope().setSubject(mContent->header()->subjectEdit()->text());
             }
             if (mContent->header()->toEdit()) {
-                QString toFieldText =
-                    mContent->header()->toEdit()->text();
-
-                // This verification of zero length string isn't needed
-                // after list of addresses
-                if (toFieldText.length() > 0) {
-                    mMessage->envelope().setToRecipients(mContent->header()->toEdit()->emailAddressList());
-                }
+                mMessage->envelope().setToRecipients(
+                    mContent->header()->toEdit()->emailAddressList());
             }
             if (mContent->header()->ccEdit()) {
-                QString ccFieldText =
-                    mContent->header()->ccEdit()->text();
-
-                if (ccFieldText.length() > 0) {
-                    mMessage->envelope().setCcRecipients(mContent->header()->ccEdit()->emailAddressList());
-                }
+                mMessage->envelope().setCcRecipients(
+                    mContent->header()->ccEdit()->emailAddressList());
             }
             if (mContent->header()->bccEdit()) {
-                QString bccFieldText =
-                    mContent->header()->bccEdit()->text();
-
-                if (bccFieldText.length() > 0) {
-                    mMessage->envelope().setBccRecipients(mContent->header()->bccEdit()->emailAddressList());
-                }
+                mMessage->envelope().setBccRecipients(
+                    mContent->header()->bccEdit()->emailAddressList());
             }
         }
     }
@@ -1031,10 +1040,7 @@
     }
 
 	// Create Priority options menu object
-	if (!mPrioritySubMenu) {
-        mPrioritySubMenu = new HbMenu();
-    }
-    mPrioritySubMenu->clearActions();
+    HbMenu *prioritySubMenu = new HbMenu();
     NmActionRequest request(this, NmActionOptionsMenu, NmActionContextViewEditor,
             NmActionContextDataMessage, mStartParam->mailboxId(), mStartParam->folderId(),
             mStartParam->messageId());
@@ -1044,12 +1050,12 @@
     for (int i = 0; i < list.count(); i++) {
         // check what priority has already been selected and hide it from options menu
         if (!list[i]->objectName().contains(mHiddenPriorityName)) {
-            mPrioritySubMenu->addAction(list[i]);
+	        prioritySubMenu->addAction(list[i]);
         }
     }
-    mPrioritySubMenu->setObjectName("editorPrioritySubMenu");
-    mPrioritySubMenu->setTitle(hbTrId("txt_mail_opt_add_priority"));
-    menu()->addMenu(mPrioritySubMenu);
+    prioritySubMenu->setObjectName("editorPrioritySubMenu");
+    prioritySubMenu->setTitle(hbTrId("txt_mail_opt_add_priority"));
+    menu()->addMenu(prioritySubMenu);
 }
 
 /*!
@@ -1487,25 +1493,15 @@
     NM_FUNCTION;
 
     QString addressesString;
-    QList<NmAddress*>::const_iterator i = list.constBegin();
-
-    while (i != list.constEnd() && *i) {
-        // Prioritize display name. Add the delimiter in the end also if
-        // address list ends to display name.
-        if ((*i)->displayName().length() > 0) {
-            addressesString += (*i)->displayName();
-            addressesString += NmDelimiter;
+    foreach (NmAddress *nmAddress,list) {
+        if (nmAddress->displayName().length() > 0) {
+            addressesString += nmAddress->displayName();
         }
         else {
-            if (i > list.constBegin()) {
-                // Add the delimiter.
-                addressesString += NmDelimiter;
-            }
-            addressesString += (*i)->address();
+            addressesString += nmAddress->address();
         }
-        ++i;
+        addressesString += NmDelimiter;
     }
-
     return addressesString;
 }
 
@@ -1610,13 +1606,19 @@
     NmId folderId = mMessage->envelope().folderId();
     NmId msgId = mMessage->envelope().messageId();
 
-    XQSharableFile file = mUiEngine.messagePartFile(mailboxId, folderId,
-    		msgId, attachmentId);
-    int error = NmUtilities::openFile(file);
-    file.close();
-    if ( error == NmNotFoundError ) {
-        HbMessageBox *box = NmUtilities::displayWarningNote(hbTrId("txt_mail_dialog_unable_to_open_attachment_file_ty"));
-        box->setAttribute(Qt::WA_DeleteOnClose);
+    QList<NmMessagePart *> attachments;
+    mMessage->attachmentList(attachments);
+    foreach (NmMessagePart *part, attachments) {
+        if (part->partId() == attachmentId) {
+            // We need to fill the part before opening the attachment.
+            mUiEngine.contentToMessagePart(mailboxId,folderId,msgId, *part);
+            int error = NmUtilities::openAttachment(part,mTempFiles);
+            if ( error == NmGeneralError ) {
+                HbMessageBox *box = NmUtilities::displayWarningNote(hbTrId("txt_mail_dialog_unable_to_open_attachment_file_ty"));
+                box->setAttribute(Qt::WA_DeleteOnClose);
+            }
+            break;
+        }
     }
 }
 
--- a/emailuis/nmailui/src/nmmailboxserviceinterface.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmmailboxserviceinterface.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -67,7 +67,10 @@
     mAsyncReqId = setCurrentRequestAsync();
 
     // Make sure that app stays background if user presses back in message list view
-    bool visible = mApplication->updateVisibilityState();
+    bool visible = false;
+    if(mApplication){
+        visible = mApplication->updateVisibilityState();
+    }
 
     if (mailboxExistsById(mailboxNmId)) {
         // Fetch inbox id
@@ -122,7 +125,11 @@
 bool NmMailboxServiceInterface::mailboxExistsById(const NmId &mailboxId) const
 {
     NM_FUNCTION;
-
+    //model needs to be refreshed because in some cases, new mailbox
+    //has not been dynamically inserted into the model yet, 
+    //thus returning incorrect count.
+    mUiEngine.refreshMailboxListModel();
+    
     const NmMailboxListModel& mailboxListModel = mUiEngine.mailboxListModel();
     int mailboxCount = mailboxListModel.rowCount();
 
--- a/emailuis/nmailui/src/nmmessagelistview.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmmessagelistview.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -57,7 +57,7 @@
 mIsFirstSyncInMessageList(true)
 {
     NM_FUNCTION;
-
+    qApp->installEventFilter(this);  
     loadViewLayout();
     createToolBar();
     initTreeView();
@@ -74,6 +74,7 @@
 
     delete mDocumentLoader;
     mWidgetList.clear();
+    mOptionsMenulist.clear();
     if (mItemContextMenu){
         mItemContextMenu->clearActions();
     }
@@ -374,6 +375,8 @@
 void NmMessageListView::folderSelected()
 {
     NM_FUNCTION;
+    
+    NM_TIMESTAMP("NmMessageListView::folderSelected start ***");
 
     // Reload view contents with new startparams if mailbox or folder
     // id is different than current values.
@@ -394,6 +397,7 @@
         // Set folder text to status bar
         setFolderName();
     }
+    NM_TIMESTAMP("NmMessageListView::folderSelected end ***");      
 }
 
 
@@ -507,10 +511,10 @@
     NmActionRequest request(this, NmActionOptionsMenu, NmActionContextViewMessageList,
     		NmActionContextDataNone, mStartParam->mailboxId(), mStartParam->folderId() );
     NmUiExtensionManager &extMngr = mApplication.extManager();
-    QList<NmAction*> list;
-    extMngr.getActions(request, list);
-    for (int i=0;i<list.count();i++) {
-        menu()->addAction(list[i]);
+    mOptionsMenulist.clear();
+    extMngr.getActions(request, mOptionsMenulist);
+    for (int i=0;i<mOptionsMenulist.count();i++) {
+        menu()->addAction(mOptionsMenulist[i]);
     }
 }
 
@@ -801,3 +805,40 @@
     }
 }
 
+/*!
+    Handle application background event. 
+    In this case the menu has to be closed.
+*/
+bool NmMessageListView::eventFilter(QObject *obj,  QEvent *event)
+{
+    if (obj == qApp)
+    {
+        // Close menu if application is switched to background, e.g. deactivated
+        if (event && event->type() == QEvent::ApplicationDeactivate)
+        {
+            // Close options menu if it active
+            HbMenu *optionsMenu = menu();
+            if (optionsMenu && optionsMenu->isVisible()) {
+                // Close any submenus that might be open
+                for (int i=0 ; i<mOptionsMenulist.count() ; i++) {
+                    NmAction *menuItem = mOptionsMenulist[i];
+                    if (menuItem && menuItem->menu()) {
+                        menuItem->menu()->close();
+                    }
+                }
+                // Close options menu
+                optionsMenu->close();
+            }
+            else if (mItemContextMenu && mItemContextMenu->isVisible()) {
+                // Close and delete item contextmenu if open
+                mItemContextMenu->clearActions();
+                delete mItemContextMenu;
+                mItemContextMenu=NULL;
+            }
+        }
+    }
+    return mApplication.eventFilter(obj, event);
+}
+
+
+
--- a/emailuis/nmailui/src/nmmessagelistviewitem.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmmessagelistviewitem.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -246,7 +246,7 @@
  */
 void  NmMessageListViewItem::setFontsUnread()
 {
-    static QColor colorRole = HbColorScheme::color("qtc_list_item_title_normal");
+    QColor colorRole = HbColorScheme::color("qtc_list_item_title_normal");
     HbFontSpec fontSpec(HbFontSpec::Primary);
     setFonts(colorRole, fontSpec);
 }
@@ -256,7 +256,7 @@
  */
 void  NmMessageListViewItem::setFontsRead()
 {
-    static QColor colorRole = HbColorScheme::color("qtc_list_item_content_normal");
+    QColor colorRole = HbColorScheme::color("qtc_list_item_content_normal");
     HbFontSpec fontSpec(HbFontSpec::Secondary);
     setFonts(colorRole, fontSpec);
 }
--- a/emailuis/nmailui/src/nmrecipientfield.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmrecipientfield.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -33,7 +33,9 @@
     mObjectPrefix(objPrefix),
     mLabel(NULL),
     mRecipientsEditor(NULL),
-    mLaunchContactsPickerButton(NULL)
+    mLaunchContactsPickerButton(NULL),
+    mAiwRequest(NULL)
+    
 {
     NM_FUNCTION;
 
@@ -73,11 +75,9 @@
     connect(mRecipientsEditor, SIGNAL(editingFinished()),
         this, SIGNAL(editingFinished()));
     connect(mRecipientsEditor, SIGNAL(selectionChanged()),
-        this, SIGNAL(selectionChanged()));
+        this, SIGNAL(launchContactsPicker()));
     connect(mLaunchContactsPickerButton, SIGNAL(clicked()),
-        this, SIGNAL(launchContactsPickerButtonClicked()));
-    connect(mLaunchContactsPickerButton, SIGNAL(clicked()),
-        this, SLOT(launchContactsPicker()), Qt::QueuedConnection);
+        this, SLOT(launchContactsPicker()));
 }
 
 
@@ -87,6 +87,7 @@
 NmRecipientField::~NmRecipientField()
 {
     NM_FUNCTION;
+    delete mAiwRequest;
 }
 
 /*!
@@ -109,6 +110,15 @@
     return mRecipientsEditor;
 }
 
+/*!
+   Label widget
+*/
+HbLabel *NmRecipientField::label() const
+{
+    NM_FUNCTION;
+    
+    return mLabel;
+}
 
 /*!
    LineEdit contents
@@ -142,34 +152,46 @@
 {
     NM_FUNCTION;
 
-    XQApplicationManager mAppmgr;
-    XQAiwRequest *launchContactsPickerRequest;
-
-    bool isEmbeded = true;
-    launchContactsPickerRequest = mAppmgr.create(NmContactsServiceName, NmContactsInterfaceName,
-                                                 NmContactsOperationName, isEmbeded);
-
-    if (launchContactsPickerRequest) {
-        connect(launchContactsPickerRequest, SIGNAL(requestOk(QVariant)),
-                mRecipientsEditor, SLOT(addSelectedContacts(QVariant)));
-    }
-    else {
-        // Failed creating request
-        NM_ERROR(1,"XQApplicationManager: failed creating fecth contactspicker request");
-	    return;
+    if (!mAiwRequest) {
+        XQApplicationManager mAppmgr;
+        
+    
+        bool isEmbeded = true;
+        mAiwRequest = mAppmgr.create(NmContactsServiceName, NmContactsInterfaceName,
+                                                     NmContactsOperationName, isEmbeded);
+        
+        if (mAiwRequest) {
+            connect(mAiwRequest, SIGNAL(requestOk(QVariant)),
+                    mRecipientsEditor, SLOT(addSelectedContacts(QVariant)));
+            connect(mAiwRequest, SIGNAL(requestOk(QVariant)),
+                           this, SLOT(requestCompleted()));
+            connect(mAiwRequest, SIGNAL(requestError(int, QString &)),
+                           this, SLOT(requestCompleted()));
+            mAiwRequest->setSynchronous(false);
+        }
+        else {
+            // Failed creating request
+            NM_ERROR(1,"XQApplicationManager: failed creating fecth contactspicker request");
+            return;
+        }
+    
+        QVariantList args;
+        args << hbTrId("txt_mail_select_contacts");
+        args << KCntActionEmail;
+        mAiwRequest->setArguments(args);
+        
+        // Send request
+        if (!mAiwRequest->send()) {
+           //Failed sending request
+           NM_ERROR(1,"XQApplicationManager: failed sending request");
+        }
     }
-
-    QVariantList args;
-    args << hbTrId("txt_mail_select_contacts");
-    args << KCntActionEmail;
-    launchContactsPickerRequest->setArguments(args);
-
-    // Send request
-    if (!launchContactsPickerRequest->send()) {
-       //Failed sending request
-       NM_ERROR(1,"XQApplicationManager: failed sending request");
-    }
-
-    delete launchContactsPickerRequest;
-    launchContactsPickerRequest = NULL;
 }
+/*!
+   XQAiwRequest calls this if request is ok or an error happens.
+*/
+void NmRecipientField::requestCompleted()
+{
+    delete mAiwRequest;
+    mAiwRequest = NULL;
+}
--- a/emailuis/nmailui/src/nmuriserviceinterface.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmuriserviceinterface.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -20,148 +20,6 @@
 #include "nmuiheaders.h"
 
 /*!
-    \class NmStartParamDataHelper
-    \brief A helper class for processing the data given to the actual service.
-*/
-class NmStartParamDataHelper
-{
-public:
-
-    /*!
-        Class constructor.
-    */
-    inline NmStartParamDataHelper()
-    : mSubject(NULL),
-      mToAddresses(NULL),
-      mCcAddresses(NULL),
-      mBccAddresses(NULL),
-      mBodyText(NULL)
-    {
-        NM_FUNCTION;
-    }
-
-    /*!
-        Class destructor.
-    */
-    inline ~NmStartParamDataHelper()
-    {
-        NM_FUNCTION;
-    }
-
-    /*!
-        Extracts the data from the given QString into the class members.
-        \param data QString containing the data.
-        \return True if success, false otherwise.
-    */
-    inline bool extractData(const QString &data)
-    {
-        NM_FUNCTION;
-        
-        bool success(false);
-        
-        QUrl uri(data);
-        
-        if (uri.isValid()) {
-            
-            mSubject = new QString(uri.queryItemValue(emailSendSubjectKey));
-            QString to = uri.path();
-            QString cc = uri.queryItemValue(emailSendCcKey);
-            QString bcc = uri.queryItemValue(emailSendBccKey);
-			QString bodyText = uri.queryItemValue(emailSendBodyTextKey);
-			if (bodyText.length()) {
-			    mBodyText = new QString(bodyText);
-			}
-            
-            addAddressesToList(to, &mToAddresses);
-            addAddressesToList(cc, &mCcAddresses);
-            addAddressesToList(bcc, &mBccAddresses);
-            
-            success = true;
-        }
-        
-        return success;
-    }
-
-    /*!
-        Appends the given addresses into the given list.
-        \param address The addresses to append.
-        \param list The list where the addresses are appended to.
-    */
-    inline void addAddressesToList(QString &addresses,
-                                   QList<NmAddress*> **list)
-    {
-        NM_FUNCTION;
-        
-        if (!addresses.isEmpty()) {
-
-            QList<NmAddress*> foundAddresses;
-                    
-            // Process multiple addresses.
-            if (addresses.contains(",")) {
-                QString str;               
-                while (addresses.contains(",")) {
-                    str = addresses.section(",", 0, 0); // Get the occurance.
-                    addresses.remove(0, (addresses.indexOf(",")+1)); // Remove the occurance.
-                    if (!str.isEmpty()) { // In case str would be empty on some error data. 
-                        NmAddress *address = new NmAddress(str);
-                        foundAddresses.append(address);    
-                    }
-                }
-            }
-            if (!addresses.isEmpty()) { // In case addresses would be empty on some error data. 
-                // Last one or single address.
-                NmAddress *address = new NmAddress(addresses);
-                foundAddresses.append(address);
-            }
-            // Append the found addresses into the given list.
-            *list = new QList<NmAddress*>();
-            (*list)->append(foundAddresses);
-        }
-    }
-        
-    /*!
-        Deletes the class members. Must be used if NmUiStartParam does not
-        take ownership of the members.
-    */
-    inline void deleteData()
-    {
-        NM_FUNCTION;
-        
-        delete mSubject;
-        mSubject = NULL;
-
-        if (mToAddresses) {
-            qDeleteAll(*mToAddresses);
-            delete mToAddresses;
-            mToAddresses = NULL;
-        }
-
-        if (mCcAddresses) {
-            qDeleteAll(*mCcAddresses);
-            delete mCcAddresses;
-            mCcAddresses = NULL;
-        }
-
-        if (mBccAddresses) {
-            qDeleteAll(*mBccAddresses);
-            delete mBccAddresses;
-            mBccAddresses = NULL;
-        }
-        
-        delete mBodyText;
-        mBodyText = NULL;
-    }
-
-public: // Data
-
-    QString *mSubject; // Not owned.
-    QList<NmAddress*> *mToAddresses; // Not owned.
-    QList<NmAddress*> *mCcAddresses; // Not owned.
-    QList<NmAddress*> *mBccAddresses; // Not owned.
-    QString *mBodyText;
-};
-
-/*!
     \class NmUriServiceInterface
     \brief NMail application service interface which provides an email sending
            interface for other application using the Qt Highway.
@@ -241,8 +99,9 @@
     }
     
     // Check the given data.
-    NmStartParamDataHelper dataHelper;
-    bool validData = dataHelper.extractData(uri);
+    NmUriParser uriParser;
+    bool validData = uriParser.extractData(uri);
+    
      
     NmMailboxListModel &mailboxListModel = mUiEngine.mailboxListModel();
     const int count = mailboxListModel.rowCount();
@@ -264,24 +123,32 @@
     }
     else { // count > 0
         if (mainWindow) {
-            mainWindow->show();        
+            mainWindow->show();
         }
-
+        
+        // The ownership of these is passed to NmApplication in launchEditorView()
+        QList<NmAddress*> *toAddresses = NmUtilities::qstringListToNmAddressList(uriParser.toAddresses());
+        QList<NmAddress*> *ccAddresses = NmUtilities::qstringListToNmAddressList(uriParser.ccAddresses());
+        QList<NmAddress*> *bccAddresses = NmUtilities::qstringListToNmAddressList(uriParser.bccAddresses());
+        
+        QString* subject = new QString(uriParser.subject());
+        QString* bodyText = new QString(uriParser.bodyText());
+       
     	mStartParam = new NmUiStartParam(
         	NmUiViewMessageEditor,
 	        0, // account id
 	        0, // folder id
     	    0, // message id
     	    NmUiEditorMailto, // editor start mode
-	        dataHelper.mToAddresses, // address list
+    	    toAddresses,
     	    NULL, // attachment list
         	true, // start as service
-	        dataHelper.mSubject, // message subject
-	        dataHelper.mCcAddresses, // list containing cc recipient addresses
-    	    dataHelper.mBccAddresses, // list containing bcc recipient addresses
-    	    dataHelper.mBodyText // body text
+        	subject, // message subject
+            ccAddresses, // list containing cc recipient addresses
+            bccAddresses, // list containing bcc recipient addresses
+            bodyText // body text
 	    );
-
+	    
         if (count == 1) {
             // A single mailbox exists.
             QModelIndex modelIndex = mailboxListModel.index(0, 0);
@@ -307,7 +174,6 @@
             // launch the editor when the dialog is closed
         }
     }
-    
     return true;
 }
 
--- a/emailuis/nmailui/src/nmutilities.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmutilities.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -39,6 +39,8 @@
                                          ")?"
                                         );
 
+static const QRegExp NmEmailDisplayNamePattern("<"+NmEmailAddressPattern.pattern()+">$");
+static const QRegExp NmEmailGreaterThenLessThen(">|<");
 /*!
    Gets valid, invalid or all the recipients from a message
  */
@@ -175,7 +177,7 @@
   Opens file specified by XQSharableFile handle. Usually used by viewer
   for opening attachments from message store as RFiles
 */
-int NmUtilities::openFile(XQSharableFile &file)
+int NmUtilities::openFile(XQSharableFile &file, QObject* listener)
 {
     NM_FUNCTION;
 
@@ -186,10 +188,15 @@
     // Create request for the sharable file
     if (request)
     {
+        QObject::connect(request, SIGNAL(requestOk(const QVariant&)),
+                            listener, SLOT(fileOpenCompleted(const QVariant&)));
+        QObject::connect(request, SIGNAL(requestError(int, const QString&)),
+                                    listener, SLOT(fileOpenError(int, const QString&)));
         // Set request arguments
         QList<QVariant> args;
         args << qVariantFromValue(file);
         request->setArguments(args);
+        request->setSynchronous(false);
         // Send the request, ownership of request is transferred
         bool res = request->send();
         if (res) {
@@ -201,6 +208,82 @@
 }
 
 /*!
+   Opens an attachment part via QtHighway. Message part object that is passed
+   to this function must contain binary content, because it is written to a
+   temporary file. List passed is appended with the new temporary filename
+   that is opened. This can be then used to delete the temporary files created
+   with for example NmUtilities::deleteTempFiles function.
+   
+   \param part attachment message part which should contain binary content.
+   \param tmpFiles list of filenames that is appended with new one.
+   \param listener XQAiwRequest listener for listening request send completion
+   \retun int NmGeneralError, if the above requirements aren't filled. Also
+              if file type isn't supported.
+*/
+int NmUtilities::openAttachment(NmMessagePart *part, 
+                                QList<QString> &tmpFiles,
+                                QObject* listener)
+{
+    int ret(NmGeneralError);
+
+    if (part) {
+        // Create a temp file that points to system temp folder.
+        QFile file(QDir::tempPath()+QDir::separator()+part->attachmentName());
+            
+        if (file.open(QIODevice::ReadWrite)) {
+            // Write content to file and close it so it can be used by other
+            // processes.
+            if (file.write(part->binaryContent()) > 0) {
+                file.close();
+                
+                // Create a request from the file.
+                XQApplicationManager aiwMgr;
+                XQAiwRequest *request = aiwMgr.create(file);
+                if (request)
+                {
+                    QObject::connect(request, SIGNAL(requestOk(const QVariant&)),
+                                        listener, SLOT(fileOpenCompleted(const QVariant&)));
+                    QObject::connect(request, SIGNAL(requestError(int, const QString&)),
+                                        listener, SLOT(fileOpenError(int, const QString&)));
+                    // Set request argument.
+                    QList<QVariant> args;
+                    args << file.fileName();
+                    request->setArguments(args);
+                    if (listener) {
+                        request->setSynchronous(false);
+                    }
+                    // Send the request
+                    bool res = request->send();
+                    if (res) {
+                        // Request ok, set error status.
+                        ret = NmNoError;
+                    }
+                }
+                if (!listener) {
+                    delete request;    
+                }
+            }
+            tmpFiles.append(file.fileName());
+        }
+    }
+    return ret;
+}
+
+/*
+ * Deletes files represented in the given list. Also clears
+ * the list after deletion.
+ * 
+ * \param tmpFiles list of files to be removed.
+ */
+void NmUtilities::deleteTempFiles(QList<QString> &tmpFiles)
+{
+    foreach (QString fileName,tmpFiles) {
+        QFile::remove(fileName);
+    }
+    tmpFiles.clear();
+}
+
+/*!
  * Truncate a string to a specific length. If length is less than
  * the string, ellipses are added to the end of the string.
  */
@@ -399,3 +482,23 @@
     }
     return nmAddress;
 }
+
+/*
+ * Function creates a list of NmAddress objects from a string list, that contains email addresses.
+ * \param const QStringList &strlist list of email address strings
+ * \return QList<NmAddress*> *NmAddresses list of NmAddress objects. Returns NULL if strlist does
+ * not contain strings.
+ */
+QList<NmAddress*> *NmUtilities::qstringListToNmAddressList(const QStringList &strlist)
+{
+    QList<NmAddress*> *addresses = NULL;
+    if(!strlist.isEmpty()) {
+        addresses = new QList<NmAddress*>;
+        QString tempString;
+        foreach(tempString, strlist) {
+            NmAddress *address = new NmAddress(tempString);
+            addresses->append(address);
+        }
+    }
+    return addresses;
+}
--- a/emailuis/nmailui/src/nmviewerheader.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerheader.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -293,6 +293,7 @@
             mRecipientsBox->setObjectName("toField");
             mRecipientsBox->setBackgroundItem(NULL);
             mRecipientsBox->setFontSpec(HbFontSpec(HbFontSpec::Secondary)); 
+            mRecipientsBox->setContextMenuFlags(0); 
             connect(mRecipientsBox, SIGNAL(anchorTapped(const QString &)),
                     this, SLOT(anchorTapped(const QString &)));                    
         }              
--- a/emailuis/nmailui/src/nmviewerserviceinterface.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerserviceinterface.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -50,23 +50,6 @@
 
 
 /*!
-    This has the soon to be DEPRICATED three argument interface!!!
-    Use viewMessage(QVariant idList, QVariant flags) instead!!!
-*/
-void NmViewerServiceInterface::viewMessage(QVariant mailboxId,
-                                           QVariant folderId,
-                                           QVariant messageId)
-{
-    QVariantList idList;
-    idList.append(mailboxId);
-    idList.append(folderId);
-    idList.append(messageId);
-    QVariant idListAsVariant = QVariant::fromValue(idList);
-    viewMessage(idListAsVariant, QVariant(EmailBackReturnsToMessageList));
-}
-
-
-/*!
     Opens the message view according to the given IDs.
 
     \param idList A list containing the required IDs for locating the wanted
@@ -150,6 +133,9 @@
         mApplication->enterNmUiView(startParam);
 
         completeRequest(mAsyncReqId, 0);
+        
+        delete message;
+        message = NULL;
     }
     else {
         // The message was not found!
--- a/emailuis/nmailui/src/nmviewerview.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/src/nmviewerview.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -79,7 +79,8 @@
 mAttaWidget(NULL),
 mViewReady(false),
 mWaitNoteCancelled(false),
-mErrorNote(NULL)
+mErrorNote(NULL),
+mAttachmentOpen(false)
 {
     // Create documentloader
     mDocumentLoader = new NmUiDocumentLoader(mMainWindow);
@@ -101,6 +102,8 @@
 */
 NmViewerView::~NmViewerView()
 {
+    // Delete opened temporary files.
+    NmUtilities::deleteTempFiles(mTempFiles);
     delete mErrorNote;
     mErrorNote=NULL;
     delete mWebView;
@@ -497,7 +500,7 @@
 void NmViewerView::openAttachment(int index)
 {
     NM_FUNCTION;
-    if (index >= 0) {
+    if (index >= 0 && !mAttachmentOpen) {
         NmId attaId = mAttaIdList.at(index);
         // reload message to get updates part sizes
         loadMessage();
@@ -522,11 +525,16 @@
                  // 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){
+                     mAttachmentOpen = true;
+                     QObject::disconnect(mAttaWidget, SIGNAL(itemActivated(int)),
+                                         this, SLOT(openAttachment(int)));
+					 // We need to fill the part before opening the attachment.
+					 mUiEngine.contentToMessagePart(mailboxId, folderId, messageId, *(messageParts[i]));
+					 int error = NmUtilities::openAttachment(messageParts[i],mTempFiles,this);
+                     if (error==NmGeneralError){
+                         mAttachmentOpen = false;
+                         QObject::connect(mAttaWidget, SIGNAL(itemActivated(int)),
+                                              this, SLOT(openAttachment(int)));
                          delete mErrorNote;
                          mErrorNote=NULL;
                          mErrorNote = NmUtilities::displayWarningNote(
@@ -550,6 +558,11 @@
         NmMessagePart *html = mMessage->htmlBodyPart();
         if (html) {
             msg += formatHtmlMessage(html);
+            // Remove DOCTYPE definition as it will break viewer layout
+            if (msg.startsWith("<!DOCTYPE", Qt::CaseInsensitive)) {
+                int doctypeTagEnd = msg.indexOf(">",0,Qt::CaseInsensitive);
+                msg.remove(0,doctypeTagEnd+1);
+            }     
         }
         else {
             NmMessagePart *plain = mMessage->plainTextBodyPart();
@@ -633,10 +646,13 @@
                 currentFont.setPixelSize(fontSpec.font().pixelSize());
             }
             document.setDefaultFont(currentFont);
-            // convert to html
+            // convert to html with html and body tags
+            // for background and text color
             document.setPlainText(plain->textContent());
-            msg = document.toHtml();
-    
+            msg += "<html><body bgcolor=white text=black>";
+            msg += document.toHtml();
+            msg += "</body></html>";
+            
             if (qApp->layoutDirection()==Qt::RightToLeft){
                 // add right alignment to document css section
                 QRegExp rx("(<style type=\"text/css\">)(.+)(</style>)", Qt::CaseInsensitive);
@@ -809,21 +825,37 @@
         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);
+
+        NmUriParser uriParser;
+        if (uriParser.extractData(link.toString())) {
+            // Create start parameters. Address list ownership
+            // is transferred to startparam object
+            // The ownership of these is passed to NmApplication in launchEditorView()
+            QList<NmAddress*> *toAddresses = NmUtilities::qstringListToNmAddressList(uriParser.toAddresses());
+            QList<NmAddress*> *ccAddresses = NmUtilities::qstringListToNmAddressList(uriParser.ccAddresses());
+            QList<NmAddress*> *bccAddresses = NmUtilities::qstringListToNmAddressList(uriParser.bccAddresses());
+            
+            QString* subject = new QString(uriParser.subject());
+            QString* bodyText = new QString(uriParser.bodyText());
+            
+            NmUiStartParam* param = new NmUiStartParam(NmUiViewMessageEditor,
+                                                       mStartParam->mailboxId(),
+                                                       mStartParam->folderId(),
+                                                       0, // message id
+                                                       NmUiEditorMailto, // editor start mode
+                                                       toAddresses,
+                                                       NULL, // attachment list
+                                                       false, // start as service
+                                                       subject, // message subject
+                                                       ccAddresses, // cc recipients
+                                                       bccAddresses, //bcc recipients
+                                                       bodyText // body text
+                                                       );
+            
+
+            mApplication.enterNmUiView(param);
+        }
+
     }    
 }
 
@@ -1053,8 +1085,12 @@
     }
 }
 
+
 /*!
-    This is called when attachment fetch is completed
+    This method is called when fetching an attachment is either completed or
+    cancelled.
+
+    \param result The result code (NmNoError if success).
 */
 void NmViewerView::fetchCompleted(int result)
 {
@@ -1064,11 +1100,21 @@
             openAttachment(mAttaIndexUnderFetch);
         } else {
             mAttaWidget->hideProgressBar(mAttaIndexUnderFetch);
+
+            if (result == NmDiskFullError) {
+                // Display an error message.
+                delete mErrorNote;
+                mErrorNote = NmUtilities::displayWarningNote(
+                    hbTrId("txt_mail_dialog_downloading_canceled"));
+            }
+
         }
     }
+
     mAttaIndexUnderFetch = NmNotFoundError;
 }
 
+
 /*!
     externalDelete. From NmUiEngine, handles viewer shutdown when current message is deleted.
 */
@@ -1133,3 +1179,17 @@
     return ret;
 }
 
+void NmViewerView::fileOpenCompleted(const QVariant&)
+{
+    mAttachmentOpen = false;
+    QObject::connect(mAttaWidget, SIGNAL(itemActivated(int)),
+                          this, SLOT(openAttachment(int)));
+}
+
+void NmViewerView::fileOpenError(int, const QString&)
+{
+    mAttachmentOpen = false;
+    QObject::connect(mAttaWidget, SIGNAL(itemActivated(int)),
+                          this, SLOT(openAttachment(int)));
+}
+
Binary file emailuis/nmailui/translations/mail.qm has changed
--- a/emailuis/nmailui/translations/mail.ts	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailui/translations/mail.ts	Thu Sep 30 11:43:07 2010 +0300
@@ -35,7 +35,7 @@
 <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>
+    <translation variants="yes" 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>
@@ -365,7 +365,7 @@
 <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>Searching</source>
-    <translation variants="no" type="unfinished"></translation>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>txt_mail_subhead_inbox</extra-loc-layout_id>    
     <extra-loc-viewid>mail_008</extra-loc-viewid>
     <extra-loc-positionid>list</extra-loc-positionid>
@@ -545,7 +545,7 @@
 <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. 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>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_007</extra-loc-viewid>
     <extra-loc-positionid>dpophead</extra-loc-positionid>
@@ -563,8 +563,8 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mail_dblist_no_messages_matched_your_search">
-    <comment>A text shown in mail list view, if there are no matches to a search.</comment>        
-    <source>No messages matched your search. Try another search term. </source>
+    <comment>A text shown in mail list view, if there are no matches to a search. Note! Draft English changed 8.9.2010</comment>        
+    <source>No matches found. Redefine search criteria.</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_008</extra-loc-viewid>
@@ -572,6 +572,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mail_list_type_to_search">
+    <comment>Hint text shown in search field. Text disappears when user starts typing search term.</comment>        
+    <source>Type to search</source>
+    <translation variants="yes" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_searchbox_pri_2</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_001_b</extra-loc-viewid>
+    <extra-loc-positionid>dialog_5</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>
@@ -655,7 +665,7 @@
 <message numerus="no" id="txt_mail_dialog_send_via">
     <comment>Title for send via dialog. This dialog lists all mailboxes the user has. Underneath the title, a list of mailboxes is displayed. </comment>        
     <source>Send via</source>
-    <translation variants="no" type="unfinished"></translation>
+    <translation variants="yes" 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>dialog</extra-loc-positionid>
@@ -675,7 +685,7 @@
 <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>
+    <translation variants="yes" 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>
@@ -715,7 +725,7 @@
 <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>
+    <translation variants="yes" 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>
@@ -725,7 +735,7 @@
 <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>
@@ -825,7 +835,7 @@
 <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>
@@ -986,7 +996,7 @@
 <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>
+    <translation variants="yes" 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>
@@ -994,8 +1004,8 @@
     <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 username or password. </comment>        
-    <source>Username 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. NOTE! Small addition to draft English (1.9.2010)</comment>        
+    <source>Username, password, or mail address 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>
@@ -1016,7 +1026,7 @@
 <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>
+    <translation variants="yes" 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>
@@ -1046,7 +1056,7 @@
 <message numerus="no" id="txt_mail_subhead_inbox">
     <comment>Custom layout ID parent. Text for indicating the current folder in mail list view. Component is simple label</comment>        
     <source>Inbox </source>
-    <translation variants="no" type="unfinished"></translation>
+    <translation variants="yes" 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>
--- a/emailuis/nmailuiengine/bwins/nmailuiengineu.def	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiengine/bwins/nmailuiengineu.def	Thu Sep 30 11:43:07 2010 +0300
@@ -317,4 +317,5 @@
 	?handleFolderCreatedEvent@NmUiEngine@@AAEXABV?$QList@VNmId@@@@ABVNmId@@@Z @ 316 NONAME ; void NmUiEngine::handleFolderCreatedEvent(class QList<class NmId> const &, class NmId const &)
 	?handleFolderDeletedEvent@NmMessageListModel@@QAEXABVNmId@@0@Z @ 317 NONAME ; void NmMessageListModel::handleFolderDeletedEvent(class NmId const &, class NmId const &)
 	?handleFolderDeletedEvent@NmUiEngine@@AAEXABV?$QList@VNmId@@@@ABVNmId@@@Z @ 318 NONAME ; void NmUiEngine::handleFolderDeletedEvent(class QList<class NmId> const &, class NmId const &)
+	?createMessageListModel@NmUiEngine@@AAEXPAPAVNmMessageListModel@@ABVNmId@@1@Z @ 319 NONAME ; void NmUiEngine::createMessageListModel(class NmMessageListModel * *, class NmId const &, class NmId const &)
 
--- a/emailuis/nmailuiengine/eabi/nmailuiengineu.def	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiengine/eabi/nmailuiengineu.def	Thu Sep 30 11:43:07 2010 +0300
@@ -324,4 +324,5 @@
 	_ZN10NmUiEngine24handleFolderCreatedEventERK5QListI4NmIdERKS1_ @ 323 NONAME
 	_ZN10NmUiEngine24handleFolderDeletedEventERK5QListI4NmIdERKS1_ @ 324 NONAME
 	_ZN18NmMessageListModel24handleFolderDeletedEventERK4NmIdS2_ @ 325 NONAME
+	_ZN10NmUiEngine22createMessageListModelEPP18NmMessageListModelRK4NmIdS5_ @ 326 NONAME
 
--- a/emailuis/nmailuiengine/src/nmuiengine.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiengine/src/nmuiengine.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -214,7 +214,8 @@
             QObject *plugin = (*dataPlugins)[i];
             if (plugin) {
                 connect(plugin, SIGNAL(mailboxEvent(NmMailboxEvent, const QList<NmId> &)),
-                    mMailboxListModel, SLOT(handleMailboxEvent(NmMailboxEvent, const QList<NmId> &)));
+                    mMailboxListModel, SLOT(handleMailboxEvent(NmMailboxEvent, const QList<NmId> &)), 
+                    Qt::UniqueConnection);
             }
         }
     } else {
@@ -238,6 +239,8 @@
 NmMessageListModel &NmUiEngine::messageListModel(const NmId &mailboxId,
                                                  const NmId &folderId)
 {
+    NM_TIMESTAMP("NmUiEngine::messageListModel begins ***");
+    
     QObject *plugin = mPluginFactory->pluginInstance(mailboxId);
     bool isInbox(false);
     if (standardFolderId(mailboxId,NmFolderInbox)==folderId){
@@ -283,7 +286,10 @@
     else {
         ret = mMessageListModel;
     }
-    return *ret;
+    
+    NM_TIMESTAMP("NmUiEngine::messageListModel ends ***");
+    
+    return *ret;    
 }
 
 
@@ -1128,6 +1134,18 @@
             }
            break;
         }
+        case NmMailboxCreated:
+            {
+            if( mailboxIds.count() ){
+                NmDataPluginInterface *pluginInterface =
+                        mPluginFactory->interfaceInstance(mailboxIds.at(0));
+            
+                if (pluginInterface) {
+                    pluginInterface->subscribeMailboxEvents(mailboxIds.at(0));
+                    }
+                }
+            }
+            break;
         default:
         break;
     }
--- a/emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/bwins/nmailuiwidgetsu.def	Thu Sep 30 11:43:07 2010 +0300
@@ -1,141 +1,159 @@
 EXPORTS
-	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *, int)
-	?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)
+	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 1 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *, int)
+	??0NmAttachmentListWidget@@QAE@PAVQGraphicsItem@@@Z @ 2 NONAME ; NmAttachmentListWidget::NmAttachmentListWidget(class QGraphicsItem *)
+	?setCustomTextColor@NmEditorTextEdit@@QAEX_NABVQColor@@@Z @ 3 NONAME ; void NmEditorTextEdit::setCustomTextColor(bool, class QColor const &)
+	?staticMetaObject@NmAttachmentListWidget@@2UQMetaObject@@B @ 4 NONAME ; struct QMetaObject const NmAttachmentListWidget::staticMetaObject
+	?setTextCursor@NmHtmlLineEdit@@QAEXABVQTextCursor@@@Z @ 5 NONAME ; void NmHtmlLineEdit::setTextCursor(class QTextCursor const &)
+	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 6 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *)
+	?keyPressEventDelete@NmRecipientLineEdit@@AAEXPAVQKeyEvent@@@Z @ 7 NONAME ; void NmRecipientLineEdit::keyPressEventDelete(class QKeyEvent *)
+	?createAutoFillPopup@NmRecipientLineEdit@@AAEXXZ @ 8 NONAME ; void NmRecipientLineEdit::createAutoFillPopup(void)
+	??1NmBaseViewScrollArea@@UAE@XZ @ 9 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(void)
+	??_ENmBaseViewScrollArea@@UAE@I@Z @ 10 NONAME ; NmBaseViewScrollArea::~NmBaseViewScrollArea(unsigned int)
+	?staticMetaObject@NmBaseViewScrollArea@@2UQMetaObject@@B @ 11 NONAME ; struct QMetaObject const NmBaseViewScrollArea::staticMetaObject
+	?setBackgroundColor@NmAttachmentListWidget@@QAEXVQColor@@@Z @ 12 NONAME ; void NmAttachmentListWidget::setBackgroundColor(class QColor)
+	?getStaticMetaObject@NmEditorTextEdit@@SAABUQMetaObject@@XZ @ 13 NONAME ; struct QMetaObject const & NmEditorTextEdit::getStaticMetaObject(void)
+	?handleItemActivated@NmAttachmentListWidget@@AAEXXZ @ 14 NONAME ; void NmAttachmentListWidget::handleItemActivated(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)
+	?setFileNameText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 16 NONAME ; void NmAttachmentListItem::setFileNameText(class QString const &)
+	?checkColor@NmAttachmentListWidget@@AAE?AVQColor@@XZ @ 17 NONAME ; class QColor NmAttachmentListWidget::checkColor(void)
+	?handleMouseReleaseEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 18 NONAME ; void NmBaseViewScrollArea::handleMouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	?init@NmAttachmentListWidget@@AAEXXZ @ 19 NONAME ; void NmAttachmentListWidget::init(void)
+	?qt_metacast@NmHtmlLineEdit@@UAEPAXPBD@Z @ 20 NONAME ; void * NmHtmlLineEdit::qt_metacast(char const *)
+	?setProgressBarValue@NmAttachmentListItem@@QAEXH@Z @ 21 NONAME ; void NmAttachmentListItem::setProgressBarValue(int)
+	?hasInputFocus@NmEditorTextEdit@@QBE_NXZ @ 22 NONAME ; bool NmEditorTextEdit::hasInputFocus(void) const
+	?showAutofillPopup@NmRecipientLineEdit@@AAEXXZ @ 23 NONAME ; void NmRecipientLineEdit::showAutofillPopup(void)
+	?updateCustomTextColor@NmEditorTextEdit@@QAEXXZ @ 24 NONAME ; void NmEditorTextEdit::updateCustomTextColor(void)
+	?gestureEvent@NmAttachmentListItem@@MAEXPAVQGestureEvent@@@Z @ 25 NONAME ; void NmAttachmentListItem::gestureEvent(class QGestureEvent *)
 	?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 * *)
-	?checkColor@NmAttachmentListWidget@@AAE?AVQColor@@XZ @ 132 NONAME ; class QColor NmAttachmentListWidget::checkColor(void)
-	?changeEvent@NmAttachmentListWidget@@MAEXPAVQEvent@@@Z @ 133 NONAME ; void NmAttachmentListWidget::changeEvent(class QEvent *)
-	?setPressed@NmAttachmentListItem@@QAEX_N@Z @ 134 NONAME ; void NmAttachmentListItem::setPressed(bool)
-	?setBackgroundColor@NmAttachmentListItem@@QAEXVQColor@@@Z @ 135 NONAME ; void NmAttachmentListItem::setBackgroundColor(class QColor)
-	?setBackgroundColor@NmAttachmentListWidget@@QAEXVQColor@@@Z @ 136 NONAME ; void NmAttachmentListWidget::setBackgroundColor(class QColor)
-	?addContacts@NmRecipientLineEdit@@QAEXV?$QList@PAVNmAddress@@@@@Z @ 137 NONAME ; void NmRecipientLineEdit::addContacts(class QList<class NmAddress *>)
-	?hasInputFocus@NmHtmlLineEdit@@QBE_NXZ @ 138 NONAME ; bool NmHtmlLineEdit::hasInputFocus(void) const
-	?hasInputFocus@NmEditorTextEdit@@QBE_NXZ @ 139 NONAME ; bool NmEditorTextEdit::hasInputFocus(void) const
+	?rectForCursorPosition@NmEditorTextEdit@@QBE?AVQRectF@@XZ @ 27 NONAME ; class QRectF NmEditorTextEdit::rectForCursorPosition(void) const
+	?itemLongPressed@NmAttachmentListItem@@IAEXVQPointF@@@Z @ 28 NONAME ; void NmAttachmentListItem::itemLongPressed(class QPointF)
+	?generateEmailAddressList@NmRecipientLineEdit@@AAEXXZ @ 29 NONAME ; void NmRecipientLineEdit::generateEmailAddressList(void)
+	??0NmBaseViewScrollArea@@QAE@PAVQGraphicsItem@@@Z @ 30 NONAME ; NmBaseViewScrollArea::NmBaseViewScrollArea(class QGraphicsItem *)
+	?longPressed@NmAttachmentListWidget@@IAEXHVQPointF@@@Z @ 31 NONAME ; void NmAttachmentListWidget::longPressed(int, class QPointF)
+	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0@Z @ 32 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *)
+	?metaObject@NmBaseViewScrollArea@@UBEPBUQMetaObject@@XZ @ 33 NONAME ; struct QMetaObject const * NmBaseViewScrollArea::metaObject(void) const
+	?metaObject@NmEditorTextEdit@@UBEPBUQMetaObject@@XZ @ 34 NONAME ; struct QMetaObject const * NmEditorTextEdit::metaObject(void) const
+	?tr@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 35 NONAME ; class QString NmEditorTextEdit::tr(char const *, char const *)
+	?staticMetaObject@NmEditorTextEdit@@2UQMetaObject@@B @ 36 NONAME ; struct QMetaObject const NmEditorTextEdit::staticMetaObject
+	?qt_metacast@NmAttachmentListWidget@@UAEPAXPBD@Z @ 37 NONAME ; void * NmAttachmentListWidget::qt_metacast(char const *)
+	?setCustomTextColor@NmEditorTextEdit@@QAEXABU?$QPair@_NVQColor@@@@@Z @ 38 NONAME ; void NmEditorTextEdit::setCustomTextColor(struct QPair<bool, class QColor> const &)
+	??1NmAttachmentListItem@@UAE@XZ @ 39 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(void)
+	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 40 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *)
+	?progressBarValue@NmAttachmentListItem@@QBEHXZ @ 41 NONAME ; int NmAttachmentListItem::progressBarValue(void) const
+	?createAutofillComponents@NmRecipientLineEdit@@AAEXXZ @ 42 NONAME ; void NmRecipientLineEdit::createAutofillComponents(void)
+	?keyPressEventLeft@NmRecipientLineEdit@@AAEXPAVQKeyEvent@@@Z @ 43 NONAME ; void NmRecipientLineEdit::keyPressEventLeft(class QKeyEvent *)
+	?mouseMoveEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 44 NONAME ; void NmBaseViewScrollArea::mouseMoveEvent(class QGraphicsSceneMouseEvent *)
+	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 45 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *)
+	?setPlainText@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 46 NONAME ; void NmHtmlLineEdit::setPlainText(class QString const &)
+	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 47 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *, int)
+	??1NmEditorTextEdit@@UAE@XZ @ 48 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(void)
+	?handleMouseMoveEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 49 NONAME ; void NmBaseViewScrollArea::handleMouseMoveEvent(class QGraphicsSceneMouseEvent *)
+	??0NmEditorTextEdit@@QAE@PAVQGraphicsItem@@@Z @ 50 NONAME ; NmEditorTextEdit::NmEditorTextEdit(class QGraphicsItem *)
+	?trUtf8@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 51 NONAME ; class QString NmBaseViewScrollArea::trUtf8(char const *, char const *, int)
+	?rearrangeLayout@NmAttachmentListWidget@@AAEXXZ @ 52 NONAME ; void NmAttachmentListWidget::rearrangeLayout(void)
+	?currentTextPart@NmRecipientLineEdit@@AAEXAAH0@Z @ 53 NONAME ; void NmRecipientLineEdit::currentTextPart(int &, int &)
+	?mouseReleaseEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 54 NONAME ; void NmBaseViewScrollArea::mouseReleaseEvent(class QGraphicsSceneMouseEvent *)
+	??1NmAttachmentListWidget@@UAE@XZ @ 55 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(void)
+	?qt_metacast@NmAttachmentListItem@@UAEPAXPBD@Z @ 56 NONAME ; void * NmAttachmentListItem::qt_metacast(char const *)
+	??_ENmAttachmentListItem@@UAE@I@Z @ 57 NONAME ; NmAttachmentListItem::~NmAttachmentListItem(unsigned int)
+	?handleTextChanged@NmRecipientLineEdit@@AAEXABVQString@@@Z @ 58 NONAME ; void NmRecipientLineEdit::handleTextChanged(class QString const &)
+	?qt_metacast@NmBaseViewScrollArea@@UAEPAXPBD@Z @ 59 NONAME ; void * NmBaseViewScrollArea::qt_metacast(char const *)
+	?getChosenAddressFromModel@NmRecipientLineEdit@@AAEXABVQModelIndex@@AAVNmAddress@@@Z @ 60 NONAME ; void NmRecipientLineEdit::getChosenAddressFromModel(class QModelIndex const &, class NmAddress &)
+	?document@NmHtmlLineEdit@@QBEPAVQTextDocument@@XZ @ 61 NONAME ; class QTextDocument * NmHtmlLineEdit::document(void) const
+	?setProgressBarValue@NmAttachmentListWidget@@QAEXHH@Z @ 62 NONAME ; void NmAttachmentListWidget::setProgressBarValue(int, int)
+	?qt_metacall@NmAttachmentListWidget@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 63 NONAME ; int NmAttachmentListWidget::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@NmAttachmentListItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 64 NONAME ; int NmAttachmentListItem::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?handleTap@NmRecipientLineEdit@@AAEXXZ @ 65 NONAME ; void NmRecipientLineEdit::handleTap(void)
+	?getStaticMetaObject@NmHtmlLineEdit@@SAABUQMetaObject@@XZ @ 66 NONAME ; struct QMetaObject const & NmHtmlLineEdit::getStaticMetaObject(void)
+	?handleLongPressGesture@NmBaseViewScrollArea@@IAEXABVQPointF@@@Z @ 67 NONAME ; void NmBaseViewScrollArea::handleLongPressGesture(class QPointF const &)
+	?constructUi@NmAttachmentListWidget@@AAEXXZ @ 68 NONAME ; void NmAttachmentListWidget::constructUi(void)
+	?hasInputFocus@NmHtmlLineEdit@@QBE_NXZ @ 69 NONAME ; bool NmHtmlLineEdit::hasInputFocus(void) const
+	?setDocument@NmHtmlLineEdit@@QAEXPAVQTextDocument@@@Z @ 70 NONAME ; void NmHtmlLineEdit::setDocument(class QTextDocument *)
+	?staticMetaObject@NmRecipientLineEdit@@2UQMetaObject@@B @ 71 NONAME ; struct QMetaObject const NmRecipientLineEdit::staticMetaObject
+	??_ENmEditorTextEdit@@UAE@I@Z @ 72 NONAME ; NmEditorTextEdit::~NmEditorTextEdit(unsigned int)
+	?metaObject@NmHtmlLineEdit@@UBEPBUQMetaObject@@XZ @ 73 NONAME ; struct QMetaObject const * NmHtmlLineEdit::metaObject(void) const
+	?trUtf8@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 74 NONAME ; class QString NmAttachmentListWidget::trUtf8(char const *, char const *, int)
+	??_ENmAttachmentListWidget@@UAE@I@Z @ 75 NONAME ; NmAttachmentListWidget::~NmAttachmentListWidget(unsigned int)
+	?setIndentForLabel@NmHtmlLineEdit@@QAEXM@Z @ 76 NONAME ; void NmHtmlLineEdit::setIndentForLabel(float)
+	??0NmRecipientLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 77 NONAME ; NmRecipientLineEdit::NmRecipientLineEdit(class QGraphicsItem *)
+	?progressValue@NmAttachmentListWidget@@QBEHH@Z @ 78 NONAME ; int NmAttachmentListWidget::progressValue(int) const
+	?setFileSizeText@NmAttachmentListItem@@QAEXABVQString@@@Z @ 79 NONAME ; void NmAttachmentListItem::setFileSizeText(class QString const &)
+	?emailAddressList@NmRecipientLineEdit@@QAE?AV?$QList@VNmAddress@@@@XZ @ 80 NONAME ; class QList<class NmAddress> NmRecipientLineEdit::emailAddressList(void)
+	??1NmHtmlLineEdit@@UAE@XZ @ 81 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(void)
+	?keyPressEvent@NmRecipientLineEdit@@MAEXPAVQKeyEvent@@@Z @ 82 NONAME ; void NmRecipientLineEdit::keyPressEvent(class QKeyEvent *)
+	?staticMetaObject@NmAttachmentListItem@@2UQMetaObject@@B @ 83 NONAME ; struct QMetaObject const NmAttachmentListItem::staticMetaObject
+	?addSelectedContacts@NmRecipientLineEdit@@QAEXABVQVariant@@@Z @ 84 NONAME ; void NmRecipientLineEdit::addSelectedContacts(class QVariant const &)
+	?getStaticMetaObject@NmAttachmentListItem@@SAABUQMetaObject@@XZ @ 85 NONAME ; struct QMetaObject const & NmAttachmentListItem::getStaticMetaObject(void)
+	?itemActivated@NmAttachmentListWidget@@IAEXH@Z @ 86 NONAME ; void NmAttachmentListWidget::itemActivated(int)
+	?textCursor@NmHtmlLineEdit@@QBE?AVQTextCursor@@XZ @ 87 NONAME ; class QTextCursor NmHtmlLineEdit::textCursor(void) const
+	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 88 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *)
+	?setHighlight@NmRecipientLineEdit@@AAEXH@Z @ 89 NONAME ; void NmRecipientLineEdit::setHighlight(int)
+	?staticMetaObject@NmHtmlLineEdit@@2UQMetaObject@@B @ 90 NONAME ; struct QMetaObject const NmHtmlLineEdit::staticMetaObject
+	?removeAttachment@NmAttachmentListWidget@@QAEXH@Z @ 91 NONAME ; void NmAttachmentListWidget::removeAttachment(int)
+	?metaObject@NmRecipientLineEdit@@UBEPBUQMetaObject@@XZ @ 92 NONAME ; struct QMetaObject const * NmRecipientLineEdit::metaObject(void) const
+	?rectForCursorPosition@NmHtmlLineEdit@@QBE?AVQRectF@@XZ @ 93 NONAME ; class QRectF NmHtmlLineEdit::rectForCursorPosition(void) const
+	?insertItemToLayout@NmAttachmentListWidget@@AAEXPAVNmAttachmentListItem@@@Z @ 94 NONAME ; void NmAttachmentListWidget::insertItemToLayout(class NmAttachmentListItem *)
+	??0NmAttachmentListItem@@QAE@PAVQGraphicsItem@@@Z @ 95 NONAME ; NmAttachmentListItem::NmAttachmentListItem(class QGraphicsItem *)
+	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 96 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *, int)
+	?getStaticMetaObject@NmRecipientLineEdit@@SAABUQMetaObject@@XZ @ 97 NONAME ; struct QMetaObject const & NmRecipientLineEdit::getStaticMetaObject(void)
+	?orientationChanged@NmAttachmentListWidget@@AAEXW4Orientation@Qt@@@Z @ 98 NONAME ; void NmAttachmentListWidget::orientationChanged(enum Qt::Orientation)
+	??0NmHtmlLineEdit@@QAE@PAVQGraphicsItem@@@Z @ 99 NONAME ; NmHtmlLineEdit::NmHtmlLineEdit(class QGraphicsItem *)
+	?addContacts@NmRecipientLineEdit@@QAEXV?$QList@PAVNmAddress@@@@@Z @ 100 NONAME ; void NmRecipientLineEdit::addContacts(class QList<class NmAddress *>)
+	?trUtf8@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 101 NONAME ; class QString NmRecipientLineEdit::trUtf8(char const *, char const *, int)
+	?keyPressEventSemicolon@NmRecipientLineEdit@@AAEXPAVQKeyEvent@@@Z @ 102 NONAME ; void NmRecipientLineEdit::keyPressEventSemicolon(class QKeyEvent *)
+	?findItem@NmAttachmentListWidget@@AAEHPBVQObject@@@Z @ 103 NONAME ; int NmAttachmentListWidget::findItem(class QObject const *)
+	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0H@Z @ 104 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *, int)
+	?trUtf8@NmHtmlLineEdit@@SA?AVQString@@PBD0@Z @ 105 NONAME ; class QString NmHtmlLineEdit::trUtf8(char const *, char const *)
+	?tr@NmHtmlLineEdit@@SA?AVQString@@PBD0H@Z @ 106 NONAME ; class QString NmHtmlLineEdit::tr(char const *, char const *, int)
+	?tr@NmAttachmentListItem@@SA?AVQString@@PBD0@Z @ 107 NONAME ; class QString NmAttachmentListItem::tr(char const *, char const *)
+	?count@NmAttachmentListWidget@@QBEHXZ @ 108 NONAME ; int NmAttachmentListWidget::count(void) const
+	?tr@NmRecipientLineEdit@@SA?AVQString@@PBD0H@Z @ 109 NONAME ; class QString NmRecipientLineEdit::tr(char const *, char const *, int)
+	?hideAutofillPopup@NmRecipientLineEdit@@AAEXXZ @ 110 NONAME ; void NmRecipientLineEdit::hideAutofillPopup(void)
+	?metaObject@NmAttachmentListWidget@@UBEPBUQMetaObject@@XZ @ 111 NONAME ; struct QMetaObject const * NmAttachmentListWidget::metaObject(void) const
+	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0H@Z @ 112 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *, int)
+	?init@NmAttachmentListItem@@AAEXXZ @ 113 NONAME ; void NmAttachmentListItem::init(void)
+	?hideProgressBar@NmAttachmentListWidget@@QAEXH@Z @ 114 NONAME ; void NmAttachmentListWidget::hideProgressBar(int)
+	?setPressed@NmAttachmentListItem@@QAEX_N@Z @ 115 NONAME ; void NmAttachmentListItem::setPressed(bool)
+	?modelCompleted@NmRecipientLineEdit@@AAEXH@Z @ 116 NONAME ; void NmRecipientLineEdit::modelCompleted(int)
+	??_ENmRecipientLineEdit@@UAE@I@Z @ 117 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(unsigned int)
+	?metaObject@NmAttachmentListItem@@UBEPBUQMetaObject@@XZ @ 118 NONAME ; struct QMetaObject const * NmAttachmentListItem::metaObject(void) const
+	?keyPressEventRight@NmRecipientLineEdit@@AAEXPAVQKeyEvent@@@Z @ 119 NONAME ; void NmRecipientLineEdit::keyPressEventRight(class QKeyEvent *)
+	?setAttachmentSize@NmAttachmentListWidget@@QAEXHABVQString@@@Z @ 120 NONAME ; void NmAttachmentListWidget::setAttachmentSize(int, class QString const &)
+	?removeProgressBar@NmAttachmentListItem@@AAEXXZ @ 121 NONAME ; void NmAttachmentListItem::removeProgressBar(void)
+	?qt_metacall@NmHtmlLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 122 NONAME ; int NmHtmlLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?inputMethodEvent@NmRecipientLineEdit@@MAEXPAVQInputMethodEvent@@@Z @ 123 NONAME ; void NmRecipientLineEdit::inputMethodEvent(class QInputMethodEvent *)
+	?getStaticMetaObject@NmBaseViewScrollArea@@SAABUQMetaObject@@XZ @ 124 NONAME ; struct QMetaObject const & NmBaseViewScrollArea::getStaticMetaObject(void)
+	??_ENmHtmlLineEdit@@UAE@I@Z @ 125 NONAME ; NmHtmlLineEdit::~NmHtmlLineEdit(unsigned int)
+	?qt_metacall@NmBaseViewScrollArea@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 126 NONAME ; int NmBaseViewScrollArea::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?constructUi@NmAttachmentListItem@@AAEXXZ @ 127 NONAME ; void NmAttachmentListItem::constructUi(void)
+	?qt_metacall@NmRecipientLineEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 128 NONAME ; int NmRecipientLineEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacall@NmEditorTextEdit@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 129 NONAME ; int NmEditorTextEdit::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?setTextColor@NmAttachmentListItem@@QAEXVQColor@@@Z @ 130 NONAME ; void NmAttachmentListItem::setTextColor(class QColor)
+	?setBackgroundColor@NmAttachmentListItem@@QAEXVQColor@@@Z @ 131 NONAME ; void NmAttachmentListItem::setBackgroundColor(class QColor)
+	?tr@NmAttachmentListWidget@@SA?AVQString@@PBD0@Z @ 132 NONAME ; class QString NmAttachmentListWidget::tr(char const *, char const *)
+	?handleMousePressEvent@NmBaseViewScrollArea@@IAEXPAVQGraphicsSceneMouseEvent@@@Z @ 133 NONAME ; void NmBaseViewScrollArea::handleMousePressEvent(class QGraphicsSceneMouseEvent *)
+	?trUtf8@NmEditorTextEdit@@SA?AVQString@@PBD0@Z @ 134 NONAME ; class QString NmEditorTextEdit::trUtf8(char const *, char const *)
+	?toPlainText@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 135 NONAME ; class QString NmHtmlLineEdit::toPlainText(void) const
+	?setTextColor@NmAttachmentListWidget@@QAEXVQColor@@@Z @ 136 NONAME ; void NmAttachmentListWidget::setTextColor(class QColor)
+	?toHtml@NmHtmlLineEdit@@QBE?AVQString@@XZ @ 137 NONAME ; class QString NmHtmlLineEdit::toHtml(void) const
+	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0@Z @ 138 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *)
+	?itemActivated@NmAttachmentListItem@@IAEXXZ @ 139 NONAME ; void NmAttachmentListItem::itemActivated(void)
+	?hideProgressBar@NmAttachmentListItem@@QAEXXZ @ 140 NONAME ; void NmAttachmentListItem::hideProgressBar(void)
+	?addSelectedContactFromHistory@NmRecipientLineEdit@@QAEXABVQModelIndex@@@Z @ 141 NONAME ; void NmRecipientLineEdit::addSelectedContactFromHistory(class QModelIndex const &)
+	?qt_metacast@NmEditorTextEdit@@UAEPAXPBD@Z @ 142 NONAME ; void * NmEditorTextEdit::qt_metacast(char const *)
+	?qt_metacast@NmRecipientLineEdit@@UAEPAXPBD@Z @ 143 NONAME ; void * NmRecipientLineEdit::qt_metacast(char const *)
+	?mousePressEvent@NmBaseViewScrollArea@@UAEXPAVQGraphicsSceneMouseEvent@@@Z @ 144 NONAME ; void NmBaseViewScrollArea::mousePressEvent(class QGraphicsSceneMouseEvent *)
+	?insertAttachment@NmAttachmentListWidget@@QAEXHABVQString@@0@Z @ 145 NONAME ; void NmAttachmentListWidget::insertAttachment(int, class QString const &, class QString const &)
+	?tr@NmBaseViewScrollArea@@SA?AVQString@@PBD0H@Z @ 146 NONAME ; class QString NmBaseViewScrollArea::tr(char const *, char const *, int)
+	?longPressGesture@NmBaseViewScrollArea@@MAEXABVQPointF@@@Z @ 147 NONAME ; void NmBaseViewScrollArea::longPressGesture(class QPointF const &)
+	?trUtf8@NmAttachmentListItem@@SA?AVQString@@PBD0H@Z @ 148 NONAME ; class QString NmAttachmentListItem::trUtf8(char const *, char const *, int)
+	?customTextColor@NmEditorTextEdit@@QBE?AU?$QPair@_NVQColor@@@@XZ @ 149 NONAME ; struct QPair<bool, class QColor> NmEditorTextEdit::customTextColor(void) const
+	?paint@NmAttachmentListWidget@@UAEXPAVQPainter@@PBVQStyleOptionGraphicsItem@@PAVQWidget@@@Z @ 150 NONAME ; void NmAttachmentListWidget::paint(class QPainter *, class QStyleOptionGraphicsItem const *, class QWidget *)
+	?setHtml@NmHtmlLineEdit@@QAEXABVQString@@@Z @ 151 NONAME ; void NmHtmlLineEdit::setHtml(class QString const &)
+	?insertContactText@NmRecipientLineEdit@@AAEXABVQString@@@Z @ 152 NONAME ; void NmRecipientLineEdit::insertContactText(class QString const &)
+	?gestureEvent@NmRecipientLineEdit@@EAEXPAVQGestureEvent@@@Z @ 153 NONAME ; void NmRecipientLineEdit::gestureEvent(class QGestureEvent *)
+	?handleLongPressed@NmAttachmentListWidget@@AAEXVQPointF@@@Z @ 154 NONAME ; void NmAttachmentListWidget::handleLongPressed(class QPointF)
+	?changeEvent@NmAttachmentListWidget@@MAEXPAVQEvent@@@Z @ 155 NONAME ; void NmAttachmentListWidget::changeEvent(class QEvent *)
+	??1NmRecipientLineEdit@@UAE@XZ @ 156 NONAME ; NmRecipientLineEdit::~NmRecipientLineEdit(void)
+	?moveCursor@NmEditorTextEdit@@QAEXW4MoveOperation@QTextCursor@@W4MoveMode@3@@Z @ 157 NONAME ; void NmEditorTextEdit::moveCursor(enum QTextCursor::MoveOperation, enum QTextCursor::MoveMode)
 
--- a/emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/eabi/nmailuiwidgetsu.def	Thu Sep 30 11:43:07 2010 +0300
@@ -5,167 +5,185 @@
 	_ZN14NmHtmlLineEdit12setPlainTextERK7QString @ 4 NONAME
 	_ZN14NmHtmlLineEdit13setTextCursorERK11QTextCursor @ 5 NONAME
 	_ZN14NmHtmlLineEdit16staticMetaObjectE @ 6 NONAME DATA 16
-	_ZN14NmHtmlLineEdit19getStaticMetaObjectEv @ 7 NONAME
-	_ZN14NmHtmlLineEdit7setHtmlERK7QString @ 8 NONAME
-	_ZN14NmHtmlLineEditC1EP13QGraphicsItem @ 9 NONAME
-	_ZN14NmHtmlLineEditC2EP13QGraphicsItem @ 10 NONAME
-	_ZN14NmHtmlLineEditD0Ev @ 11 NONAME
-	_ZN14NmHtmlLineEditD1Ev @ 12 NONAME
-	_ZN14NmHtmlLineEditD2Ev @ 13 NONAME
-	_ZN16NmEditorTextEdit11qt_metacallEN11QMetaObject4CallEiPPv @ 14 NONAME
-	_ZN16NmEditorTextEdit11qt_metacastEPKc @ 15 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
-	_ZN20NmAttachmentListItem10setPressedEb @ 162 NONAME
-	_ZN22NmAttachmentListWidget10checkColorEv @ 163 NONAME
-	_ZN22NmAttachmentListWidget11changeEventEP6QEvent @ 164 NONAME
-	_ZN20NmAttachmentListItem18setBackgroundColorE6QColor @ 165 NONAME
-	_ZN22NmAttachmentListWidget18setBackgroundColorE6QColor @ 166 NONAME
-	_ZN19NmRecipientLineEdit11addContactsE5QListIP9NmAddressE @ 167 NONAME
-	_ZNK14NmHtmlLineEdit13hasInputFocusEv @ 168 NONAME
-	_ZNK16NmEditorTextEdit13hasInputFocusEv @ 169 NONAME
+	_ZN14NmHtmlLineEdit17setIndentForLabelEf @ 7 NONAME
+	_ZN14NmHtmlLineEdit19getStaticMetaObjectEv @ 8 NONAME
+	_ZN14NmHtmlLineEdit7setHtmlERK7QString @ 9 NONAME
+	_ZN14NmHtmlLineEditC1EP13QGraphicsItem @ 10 NONAME
+	_ZN14NmHtmlLineEditC2EP13QGraphicsItem @ 11 NONAME
+	_ZN14NmHtmlLineEditD0Ev @ 12 NONAME
+	_ZN14NmHtmlLineEditD1Ev @ 13 NONAME
+	_ZN14NmHtmlLineEditD2Ev @ 14 NONAME
+	_ZN16NmEditorTextEdit11qt_metacallEN11QMetaObject4CallEiPPv @ 15 NONAME
+	_ZN16NmEditorTextEdit11qt_metacastEPKc @ 16 NONAME
+	_ZN16NmEditorTextEdit16staticMetaObjectE @ 17 NONAME DATA 16
+	_ZN16NmEditorTextEdit18setCustomTextColorERK5QPairIb6QColorE @ 18 NONAME
+	_ZN16NmEditorTextEdit18setCustomTextColorEbRK6QColor @ 19 NONAME
+	_ZN16NmEditorTextEdit19getStaticMetaObjectEv @ 20 NONAME
+	_ZN16NmEditorTextEdit21updateCustomTextColorEv @ 21 NONAME
+	_ZN16NmEditorTextEditC1EP13QGraphicsItem @ 22 NONAME
+	_ZN16NmEditorTextEditC2EP13QGraphicsItem @ 23 NONAME
+	_ZN16NmEditorTextEditD0Ev @ 24 NONAME
+	_ZN16NmEditorTextEditD1Ev @ 25 NONAME
+	_ZN16NmEditorTextEditD2Ev @ 26 NONAME
+	_ZN19NmRecipientLineEdit11addContactsE5QListIP9NmAddressE @ 27 NONAME
+	_ZN19NmRecipientLineEdit11qt_metacallEN11QMetaObject4CallEiPPv @ 28 NONAME
+	_ZN19NmRecipientLineEdit11qt_metacastEPKc @ 29 NONAME
+	_ZN19NmRecipientLineEdit12gestureEventEP13QGestureEvent @ 30 NONAME
+	_ZN19NmRecipientLineEdit12setHighlightEi @ 31 NONAME
+	_ZN19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 32 NONAME
+	_ZN19NmRecipientLineEdit14modelCompletedEi @ 33 NONAME
+	_ZN19NmRecipientLineEdit15currentTextPartERiS0_ @ 34 NONAME
+	_ZN19NmRecipientLineEdit16emailAddressListEv @ 35 NONAME
+	_ZN19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 36 NONAME
+	_ZN19NmRecipientLineEdit16staticMetaObjectE @ 37 NONAME DATA 16
+	_ZN19NmRecipientLineEdit17handleTextChangedERK7QString @ 38 NONAME
+	_ZN19NmRecipientLineEdit17hideAutofillPopupEv @ 39 NONAME
+	_ZN19NmRecipientLineEdit17insertContactTextERK7QString @ 40 NONAME
+	_ZN19NmRecipientLineEdit17keyPressEventLeftEP9QKeyEvent @ 41 NONAME
+	_ZN19NmRecipientLineEdit17showAutofillPopupEv @ 42 NONAME
+	_ZN19NmRecipientLineEdit18keyPressEventRightEP9QKeyEvent @ 43 NONAME
+	_ZN19NmRecipientLineEdit19addSelectedContactsERK8QVariant @ 44 NONAME
+	_ZN19NmRecipientLineEdit19createAutoFillPopupEv @ 45 NONAME
+	_ZN19NmRecipientLineEdit19getStaticMetaObjectEv @ 46 NONAME
+	_ZN19NmRecipientLineEdit19keyPressEventDeleteEP9QKeyEvent @ 47 NONAME
+	_ZN19NmRecipientLineEdit22keyPressEventSemicolonEP9QKeyEvent @ 48 NONAME
+	_ZN19NmRecipientLineEdit24createAutofillComponentsEv @ 49 NONAME
+	_ZN19NmRecipientLineEdit24generateEmailAddressListEv @ 50 NONAME
+	_ZN19NmRecipientLineEdit25getChosenAddressFromModelERK11QModelIndexR9NmAddress @ 51 NONAME
+	_ZN19NmRecipientLineEdit29addSelectedContactFromHistoryERK11QModelIndex @ 52 NONAME
+	_ZN19NmRecipientLineEdit9handleTapEv @ 53 NONAME
+	_ZN19NmRecipientLineEditC1EP13QGraphicsItem @ 54 NONAME
+	_ZN19NmRecipientLineEditC2EP13QGraphicsItem @ 55 NONAME
+	_ZN19NmRecipientLineEditD0Ev @ 56 NONAME
+	_ZN19NmRecipientLineEditD1Ev @ 57 NONAME
+	_ZN19NmRecipientLineEditD2Ev @ 58 NONAME
+	_ZN20NmAttachmentListItem10setPressedEb @ 59 NONAME
+	_ZN20NmAttachmentListItem11constructUiEv @ 60 NONAME
+	_ZN20NmAttachmentListItem11qt_metacallEN11QMetaObject4CallEiPPv @ 61 NONAME
+	_ZN20NmAttachmentListItem11qt_metacastEPKc @ 62 NONAME
+	_ZN20NmAttachmentListItem12gestureEventEP13QGestureEvent @ 63 NONAME
+	_ZN20NmAttachmentListItem12setTextColorE6QColor @ 64 NONAME
+	_ZN20NmAttachmentListItem13itemActivatedEv @ 65 NONAME
+	_ZN20NmAttachmentListItem15hideProgressBarEv @ 66 NONAME
+	_ZN20NmAttachmentListItem15itemLongPressedE7QPointF @ 67 NONAME
+	_ZN20NmAttachmentListItem15setFileNameTextERK7QString @ 68 NONAME
+	_ZN20NmAttachmentListItem15setFileSizeTextERK7QString @ 69 NONAME
+	_ZN20NmAttachmentListItem16staticMetaObjectE @ 70 NONAME DATA 16
+	_ZN20NmAttachmentListItem17removeProgressBarEv @ 71 NONAME
+	_ZN20NmAttachmentListItem18setBackgroundColorE6QColor @ 72 NONAME
+	_ZN20NmAttachmentListItem19getStaticMetaObjectEv @ 73 NONAME
+	_ZN20NmAttachmentListItem19setProgressBarValueEi @ 74 NONAME
+	_ZN20NmAttachmentListItem4initEv @ 75 NONAME
+	_ZN20NmAttachmentListItemC1EP13QGraphicsItem @ 76 NONAME
+	_ZN20NmAttachmentListItemC2EP13QGraphicsItem @ 77 NONAME
+	_ZN20NmAttachmentListItemD0Ev @ 78 NONAME
+	_ZN20NmAttachmentListItemD1Ev @ 79 NONAME
+	_ZN20NmAttachmentListItemD2Ev @ 80 NONAME
+	_ZN20NmBaseViewScrollArea11qt_metacallEN11QMetaObject4CallEiPPv @ 81 NONAME
+	_ZN20NmBaseViewScrollArea11qt_metacastEPKc @ 82 NONAME
+	_ZN20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 83 NONAME
+	_ZN20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 84 NONAME
+	_ZN20NmBaseViewScrollArea16longPressGestureERK7QPointF @ 85 NONAME
+	_ZN20NmBaseViewScrollArea16staticMetaObjectE @ 86 NONAME DATA 16
+	_ZN20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 87 NONAME
+	_ZN20NmBaseViewScrollArea19getStaticMetaObjectEv @ 88 NONAME
+	_ZN20NmBaseViewScrollArea20handleMouseMoveEventEP24QGraphicsSceneMouseEvent @ 89 NONAME
+	_ZN20NmBaseViewScrollArea21handleMousePressEventEP24QGraphicsSceneMouseEvent @ 90 NONAME
+	_ZN20NmBaseViewScrollArea22handleLongPressGestureERK7QPointF @ 91 NONAME
+	_ZN20NmBaseViewScrollArea23handleMouseReleaseEventEP24QGraphicsSceneMouseEvent @ 92 NONAME
+	_ZN20NmBaseViewScrollAreaC1EP13QGraphicsItem @ 93 NONAME
+	_ZN20NmBaseViewScrollAreaC2EP13QGraphicsItem @ 94 NONAME
+	_ZN20NmBaseViewScrollAreaD0Ev @ 95 NONAME
+	_ZN20NmBaseViewScrollAreaD1Ev @ 96 NONAME
+	_ZN20NmBaseViewScrollAreaD2Ev @ 97 NONAME
+	_ZN22NmAttachmentListWidget10checkColorEv @ 98 NONAME
+	_ZN22NmAttachmentListWidget11changeEventEP6QEvent @ 99 NONAME
+	_ZN22NmAttachmentListWidget11constructUiEv @ 100 NONAME
+	_ZN22NmAttachmentListWidget11longPressedEi7QPointF @ 101 NONAME
+	_ZN22NmAttachmentListWidget11qt_metacallEN11QMetaObject4CallEiPPv @ 102 NONAME
+	_ZN22NmAttachmentListWidget11qt_metacastEPKc @ 103 NONAME
+	_ZN22NmAttachmentListWidget12setTextColorE6QColor @ 104 NONAME
+	_ZN22NmAttachmentListWidget13itemActivatedEi @ 105 NONAME
+	_ZN22NmAttachmentListWidget15hideProgressBarEi @ 106 NONAME
+	_ZN22NmAttachmentListWidget15rearrangeLayoutEv @ 107 NONAME
+	_ZN22NmAttachmentListWidget16insertAttachmentEiRK7QStringS2_ @ 108 NONAME
+	_ZN22NmAttachmentListWidget16removeAttachmentEi @ 109 NONAME
+	_ZN22NmAttachmentListWidget16staticMetaObjectE @ 110 NONAME DATA 16
+	_ZN22NmAttachmentListWidget17handleLongPressedE7QPointF @ 111 NONAME
+	_ZN22NmAttachmentListWidget17setAttachmentSizeEiRK7QString @ 112 NONAME
+	_ZN22NmAttachmentListWidget18insertItemToLayoutEP20NmAttachmentListItem @ 113 NONAME
+	_ZN22NmAttachmentListWidget18orientationChangedEN2Qt11OrientationE @ 114 NONAME
+	_ZN22NmAttachmentListWidget18setBackgroundColorE6QColor @ 115 NONAME
+	_ZN22NmAttachmentListWidget19getStaticMetaObjectEv @ 116 NONAME
+	_ZN22NmAttachmentListWidget19handleItemActivatedEv @ 117 NONAME
+	_ZN22NmAttachmentListWidget19setProgressBarValueEii @ 118 NONAME
+	_ZN22NmAttachmentListWidget4initEv @ 119 NONAME
+	_ZN22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 120 NONAME
+	_ZN22NmAttachmentListWidget8findItemEPK7QObject @ 121 NONAME
+	_ZN22NmAttachmentListWidgetC1EP13QGraphicsItem @ 122 NONAME
+	_ZN22NmAttachmentListWidgetC2EP13QGraphicsItem @ 123 NONAME
+	_ZN22NmAttachmentListWidgetD0Ev @ 124 NONAME
+	_ZN22NmAttachmentListWidgetD1Ev @ 125 NONAME
+	_ZN22NmAttachmentListWidgetD2Ev @ 126 NONAME
+	_ZNK14NmHtmlLineEdit10metaObjectEv @ 127 NONAME
+	_ZNK14NmHtmlLineEdit10textCursorEv @ 128 NONAME
+	_ZNK14NmHtmlLineEdit11toPlainTextEv @ 129 NONAME
+	_ZNK14NmHtmlLineEdit13hasInputFocusEv @ 130 NONAME
+	_ZNK14NmHtmlLineEdit21rectForCursorPositionEv @ 131 NONAME
+	_ZNK14NmHtmlLineEdit6toHtmlEv @ 132 NONAME
+	_ZNK14NmHtmlLineEdit8documentEv @ 133 NONAME
+	_ZNK16NmEditorTextEdit10metaObjectEv @ 134 NONAME
+	_ZNK16NmEditorTextEdit13hasInputFocusEv @ 135 NONAME
+	_ZNK16NmEditorTextEdit15customTextColorEv @ 136 NONAME
+	_ZNK16NmEditorTextEdit21rectForCursorPositionEv @ 137 NONAME
+	_ZNK19NmRecipientLineEdit10metaObjectEv @ 138 NONAME
+	_ZNK20NmAttachmentListItem10metaObjectEv @ 139 NONAME
+	_ZNK20NmAttachmentListItem16progressBarValueEv @ 140 NONAME
+	_ZNK20NmBaseViewScrollArea10metaObjectEv @ 141 NONAME
+	_ZNK22NmAttachmentListWidget10metaObjectEv @ 142 NONAME
+	_ZNK22NmAttachmentListWidget13progressValueEi @ 143 NONAME
+	_ZNK22NmAttachmentListWidget5countEv @ 144 NONAME
+	_ZTI14NmHtmlLineEdit @ 145 NONAME
+	_ZTI16NmEditorTextEdit @ 146 NONAME
+	_ZTI19NmRecipientLineEdit @ 147 NONAME
+	_ZTI20NmAttachmentListItem @ 148 NONAME
+	_ZTI20NmBaseViewScrollArea @ 149 NONAME
+	_ZTI22NmAttachmentListWidget @ 150 NONAME
+	_ZTV14NmHtmlLineEdit @ 151 NONAME
+	_ZTV16NmEditorTextEdit @ 152 NONAME
+	_ZTV19NmRecipientLineEdit @ 153 NONAME
+	_ZTV20NmAttachmentListItem @ 154 NONAME
+	_ZTV20NmBaseViewScrollArea @ 155 NONAME
+	_ZTV22NmAttachmentListWidget @ 156 NONAME
+	_ZThn16_N14NmHtmlLineEditD0Ev @ 157 NONAME
+	_ZThn16_N14NmHtmlLineEditD1Ev @ 158 NONAME
+	_ZThn16_N16NmEditorTextEditD0Ev @ 159 NONAME
+	_ZThn16_N16NmEditorTextEditD1Ev @ 160 NONAME
+	_ZThn16_N19NmRecipientLineEditD0Ev @ 161 NONAME
+	_ZThn16_N19NmRecipientLineEditD1Ev @ 162 NONAME
+	_ZThn16_N20NmAttachmentListItemD0Ev @ 163 NONAME
+	_ZThn16_N20NmAttachmentListItemD1Ev @ 164 NONAME
+	_ZThn16_N20NmBaseViewScrollAreaD0Ev @ 165 NONAME
+	_ZThn16_N20NmBaseViewScrollAreaD1Ev @ 166 NONAME
+	_ZThn16_N22NmAttachmentListWidgetD0Ev @ 167 NONAME
+	_ZThn16_N22NmAttachmentListWidgetD1Ev @ 168 NONAME
+	_ZThn8_N14NmHtmlLineEditD0Ev @ 169 NONAME
+	_ZThn8_N14NmHtmlLineEditD1Ev @ 170 NONAME
+	_ZThn8_N16NmEditorTextEditD0Ev @ 171 NONAME
+	_ZThn8_N16NmEditorTextEditD1Ev @ 172 NONAME
+	_ZThn8_N19NmRecipientLineEdit13keyPressEventEP9QKeyEvent @ 173 NONAME
+	_ZThn8_N19NmRecipientLineEdit16inputMethodEventEP17QInputMethodEvent @ 174 NONAME
+	_ZThn8_N19NmRecipientLineEditD0Ev @ 175 NONAME
+	_ZThn8_N19NmRecipientLineEditD1Ev @ 176 NONAME
+	_ZThn8_N20NmAttachmentListItemD0Ev @ 177 NONAME
+	_ZThn8_N20NmAttachmentListItemD1Ev @ 178 NONAME
+	_ZThn8_N20NmBaseViewScrollArea14mouseMoveEventEP24QGraphicsSceneMouseEvent @ 179 NONAME
+	_ZThn8_N20NmBaseViewScrollArea15mousePressEventEP24QGraphicsSceneMouseEvent @ 180 NONAME
+	_ZThn8_N20NmBaseViewScrollArea17mouseReleaseEventEP24QGraphicsSceneMouseEvent @ 181 NONAME
+	_ZThn8_N20NmBaseViewScrollAreaD0Ev @ 182 NONAME
+	_ZThn8_N20NmBaseViewScrollAreaD1Ev @ 183 NONAME
+	_ZThn8_N22NmAttachmentListWidget5paintEP8QPainterPK24QStyleOptionGraphicsItemP7QWidget @ 184 NONAME
+	_ZThn8_N22NmAttachmentListWidgetD0Ev @ 185 NONAME
+	_ZThn8_N22NmAttachmentListWidgetD1Ev @ 186 NONAME
+	_ZN16NmEditorTextEdit10moveCursorEN11QTextCursor13MoveOperationENS0_8MoveModeE @ 187 NONAME
 
--- a/emailuis/nmailuiwidgets/inc/nmailuiwidgetsheaders.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmailuiwidgetsheaders.h	Thu Sep 30 11:43:07 2010 +0300
@@ -25,6 +25,8 @@
 #include <QGraphicsItem>
 #include <QGraphicsSceneMouseEvent>
 #include <QGraphicsGridLayout>
+#include <QTextBlock>
+#include <QGraphicsLinearLayout>
 
 // Symbian & qt extensions
 #ifdef Q_OS_SYMBIAN
@@ -41,6 +43,7 @@
 #include <HbInstantFeedback>
 #include <HbFrameItem>
 #include <HbEffect>
+#include <HbFrameBackground>
 #include <hbmessagebox.h>
 #include <hbscrollarea.h>
 #include <hbstyleloader.h>
@@ -49,19 +52,31 @@
 #include <hbdocumentloader.h>
 #include <hbinstance.h>
 #include <hbcolorscheme.h>
+#include <hbpangesture.h>
 #include <hbtapgesture.h>
 #include <hbevent.h>
+#include <hbinputvkbhost.h>
 #include <hbinputmethod.h>
+#include <hbstyle.h>
+#include <hbevent.h>
+#include <hblabel.h>
+#include <hbrichtextitem.h>
 
 // nmail
 #include <nmaddress.h>
 #include <nmcommon.h>
 
+// nmutilities
+#include <nmcontacthistorymodel.h>
+#include <nmcontacthistorymodelcommon.h>
+
 // nmailuiwidgets
 #include "nmrecipientlineedit.h"
 #include "nmhtmllineedit.h"
 #include "nmeditortextedit.h"
 #include "nmbaseviewscrollarea.h"
+#include "nmautofilllistview.h"
+#include "nmautofilllistviewitem.h"
 #include "nmattachmentlistitem.h"
 #include "nmattachmentlistwidget.h"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiwidgets/inc/nmautofilllistview.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,35 @@
+/*
+* 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: List view for the autofill items
+*
+*/
+
+#ifndef NMAUTOFILLLISTVIEW_H
+#define NMAUTOFILLLISTVIEW_H
+
+#include <hblistview.h>
+
+class QGraphicsItem;
+class QGestureEvent;
+
+
+class NmAutoFillListView : public HbListView
+{
+public:
+    NmAutoFillListView(QGraphicsItem *parent = NULL);
+public slots:
+    void orientationChanged(Qt::Orientation orientation);
+};
+
+#endif // NMAUTOFILLLISTVIEW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiwidgets/inc/nmautofilllistviewitem.h	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* 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: Customized list view item to display autofill items on list.
+*
+*/
+
+#ifndef NMAUTOFILLLISTVIEWITEM_H_
+#define NMAUTOFILLLISTVIEWITEM_H_
+
+#include <hblistviewitem.h>
+
+class HbLabel;
+class QGraphicsLinearLayout;
+class NmContactHistoryModelSubItem;
+class HbRichTextItem;
+
+class NmAutoFillListViewItem : public HbListViewItem
+{
+    Q_OBJECT
+public:
+    NmAutoFillListViewItem(QGraphicsItem * parent = NULL);
+    virtual ~NmAutoFillListViewItem();
+
+public: // from HbListViewItem
+    HbListViewItem *createItem();
+    void updateChildItems();
+    bool canSetModelIndex(const QModelIndex &index);
+
+private:
+    QString setHtmlUnderLine(const NmContactHistoryModelSubItem &subItem);
+
+private:
+    HbRichTextItem *mDisplayName; //not owned
+    HbRichTextItem *mAddress; //not owned
+};
+
+#endif /* NMAUTOFILLLISTVIEWITEM_H_ */
--- a/emailuis/nmailuiwidgets/inc/nmeditortextedit.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmeditortextedit.h	Thu Sep 30 11:43:07 2010 +0300
@@ -36,6 +36,8 @@
     bool hasInputFocus() const;
 
     QRectF rectForCursorPosition() const;
+    
+    void moveCursor(QTextCursor::MoveOperation op, QTextCursor::MoveMode mode);
 
 public slots:
     void updateCustomTextColor();
--- a/emailuis/nmailuiwidgets/inc/nmhtmllineedit.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmhtmllineedit.h	Thu Sep 30 11:43:07 2010 +0300
@@ -41,10 +41,14 @@
     bool hasInputFocus() const;
 
     QRectF rectForCursorPosition() const;
-
+    void setIndentForLabel(const qreal indent);
+    
 public slots:
     void setPlainText(const QString &text);
     void setHtml(const QString &text);
+
+private:
+    qreal mIndent;
 };
 
 #endif /* NMHTMLLINEEDIT_H_ */
--- a/emailuis/nmailuiwidgets/inc/nmrecipientlineedit.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/inc/nmrecipientlineedit.h	Thu Sep 30 11:43:07 2010 +0300
@@ -11,60 +11,98 @@
 *
 * Contributors:
 *
-* Description: nmrecipientlineedit.h
+* Description: implementation of recipient field (to, cc, bcc) line editor
 *
 */
 
 #ifndef NMRECIPIENTLINEEDIT_H_
 #define NMRECIPIENTLINEEDIT_H_
 
-#include <nmailuiwidgetsdef.h>
 #include <nmhtmllineedit.h>
-#include <nmaddress.h>
 
 class QGraphicsItem;
+class QModelIndex;
 
+class HbPopup;
+class HbListView;
+
+class NmContactHistoryModel;
+class NmAutoFillListViewItem;
+class NmPopupBackground;
+class NmAddress;
 
 class NMAILUIWIDGETS_EXPORT NmRecipientLineEdit : public NmHtmlLineEdit
 {
     Q_OBJECT
-    
+
 public:
-    NmRecipientLineEdit(QGraphicsItem *parent = 0);
+    NmRecipientLineEdit(QGraphicsItem *parent = NULL);
     virtual ~NmRecipientLineEdit();
-
-    // Get the emailaddress list generated from the content of the lineedit.
     QList<NmAddress> emailAddressList();
     void addContacts(QList<NmAddress *> contacts);
 	
 public slots:
-#ifdef Q_OS_SYMBIAN
     void addSelectedContacts(const QVariant &selectedContacts);
-#endif
+    void addSelectedContactFromHistory(const QModelIndex &modelIndex);
 
 protected:	// from HbLineEdit
     void keyPressEvent(QKeyEvent *event);
     void inputMethodEvent(QInputMethodEvent *event);
 
 private:
-    // Generate emailaddress list from the content of the lineedit.
     void generateEmailAddressList();
-	
-private slots:    
+    void createAutofillComponents();
+    void createAutoFillPopup();
+    void showAutofillPopup();
+    void hideAutofillPopup();
+    void currentTextPart(int& startIndex, int& length);
+    void getChosenAddressFromModel(const QModelIndex &modelIndex, NmAddress &address);
+    void setHighlight(int currentPos);
+    void gestureEvent(QGestureEvent* event);
+    void handleTap();
+    void insertContactText(const QString &text);
+    void keyPressEventSemicolon(QKeyEvent *event);
+    void keyPressEventDelete(QKeyEvent *event);
+    void keyPressEventLeft(QKeyEvent *event);
+    void keyPressEventRight(QKeyEvent *event);
+    
+private slots:
     void handleTextChanged(const QString &text);
+    void modelCompleted(int err);
 
 private:
     // mEmailAddressList contains all emailaddress that appear in the lineedit and 
     // all emailaddress corresponding to the contact's name added from Contacts,
     // including invalid emailaddress user typed or invalid emailaddress added from Contacts.
     // Emailaddress validation check is conducted in nmeditorview.
-    QList<NmAddress> mEmailAddressList; 
-	
+    QList<NmAddress> mEmailAddressList; 	
     QList<NmAddress> mRecipientsAddedFromContacts;
 	
     // Flag "need to generate mEmailAddressList" is used whenever editing made after 
     // the emailaddress validation check failed.
     bool mNeedToGenerateEmailAddressList;
+
+    NmContactHistoryModel *mContactHistoryModel; // owned
+
+    HbPopup *mAutoFillPopup; // owned
+
+    HbListView *mAutofillListView; // owned
+    NmAutoFillListViewItem *mAutofillListViewItem; //owned
+    NmPopupBackground *mPopupBackground; // pwned
+};
+
+class NmPopupBackground : public QGraphicsItem
+{
+public:
+    explicit NmPopupBackground(HbPopup *popup, QGraphicsItem *parent = 0);
+    bool isModal() { return true; }
+    QRectF boundingRect() const { return QRect(-100, -100, 1000, 1000); }
+    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
+protected:
+    bool sceneEvent(QEvent *event);
+private:
+    mutable QRectF mRect;
+    HbPopup *mPopup; //not owned
 };
 
 #endif   // NMRECIPIENTLINEEDIT_H_
--- a/emailuis/nmailuiwidgets/nmailuiwidgets.pro	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/nmailuiwidgets.pro	Thu Sep 30 11:43:07 2010 +0300
@@ -17,7 +17,9 @@
 INCLUDEPATH += ./inc \
   ../../inc
 
-HEADERS += inc/nmailuiwidgetsheaders.h \
+HEADERS += inc/nmautofilllistview.h \
+           inc/nmautofilllistviewitem.h \
+           inc/nmailuiwidgetsheaders.h \
            inc/nmailuiwidgetsdef.h \
            inc/nmbaseviewscrollarea.h \
            inc/nmrecipientlineedit.h \
@@ -26,7 +28,9 @@
            inc/nmattachmentlistwidget.h \
            inc/nmattachmentlistitem.h
 
-SOURCES += src/nmbaseviewscrollarea.cpp \
+SOURCES += src/nmautofilllistview.cpp \
+           src/nmautofilllistviewitem.cpp \
+           src/nmbaseviewscrollarea.cpp \
            src/nmrecipientlineedit.cpp \
            src/nmhtmllineedit.cpp \
            src/nmeditortextedit.cpp \
@@ -43,7 +47,8 @@
     LIBS += -lnmailbase \
             -lxqservice \
             -lxqserviceutil \
-            -lqtcontacts
+            -lqtcontacts \
+            -lnmutilities
 
     defBlock = \      
       "$${LITERAL_HASH}if defined(MARM)" \
--- a/emailuis/nmailuiwidgets/nmailuiwidgets.qrc	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/nmailuiwidgets.qrc	Thu Sep 30 11:43:07 2010 +0300
@@ -6,5 +6,10 @@
         <file alias="nmeditortexteditblack.css">resources/nmeditortexteditblack.css</file>
         <file alias="nmeditortexteditblue.css">resources/nmeditortexteditblue.css</file>
         <file alias="nmeditortextedit.widgetml">resources/nmeditortextedit.widgetml</file>
+        <file alias="nmautofilllistviewitem.css">resources/nmautofilllistviewitem.css</file>
+        <file alias="nmautofilllistviewitem.widgetml">resources/nmautofilllistviewitem.widgetml</file>
+        <file alias="nmrecipientlineedit.css">resources/nmrecipientlineedit.css</file>
+        <file alias="nmrecipientlineedit.widgetml">resources/nmrecipientlineedit.widgetml</file>
+	<file alias="nmautofilllistview.docml">resources/nmautofilllistview.docml</file>
     </qresource>
 </RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiwidgets/resources/nmautofilllistview.docml	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+<widget name="listview" type="HbListView">
+	<sizehint type="MAXIMUM" height="expr(var(hb-param-screen-height)-var(hb-param-margin-gene-top)-var(hb-param-widget-toolbar-height)-7.5un)" />
+	<sizehint type="FIXED" width="expr(var(hb-param-screen-width)-var(hb-param-margin-gene-right)-var(hb-param-margin-gene-left)-9.5un)" />
+
+</widget>
+</hbdocument>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiwidgets/resources/nmautofilllistviewitem.css	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,25 @@
+NmAutoFillListViewItem:portrait {
+        layout:portrait-111;
+}
+
+NmAutoFillListViewItem:landscape {
+        layout:landscape-111;
+}
+
+
+NmAutoFillListViewItem::AutoFillListViewDisplayName:landscape {
+pref-width:expr((1/2)*(var(hb-param-screen-width)-var(hb-param-margin-gene-right)-var(hb-param-margin-gene-left)-9.5un-var(hb-param-margin-gene-middle-horizontal)-var(hb-param-margin-gene-popup)-var(hb-param-margin-gene-popup)));
+size-policy-horizontal:fixed;
+font-variant:primary; 
+text-height: var(hb-param-graphic-size-primary);
+}
+
+NmAutoFillListViewItem::AutoFillListViewDisplayName:portrait {
+font-variant:primary; 
+text-height: var(hb-param-graphic-size-primary);
+}
+
+NmAutoFillListViewItem::AutoFillListViewAddress {
+font-variant:secondary;
+text-height:var(hb-param-graphic-size-secondary);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiwidgets/resources/nmautofilllistviewitem.widgetml	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,23 @@
+<hbwidget version="0.1" type="NmAutoFillListViewItem">
+<layout name="landscape-111" type="mesh">
+        <meshitem src="AutoFillListViewDisplayName" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" />
+        <meshitem src="AutoFillListViewDisplayName" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
+        <meshitem src="AutoFillListViewDisplayName" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
+        <meshitem src="AutoFillListViewDisplayName" srcEdge="RIGHT" dst="AutoFillListViewAddress" dstEdge="LEFT" spacing="var(hb-param-margin-gene-middle-vertical)"/>
+        
+        <meshitem src="AutoFillListViewAddress" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)"/>
+        <meshitem src="AutoFillListViewAddress" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)"/>
+        <meshitem src="AutoFillListViewAddress" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)"/>
+    </layout>
+
+    <layout name="portrait-111" type="mesh">
+        <meshitem src="AutoFillListViewDisplayName" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" />
+        <meshitem src="AutoFillListViewDisplayName" srcEdge="TOP" dst="" dstEdge="TOP" spacing="-var(hb-param-margin-gene-top)" />
+        <meshitem src="AutoFillListViewDisplayName" srcEdge="BOTTOM" dst="AutoFillListViewAddress" dstEdge="TOP" spacing="var(hb-param-margin-gene-middle-horizontal)"/>
+        <meshitem src="AutoFillListViewDisplayName" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+
+        <meshitem src="AutoFillListViewAddress" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" spacing="var(hb-param-margin-gene-bottom)" />
+        <meshitem src="AutoFillListViewAddress" srcEdge="RIGHT" dst="" dstEdge="RIGHT" spacing="var(hb-param-margin-gene-right)" />
+        <meshitem src="AutoFillListViewAddress" srcEdge="LEFT" dst="" dstEdge="LEFT" spacing="-var(hb-param-margin-gene-left)" />
+    </layout>
+</hbwidget>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiwidgets/resources/nmrecipientlineedit.css	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,18 @@
+NmRecipientLineEdit{
+    layout:default;
+    text-align: left;
+}
+
+NmRecipientLineEdit::text{
+    left: -var(hb-param-margin-gene-middle-horizontal);
+    right: var(hb-param-margin-gene-middle-horizontal);
+    top: -expr(var(hb-param-margin-gene-top)-4px);
+    bottom: expr(var(hb-param-margin-gene-bottom)-4px);
+}
+
+/*
+  Added font information LineEdit in DataFormItem case , its needed to pass loc test of dataform "qtl_dataform_editor_sec".
+*/
+HbDataFormViewItem > NmRecipientLineEdit {
+    font-variant:secondary; /* still loclization id xls its not updated to have correct infor , temporary setting font to secondary  */
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiwidgets/resources/nmrecipientlineedit.widgetml	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,12 @@
+<hbwidget version="0.1" type="NmRecipientLineEdit">
+
+  <layout name="default" type="mesh">
+    <meshitem src="text" srcEdge="TOP" dst="" dstEdge="TOP" />
+    <meshitem src="text" srcEdge="BOTTOM" dst="" dstEdge="BOTTOM" />
+    <meshitem src="text" srcEdge="LEFT" dst="" dstEdge="LEFT" />
+    <meshitem src="text" srcEdge="RIGHT" dst="" dstEdge="RIGHT" />
+    <meshitem src="autoFillPopup" srcEdge="TOP" dst="" dstEdge="BOTTOM" />
+    <meshitem src="autoFillPopup" srcEdge="CENTERH" dst="" dstEdge="CENTERH" />
+  </layout>
+
+</hbwidget>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiwidgets/src/nmautofilllistview.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,52 @@
+/*
+* 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: List view for the autofill items. 
+*
+*/
+
+#include "nmailuiwidgetsheaders.h"
+
+
+static const int NmHorizontalPreferredWidth(500);
+static const int NmVerticalPreferredWidth(300);
+
+/*!
+    \class NmAutoFillListView
+    \brief List view for the autofill items.
+    
+    The main function is to handle the virtual keyboard openings and closings. 
+*/
+
+/*!
+    Constructor of NmAutoFillListView.
+    
+    Registers widgetML and CSS files to HbStyle system for view items.
+*/
+NmAutoFillListView::NmAutoFillListView(QGraphicsItem *parent) : HbListView(parent)
+{
+}
+/*!
+    The popup size changes with the orientation. In horizontal orientation, the popup is wider.
+    
+    \param orientation 
+ */
+void NmAutoFillListView::orientationChanged(Qt::Orientation orientation)
+{
+    if (orientation == Qt::Horizontal) {
+        setPreferredWidth(NmHorizontalPreferredWidth);
+    }
+    else {
+        setPreferredWidth(NmVerticalPreferredWidth);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emailuis/nmailuiwidgets/src/nmautofilllistviewitem.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -0,0 +1,173 @@
+/*
+* 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: Customized list view item to display autofill items on list. 
+*
+*/
+
+#include "nmailuiwidgetsheaders.h"
+
+static const QString NmAutoFillListViewDisplayName("AutoFillListViewDisplayName");
+static const QString NmAutoFillListViewAddress("AutoFillListViewAddress");
+
+static const QString NmAutoFillListViewItemUnderLineStart("<U>");
+static const QString NmAutoFillListViewItemUnderLineEnd("</U>");
+
+
+/*!
+    \class NmAutoFillListViewItem
+    \brief List view items for autofill items. 
+    
+    Customized list view item to display autofill items on list. 
+*/
+
+/*!
+    Constructor of NmAutoFillListViewItem.
+    
+    Calls constructUi function and sets stretching to landscape mode. 
+*/
+NmAutoFillListViewItem::NmAutoFillListViewItem(QGraphicsItem *parent)
+: HbListViewItem(parent), mDisplayName(NULL), mAddress(NULL)
+{
+    NM_FUNCTION;   
+}
+
+/*!
+    Destructor of NmAutoFillListViewItem.
+*/
+NmAutoFillListViewItem::~NmAutoFillListViewItem()
+{
+}
+
+/*!
+    Item creation. Overwrites HbListViewItem funtion.
+    
+    \return A newly created NmAutoFillListViewItem. 
+*/
+HbListViewItem* NmAutoFillListViewItem::createItem()
+{
+    NM_FUNCTION;
+    
+    return new NmAutoFillListViewItem(*this);
+}
+
+/*!
+    Update child items. Overwrites HbListViewItem funtion.
+    
+    The data is fetched from the model by using current model index and displayed.     
+*/
+void NmAutoFillListViewItem::updateChildItems()
+{
+    NM_FUNCTION;
+ 
+    QString displayText;
+    QString addressText;
+
+
+    //Get data from model
+    //check if QVariant is ok for this item etc.
+    NmContactHistoryModelItem item =
+            modelIndex().data(Qt::DisplayRole).value<NmContactHistoryModelItem>();
+    
+    if (item.subItemCount()) {
+
+        QList<NmContactHistoryModelSubItem> itemlist = item.subEntries();
+        
+        //Check if both displayname and address is found. 
+        if(itemlist.count() == 2) {
+            displayText.append(setHtmlUnderLine(itemlist[0]));
+            addressText.append(setHtmlUnderLine(itemlist[1]));
+        //If only 1 item is found. It will be set to position of displayname. 
+        } else if(itemlist.count() == 1) {
+            displayText.append(setHtmlUnderLine(itemlist[0]));
+        }
+    } else {
+        //Items not found. There is no point to continue. 
+        return;
+    }
+
+    if (!mDisplayName) {
+        mDisplayName = new HbRichTextItem(this);
+        mDisplayName->setObjectName(NmAutoFillListViewDisplayName);
+        HbStyle::setItemName(mDisplayName, NmAutoFillListViewDisplayName);
+    }
+
+    mDisplayName->setText(displayText);
+
+    if (!mAddress){
+        mAddress = new HbRichTextItem(this);
+        mAddress->setObjectName(NmAutoFillListViewAddress);
+        HbStyle::setItemName(mAddress, NmAutoFillListViewAddress);
+    }
+
+    mAddress->setText(addressText);
+
+    HbListViewItem::updateChildItems();
+}
+
+/*!    
+    Model index can be set. Overwrites HbListViewItem funtion.
+
+    Enables set of all model indexes.  
+    \param index The model index. 
+    \return always true. 
+*/
+bool NmAutoFillListViewItem::canSetModelIndex(const QModelIndex &index)
+{
+    NM_FUNCTION;
+    
+    Q_UNUSED(index);
+    return true;
+}
+
+/*!
+    Private helper class to set html underline tags. 
+    
+    \param subItem Reference to subitem to do underlining. 
+    \return QString underlined by html tags. 
+ */
+QString NmAutoFillListViewItem::setHtmlUnderLine(const NmContactHistoryModelSubItem &subItem)
+{
+    NM_FUNCTION;
+
+    QString ret;
+    bool odd(false);
+    int index_corrector(0);
+
+    QList<int> matching = subItem.mMatchingRanges;
+    ret.append(subItem.mItemText);
+
+    //Check that there is even count of matching range indexes.
+    if ((matching.count() % 2) == 0) {
+
+        foreach(int index, matching) {
+            
+            //Make sanity check for indexes. 
+            if (index < subItem.mItemText.length() && index >= 0) {
+                if (!odd) {
+                    ret = ret.insert(index+index_corrector,NmAutoFillListViewItemUnderLineStart);
+                    index_corrector += NmAutoFillListViewItemUnderLineStart.length();
+                } else {
+                    ret = ret.insert(index+1+index_corrector,NmAutoFillListViewItemUnderLineEnd);
+                    index_corrector += NmAutoFillListViewItemUnderLineEnd.length();
+                }
+            } else {
+                //Sanity check failed. No point to continue. 
+                break; 
+            }
+            odd = odd ? false : true;
+       }
+    }
+    return ret;
+}
+
--- a/emailuis/nmailuiwidgets/src/nmeditortextedit.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmeditortextedit.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -175,12 +175,38 @@
 }
 
 /*!
- *  Returns the rectangle for the cursor.
+ *  Returns the rectangle for the cursor including the predictive text area.
+ *  HbAbstractEditPrivate::ensurePositionVisible() uses the same algorithm.
  */
 QRectF NmEditorTextEdit::rectForCursorPosition() const
 {
     NM_FUNCTION;
     
-    return HbTextEdit::rectForPosition(cursorPosition());
+    int cursorPos = cursorPosition();
+    QRectF rect = rectForPosition(cursorPos);
+    QTextDocument *doc = document();
+    if (doc) {
+        rect.adjust(0, -doc->documentMargin(), 0, doc->documentMargin());
+        const QTextBlock block = doc->findBlock(cursorPos);
+        QTextLayout *blockLayout = block.layout();
+        if (block.isValid() && blockLayout) {
+            if (blockLayout->preeditAreaText().length()) {
+                // Adjust cursor rect so that predictive text will be also visible
+                rect.adjust(0, 0, boundingRect().width() / 2, 0);
+            }
+        }
+    }
+
+    return rect;
 }
 
+/*!
+ *  Sets the visible cursor position
+ */
+
+void NmEditorTextEdit::moveCursor(QTextCursor::MoveOperation op, QTextCursor::MoveMode mode)
+{
+    NM_FUNCTION;
+    HbAbstractEdit::moveCursor(op, mode);
+}
+
--- a/emailuis/nmailuiwidgets/src/nmhtmllineedit.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmhtmllineedit.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -16,6 +16,9 @@
 */
 
 #include "nmailuiwidgetsheaders.h"
+
+static const int NmLabelIndentUsePreviousValue = 0;
+
 /*
 #include "nmhtmllineedit.h"
 */
@@ -23,7 +26,8 @@
     Constructor
  */
 NmHtmlLineEdit::NmHtmlLineEdit(QGraphicsItem *parent) :
-    HbLineEdit(parent)
+    HbLineEdit(parent),
+    mIndent(0)
 {
     NM_FUNCTION;
 
@@ -85,6 +89,8 @@
     NM_FUNCTION;
     
     HbAbstractEdit::setHtml(text);
+    // Resetting the indent is called because setting new content lose old indention set. 
+    setIndentForLabel(NmLabelIndentUsePreviousValue);    
 }
 
 QString NmHtmlLineEdit::toPlainText () const
@@ -99,6 +105,8 @@
     NM_FUNCTION;
     
     HbAbstractEdit::setPlainText(text);
+    // Resetting the indent is called because setting new content lose old indention set. 
+    setIndentForLabel(NmLabelIndentUsePreviousValue);    
 }
 
 /*!
@@ -124,11 +132,49 @@
 
 
 /*!
- *  Returns the rectangle for the cursor.
+ *  Returns the rectangle for the cursor including the predictive text area.  
+ *  HbAbstractEditPrivate::ensurePositionVisible() uses the same algorithm.
  */
 QRectF NmHtmlLineEdit::rectForCursorPosition() const
 {
     NM_FUNCTION;
     
-    return HbLineEdit::rectForPosition(cursorPosition());
+    int cursorPos = cursorPosition();
+    QRectF rect = rectForPosition(cursorPos);
+    QTextDocument *doc = document();
+    if (doc) {
+        rect.adjust(0, -doc->documentMargin(), 0, doc->documentMargin());
+        const QTextBlock block = doc->findBlock(cursorPos);
+        QTextLayout *blockLayout = block.layout();
+        if (block.isValid() && blockLayout) {
+            if (blockLayout->preeditAreaText().length()) {
+                // Adjust cursor rect so that predictive text will be also visible
+                rect.adjust(0, 0, boundingRect().width() / 2, 0);
+            }
+        }
+    }
+
+    return rect;
 }
+
+/*!
+    Set margin for the first line. This will create empty space
+    into begining of the edit field to reserve enough space for the
+    label text e.g. 'To:'.
+ */
+void NmHtmlLineEdit::setIndentForLabel(const qreal indent)
+{
+    NM_FUNCTION;
+	
+    // Check that should we use previous value or set new value.
+    // Previous value is used when edit field content is changed.
+    if (indent != NmLabelIndentUsePreviousValue) {
+        mIndent = indent;
+    }
+    QTextCursor cursor(this->document());
+    cursor.select(QTextCursor::BlockUnderCursor);
+    QTextBlockFormat format;
+    format.setTextIndent(mIndent);
+    cursor.mergeBlockFormat(format);
+}
+
--- a/emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmailuiwidgets/src/nmrecipientlineedit.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -11,95 +11,118 @@
 *
 * Contributors:
 *
-* Description: nmrecipientlineedit.cpp
-* 
+* Description: implementation of recipient field (to, cc, bcc) line editor
+*
 */
 
 #include "nmailuiwidgetsheaders.h"
 
-static const QString Semicolon(";");
-static const QString Delimiter("; ");
-static const QRegExp CommaOrSemicolon("[,;]");
+static const QString NmRecipientLineEditSemicolon(";");
+static const QString NmRecipientLineEditDelimiter("; ");
+static const QRegExp NmRecipientLineEditCommaOrSemicolon("[,;]");
+
+static const int NmRecipientLineEditFadedAlpha(125);
 
+static const int NmRecipientLineEditForegroundZValue(200);
+static const int NmRecipientLineEditBackgroundZValue(0);
 
+static const QString FILE_PATH_WIDGETML = ":nmrecipientlineedit.widgetml";
+static const QString FILE_PATH_CSS = ":nmrecipientlineedit.css";
+static const QString FILE_PATH_AUTOFILL_DOCML = ":nmautofilllistview.docml";
+static const QString FILE_PATH_AUTOFILLITEM_WIDGETML = ":nmautofilllistviewitem.widgetml";
+static const QString FILE_PATH_AUTOFILLITEM_CSS = ":nmautofilllistviewitem.css";
 /*!
    Constructor
 */
-NmRecipientLineEdit::NmRecipientLineEdit(QGraphicsItem *parent) 
+NmRecipientLineEdit::NmRecipientLineEdit(QGraphicsItem *parent)
     : NmHtmlLineEdit(parent),
-    mNeedToGenerateEmailAddressList(true)
+    mNeedToGenerateEmailAddressList(true),
+    mContactHistoryModel(NULL),
+    mAutoFillPopup(NULL),
+    mAutofillListView(NULL),
+    mAutofillListViewItem(NULL),
+    mPopupBackground(NULL)
 {
     NM_FUNCTION;
-    
+
+    HbStyleLoader::registerFilePath(FILE_PATH_WIDGETML);
+    HbStyleLoader::registerFilePath(FILE_PATH_CSS);
+    HbStyleLoader::registerFilePath(FILE_PATH_AUTOFILLITEM_WIDGETML);
+    HbStyleLoader::registerFilePath(FILE_PATH_AUTOFILLITEM_CSS);
+
+    createAutofillComponents();
+
     connect(this, SIGNAL(textChanged(QString)), this, SLOT(handleTextChanged(QString)));
 }
 
-
 /*!
    Destructor
 */
 NmRecipientLineEdit::~NmRecipientLineEdit()
 {
     NM_FUNCTION;
+    delete mPopupBackground;
+    delete mContactHistoryModel;
+    delete mAutofillListView;
+
+    HbStyleLoader::unregisterFilePath(FILE_PATH_WIDGETML);
+    HbStyleLoader::unregisterFilePath(FILE_PATH_CSS);
+    HbStyleLoader::unregisterFilePath(FILE_PATH_AUTOFILLITEM_WIDGETML);
+    HbStyleLoader::unregisterFilePath(FILE_PATH_AUTOFILLITEM_CSS);
 }
 
-
 /*!
    Get the emailaddress list generated from the content of the lineedit.
 */
 QList<NmAddress> NmRecipientLineEdit::emailAddressList()
 {
     NM_FUNCTION;
-    
+
     if (mNeedToGenerateEmailAddressList) {
         // Empty mEmailAddressList.
         mEmailAddressList.clear();
         // Generate mEmailAddressList from the lineedit content.
-        generateEmailAddressList();					
+        generateEmailAddressList();
         mNeedToGenerateEmailAddressList = false;
     }
 
-    return mEmailAddressList;	
+    return mEmailAddressList;
 }
 
-
-#ifdef Q_OS_SYMBIAN
 /*!
-   This Slot appends the selected contacts to the end of the lineedit content.    
+   This Slot appends the selected contacts to the end of the lineedit content.
 */
 void NmRecipientLineEdit::addSelectedContacts(const QVariant &selectedContacts)
 {
     NM_FUNCTION;
-    
+
     // If user selected contact
-    if (!selectedContacts.isNull()) {        
+    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))){
-            
+        if (text().length() != 0 && !(text().endsWith(NmRecipientLineEditSemicolon)) &&
+            !(text().endsWith(NmRecipientLineEditDelimiter))){
+
             // Move cursor to the end of the lineedit.
-            this->setCursorPosition(this->text().length());       
+            setCursorPosition(text().length());
             QTextCursor textCursor(this->textCursor());
             // Append delimiter("; ") to the end of the lineedit
-            textCursor.insertText(Delimiter);
+            textCursor.insertText(NmRecipientLineEditDelimiter);
         }
-        
+
         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;
-            
+
             // If this contact has no name, use it's emailaddress as the display name
-            if(contactName.isEmpty()) {	
+            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);
+                setCursorPosition(text().length());
+                insertContactText(contactEmailAddress);
             }
             // If this contact has name, use the name as the display name
             else {
@@ -113,88 +136,199 @@
                         contactName.append(">");
                     }
                 }
-                
+
                 // 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);
+                setCursorPosition(text().length());
+                insertContactText(contactName);
             }
-                
-            QTextCursor textCursor(this->textCursor());
-            // Append delimiter("; ")
-            textCursor.insertText(Delimiter);
-            
-            // Form the contact into Qmail NmAddress format.
+
+            // Form the contact into NmAddress format.
             NmAddress contact;
             contact.setAddress(contactEmailAddress);
             contact.setDisplayName(contactName);
-            
+
             // Add this NmAddress formated contact into mRecipientsAddedFromContacts.
             mRecipientsAddedFromContacts.append(contact);
-        } 
+        }
     }
     else {
-        //Request returned NULL 
+        //Request returned NULL
         NM_COMMENT("ContactsPicker request returned NULL.");
     }
-        
 }
 
 Q_IMPLEMENT_USER_METATYPE(CntServicesContact)
 Q_IMPLEMENT_USER_METATYPE_NO_OPERATORS(CntServicesContactList)
-#endif   // Q_OS_SYMBIAN
-
 
 /*!
-   keyPressEvent handles replacing user inputs "," or ";" from physical keyboard with "; "
-   P.S. keyPressEvent can only catch QKeyEvent "," or ";" typed from physical keyboard,
-   inputMethodEvent method handles user inputs "," or ";" from virtual keyboard.
+   keyPressEvent handles different keypress events, and reacts to them
 */
 void NmRecipientLineEdit::keyPressEvent(QKeyEvent *keyEvent)
 {
     NM_FUNCTION;
-    
-	bool eventHandled = false;
-	
+
     if (keyEvent) {
-        switch (keyEvent->key()) {    
+        switch (keyEvent->key()) {
         case Qt::Key_Comma:
         case Qt::Key_Semicolon:
-            {
-                QString textBeforeCursor = (this->text()).left(this->cursorPosition());
-                
-                // No action when the lineedit is empty or cursor is after a Delimiter("; ") 
-                // or a Semicolon (";").
-                if ((this->text()).isEmpty() || textBeforeCursor.endsWith(Delimiter)
-                    || textBeforeCursor.endsWith(Semicolon)) {
-                    keyEvent->ignore();
-                    eventHandled = true;
-                }
-                else {
-                    // Generate custom keyevent for Delimiter("; ") and 
-                    // forward to the base class to handle.
-                    QKeyEvent delimiterKeyEvent(keyEvent->type(), keyEvent->key(),
-                                                keyEvent->modifiers(), Delimiter);
-                    NmHtmlLineEdit::keyPressEvent(&delimiterKeyEvent);
-                    eventHandled = true;
-                }
-            }
+            keyPressEventSemicolon(keyEvent);
+            break;
+            
+        case Qt::Key_Backspace:
+        case Qt::Key_Delete:
+            keyPressEventDelete(keyEvent);
+            break;
+            
+        case Qt::Key_Left:
+            keyPressEventLeft(keyEvent);
+            break;
+
+        case Qt::Key_Right:
+            keyPressEventRight(keyEvent);
             break;
 
         default:
             NmHtmlLineEdit::keyPressEvent(keyEvent);
-            eventHandled = true;
-            break;      
-        }
+            break;
+        } // switch
+    keyEvent->accept();
+    }
+}
+
+/*!
+ * subroutine of keyPressEvent that handles semicolon and comma key presses
+ */
+void NmRecipientLineEdit::keyPressEventSemicolon(QKeyEvent *event)
+{
+    NM_FUNCTION;
+    QString textBeforeCursor = (text()).left(cursorPosition());
+
+    // No action when the lineedit is empty or cursor is after a Delimiter("; ")
+    // or a Semicolon (";").
+    if ((text()).isEmpty() || textBeforeCursor.endsWith(NmRecipientLineEditDelimiter)
+        || textBeforeCursor.endsWith(NmRecipientLineEditSemicolon)) {
+        event->ignore();
+    }
+    else {
+        // Generate custom keyevent for Delimiter("; ") and
+        // forward to the base class to handle.
+        QKeyEvent delimiterKeyEvent(event->type(), event->key(),
+                                    event->modifiers(), NmRecipientLineEditDelimiter);
+        NmHtmlLineEdit::keyPressEvent(&delimiterKeyEvent);
     }
-    
-    // If event is not handled, forward to the base class to handle.
-    if (!eventHandled) {
-        NmHtmlLineEdit::keyPressEvent(keyEvent);
+}
+
+/*!
+ * subroutine of keyPressEvent that handles delete and backspace key presses
+ */
+void NmRecipientLineEdit::keyPressEventDelete(QKeyEvent *event)
+{
+    NM_FUNCTION;
+    int pos = cursorPosition();
+
+    // 1) if selection exists, delete it
+    if (hasSelectedText()) {
+        // if already selected delete it
+        disconnect(this, SIGNAL(textChanged(QString)),
+                this, SLOT(handleTextChanged(QString)));
+        QKeyEvent eve(event->type(), Qt::Key_Delete, Qt::NoModifier);
+        HbLineEdit::keyPressEvent(&eve);
+        connect(this, SIGNAL(textChanged(QString)),
+                this, SLOT(handleTextChanged(QString)));
+        setCursorPosition(text().length());
+        handleTextChanged(text());
+    } else { // no selection..
+        // peek if earlier chars are underlined
+        setCursorPosition(pos-2);
+        bool isContact(textCursor().charFormat().fontUnderline());
+        setCursorPosition(pos);
+        if (isContact) {
+            // contact
+            setCursorPosition(pos-3);
+            setHighlight(pos-3); // creates a selection for the current contact
+        } else {
+            // plain text
+            HbLineEdit::keyPressEvent(event);
+        }
     }
 }
 
+/*!
+ * subroutine of keyPressEvent that handles left key presses
+ */
+void NmRecipientLineEdit::keyPressEventLeft(QKeyEvent *event)
+{
+    NM_FUNCTION;
+    //look ahead left.
+    int pos = cursorPosition();
+    QString text = this->text();
+    text = text.left(pos);
+
+    //look for next seperator while going left.
+    int semicolonPos = text.lastIndexOf(NmRecipientLineEditSemicolon);
+    bool selectedText = hasSelectedText();
+
+    if (selectedText) {
+        int selectionStart = textCursor().selectionStart();
+        if (selectionStart>=2) {
+            setCursorPosition(selectionStart-2);
+        }
+        else {
+            setCursorPosition(0);
+        }
+        textCursor().clearSelection();
+    }
+    else { // not selected
+
+        setCursorPosition(pos-2);
+        bool isContact = textCursor().charFormat().fontUnderline();
+        setCursorPosition(pos);
+
+        if (isContact) {
+            setHighlight(pos-3);
+        }
+        else {
+            if (pos-2  == semicolonPos) {
+                setCursorPosition(pos-1); // jump over one extra char
+            }
+            HbLineEdit::keyPressEvent(event);
+        }
+    }
+}
+
+/*!
+ * subroutine of keyPressEvent that handles right key presses
+ */
+void NmRecipientLineEdit::keyPressEventRight(QKeyEvent *event)
+{
+    NM_FUNCTION;
+    bool selectedText = hasSelectedText();
+
+    if (selectedText) {
+        int selectionEnd = textCursor().selectionEnd();
+        setCursorPosition(selectionEnd+1);
+        textCursor().clearSelection();
+    }
+    else {
+        int pos = cursorPosition();
+
+        //look ahead
+        setCursorPosition(pos+3);
+        bool isContact = textCursor().charFormat().fontUnderline();
+        setCursorPosition(pos);
+
+        if (isContact) {
+            setHighlight(pos+3);
+        }
+        else {
+            int nextSemicolon = text().indexOf(NmRecipientLineEditSemicolon,pos);
+            if (nextSemicolon==pos) {
+                setCursorPosition(pos+1); // jump over one extra char
+            }
+        HbLineEdit::keyPressEvent(event);
+        }
+    }
+}
 
 /*!
    inputMethodEvent handles replacing user inputs "," or ";" from virtual keyboard with "; ".
@@ -203,28 +337,27 @@
 void NmRecipientLineEdit::inputMethodEvent(QInputMethodEvent *event)
 {
     NM_FUNCTION;
-    
-	bool eventHandled = false;
-	
+
+	bool eventHandled(false);
+
     if (event) {
         QString eventText = event->commitString();
 
         if (!eventText.isEmpty() || event->replacementLength()) {
             // If typed charater from virtual keyboard is "," or ";"
-            if (eventText.contains(CommaOrSemicolon)) {
-                QString textBeforeCursor = (this->text()).left(this->cursorPosition());
-				
-                // No action when the lineedit is empty or cursor is after a Delimiter("; ") 
+            if (eventText.contains(NmRecipientLineEditCommaOrSemicolon)) {
+                QString textBeforeCursor = text().left(cursorPosition());
+
+                // No action when the lineedit is empty or cursor is after a Delimiter("; ")
                 // or Semicolon (";").
-                if ((this->text()).isEmpty() || textBeforeCursor.endsWith(Delimiter)
-                    || textBeforeCursor.endsWith(Semicolon)) {
+                if (text().isEmpty() || textBeforeCursor.endsWith(NmRecipientLineEditDelimiter) || textBeforeCursor.endsWith(NmRecipientLineEditSemicolon)) {
                     event->ignore();
                     eventHandled = true;
                 }
                 else {
                     // Modify event with Delimiter("; ") and forward to the base class to handle.
-                    event->setCommitString(Delimiter, event->replacementStart(),
-                                           event->replacementLength()); 
+                    event->setCommitString(NmRecipientLineEditDelimiter, event->replacementStart(),
+                                           event->replacementLength());
                     NmHtmlLineEdit::inputMethodEvent(event);
                     eventHandled = true;
                 }
@@ -238,20 +371,74 @@
     }
 }
 
- 
+/*!
+ signal received from user screen input
+ */
+void NmRecipientLineEdit::gestureEvent(QGestureEvent* event)
+{
+    //passing gesture event to base class.
+    HbLineEdit::gestureEvent(event);
+
+    if (HbTapGesture *tap = qobject_cast<HbTapGesture*>(event->gesture(Qt::TapGesture))) {
+        //capturing gesture position, and map to local co-ordinates.
+        QPointF pos = mapFromScene(tap->scenePosition());
+
+        switch (tap->state()) {
+        case Qt::GestureFinished:
+            if (HbTapGesture::Tap == tap->tapStyleHint()) {
+                handleTap();
+            }
+            break;
+        default:
+            break;
+        }
+        event->accept();
+    }
+    else {
+        event->ignore();
+    }
+}
+
+/*!
+ user has tapped the recipient field on the screen
+ */
+void NmRecipientLineEdit::handleTap()
+{
+    int currentPos = cursorPosition();
+    QString txt = text();
+
+    QString leftTxt = txt.left(currentPos+2);
+    int previousSemicolonIndex = leftTxt.lastIndexOf(NmRecipientLineEditSemicolon,currentPos);
+    if ((currentPos>0) &&
+       (currentPos==previousSemicolonIndex || currentPos==previousSemicolonIndex+1)) {
+        //pressed just on seperator
+        setCursorPosition(previousSemicolonIndex+2);
+    }
+    else
+    {
+        // pressed in middle of an address
+        setCursorPosition(currentPos);
+        if (textCursor().charFormat().fontUnderline()) {
+            // This entry is a "contact"
+            setHighlight(currentPos);
+        }
+    }
+    update();
+}
+
 /*!
    Generate a list of all the email addresses from the content of the lineedit.
 */
 void NmRecipientLineEdit::generateEmailAddressList()
-{   
+{
     NM_FUNCTION;
-    
-    // Remove whitespace from the start and the end of the lineedit content. 
-    QString contentOfLineedit = (this->text()).trimmed();
-    
+
+    // Remove whitespace from the start and the end of the lineedit content.
+    QString contentOfLineedit = text().trimmed();
+
     // Split the lineedit content by semicolon(";").
-    QStringList itemsOfLineeditContent = contentOfLineedit.split(Semicolon, QString::SkipEmptyParts);
-        
+    QStringList itemsOfLineeditContent = contentOfLineedit.split(NmRecipientLineEditSemicolon, QString::SkipEmptyParts);
+
     // Loop through all the items of the lineedit content.
     for (int i = 0; i != itemsOfLineeditContent.count(); ++i) {
         // Remove whitespace from the start and the end of the item.
@@ -259,41 +446,41 @@
 
         // Get the count of the recipients added from Contacts.
         int countOfRecipientsAddedFromContacts = mRecipientsAddedFromContacts.count();
-        
+
         // If there is recipient added from Contacts.
         if (countOfRecipientsAddedFromContacts > 0) {
             QStringList listOfAddedContactsName;
             QStringList listOfAddedContactsAddress;
-            
+
             // Loop through all the recipients added from Contacts.
             for (int j = 0; j != countOfRecipientsAddedFromContacts; ++j) {
-                NmAddress contact = mRecipientsAddedFromContacts.at(j);          
+                NmAddress contact = mRecipientsAddedFromContacts.at(j);
                 listOfAddedContactsName.append(contact.displayName());
                 listOfAddedContactsAddress.append(contact.address());
             }
-                
+
             int indexInAddedContactsName = listOfAddedContactsName.indexOf(itemInLineedit);
             int indexInAddedContactsAddress = listOfAddedContactsAddress.indexOf(itemInLineedit);
-            
+
             // If this itemInLineedit matches the name of one added contact.
             if (indexInAddedContactsName >= 0) {
                 // Add the recipient into mEmailAddressList.
-                mEmailAddressList.append(mRecipientsAddedFromContacts.at(indexInAddedContactsName));  
+                mEmailAddressList.append(mRecipientsAddedFromContacts.at(indexInAddedContactsName));
             }
             // If this itemInLineedit matches the emailaddress of one added contact.
-            else if (indexInAddedContactsAddress >= 0) { 
+            else if (indexInAddedContactsAddress >= 0) {
                 // Add the recipient into mEmailAddressList.
-                mEmailAddressList.append(mRecipientsAddedFromContacts.at(indexInAddedContactsAddress));  
+                mEmailAddressList.append(mRecipientsAddedFromContacts.at(indexInAddedContactsAddress));
             }
             // This itemInLineedit is not added from Contacts
-            else { 
+            else {
                 // Form the item into NmAddress format.
                 NmAddress recipient;
                 recipient.setAddress(itemInLineedit);
                 // There is no display name info available, so leave display name empty.
-                recipient.setDisplayName(QString()); 
+                recipient.setDisplayName(QString());
                 // Add this NmAddress formated lineedit item into mEmailAddressList.
-                mEmailAddressList.append(recipient);  
+                mEmailAddressList.append(recipient);
             }
         }
         else { // There is no recipient is added from Contacts
@@ -301,9 +488,9 @@
             NmAddress recipient;
             recipient.setAddress(itemInLineedit);
             // There is no display name info available, so leave display name emapty.
-            recipient.setDisplayName(QString()); 
+            recipient.setDisplayName(QString());
             // Add this NmAddress formated lineedit item into mEmailAddressList.
-            mEmailAddressList.append(recipient);  
+            mEmailAddressList.append(recipient);
         }
     }
 }
@@ -315,13 +502,26 @@
 void NmRecipientLineEdit::handleTextChanged(const QString &text)
 {
     NM_FUNCTION;
-    
-    Q_UNUSED(text);
+
     mNeedToGenerateEmailAddressList = true;
+
+    //if there is no text, hide popup already
+    if (document()->isEmpty()) {
+        hideAutofillPopup();
+    }
+
+    if (mContactHistoryModel) {
+        int startPos(-1), length(-1);
+        currentTextPart(startPos, length);
+        QString t = text.mid(startPos, length);
+        if (t.length()) {
+            mContactHistoryModel->query(t);
+        }
+    }
 }
 
-/*
- * If recipient is added from Contacts by Contacts, we need to add it to the list.
+/*!
+    If recipient is added from Contacts by Contacts, we need to add it to the list.
  */
 void NmRecipientLineEdit::addContacts(QList<NmAddress *> contacts)
 {
@@ -332,3 +532,287 @@
         }
     }
 }
+
+/*!
+   This Slot appends the selected contact to the end of the lineedit content.
+*/
+void NmRecipientLineEdit::addSelectedContactFromHistory(const QModelIndex &modelIndex)
+{
+    NM_FUNCTION;
+
+    // ignore text changes during handling of text
+    disconnect(this, SIGNAL(textChanged(QString)),
+               this, SLOT(handleTextChanged(QString)));
+
+    // Get address from contact history model
+    NmAddress contact;
+    getChosenAddressFromModel(modelIndex, contact);
+
+    if (!contact.address().isEmpty()) {
+        // Add the recipient to internal list of addresses
+        mRecipientsAddedFromContacts.append(contact);
+
+        // Find the text part to be replaced
+        int startPos(-1), length(-1);
+        currentTextPart(startPos, length);
+
+        // delete currently entered characters before adding replacement
+        QTextCursor cursor(textCursor());
+        cursor.setPosition(startPos);
+        for(int i=0; i<length; i++) {
+            cursor.deleteChar();
+        }
+
+        // Insert replacement text
+        if (contact.displayName().isEmpty()) {
+            insertContactText(contact.address());
+        }
+        else {
+            insertContactText(contact.displayName());
+        }
+    }
+    // Continue accepting text changes..
+    connect(this, SIGNAL(textChanged(QString)),
+            this, SLOT(handleTextChanged(QString)));
+
+    //hide popup
+    hideAutofillPopup();
+}
+/*!
+ reads the chosen data from contact history model
+ */
+void NmRecipientLineEdit::getChosenAddressFromModel(const QModelIndex &modelIndex, NmAddress &address)
+{
+    NM_FUNCTION;
+    // Dig out the chosen contact data
+    // Get the activated item with given modelIndex
+    NmContactHistoryModelItem item = mContactHistoryModel->data(modelIndex, Qt::DisplayRole).value<NmContactHistoryModelItem>();
+    if (item.subItemCount()) {
+        QList<NmContactHistoryModelSubItem> itemlist = item.subEntries();
+        if (itemlist.count() == 2) {
+            address.setDisplayName(itemlist[0].mItemText);
+            address.setAddress(itemlist[1].mItemText);
+        } else if (itemlist.count() == 1) {
+            // only emailaddress found (no display name)
+            address.setAddress(itemlist[0].mItemText);
+        }
+    }
+}
+
+/*!
+ finds the current "entry" (startindex+length) based on current cursor position.
+ Excludes possible trailing delimiter
+ */
+void NmRecipientLineEdit::currentTextPart(int &startIndex, int &length)
+{
+    NM_FUNCTION;
+
+    // Get current cursor position in the text
+    int currentPos = textCursor().position();
+
+    QString tmp_debug = text();
+    startIndex = qMax(text().lastIndexOf(NmRecipientLineEditSemicolon,currentPos-1), 0);
+    if (startIndex>0) {
+        startIndex+=2; // in case entry is not the first, advance the start index by amount of "; ".
+    }
+
+
+    int nextDelimiterIndex=text().indexOf(NmRecipientLineEditDelimiter,currentPos);
+    if (nextDelimiterIndex==-1) {
+        // no delim after current pos
+        length=text().length()-startIndex;
+    }
+    else {
+        // delim after current pos found
+        length=nextDelimiterIndex-startIndex;
+    }
+}
+
+/*!
+    Helper function for creating autofill component.
+*/
+void NmRecipientLineEdit::createAutofillComponents()
+{
+    NM_FUNCTION;
+    
+    //create model
+    mContactHistoryModel = new NmContactHistoryModel(EmailAddressModel);
+    connect(mContactHistoryModel,SIGNAL(modelCompleted(int)),this,SLOT(modelCompleted(int)));
+
+    //create popup list components
+    HbDocumentLoader loader;
+    bool loadingOk(false);
+    loader.load(FILE_PATH_AUTOFILL_DOCML, &loadingOk);
+    if (loadingOk){
+        mAutofillListView = dynamic_cast<HbListView*>(loader.findWidget("listview"));
+    }
+    else {
+        NM_COMMENT("mAutofillListView loading from docML failed.");
+        return; 
+    }
+    
+    connect(mAutofillListView, SIGNAL(activated(const QModelIndex &)),
+            this, SLOT(addSelectedContactFromHistory(const QModelIndex &)));
+
+    mAutofillListViewItem = new NmAutoFillListViewItem();
+    mAutofillListView->setModel(static_cast<QAbstractListModel*>(mContactHistoryModel),mAutofillListViewItem);
+
+    //create popup
+    createAutoFillPopup();
+
+    //set layout for popup
+    QGraphicsLinearLayout *linLayout = new QGraphicsLinearLayout(Qt::Horizontal,
+                                                                 mAutoFillPopup);
+    linLayout->addItem(mAutofillListView);
+
+}
+
+/*!
+  Helper function for creating popup component.
+*/
+void NmRecipientLineEdit::createAutoFillPopup()
+{
+    NM_FUNCTION;
+    mAutoFillPopup = new HbPopup(this);
+    mAutoFillPopup->setVisible(false);
+    mAutoFillPopup->setFlag(QGraphicsItem::ItemIsPanel, true);
+    mAutoFillPopup->setActive(false);
+    mAutoFillPopup->setFocusPolicy(Qt::NoFocus);
+    mAutoFillPopup->setBackgroundFaded(false);
+    mAutoFillPopup->setDismissPolicy(HbPopup::TapOutside);
+    mAutoFillPopup->setTimeout(HbPopup::NoTimeout);
+    mAutoFillPopup->setFrameType(HbPopup::Weak); //uses qtg_fr_popup_secondary graphics
+    HbStyle::setItemName(mAutoFillPopup, QString("autoFillPopup"));
+
+    mPopupBackground = new NmPopupBackground(mAutoFillPopup, this);
+    mPopupBackground->setVisible(false);
+    mPopupBackground->setZValue(mAutoFillPopup->zValue() - 1);
+}
+
+/*!
+  Helper function for showing autofill popup.
+*/
+void NmRecipientLineEdit::showAutofillPopup()
+{
+    NM_FUNCTION;
+    if (!mAutoFillPopup->isVisible()) {
+        parentItem()->setZValue(NmRecipientLineEditForegroundZValue);
+        mAutoFillPopup->show();
+        mPopupBackground->setVisible(true);
+    }
+}
+
+/*!
+  Helper function for hiding autofill popup.
+*/
+void NmRecipientLineEdit::hideAutofillPopup()
+{
+    NM_FUNCTION;
+    if (mAutoFillPopup->isVisible()) {
+        mPopupBackground->setVisible(false);
+        parentItem()->setZValue(NmRecipientLineEditBackgroundZValue);
+        mAutoFillPopup->hide();
+    }
+}
+
+/*!
+  Slot for listening when model is ready with a new data.
+*/
+void NmRecipientLineEdit::modelCompleted(int err)
+{
+    NM_FUNCTION;
+    if (err == 0) {
+        //show model if there was findings
+        int count = mContactHistoryModel->rowCount(QModelIndex());
+
+        if (count > 0) {
+            showAutofillPopup();
+        } else {
+            hideAutofillPopup();
+        }
+    }
+}
+
+/*!
+ finds the current "entry" in the editor field based on current cursor position and creates a selection of it.
+ Includes possible trailing delimiter
+ */
+void NmRecipientLineEdit::setHighlight(int currentPos)
+{
+    QString txt = text();
+
+    int startPos = qMax(txt.lastIndexOf(NmRecipientLineEditDelimiter,currentPos), 0);
+    if (startPos) {
+        startPos+=2; // in case entry is not the first, advance the start index by amount of "; "
+    }
+    int endPos = qMax(txt.indexOf(NmRecipientLineEditDelimiter,currentPos), currentPos);
+
+    if (startPos >= 0 && endPos >= 0 && startPos != endPos) {
+        setSelection(startPos, endPos - startPos + 2);
+    }
+    else {
+        deselect();
+    }
+
+    update();
+}
+
+/*!
+ inserts a new contact text (underlined) + trailing delimiter to current cursor position in editor field
+ */
+void NmRecipientLineEdit::insertContactText(const QString &text)
+    {
+    NM_FUNCTION;
+
+    // Insert contact text as underlined
+    QTextCharFormat colorFormat(textCursor().charFormat());
+    QColor fgColor = colorFormat.foreground().color();
+    fgColor.setAlpha(NmRecipientLineEditFadedAlpha);
+    colorFormat.setUnderlineColor(fgColor);
+    colorFormat.setFontUnderline(true);
+    textCursor().insertText(text, colorFormat);
+
+    // Insert delimiter (not underlined)
+    colorFormat.setFontUnderline(false);
+    textCursor().insertText(NmRecipientLineEditDelimiter,colorFormat);
+    }
+
+/*!
+    Popup's background item. Used to close properly popup if clicked to outside of the popup.
+ */
+NmPopupBackground::NmPopupBackground(HbPopup * popup, QGraphicsItem *parent) :
+    QGraphicsItem(parent),
+    mPopup(popup)
+{
+    // This is needed to be able to block moving the focus to items behind background item by
+    // clicking on them.
+    setFlag(QGraphicsItem::ItemIsFocusable);
+    setFlag(QGraphicsItem::ItemIsPanel);
+}
+
+/*!
+    Paint. Not used but since this is pure virtual it must be here. 
+ */
+void NmPopupBackground::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget )
+{
+    Q_UNUSED(option)
+    Q_UNUSED(widget);
+    Q_UNUSED(painter);
+}
+
+/*!
+    Mouse press events are checked here. If background is clicked, popup must be closed. 
+ */
+bool NmPopupBackground::sceneEvent(QEvent *event)
+{
+    if (event->type() == QEvent::GraphicsSceneMousePress) {
+        mPopup->close();
+        setVisible(false);
+        event->accept();
+        return true;
+    }
+    else {
+        event->ignore();
+        return QGraphicsItem::sceneEvent(event);
+    }
+}
--- a/emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmframeworkadapter.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -338,10 +338,14 @@
     RArray<TFSMailSortCriteria> sorting;
     CleanupClosePushL(sorting);
     sorting.Append(criteria);
+    
+    NM_TIMESTAMP("ListMessagesL in getMessagesFromFolderL start");   
 
     // Get the message list from the backend.
     MFSMailIterator* iterator(NULL);
     iterator = folder->ListMessagesL(details, sorting);
+    
+    NM_TIMESTAMP("ListMessagesL in getMessagesFromFolderL end");
 
     if (iterator) {
         CleanupStack::PushL(iterator);
@@ -356,8 +360,10 @@
         for (int i = blockSize;
              i < maxItemCount && moreMessagesToFollow;
              i += blockSize) {
+            NM_TIMESTAMP("  NextL in getMessagesFromFolderL begins");            
             moreMessagesToFollow =
                 iterator->NextL(messages[i-1]->GetMessageId(), blockSize, messages);
+            NM_TIMESTAMP("  NextL in getMessagesFromFolderL end");              
         }
 
         // Add all the found emails into the result list.
@@ -1314,7 +1320,10 @@
         // param2: TFSMailMsgId* aNewParentFolder
         // param3: TFSMailMsgId* aOldParentFolder
         case TFSEventMailMoved:
-            handleMailMoved(param1, param2, param3, mailbox);
+            if(param2 && param3)
+                {
+                handleMailMoved(param1, param2, param3, mailbox);
+                }            
             break;
 
         // Mails copied
--- a/emailuis/nmframeworkadapter/src/nmfwamessagepartfetchingoperation.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmfwamessagepartfetchingoperation.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -48,15 +48,23 @@
     doCancelOperation();
 }
 
+
 /*!
+    Handles fetching events.
 
- */
-void NmFwaMessagePartFetchingOperation::RequestResponseL(TFSProgress aEvent, TInt aRequestId)
+    \param aEvent
+    \param aRequestId
+*/
+void NmFwaMessagePartFetchingOperation::RequestResponseL(TFSProgress aEvent,
+                                                         TInt aRequestId)
 {
     NM_FUNCTION;
     
     if (aRequestId == mRequestId) {
-        if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete ) {
+        if (aEvent.iError == KErrDiskFull) {
+            completeOperation(NmDiskFullError);
+        }
+        else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestComplete) {
             completeOperation(aEvent.iError);
         }
         else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_RequestCancelled) {
@@ -64,12 +72,14 @@
         }
         else if (aEvent.iProgressStatus == TFSProgress::EFSStatus_Status) {
             int progress = 0;
+            
             if (aEvent.iMaxCount > 0) {
                 // calculate progress per cents
                 qreal counterValue = aEvent.iCounter;
                 qreal maxCount = aEvent.iMaxCount;
                 progress = (counterValue / maxCount)*100;
             }
+            
             if (progress > mLastProgressValue) {
                 // send only increasing values to prevent downward changing percentage
                 mLastProgressValue = progress;
@@ -79,6 +89,7 @@
     }
 }
 
+
 /*!
 
  */
--- a/emailuis/nmframeworkadapter/src/nmmailboxsearchobserver.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmframeworkadapter/src/nmmailboxsearchobserver.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -62,6 +62,8 @@
             emit matchFound(messageEnvelope.messageId(), messageEnvelope.folderId());
             delete message;
         }
+    delete aMatchMessage;
+    aMatchMessage = NULL;
     }
 }
 
--- a/emailuis/nmhswidget/conf/nmhswidget.docml	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmhswidget/conf/nmhswidget.docml	Thu Sep 30 11:43:07 2010 +0300
@@ -12,6 +12,7 @@
                     <string name="textColor" value="#000000"/>
                     <string locid="txt_mail_widget_info_no_messages" name="plainText" value="No mails!!!"/>
                     <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-tiny)"/>
+                    <enums name="textWrapping" value="TextNoWrap"/>
                 </widget>
                 <widget name="mailListView" type="HbListView">
                     <widget name="listItemPrototype" role="HbAbstractView:prototype" type="HbListViewItem"/>
@@ -45,6 +46,7 @@
                     <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)"/>
+                    <enums name="textWrapping" value="TextNoWrap"/>
                 </widget>
                 <widget name="mailboxIcon" type="HbLabel">
                     <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
@@ -63,6 +65,7 @@
                     <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)"/>
+                    <enums name="textWrapping" value="TextNoWrap"/>
                 </widget>
                 <widget name="collapseExpandIcon" type="HbPushButton">
                     <icon iconName="note_warning" name="icon"/>
--- a/emailuis/nmhswidget/inc/nmhswidget.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidget.h	Thu Sep 30 11:43:07 2010 +0300
@@ -23,7 +23,6 @@
 
 class NmHsWidgetEmailEngine;
 class NmHsWidgetTitleRow;
-class NmHsWidgetEmailRow;
 class QGraphicsLinearLayout;
 class QTranslator;
 class HbFrameDrawer;
@@ -32,7 +31,6 @@
 class HbDocumentLoader;
 class HbListView;
 class NmHsWidgetListModel;
-class NmHsWidgetListView;
 class QModelIndex;
 
 
--- a/emailuis/nmhswidget/inc/nmhswidgetconsts.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidgetconsts.h	Thu Sep 30 11:43:07 2010 +0300
@@ -23,7 +23,7 @@
  *************************************************/
 //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 = 3;
+const int KMaxNumberOfEnvelopesProvided = 99;
 //Maximum value for unread count
 const int KMaxUnreadCount = 999; 
 
@@ -42,6 +42,8 @@
 const QString KNmHsWidgetContentContainer = "mailRowContainer";
 /** no mails label - shown when inbox is empty */
 const QString KNmHsWidgetNoMailsLabel = "noMailsLabel";
+/** mail list view - list component that contains the messages */
+const QString KNmHsWidgetMailListView = "mailListView";
 /** contents margin/spacing in all layouts / container widgets */
 const int KNmHsWidgetContentsMargin = 0;
 /** Widget's background image*/
--- a/emailuis/nmhswidget/inc/nmhswidgetlistviewitem.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmhswidget/inc/nmhswidgetlistviewitem.h	Thu Sep 30 11:43:07 2010 +0300
@@ -39,7 +39,8 @@
 
 protected:
     void setFonts(const QColor &colorRole, HbFontSpec &fontSpec);
-    void getFontSizes();   
+    void getFontSizes();  
+    QString cleanupDisplayName( const QString &displayName );
     
 private:
     void createMessageItemLayout();
--- a/emailuis/nmhswidget/src/nmhswidget.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidget.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -156,9 +156,9 @@
         mContentContainer = static_cast<HbWidget*> (loader.findWidget(KNmHsWidgetContentContainer));
         mEmptySpaceContainer = static_cast<HbWidget*> (loader.findWidget(KNmHsWidgetEmptySpaceContainer));
         mNoMailsLabel = static_cast<HbLabel*> (loader.findWidget(KNmHsWidgetNoMailsLabel));
-        mListView = static_cast<HbListView*> (loader.findWidget("mailListView"));
+        mListView = static_cast<HbListView*> (loader.findWidget(KNmHsWidgetMailListView));
         if (!mMainContainer || !mWidgetContainer || !mContentContainer 
-                || !mEmptySpaceContainer || !mNoMailsLabel ) {
+                || !mEmptySpaceContainer || !mNoMailsLabel || !mListView) {
             //something failed in documentloader, no point to continue
             NM_ERROR(1,"NmHsWidget::loadDocML fail @ containers or label");
             ok = false;
@@ -318,8 +318,10 @@
                 ,mTitleRow, SLOT( updateAccountName(const QString&) ) );
 
 	    //Get signals about user actions
+        //Qt::QueuedConnection used to improve ui responsiveness 
 	    connect(mTitleRow, SIGNAL( mailboxLaunchTriggered() )
-	            ,mEngine, SLOT( launchMailAppInboxView() ) );
+	            ,mEngine, SLOT( launchMailAppInboxView() ), Qt::QueuedConnection);
+	    
 	    connect(mTitleRow, SIGNAL( expandCollapseButtonPressed() )
 	            ,this, SLOT( handleExpandCollapseEvent() ) );
 	    
--- a/emailuis/nmhswidget/src/nmhswidgetemailengine.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidgetemailengine.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -130,9 +130,9 @@
         SLOT( handleMessageEvent(NmMessageEvent, const NmId&,
                 const QList<NmId>&, const NmId&) ));
 
-    connect( pluginInstance, SIGNAL( void folderEvent(
-             NmFolderEvent, const QList<NmId>, const NmId&) ), this,
-             SLOT( void handleFolderEvent( NmFolderEvent, const QList<NmId>, const NmId&)));
+    connect( pluginInstance, SIGNAL( folderEvent(
+             NmFolderEvent, const QList<NmId>&, const NmId&) ), this,
+             SLOT( handleFolderEvent( NmFolderEvent, const QList<NmId>&, const NmId&)));
 
     connect(pluginInstance, SIGNAL( mailboxEvent(NmMailboxEvent, const QList<NmId>& ) ), this,
         SLOT( handleMailboxEvent(NmMailboxEvent, const QList<NmId>&) ));
--- a/emailuis/nmhswidget/src/nmhswidgetlistviewitem.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidgetlistviewitem.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -15,6 +15,7 @@
 *
 */
 
+#include <qregexp.h>
 #include <hbtextitem.h>
 #include <hbiconitem.h>
 #include <hbframeitem.h>
@@ -23,6 +24,7 @@
 #include <hbcolorscheme.h>
 #include <nmmessageenvelope.h>
 #include <nmicons.h>
+#include <hbstringutil.h>
 #include "nmhswidgetlistviewitem.h"
 
 /*!
@@ -148,7 +150,7 @@
     // Sender.
     QString senderDisplayName = envelope.sender().displayName();
     if (!senderDisplayName.isNull() && !senderDisplayName.isEmpty()) {
-        mSender->setText(senderDisplayName);
+        mSender->setText(cleanupDisplayName(senderDisplayName));
     }
     else {
         mSender->setText(envelope.sender().address());
@@ -162,10 +164,10 @@
     if (sentLocalDate == currentdate) {
         QString shortTimeSpec = r_qtn_time_usual;
         QTime time = localTime.time();
-        mTime->setText(locale.format(time, shortTimeSpec));
+        mTime->setText(HbStringUtil::convertDigits(locale.format(time, shortTimeSpec)));
     } else {
         QString shortDateSpec = r_qtn_date_without_year;
-        mTime->setText(locale.format(sentLocalDate, shortDateSpec));
+        mTime->setText(HbStringUtil::convertDigits(locale.format(sentLocalDate, shortDateSpec)));
     }
     // Subject.
     QString subjectText = envelope.subject();
@@ -310,3 +312,22 @@
         mTime->setTextColor(colorRole);
     }
 }
+
+/*!
+  Cleans up display name by stripping extra characters from the beginning and end of the string.
+*/
+QString NmHsWidgetListViewItem::cleanupDisplayName( const QString &displayName )
+{
+    NM_FUNCTION;
+
+    // find the first and last position that is NOT one of the characters below
+    QRegExp rx("[^\\s\"<>]");
+    int firstPos = std::max(rx.indexIn(displayName), 0);
+    int lastPos = rx.lastIndexIn(displayName);
+
+    if (lastPos < 0) {
+        lastPos = displayName.length() - 1;
+    }
+
+    return displayName.mid(firstPos, lastPos - firstPos + 1);
+}
--- a/emailuis/nmhswidget/src/nmhswidgettitlerow.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmhswidget/src/nmhswidgettitlerow.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -26,6 +26,7 @@
 #include <hbframeitem.h>
 #include <hbtapgesture.h>
 #include <hbinstantfeedback.h>
+#include <hbstringutil.h>
 #include "nmicons.h"
 #include "nmhswidgettitlerow.h"
 #include "nmhswidgetconsts.h"
@@ -234,7 +235,7 @@
     //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 >= 0) {
-        QString unreadCount(hbTrId("txt_mail_widget_list_l1").arg(mUnreadCount));
+        QString unreadCount(HbStringUtil::convertDigits(hbTrId("txt_mail_widget_list_l1").arg(mUnreadCount)));
         mUnreadCountLabel->setPlainText(unreadCount);
         QFontMetrics fm(mUnreadCountLabel->font());
         qreal textWidth = fm.width(unreadCount);
--- a/emailuis/nmsettingui/inc/nmmailboxsettingview.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmsettingui/inc/nmmailboxsettingview.h	Thu Sep 30 11:43:07 2010 +0300
@@ -58,8 +58,14 @@
     void queuedScroll(const QModelIndex &index);
 
 
+signals:
+
+    void emitEditingFinished();
+
 private:
 
+    bool eventFilter(QObject *watched, QEvent *event);
+
     Q_DISABLE_COPY(NmMailboxSettingView)
 
 
--- a/emailuis/nmsettingui/src/nmmailboxsettingview.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/emailuis/nmsettingui/src/nmmailboxsettingview.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -23,6 +23,8 @@
 #include <HbDataForm>
 #include <HbDataFormModel>
 #include <HbDocumentLoader>
+#include <HbLineEdit>
+#include <HbVkbHostBridge>
 
 #include "nmmailboxsettingview.h"
 #include "nmmailboxsettingsmanager.h"
@@ -80,11 +82,13 @@
     if (mForm) {
 
         qRegisterMetaType<QModelIndex>("QModelIndex");
+
         connect(mForm, SIGNAL(activated(QModelIndex)),
                 this, SLOT(itemActivated(QModelIndex)));
         connect(mForm, SIGNAL(itemShown(QModelIndex)),
                 this, SLOT(disablePredictiveText(QModelIndex)));
 
+
         // Fix for dataform item recycling.
         mForm->setItemRecycling(false);
 
@@ -183,6 +187,7 @@
 
     int type(index.data(HbDataFormModelItem::ItemTypeRole).toInt());
 
+
     if (type == HbDataFormModelItem::GroupItem) {
 
         // Scroll the groupitem to top.
@@ -220,6 +225,7 @@
         HbWidget *widget = item->dataItemContentWidget();
         if (widget) {
             widget->setInputMethodHints(Qt::ImhNoPredictiveText);
+            widget->installEventFilter(this);
 		}
     }
 }
@@ -235,4 +241,33 @@
 
     mForm->scrollTo(index, HbAbstractItemView::PositionAtTop);
 }
+
+/*!
+    Forces HbLineEdit to emit editingFinished when focus has been removed from it, if VKB is open.
+    NOTE: This can be removed when VKB handling is fixed by orbit so that editingFinished signal is
+          emitted when group box is collapsed.
+
+    \param watched object that eventFilter has installed to.
+    \param event occured event.
+*/
+bool NmMailboxSettingView::eventFilter(QObject *watched, QEvent *event)
+{
+    if (event->type() == QFocusEvent::FocusOut) {
+        QGraphicsItem *item = qobject_cast<QGraphicsItem *>(watched);
+        if (item && item->type() == Hb::ItemType_LineEdit) {
+            HbVkbHostBridge *instance = HbVkbHostBridge::instance();
+            // Only force emit if VKB is open.
+            if(instance && instance->keypadStatus() == HbVkbHost::HbVkbStatusOpened) {
+                HbLineEdit *edit = static_cast<HbLineEdit *>(item);
+                // Save settings.
+                connect(this, SIGNAL(emitEditingFinished()), edit, SIGNAL(editingFinished()));
+                emit emitEditingFinished();
+                disconnect(this, SIGNAL(emitEditingFinished()), edit, SIGNAL(editingFinished()));
+            }
+        }
+    }
+    // Event has not been consumed.
+    return false;
+}
+
 // End of file.
--- a/ipsservices/ipssosaoplugin/src/IpsSosAOPopAgent.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/ipssosaoplugin/src/IpsSosAOPopAgent.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -237,8 +237,14 @@
     FUNC_LOG;
     TMsvEntry tentry;
     TMsvId service;
-    iSession.GetEntry( iServiceId, service, tentry );
-    return tentry.Connected();
+    if (iSession.GetEntry( iServiceId, service, tentry ) == KErrNone)
+        {
+        return tentry.Connected();
+        }
+    else
+        {
+        return EFalse;
+        }
     }
 
 // ----------------------------------------------------------------------------
--- a/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/ipssosplugin/inc/ipsplgsosbaseplugin.h	Thu Sep 30 11:43:07 2010 +0300
@@ -493,7 +493,9 @@
        const TFSMailMsgId& aMailBoxId,
        const TDesC& aUsername,
        const TDesC& aPassword );
-
+// <qmail>       
+    virtual TUid Id( ) const;
+// </qmail>
 public:
 
     /**
--- a/ipsservices/ipssosplugin/ipssosplugin.pro	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/ipssosplugin/ipssosplugin.pro	Thu Sep 30 11:43:07 2010 +0300
@@ -175,7 +175,8 @@
     -lflogger \
     -lfeatmgr \
     -lmessagestoreclient \
-    -lxqsettingsmanager
+    -lxqsettingsmanager \
+    -lAlwaysOnlineManagerClient
 
     BLD_INF_RULES.prj_exports += \
       "inc/ipsplgsmtpoperation.h |../inc/ipsplgsmtpoperation.h" \
--- a/ipsservices/ipssosplugin/src/ipsplgsearch.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsearch.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -744,14 +744,12 @@
     {
     FUNC_LOG;
     CFSMailMessage* obsMail = iMapper->GetMailMessageL( *iActiveEntry );
-    CleanupStack::PushL( obsMail );    
-    
+    TFSMailMsgId id = obsMail->GetMessageId(); 
+    // obsMail ownership is transferred
     iObserver->MatchFoundL( obsMail );    
+    return id;       
+    }
     
-    CleanupStack::Pop( obsMail );
-    return obsMail->GetMessageId();        
-    }
-
 // ---------------------------------------------------------------------------
 // From class MIpsPlgSearch.
 // CIpsPlgSearch::SearchFinished()
--- a/ipsservices/ipssosplugin/src/ipsplgsearchop.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsearchop.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -101,8 +101,8 @@
     iState = EStarted;
 
     iSearcher = CIpsPlgTextSearcher::NewL( *this );
-    iSearcher->SetParametersL( 
-        iObserver.SearchStringsL(), 
+    iSearcher->SetParametersL(
+        iObserver.SearchStringsL(),
         EIpsPlgCriteriaOperationOR,
         EFalse,
         KIpsPlgSnippetLen );
@@ -110,7 +110,7 @@
     ActivateAndComplete();
     }
 
-// ======== MEMBER FUNCTIONS ======== 
+// ======== MEMBER FUNCTIONS ========
 
 // ---------------------------------------------------------------------------
 // From class CIpsPlgBaseOperation.
@@ -140,7 +140,7 @@
             iObserver.CollectMessagesL();
             iObserver.Sort();
             iState = ERunning;
-            iRequiredPriority = EPriorityStandard; // priority changes may be decreased
+            iRequiredPriority = EPriorityIdle; // priority changes may be decreased
             ActivateAndComplete();
             break;
             }
@@ -161,11 +161,18 @@
                     return;
                     }
             iState = ERunning;
-// When client wants call to contact the priority must be decreased 
+// When client wants call to contact the priority must be decreased
 // to enable search for contact which uses idle priority
             TInt clientRequiredPriority(iRequiredPriority);
             iObserver.ClientRequiredSearchPriority( &clientRequiredPriority );
-            iRequiredPriority = ((clientRequiredPriority > EPriorityIdle) ? EPriorityStandard : EPriorityIdle-1);
+
+            if (clientRequiredPriority>EPriorityStandard) {
+			    clientRequiredPriority = EPriorityStandard;
+			}
+            else if(clientRequiredPriority<EPriorityIdle-1) {
+			    clientRequiredPriority = EPriorityIdle-1;
+			}
+            iRequiredPriority = clientRequiredPriority;
 
             ActivateAndComplete();
             break;
@@ -201,28 +208,28 @@
         {
         // Delete object before creating new. Previous object is not needed.
         delete iMessage;
-        iMessage = NULL;        
+        iMessage = NULL;
         delete iHeader;
         iHeader = NULL;
-        iMessage = iObserver.NextMessageL();        
-        
-        // If message is not set, the search is finished. 
+        iMessage = iObserver.NextMessageL();
+
+        // If message is not set, the search is finished.
         // Run down the operation.
         if ( !iMessage )
             {
             iState = EFinished;
             return EFalse;
-            }        
-        
+            }
+
         // Retrieve the message header also.
-        iHeader = iObserver.MessageHeaderL();        
+        iHeader = iObserver.MessageHeaderL();
         }
     else
         {
         // Stop the loop, cancel should not continue.
         return EFalse;
         }
-    return ETrue;        
+    return ETrue;
     }
 
 // ---------------------------------------------------------------------------
@@ -254,25 +261,25 @@
         CRichText* txt = CRichText::NewL( para, chars );
         CleanupStack::PushL( txt );
 
-        iMessage->GetBodyTextL( 
+        iMessage->GetBodyTextL(
             iObserver.CurrentMessage().Id(),
-            CImEmailMessage::EThisMessageOnly, 
-            *txt, 
-            *para, 
-            *chars );    
+            CImEmailMessage::EThisMessageOnly,
+            *txt,
+            *para,
+            *chars );
 
         RBuf temp;
-        temp.CreateL( txt->DocumentLength() ); 
+        temp.CreateL( txt->DocumentLength() );
         CleanupClosePushL( temp );
-        
+
         txt->Extract( temp );
         SearchFromStringL( temp );
-        
+
         CleanupStack::PopAndDestroy( &temp );
-        CleanupStack::PopAndDestroy( txt );    
+        CleanupStack::PopAndDestroy( txt );
         CleanupStack::PopAndDestroy( chars );
         CleanupStack::PopAndDestroy( para );
-        }    
+        }
     }
 
 // ---------------------------------------------------------------------------
@@ -315,18 +322,18 @@
     FUNC_LOG;
     if ( iState == ERunning )
         {
-        iSearcher->Cleanup();                       
-        
+        iSearcher->Cleanup();
+
         // Mail is fetched, search from entire mail.
         if ( iHeader )
-            {                           
-            SearchFromEntireMailL(); 
+            {
+            SearchFromEntireMailL();
             }
-        // Mail not fetched, search only from subject.            
+        // Mail not fetched, search only from subject.
         else
-            {                                        
-            SearchFromSubjectL();                                             
-            }                       
+            {
+            SearchFromSubjectL();
+            }
         iState = ( iState == EHit ) ? ERunning : iState;
         }
     }
@@ -335,10 +342,10 @@
 // CIpsPlgSearchOp::HitL()
 // ---------------------------------------------------------------------------
 //
-void CIpsPlgSearchOp::HitL( 
-    const TDesC& /* aSnippet */, 
-    TInt /* aSnippetCharPos */, 
-    TBool /* aStartIncomplete */, 
+void CIpsPlgSearchOp::HitL(
+    const TDesC& /* aSnippet */,
+    TInt /* aSnippetCharPos */,
+    TBool /* aStartIncomplete */,
     TBool /* aEndIncomplete */ )
     {
     FUNC_LOG;
@@ -355,7 +362,7 @@
     FUNC_LOG;
     // In case of cancel, the stop should not be indicated.
     if ( iState == EFinished )
-        {        
+        {
         iObserver.SearchFinishedL();
         iState = EStopped;
         }
@@ -368,17 +375,17 @@
 void CIpsPlgSearchOp::ActivateAndComplete( )
     {
     FUNC_LOG;
-    iStatus = KRequestPending; 
-// When client wants call to contact the priority must be decreased 
+    iStatus = KRequestPending;
+// When client wants call to contact the priority must be decreased
 // to enable search for contact made with idle priority
     if ( Priority() != iRequiredPriority ) // <cmail>
     	SetPriority(iRequiredPriority);
 
-    SetActive();    
+    SetActive();
     TRequestStatus* status = &iStatus;
-    User::RequestComplete( status, KErrNone );    
+    User::RequestComplete( status, KErrNone );
     }
-    
+
 // ---------------------------------------------------------------------------
 // CIpsPlgSearchOp::SearchFromEntireMailL( )
 // ---------------------------------------------------------------------------
@@ -386,7 +393,7 @@
 void CIpsPlgSearchOp::SearchFromEntireMailL( )
     {
     FUNC_LOG;
-    if ( SearchFromStringL( iHeader->Subject() ) ) 
+    if ( SearchFromStringL( iHeader->Subject() ) )
         {
         return;
         }
@@ -417,16 +424,16 @@
     iObserver.GetSubjectL( subject );
     TBool found = SearchFromStringL( subject );
     CleanupStack::PopAndDestroy( &subject );
-    
+
     if ( !found )
         {
         RBuf sender;
         CleanupClosePushL( sender );
         iObserver.GetSenderL( sender );
         found = SearchFromStringL( sender );
-        CleanupStack::PopAndDestroy( &sender );  
+        CleanupStack::PopAndDestroy( &sender );
         }
     }
-    
+
 // End of File
 
--- a/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsosbaseplugin.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -556,7 +556,8 @@
 // ---------------------------------------------------------------------------
 void CIpsPlgSosBasePlugin::GoOnlineL( const TFSMailMsgId& aMailBoxId )
     {
-    if ( !ConnOpRunning( aMailBoxId) )
+    if ( iSyncStateHandler->GetCurrentSyncState(
+            aMailBoxId) == Idle)
         {
         // append mailbox id go online mailbox array
         RefreshNowL( aMailBoxId, *this, 0 );
@@ -2498,4 +2499,11 @@
             }
         }
     }
+// <qmail>
+// ---------------------------------------------------------------------------
+// ---------------------------------------------------------------------------
+TUid CIpsPlgSosBasePlugin::Id( ) const
+    {
+    return TUid::Uid( PluginId() );
+    }
 // </qmail>
--- a/ipsservices/ipssosplugin/src/ipsplgsyncstatehandler.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/ipssosplugin/src/ipsplgsyncstatehandler.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -88,10 +88,31 @@
     
     TInt err = iSession.GetEntry( aMailboxId.Id(), service, tEntry );
 
-    if ( err != KErrNone || iOperationsRef.Count() == 0 )
+    if ( err != KErrNone )
         {
         return Idle;
         }
+    
+    RAlwaysOnlineClientSession aosession;
+    
+    err = aosession.Connect();
+    if ( err == KErrNone )
+        {
+        
+        TPckgBuf<TInt> idBuf( aMailboxId.Id() );
+        TInt status = KErrNotFound;
+        TPckgBuf<TInt> statusBuf( status );
+        TInt error = aosession.SendReceiveSync(
+            EServerAPIEmailQueryState, idBuf, statusBuf );
+        status = statusBuf();
+        if ( error == KErrNone && 
+                status == EIpsAOPluginStatusSyncStarted )
+            {
+            aosession.Close();
+            return EmailSyncing;
+            }
+        }
+    aosession.Close();
 
     // If the mailbox is not online but it has some connection operation
     // already running, it means that it will be synchronized when the mailbox
@@ -113,28 +134,10 @@
             }
         }
 
-#ifndef RD_101_EMAIL    
+//#ifndef RD_101_EMAIL    
 // <cmail> RD_IPS_AO_PLUGIN flaf removed
-    RAlwaysOnlineClientSession aosession;
-    
-    err = aosession.Connect();
-    if ( err == KErrNone )
-        {
-        
-        TPckgBuf<TInt> idBuf( aMailboxId.Id() );
-        TInt status = KErrNotFound;
-        TPckgBuf<TInt> statusBuf( status );
-        TInt error = aosession.SendReceiveSync(
-            EServerAPIEmailQueryState, idBuf, statusBuf );
-        status = statusBuf();
-        if ( error == KErrNone && 
-                status == EIpsAOPluginStatusSyncStarted )
-            {
-            return EmailSyncing;
-            }
-        }
-    aosession.Close();
-#endif
+
+//#endif
     
 // </cmail> 
    
--- a/ipsservices/nmipssettings/inc/nmipssettingshelper.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/nmipssettings/inc/nmipssettingshelper.h	Thu Sep 30 11:43:07 2010 +0300
@@ -63,22 +63,17 @@
     void setServerInfoGroupItem(HbDataFormModelItem *item);
     void createOrUpdateReceivingScheduleGroupDynamicItem(IpsServices::SettingItem item);
     void createServerInfoGroupDynamicItems(bool hiddenItem);
-
-    int getCorrectIncomingPortRadioButtonIndex();
-    int getCorrectIncomingSecureRadioButtonIndex();
-    int getCorrectOutgoingSecureRadioButtonIndex();
-    int getCorrectFolderPathRadioButtonIndex();
-    int getCorrectOutgoingPortRadioButtonIndex();
-    int getCorrectOutgoingAuthenticationRadioButtonIndex();
+   
+    int getCorrectIncomingPortComboBoxIndex();
+    int getCorrectIncomingSecureComboBoxIndex();
+    int getCorrectOutgoingSecureComboBoxIndex();
+    int getCorrectFolderPathComboBoxIndex();
+    int getCorrectOutgoingPortComboBoxIndex();
+    int getCorrectOutgoingAuthenticationComboBoxIndex();
+    
     void handleReceivingScheduleSettingChange(IpsServices::SettingItem settingItem,
         const QVariant &settingValue);
     QString destinationNameFromIdentifier(uint identifier);
-    void incomingSecureConnectionItemChange(int index);
-    void incomingPortChange(int index);
-    void outgoingSecureConnectionItemChange(int index);
-    void outgoingPortChange(int index);
-    void outgoingAuthenticationChange(int index);
-    void folderPathChange(int index);
 
 signals:
 
@@ -109,6 +104,12 @@
     void incomingMailServerTextChange(const QString &text);
     void saveOutgoingMailServer();
     void outgoingMailServerTextChange(const QString &text);
+    void incomingSecureConnectionItemChange(int index);
+	void incomingPortChange(int index);
+	void outgoingSecureConnectionItemChange(int index);
+	void outgoingPortChange(int index);
+	void outgoingAuthenticationChange(int index);
+	void folderPathChange(int index);
     void connectionButtonPress();
 
 private slots:
@@ -116,14 +117,13 @@
     void receivingWeekdaysModified();
     void startTimeModified(QTime time);
     void endTimeModified(QTime time);
-    void refreshPeriodModified(HbAction *action);
     void handleMailboxDelete(HbAction *action);
     void handleMailboxDeleteUpdate(HbAction *action);
     void handleUserDefinedIncomingPortInput(HbAction *action);
     void handleUserDefinedFolderPathInput(HbAction *action);
     void handleUserDefinedOutgoingPortInput(HbAction *action);
     void handleConnectionSelected(uint status);
-    void refreshIndexModified(int index);
+    void refreshPeriodModified(int index);
 
 private:
 
@@ -164,7 +164,7 @@
     CmApplSettingsUi *mDestinationDialog; // Owned.
     bool mServerInfoDynamicItemsVisible;
     bool mAbortDynamicRSItemHandling;
-    int mCurrentRefreshIndex;
+    int mPrevInboxCount;
 };
 
 #endif // NMIPSSETTINGSHELPER_H
--- a/ipsservices/nmipssettings/inc/nmipssettingsplugin.h	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/nmipssettings/inc/nmipssettingsplugin.h	Thu Sep 30 11:43:07 2010 +0300
@@ -59,15 +59,8 @@
 private slots:
 
     void createUserDefinedMode();
-    void showMailInInboxModified(HbAction*);
-    void incomingSecureConnectionModified(HbAction*);
-    void incomingPortModified(HbAction*);
-    void outgoingSecureConnectionModified(HbAction*);
-    void outgoingPortModified(HbAction*);
-    void outgoingAuthenticationModified(HbAction*);
-    void folderPathModified(HbAction*);
-    void popupRadioButtonIndexModified(int index);
-
+    void showMailInInboxModified(int index);
+    
 private:
 
     void initGroupItems();
@@ -86,7 +79,6 @@
     HbDataFormModel *mModel; // Not owned.
     HbDataForm *mForm; // Not owned.
     bool mHiddenItem;
-    int mSelectedPopupRadioButtonIndex;
 };
 
 #endif // NMIPSSETTINGS_H
--- a/ipsservices/nmipssettings/src/nmipssettingshelper.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/nmipssettings/src/nmipssettingshelper.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -100,9 +100,11 @@
   mOutgoingPortInputValidator(NULL),
   mDestinationDialog(NULL),
   mServerInfoDynamicItemsVisible(false),
-  mAbortDynamicRSItemHandling(false),
-  mCurrentRefreshIndex(-1)
+  mAbortDynamicRSItemHandling(false)
 {
+    QVariant inboxValue;
+    mSettingsManager.readSetting(IpsServices::ReceptionInboxSyncWindow, inboxValue);
+    mPrevInboxCount = inboxValue.toInt();
 }
 
 /*!
@@ -302,7 +304,7 @@
                 // If not exist, create one
                 if (!formItemData) {
                     formItemData = new CpSettingFormItemData(
-                        HbDataFormModelItem::RadioButtonListItem,
+                        HbDataFormModelItem::ComboBoxItem,
                             hbTrId("txt_mailips_setlabel_refresh_mail"));
 
                     mReceivingScheduleGroupItem->appendChild(formItemData);
@@ -316,13 +318,9 @@
                                      << HbStringUtil::convertDigits(hbTrId("txt_mailips_setlabel_val_every_1_hour"))
                                      << HbStringUtil::convertDigits(hbTrId("txt_mailips_setlabel_val_every_4_hours"));
                     formItemData->setContentWidgetData("items", refreshMailItems);
-                    formItemData->setContentWidgetData("displayMode","popup");
-
-                    mDataForm.addConnection(formItemData, SIGNAL(finished(HbAction *)),
-                           this, SLOT(refreshPeriodModified(HbAction *)));
-
-                    mDataForm.addConnection(formItemData, SIGNAL(itemSelected(int)),
-                           this, SLOT(refreshIndexModified(int)));
+                    
+                    mDataForm.addConnection(formItemData, SIGNAL(currentIndexChanged(int)),
+                           this, SLOT(refreshPeriodModified(int)));
                 }
 
                 // Update data
@@ -333,8 +331,7 @@
                 refreshPeriod[15] = 1;
                 refreshPeriod[60] = 2;
                 refreshPeriod[240] = 3;
-                formItemData->setContentWidgetData("selected",
-                    refreshPeriod.value(interval.toInt()));
+                formItemData->setContentWidgetData("currentIndex",refreshPeriod.value(interval.toInt()));
                 break;
             }
             default:
@@ -497,7 +494,7 @@
         mSettingsManager.writeSetting(IpsServices::IncomingLoginName, username);
         // Outgoing username needs to be updated if it is set as Same as Incoming.
         item = mContentItems.value(IpsServices::SMTPAuthentication);
-        QVariant selected = item->contentWidgetData("selected");
+        QVariant selected = item->contentWidgetData("currentIndex");
         if (selected.toInt() == IpsServices::EMailAuthSameAsIncoming) {
             mSettingsManager.writeSetting(IpsServices::OutgoingLoginName, username);
         }
@@ -555,7 +552,7 @@
     mSettingsManager.writeSetting(IpsServices::IncomingPassword, password);
     // Outgoing password needs to be updated if it is set as Same as Incoming.
     item = mContentItems.value(IpsServices::SMTPAuthentication);
-    QVariant selected = item->contentWidgetData("selected");
+    QVariant selected = item->contentWidgetData("currentIndex");
     if (selected.toInt() == IpsServices::EMailAuthSameAsIncoming) {
         mSettingsManager.writeSetting(IpsServices::OutgoingPassword, password);
     }
@@ -722,8 +719,16 @@
     syncWindows[0] = 3;
 
     HbDataFormModelItem *item = mContentItems.value(IpsServices::ReceptionInboxSyncWindow);
-    if (item) {
-        item->setContentWidgetData("selected", syncWindows.value(value.toInt()));
+    if (item){
+        int tmpValue = value.toInt();
+        if(mPrevInboxCount != tmpValue){
+            // store selected setting
+            emit goOffline(mSettingsManager.mailboxId());
+            mEmitOnline = true;
+            mSettingsManager.writeSetting(IpsServices::ReceptionInboxSyncWindow, tmpValue);
+            mPrevInboxCount = tmpValue;
+        }
+        item->setContentWidgetData("currentIndex", syncWindows.value(tmpValue));
     }
 }
 
@@ -824,7 +829,7 @@
 */
 void NmIpsSettingsHelper::incomingPortChange(int index)
 {
-    int previousindex = getCorrectIncomingPortRadioButtonIndex();
+    int previousindex = getCorrectIncomingPortComboBoxIndex();
 
     if (index == IpsServices::NmIpsSettingsDefault) {
         if (index != previousindex) {
@@ -868,7 +873,7 @@
 */
 void NmIpsSettingsHelper::handleUserDefinedIncomingPortInput(HbAction *action)
 {
-    int previousindex = getCorrectIncomingPortRadioButtonIndex();
+    int previousindex = getCorrectIncomingPortComboBoxIndex();
 
     if (action == mIncomingPortInputDialog->actions().at(0)) {
         QVariant newPort = mIncomingPortInputDialog->value();
@@ -878,15 +883,15 @@
     } else {
         //set selected value back if user canceled.
         HbDataFormModelItem *item = mContentItems.value(IpsServices::IncomingPort);
-        item->setContentWidgetData("selected", previousindex);
+        item->setContentWidgetData("currentIndex", previousindex);
     }
 }
 
 /*!
-    Used for getting the index to display in the port radio button list
+    Used for getting the index to display in the port combo box list
     \return index Used to set the selected value
 */
-int NmIpsSettingsHelper::getCorrectIncomingPortRadioButtonIndex()
+int NmIpsSettingsHelper::getCorrectIncomingPortComboBoxIndex()
 {
     QVariant incomingPort;
     mSettingsManager.readSetting(IpsServices::IncomingPort, incomingPort);
@@ -905,7 +910,7 @@
 */
 void NmIpsSettingsHelper::incomingSecureConnectionItemChange(int index)
 {
-    int previousindex = getCorrectIncomingSecureRadioButtonIndex();
+    int previousindex = getCorrectIncomingSecureComboBoxIndex();
 
     if (previousindex != index) {
         emit goOffline(mSettingsManager.mailboxId());
@@ -931,7 +936,7 @@
         }
         // Update incoming port value only if default incoming port used
         HbDataFormModelItem *item = mContentItems.value(IpsServices::IncomingPort);
-        QVariant data = item->contentWidgetData("selected");
+        QVariant data = item->contentWidgetData("currentIndex");
         // Default incoming port selected
         if (data.toInt() == IpsServices::NmIpsSettingsDefault) {
             int port = mSettingsManager.determineDefaultIncomingPort();
@@ -941,10 +946,10 @@
 }
 
 /*!
-    Used for getting the index to display in the secure connection radio button list.
+    Used for getting the index to display in the secure connection combo box list.
     \return index Used to set the selected value
 */
-int NmIpsSettingsHelper::getCorrectIncomingSecureRadioButtonIndex()
+int NmIpsSettingsHelper::getCorrectIncomingSecureComboBoxIndex()
 {
     QVariant secureSockets;
     QVariant secureSSLWrapper;
@@ -968,10 +973,10 @@
 }
 
 /*!
-    Used for getting the index to display in the secure connection radio button list.
+    Used for getting the index to display in the secure connection combo box list.
     \return index Used to set the selected value
 */
-int NmIpsSettingsHelper::getCorrectOutgoingSecureRadioButtonIndex()
+int NmIpsSettingsHelper::getCorrectOutgoingSecureComboBoxIndex()
 {
     QVariant secureSockets;
     QVariant secureSSLWrapper;
@@ -999,7 +1004,7 @@
 */
 void NmIpsSettingsHelper::folderPathChange(int index)
 {
-    int previousindex = getCorrectFolderPathRadioButtonIndex();
+    int previousindex = getCorrectFolderPathComboBoxIndex();
 
     if (index == IpsServices::NmIpsSettingsDefault) {
         if (index != previousindex ) {
@@ -1036,7 +1041,7 @@
 */
 void NmIpsSettingsHelper::handleUserDefinedFolderPathInput(HbAction *action)
 {
-    int previousindex = getCorrectFolderPathRadioButtonIndex();
+    int previousindex = getCorrectFolderPathComboBoxIndex();
 
     HbDataFormModelItem *item = mContentItems.value(IpsServices::FolderPath);
 
@@ -1045,11 +1050,11 @@
         mSettingsManager.writeSetting(IpsServices::FolderPath, newFolderPath);
         //set selected index to default if user inputed empty string.
         if (newFolderPath.toString().isEmpty()) {
-            item->setContentWidgetData("selected", IpsServices::NmIpsSettingsDefault);
+            item->setContentWidgetData("currentIndex", IpsServices::NmIpsSettingsDefault);
         }
     } else {
         //set selected value back if user canceled.
-        item->setContentWidgetData("selected", previousindex);
+        item->setContentWidgetData("currentIndex", previousindex);
     }
 }
 
@@ -1114,10 +1119,10 @@
 }
 
 /*!
-    Used for getting the index to display in the inbox path radio button list
+    Used for getting the index to display in the inbox path combo box list
     \return index Used to set the selected value
 */
-int NmIpsSettingsHelper::getCorrectFolderPathRadioButtonIndex()
+int NmIpsSettingsHelper::getCorrectFolderPathComboBoxIndex()
 {
     QVariant folderPath;
     mSettingsManager.readSetting(IpsServices::FolderPath, folderPath);
@@ -1268,7 +1273,7 @@
 */
 void NmIpsSettingsHelper::outgoingPortChange(int index)
 {
-    int previousindex = getCorrectOutgoingPortRadioButtonIndex();
+    int previousindex = getCorrectOutgoingPortComboBoxIndex();
 
     if (index == IpsServices::NmIpsSettingsDefault) {
         if (index != previousindex) {
@@ -1313,7 +1318,7 @@
 */
 void NmIpsSettingsHelper::handleUserDefinedOutgoingPortInput(HbAction *action)
 {
-    int previousindex = getCorrectOutgoingPortRadioButtonIndex();
+    int previousindex = getCorrectOutgoingPortComboBoxIndex();
 
     if (action == mOutgoingPortInputDialog->actions().at(0)) {
         QVariant newPort = mOutgoingPortInputDialog->value();
@@ -1323,7 +1328,7 @@
     } else {
         //set selected value back if user canceled.
         HbDataFormModelItem *item = mContentItems.value(IpsServices::OutgoingPort);
-        item->setContentWidgetData("selected", previousindex);
+        item->setContentWidgetData("currentIndex", previousindex);
     }
 }
 
@@ -1345,10 +1350,10 @@
 }
 
 /*!
-    Used for getting the index to display in the outgoing port radio button list.
+    Used for getting the index to display in the outgoing port combo box list.
     \return index Used to set the selected value.
 */
-int NmIpsSettingsHelper::getCorrectOutgoingPortRadioButtonIndex()
+int NmIpsSettingsHelper::getCorrectOutgoingPortComboBoxIndex()
 {
     QVariant outgoingPort;
     mSettingsManager.readSetting(IpsServices::OutgoingPort, outgoingPort);
@@ -1364,10 +1369,10 @@
 }
 
 /*!
-    Used for getting the index to display in the outgoing authentication radio button list.
+    Used for getting the index to display in the outgoing authentication combo box list.
     \return index Used to set the selected value.
 */
-int NmIpsSettingsHelper::getCorrectOutgoingAuthenticationRadioButtonIndex()
+int NmIpsSettingsHelper::getCorrectOutgoingAuthenticationComboBoxIndex()
 {
     int index(IpsServices::EMailAuthNone);
     QVariant temp;
@@ -1403,11 +1408,11 @@
 
 /*!
     Saves the outgoing secure connection value into database if user has changed the value.
-    \param index Selected radio button index.
+    \param index Selected combo box index.
 */
 void NmIpsSettingsHelper::outgoingSecureConnectionItemChange(int index)
 {
-    int previousindex = getCorrectOutgoingSecureRadioButtonIndex();
+    int previousindex = getCorrectOutgoingSecureComboBoxIndex();
 
     if (previousindex != index) {
         emit goOffline(mSettingsManager.mailboxId());
@@ -1433,7 +1438,7 @@
         }
         // Update outgoing port value only if default outgoing port used
         HbDataFormModelItem *item = mContentItems.value(IpsServices::OutgoingPort);
-        QVariant data = item->contentWidgetData("selected");
+        QVariant data = item->contentWidgetData("currentIndex");
         // Default outgoing port selected
         if (data.toInt() == IpsServices::NmIpsSettingsDefault) {
 			int port = mSettingsManager.determineDefaultOutgoingPort();
@@ -1445,11 +1450,11 @@
 /*!
     Saves the outgoing authetication value into database if user has changed the value and
     updates dynamic group items.
-    \param index Selected radio button index.
+    \param index Selected combo box index.
 */
 void NmIpsSettingsHelper::outgoingAuthenticationChange(int index)
 {
-    int previousindex = getCorrectOutgoingAuthenticationRadioButtonIndex();
+    int previousindex = getCorrectOutgoingAuthenticationComboBoxIndex();
 
     if (previousindex != index) {
         QVariant loginName;
@@ -1524,28 +1529,15 @@
 
 \param index The index value of the selection.
 */
-void NmIpsSettingsHelper::refreshIndexModified(int index)
-{
-    mCurrentRefreshIndex = index;
-}
-
-/*!
-    Handles refresh period modifications.
-    \param action Action that determines whether user clicked OK or cancel.
-*/
-void NmIpsSettingsHelper::refreshPeriodModified(HbAction *action)
+void NmIpsSettingsHelper::refreshPeriodModified(int index)
 {
-    if ((action->text() == hbTrId("txt_common_button_ok")
-            && (mCurrentRefreshIndex >=0 && mCurrentRefreshIndex <=3))) {
-        int conversionTable[] = { 5, 15, 60, 240 };
-        int selectedValue(conversionTable[mCurrentRefreshIndex]);
-        QVariant previouslySelectedValue;
-        mSettingsManager.readSetting(IpsServices::ReceptionRefreshPeriodDayTime,
-            previouslySelectedValue);
-        if (selectedValue != previouslySelectedValue.toInt()) {
-            handleReceivingScheduleSettingChange(IpsServices::ReceptionRefreshPeriodDayTime,
-                selectedValue);
-        }
-    }
-    mCurrentRefreshIndex = -1;
+	int conversionTable[] = { 5, 15, 60, 240 };
+	int selectedValue(conversionTable[index]);
+	QVariant previouslySelectedValue;
+	mSettingsManager.readSetting(IpsServices::ReceptionRefreshPeriodDayTime,
+		previouslySelectedValue);
+	if (selectedValue != previouslySelectedValue.toInt()) {
+		handleReceivingScheduleSettingChange(IpsServices::ReceptionRefreshPeriodDayTime,
+			selectedValue);
+	}
 }
--- a/ipsservices/nmipssettings/src/nmipssettingsplugin.cpp	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/nmipssettings/src/nmipssettingsplugin.cpp	Thu Sep 30 11:43:07 2010 +0300
@@ -43,6 +43,7 @@
 static const QString NmIpsSettingsComboItems("comboItems");
 static const QString NmIpsSettingsLabelTexts("labelTexts");
 static const QString NmIpsSettingsItems("items");
+static const QString NmIpsSettingsCurrentIndex("currentIndex");
 static const int NmIpsSettingsReceptionUserDefinedProfileEnabled(1);
 
 /*!
@@ -60,8 +61,7 @@
 NmIpsSettingsPlugin::NmIpsSettingsPlugin()
 : mSettingsHelper(NULL),
   mSettingsManager(NULL),
-  mHiddenItem(false),
-  mSelectedPopupRadioButtonIndex(-1)
+  mHiddenItem(false)
 {
     QString lang = QLocale::system().name();
     QString path = "Z:/resource/qt/translations/";
@@ -310,16 +310,12 @@
 
     QVariant profileIndex;
     mSettingsManager->readSetting(IpsServices::ReceptionActiveProfile, profileIndex);
-    infoItem->setContentWidgetData(QString("currentIndex"), profileIndex);
+    infoItem->setContentWidgetData(NmIpsSettingsCurrentIndex, profileIndex);
 
     // 2. Show mail in inbox
-    QVariant mailInInbox;
-    mSettingsManager->readSetting(IpsServices::ReceptionInboxSyncWindow, mailInInbox);
-
     CpSettingFormItemData *showMailInInboxItem =
-        new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, hbTrId(
+        new CpSettingFormItemData(HbDataFormModelItem::ComboBoxItem, hbTrId(
             "txt_mailips_setlabel_show_mail_in_inbox"));
-
     mSettingsHelper->insertContentItem(IpsServices::ReceptionInboxSyncWindow, showMailInInboxItem);
 
     // If changes are made to showMailItems, conversion table in
@@ -329,19 +325,16 @@
                   << HbStringUtil::convertDigits("100")
                   << HbStringUtil::convertDigits("500")
                   << hbTrId("txt_mailips_setlabel_val_all");
-
     showMailInInboxItem->setContentWidgetData(NmIpsSettingsItems, showMailItems);
-    showMailInInboxItem->setContentWidgetData("displayMode","popup");
+    
     showMailInInboxItem->setEnabled(true);
     item.appendChild(showMailInInboxItem);
 
     // Active sync profile connection
     mForm->addConnection(infoItem, SIGNAL(currentIndexChanged(int)),
 						 mSettingsHelper, SLOT(receivingScheduleChange(int)));
-    mForm->addConnection(showMailInInboxItem, SIGNAL(finished(HbAction *)),
-						 this, SLOT(showMailInInboxModified(HbAction *)));
-    mForm->addConnection(showMailInInboxItem, SIGNAL(itemSelected(int)),
-						 this, SLOT(popupRadioButtonIndexModified(int)));
+    mForm->addConnection(showMailInInboxItem, SIGNAL(currentIndexChanged(int)),
+						 this, SLOT(showMailInInboxModified(int)));
 
     // Must be called manually here, because the signal->slot connection set above using
     // HbDataForm::addConnection() is actually established AFTER the properties have first been
@@ -440,28 +433,23 @@
 
     // 2. Incoming Secure connection
     CpSettingFormItemData *incomingSecureConnectionItem =
-        new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, hbTrId(
+        new CpSettingFormItemData(HbDataFormModelItem::ComboBoxItem, hbTrId(
             "txt_mailips_setlabel_incoming_security"));
-
     mSettingsHelper->insertContentItem(IpsServices::IncomingSecureSockets, incomingSecureConnectionItem);
 
     QStringList showSCItems;
     showSCItems << hbTrId("txt_mailips_setlabel_security_val_on_starttls")
                 << hbTrId("txt_mailips_setlabel_security_val_on_ssltls")
                 << hbTrId("txt_mailips_setlabel_security_val_off");
-
-    incomingSecureConnectionItem->setContentWidgetData(QString("items"), showSCItems);
-    incomingSecureConnectionItem->setContentWidgetData("displayMode","popup");
+    incomingSecureConnectionItem->setContentWidgetData(NmIpsSettingsItems, showSCItems);
 
     int incomingSecureConnectionItemIndex =
-        mSettingsHelper->getCorrectIncomingSecureRadioButtonIndex();
-    incomingSecureConnectionItem->setContentWidgetData(QString("selected"),
+        mSettingsHelper->getCorrectIncomingSecureComboBoxIndex();
+    incomingSecureConnectionItem->setContentWidgetData(NmIpsSettingsCurrentIndex,
                                                        incomingSecureConnectionItemIndex);
 
-    mForm->addConnection(incomingSecureConnectionItem, SIGNAL(finished(HbAction *)),
-						 this, SLOT(incomingSecureConnectionModified(HbAction *)));
-    mForm->addConnection(incomingSecureConnectionItem, SIGNAL(itemSelected(int)),
-						 this, SLOT(popupRadioButtonIndexModified(int)));
+    mForm->addConnection(incomingSecureConnectionItem, SIGNAL(currentIndexChanged(int)),
+						 mSettingsHelper, SLOT(incomingSecureConnectionItemChange(int)));
 
     if (mHiddenItem) {
         incomingSecureConnectionItem->setEnabled(false);
@@ -470,23 +458,20 @@
 
     // 3. Incoming mail server port
     CpSettingFormItemData *incomingPortItem =
-        new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, hbTrId(
+        new CpSettingFormItemData(HbDataFormModelItem::ComboBoxItem, hbTrId(
             "txt_mailips_setlabel_incoming_port"));
     mSettingsHelper->insertContentItem(IpsServices::IncomingPort, incomingPortItem);
+    
     QStringList incomingPortItems;
     incomingPortItems << hbTrId("txt_mailips_setlabel_incoming_port_default")
                       << hbTrId("txt_mailips_setlabel_incoming_port_user_defined");
-
-    incomingPortItem->setContentWidgetData(QString("items"), incomingPortItems);
-    incomingPortItem->setContentWidgetData("displayMode","popup");
+    incomingPortItem->setContentWidgetData(NmIpsSettingsItems, incomingPortItems);
 
-    int incomingPortItemIndex = mSettingsHelper->getCorrectIncomingPortRadioButtonIndex();
-    incomingPortItem->setContentWidgetData(QString("selected"), incomingPortItemIndex);
+    int incomingPortItemIndex = mSettingsHelper->getCorrectIncomingPortComboBoxIndex();
+    incomingPortItem->setContentWidgetData(NmIpsSettingsCurrentIndex, incomingPortItemIndex);
 
-    mForm->addConnection(incomingPortItem, SIGNAL(finished(HbAction *)),
-   						 this, SLOT(incomingPortModified(HbAction *)));
-    mForm->addConnection(incomingPortItem, SIGNAL(itemSelected(int)),
-					 this, SLOT(popupRadioButtonIndexModified(int)));
+    mForm->addConnection(incomingPortItem, SIGNAL(currentIndexChanged(int)),
+						 mSettingsHelper, SLOT(incomingPortChange(int)));
 
     if (mHiddenItem) {
         incomingPortItem->setEnabled(false);
@@ -516,26 +501,23 @@
 
     // 5. Outgoing secure connection
     CpSettingFormItemData *outgoingSecureConnectionItem =
-        new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, hbTrId(
+        new CpSettingFormItemData(HbDataFormModelItem::ComboBoxItem, hbTrId(
             "txt_mailips_setlabel_outgoing_security"));
     mSettingsHelper->insertContentItem(IpsServices::OutgoingSecureSockets, outgoingSecureConnectionItem);
+    
     QStringList outgoingShowSCItems;
     outgoingShowSCItems << hbTrId("txt_mailips_setlabel_security_val_on_starttls")
                         << hbTrId("txt_mailips_setlabel_security_val_on_ssltls")
                         << hbTrId("txt_mailips_setlabel_security_val_off");
-
-    outgoingSecureConnectionItem->setContentWidgetData(QString("items"), outgoingShowSCItems);
-    outgoingSecureConnectionItem->setContentWidgetData("displayMode","popup");
+    outgoingSecureConnectionItem->setContentWidgetData(NmIpsSettingsItems, outgoingShowSCItems);
 
     int outgoingSecureConnectionItemIndex =
-        mSettingsHelper->getCorrectOutgoingSecureRadioButtonIndex();
-    outgoingSecureConnectionItem->setContentWidgetData(QString("selected"),
+        mSettingsHelper->getCorrectOutgoingSecureComboBoxIndex();
+    outgoingSecureConnectionItem->setContentWidgetData(NmIpsSettingsCurrentIndex,
                                                        outgoingSecureConnectionItemIndex);
-
-    mForm->addConnection(outgoingSecureConnectionItem, SIGNAL(finished(HbAction *)),
-      				     this, SLOT(outgoingSecureConnectionModified(HbAction *)));
-    mForm->addConnection(outgoingSecureConnectionItem, SIGNAL(itemSelected(int)),
-				         this, SLOT(popupRadioButtonIndexModified(int)));
+    
+    mForm->addConnection(outgoingSecureConnectionItem, SIGNAL(currentIndexChanged(int)),
+				         mSettingsHelper, SLOT(outgoingSecureConnectionItemChange(int)));
 
     if (mHiddenItem) {
         outgoingSecureConnectionItem->setEnabled(false);
@@ -544,23 +526,20 @@
 
     // 6. Outgoing mail server port
     CpSettingFormItemData *outgoingPortItem =
-        new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, hbTrId(
+        new CpSettingFormItemData(HbDataFormModelItem::ComboBoxItem, hbTrId(
             "txt_mailips_setlabel_outgoing_port"));
     mSettingsHelper->insertContentItem(IpsServices::OutgoingPort, outgoingPortItem);
+    
     QStringList outgoingPortItems;
     outgoingPortItems << hbTrId("txt_mailips_setlabel_incoming_port_default")
                       << hbTrId("txt_mailips_setlabel_incoming_port_user_defined");
-
-    outgoingPortItem->setContentWidgetData(QString("items"), outgoingPortItems);
-    outgoingPortItem->setContentWidgetData("displayMode","popup");
+    outgoingPortItem->setContentWidgetData(NmIpsSettingsItems, outgoingPortItems);
 
-    int outgoingPortItemIndex = mSettingsHelper->getCorrectOutgoingPortRadioButtonIndex();
-    outgoingPortItem->setContentWidgetData(QString("selected"), outgoingPortItemIndex);
+    int outgoingPortItemIndex = mSettingsHelper->getCorrectOutgoingPortComboBoxIndex();
+    outgoingPortItem->setContentWidgetData(NmIpsSettingsCurrentIndex, outgoingPortItemIndex);
 
-    mForm->addConnection(outgoingPortItem, SIGNAL(finished(HbAction *)),
-					     this, SLOT(outgoingPortModified(HbAction *)));
-	mForm->addConnection(outgoingPortItem, SIGNAL(itemSelected(int)),
-						 this, SLOT(popupRadioButtonIndexModified(int)));
+	mForm->addConnection(outgoingPortItem, SIGNAL(currentIndexChanged(int)),
+						 mSettingsHelper, SLOT(outgoingPortChange(int)));
 
     if (mHiddenItem) {
         outgoingPortItem->setEnabled(false);
@@ -569,25 +548,22 @@
 
     // 7. Outgoing authentication.
     CpSettingFormItemData *outgoingAuthenticationItem =
-        new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, hbTrId(
+        new CpSettingFormItemData(HbDataFormModelItem::ComboBoxItem, hbTrId(
             "txt_mailips_setlabel_outgoing_mail_authentication"));
     mSettingsHelper->insertContentItem(IpsServices::SMTPAuthentication, outgoingAuthenticationItem);
+    
     QStringList outgoingAuthenticationItems;
     outgoingAuthenticationItems << hbTrId("txt_mailips_setlabel_outgoing_authentication_none")
                                 << hbTrId("txt_mailips_setlabel_outgoing_authentication_same")
                                 << hbTrId("txt_mailips_setlabel_outgoing_authentication_user");
-
-    outgoingAuthenticationItem->setContentWidgetData(QString("items"), outgoingAuthenticationItems);
-    outgoingAuthenticationItem->setContentWidgetData("displayMode","popup");
+    outgoingAuthenticationItem->setContentWidgetData(NmIpsSettingsItems, outgoingAuthenticationItems);
 
     int outgoingAuthenticationIndex =
-        mSettingsHelper->getCorrectOutgoingAuthenticationRadioButtonIndex();
-    outgoingAuthenticationItem->setContentWidgetData(QString("selected"), outgoingAuthenticationIndex);
+        mSettingsHelper->getCorrectOutgoingAuthenticationComboBoxIndex();
+    outgoingAuthenticationItem->setContentWidgetData(NmIpsSettingsCurrentIndex, outgoingAuthenticationIndex);
 
-    mForm->addConnection(outgoingAuthenticationItem, SIGNAL(finished(HbAction *)),
-    					 this, SLOT(outgoingAuthenticationModified(HbAction *)));
-	mForm->addConnection(outgoingAuthenticationItem, SIGNAL(itemSelected(int)),
-						 this, SLOT(popupRadioButtonIndexModified(int)));
+	mForm->addConnection(outgoingAuthenticationItem, SIGNAL(currentIndexChanged(int)),
+						 mSettingsHelper, SLOT(outgoingAuthenticationChange(int)));
 
     item.appendChild(outgoingAuthenticationItem);
     if (mHiddenItem) {
@@ -601,23 +577,20 @@
     // This item is only shown for IMAP4 account.
     if (mSettingsManager->accountType() == IpsServices::EMailImap) {
         CpSettingFormItemData *folderPathItem =
-            new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, hbTrId(
+            new CpSettingFormItemData(HbDataFormModelItem::ComboBoxItem, hbTrId(
                 "txt_mailips_setlabel_folder_path"));
         mSettingsHelper->insertContentItem(IpsServices::FolderPath, folderPathItem);
+        
         QStringList folderPathItems;
         folderPathItems << hbTrId("txt_mailips_setlabel_folder_path_val_default")
                         << hbTrId("txt_mailips_setlabel_folder_path_user_defined");
-
-        folderPathItem->setContentWidgetData(QString("items"), folderPathItems);
-        folderPathItem->setContentWidgetData("displayMode","popup");
+        folderPathItem->setContentWidgetData(NmIpsSettingsItems, folderPathItems);
 
-        int folderPathItemIndex = mSettingsHelper->getCorrectFolderPathRadioButtonIndex();
-        folderPathItem->setContentWidgetData(QString("selected"), folderPathItemIndex);
+        int folderPathItemIndex = mSettingsHelper->getCorrectFolderPathComboBoxIndex();
+        folderPathItem->setContentWidgetData(NmIpsSettingsCurrentIndex, folderPathItemIndex);
 
-        mForm->addConnection(folderPathItem, SIGNAL(finished(HbAction *)),
-            			     this, SLOT(folderPathModified(HbAction *)));
 		mForm->addConnection(folderPathItem, SIGNAL(itemSelected(int)),
-							 this, SLOT(popupRadioButtonIndexModified(int)));
+							 mSettingsHelper, SLOT(folderPathChange(int)));
 
         item.appendChild(folderPathItem);
     }
@@ -695,117 +668,17 @@
 
 \param action Action that determines whether user clicked OK or cancel.
 */
-void NmIpsSettingsPlugin::showMailInInboxModified(HbAction *action)
-{
-    if ((action->text() == hbTrId("txt_common_button_ok"))
-            && (mSelectedPopupRadioButtonIndex >=0 && mSelectedPopupRadioButtonIndex <=3)) {
-        int conversionTable[] = { 50, 100, 500, 0 };
-        int selectedValue(conversionTable[mSelectedPopupRadioButtonIndex]);
-
-        QVariant previouslySelectedValue;
-        mSettingsManager->readSetting(IpsServices::ReceptionInboxSyncWindow, previouslySelectedValue);
-        if (previouslySelectedValue.toInt() != selectedValue) {
-            mSettingsHelper->handleReceivingScheduleSettingChange(
-                IpsServices::ReceptionInboxSyncWindow, selectedValue);
-        }
-    }
-    mSelectedPopupRadioButtonIndex = -1;
-}
-
-/*!
-Handles incoming secure connection modifications.
-
-\param action Action that determines whether user clicked OK or cancel.
-*/
-void NmIpsSettingsPlugin::incomingSecureConnectionModified(HbAction *action)
-{
-    if(action->text() == hbTrId("txt_common_button_ok") &&
-       mSelectedPopupRadioButtonIndex >=0) {
-       mSettingsHelper->incomingSecureConnectionItemChange(mSelectedPopupRadioButtonIndex);
-    }
-    mSelectedPopupRadioButtonIndex = -1;
-}
-
-/*!
-Handles incoming port modifications.
-
-\param action Action that determines whether user clicked OK or cancel.
-*/
-void NmIpsSettingsPlugin::incomingPortModified(HbAction *action)
-{
-	if ((action->text() == hbTrId("txt_common_button_ok")) &&
-		(mSelectedPopupRadioButtonIndex == IpsServices::NmIpsSettingsDefault ||
-		 mSelectedPopupRadioButtonIndex == IpsServices::NmIpsSettingsUserDefined)) {
-	       mSettingsHelper->incomingPortChange(mSelectedPopupRadioButtonIndex);
-	    }
-	mSelectedPopupRadioButtonIndex = -1;
-}
-
-/*!
-Handles outgoing secure connection modifications.
-
-\param action Action that determines whether user clicked OK or cancel.
-*/
-void NmIpsSettingsPlugin::outgoingSecureConnectionModified(HbAction *action)
+void NmIpsSettingsPlugin::showMailInInboxModified(int index)
 {
-	if (action->text() == hbTrId("txt_common_button_ok") &&
-		mSelectedPopupRadioButtonIndex >= 0) {
-		       mSettingsHelper->outgoingSecureConnectionItemChange(mSelectedPopupRadioButtonIndex);
-		}
-	mSelectedPopupRadioButtonIndex = -1;
-}
-
-/*!
-Handles outgoing port modifications.
-
-\param action Action that determines whether user clicked OK or cancel.
-*/
-void NmIpsSettingsPlugin::outgoingPortModified(HbAction *action)
-{
-	if ((action->text() == hbTrId("txt_common_button_ok")) &&
-		(mSelectedPopupRadioButtonIndex == IpsServices::NmIpsSettingsDefault ||
-		 mSelectedPopupRadioButtonIndex == IpsServices::NmIpsSettingsUserDefined)) {
-	       mSettingsHelper->outgoingPortChange(mSelectedPopupRadioButtonIndex);
-	    }
-	mSelectedPopupRadioButtonIndex = -1;
-}
-
-/*!
-Handles outgoing authentication modifications.
+	int conversionTable[] = { 50, 100, 500, 0 };
+	int selectedValue(conversionTable[index]);
 
-\param action Action that determines whether user clicked OK or cancel.
-*/
-void NmIpsSettingsPlugin::outgoingAuthenticationModified(HbAction *action)
-{
-	if (action->text() == hbTrId("txt_common_button_ok") &&
-		mSelectedPopupRadioButtonIndex >= 0) {
-	       mSettingsHelper->outgoingAuthenticationChange(mSelectedPopupRadioButtonIndex);
-	    }
-	mSelectedPopupRadioButtonIndex = -1;
-}
-
-/*!
-Handles folder path modifications.
-
-\param action Action that determines whether user clicked OK or cancel.
-*/
-void NmIpsSettingsPlugin::folderPathModified(HbAction *action)
-{
-	if ((action->text() == hbTrId("txt_common_button_ok")) &&
-		(mSelectedPopupRadioButtonIndex == IpsServices::NmIpsSettingsDefault ||
-		 mSelectedPopupRadioButtonIndex == IpsServices::NmIpsSettingsUserDefined)) {
-	       mSettingsHelper->folderPathChange(mSelectedPopupRadioButtonIndex);
-	    }
-	mSelectedPopupRadioButtonIndex = -1;
-}
-
-/*!
-
-\param index The index value of the selection.
-*/
-void NmIpsSettingsPlugin::popupRadioButtonIndexModified(int index)
-{
-    mSelectedPopupRadioButtonIndex = index;
+	QVariant previouslySelectedValue;
+	mSettingsManager->readSetting(IpsServices::ReceptionInboxSyncWindow, previouslySelectedValue);
+	if (previouslySelectedValue.toInt() != selectedValue) {
+		mSettingsHelper->handleReceivingScheduleSettingChange(
+			IpsServices::ReceptionInboxSyncWindow, selectedValue);
+	}
 }
 
 Q_EXPORT_PLUGIN2(nmipssettings, NmIpsSettingsPlugin);
Binary file ipsservices/nmipssettings/translations/mailips.qm has changed
--- a/ipsservices/nmipssettings/translations/mailips.ts	Wed Sep 15 17:47:19 2010 +0300
+++ b/ipsservices/nmipssettings/translations/mailips.ts	Thu Sep 30 11:43:07 2010 +0300
@@ -25,7 +25,7 @@
 <message numerus="no" id="txt_mailips_dialog_heading_refresh_mail">
     <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>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_006_b_f</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
@@ -65,7 +65,7 @@
 <message numerus="no" id="txt_mailips_dialog_heading_connection">
     <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>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_006_a_a</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
@@ -75,7 +75,7 @@
 <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. Example flow can be found from 10.2settings.ptt, slide 16</comment>        
     <source>Show mail in inbox</source>
-    <translation variants="no" type="unfinished"></translation>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_006_b_a</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
@@ -162,16 +162,6 @@
     <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>
-</message>
 <message numerus="no" id="txt_mailips_setlabel_download_images_val_sun">
     <comment>One of the values for txt_mailips_setlabel_receiving_weekdays. Sunday setting item</comment>        
     <source>Sun</source>
@@ -202,6 +192,16 @@
     <extra-loc-feature>mail</extra-loc-feature>
     <extra-loc-blank>False</extra-loc-blank>
 </message>
+<message numerus="no" id="txt_mailips_dpopinfo_saving_settings">
+    <comment>Simple progress dialog shown (if needed i.e. saving takes some time) after the user returns from Settings back to mail list. Under this text a progress bar animation (indefinite) is shown.</comment>        
+    <source>Saving settings</source>
+    <translation variants="no" type="unfinished"></translation>
+    <extra-loc-layout_id>qtl_dialog_pri3</extra-loc-layout_id>    
+    <extra-loc-viewid>mail_001</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_mailips_list_popup_sec_every_4_hours">
     <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>
@@ -345,7 +345,7 @@
 <message numerus="no" id="txt_mailips_dialog_heading_outgoing_authentication">
     <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>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_006_d_c</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
@@ -475,7 +475,7 @@
 <message numerus="no" id="txt_mailips_dialog_heading_end_time">
     <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>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_006_b_e</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
@@ -495,7 +495,7 @@
 <message numerus="no" id="txt_mailips_dialog_heading_outgoing_connection">
     <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>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_006_d_b</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
@@ -633,7 +633,7 @@
     <extra-loc-blank>False</extra-loc-blank>
 </message>
 <message numerus="no" id="txt_mailips_setlabel_show_mail_in_other_folders">
-    <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 other folders (than Inbox) from server (50, 100, 200 or All).</comment>        
+    <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 other folders (than Inbox) from server (50, 100, 200 or All). Not 10.1 content.</comment>        
     <source>Show mail in other folders</source>
     <translation variants="no" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dataform_pri</extra-loc-layout_id>    
@@ -755,7 +755,7 @@
 <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>
+    <translation variants="yes" 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>
@@ -783,9 +783,9 @@
     <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. Example flow can be found from 10.2settings.ptt, slide 16</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. Not 10.1 content.</comment>        
     <source>Show mail in other folders</source>
-    <translation variants="no" type="unfinished"></translation>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_006_b_b</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
@@ -835,7 +835,7 @@
 <message numerus="no" id="txt_mailips_dialog_heading_incoming_connection">
     <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>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_006_d_a</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
@@ -855,7 +855,7 @@
 <message numerus="no" id="txt_mailips_dialog_heading_receiving_days">
     <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>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_006_b_c</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>
@@ -905,7 +905,7 @@
 <message numerus="no" id="txt_mailips_dialog_heading_start_time">
     <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>
+    <translation variants="yes" type="unfinished"></translation>
     <extra-loc-layout_id>qtl_dialog_pri_heading</extra-loc-layout_id>    
     <extra-loc-viewid>mail_006_b_d</extra-loc-viewid>
     <extra-loc-positionid>title</extra-loc-positionid>